Skip to content

[https://nvbugs/6541343][fix] Add slurm_wait_all_ranks() — a job+step-keyed marker barrier on the shared… - #17367

Merged
EmmaQiaoCh merged 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6541343
Aug 24, 2026
Merged

[https://nvbugs/6541343][fix] Add slurm_wait_all_ranks() — a job+step-keyed marker barrier on the shared…#17367
EmmaQiaoCh merged 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6541343

Conversation

@trtllm-agent

@trtllm-agent trtllm-agent commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: The install lock is node-local ($resourcePathNode=/tmp), so nothing fences ranks across nodes before pytest; the 300s PMIx fence timeout on import tensorrt_llm's module-scope MPI collective then aborts every rank when one node installs late.
  • Fix: Add slurm_wait_all_ranks() — a job+step-keyed marker barrier on the shared $jobWorkspace counting SLURM_NTASKS rank markers — immediately before eval $pytestCommand, placed after the SLURM_* wipe so single-node/disagg paths no-op.
  • Original test: pytest tests/integration/defs/accuracy/test_llm_api_pytorch.py::TestDeepSeekR1::test_nvfp4_multi_gpus[throughput] -v
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Dev Engineer Review

  • Added slurm_wait_all_ranks() in jenkins/scripts/slurm_run.sh.
  • The barrier uses job- and step-specific markers under $jobWorkspace.
  • It waits for all SLURM_NTASKS ranks before pytest execution.
  • Single-rank and workspace-less runs skip the barrier.
  • A 3600-second timeout prevents indefinite waits.
  • Rank 0 reports progress.
  • The barrier runs after the SLURM_* environment reset.
  • No configuration or test-list files changed.

QA Engineer Review

No test changes.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0f010277-d8a3-4ff3-966d-7c6feba161ae

📥 Commits

Reviewing files that changed from the base of the PR and between e97f3f3 and 640b4a6.

📒 Files selected for processing (1)
  • jenkins/scripts/slurm_run.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • jenkins/scripts/slurm_run.sh

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The Slurm runner adds a shared barrier before pytest. Each rank writes a readiness marker in a job- and step-specific workspace directory. The barrier skips single-rank or workspace-less runs and times out after 3600 seconds.

Changes

Slurm barrier

Layer / File(s) Summary
Readiness barrier before pytest
jenkins/scripts/slurm_run.sh
Adds slurm_wait_all_ranks, which coordinates ranks through shared readiness markers, reports progress from rank 0, skips unsupported runs, and enforces a 3600-second timeout before pytest execution.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 640b4

This PR adds a shared-workspace barrier before distributed tests to prevent ranks from starting before installation completes. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant SlurmRank
  participant JobWorkspace
  participant Pytest
  SlurmRank->>JobWorkspace: Create rank readiness marker
  SlurmRank->>JobWorkspace: Wait for all configured rank markers
  JobWorkspace-->>SlurmRank: Return readiness progress
  SlurmRank->>Pytest: Start pytest after barrier
Loading

Possibly related PRs

Suggested reviewers: dpitman-nvda

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the NVBugs issue, fix type, and primary change: adding a Slurm rank barrier.
Description check ✅ Passed The description explains the root cause, fix, placement, test plan, and bug link, although it uses different headings than the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@jenkins/scripts/slurm_run.sh`:
- Around line 75-85: Add the standard NVIDIA copyright header to the top of
slurm_run.sh, using 2026 as the latest modification year. Preserve the existing
script content and behavior unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 87e29a98-56b2-458d-aa3f-d764e78df970

📥 Commits

Reviewing files that changed from the base of the PR and between 1745a6e and 01809cd.

📒 Files selected for processing (1)
  • jenkins/scripts/slurm_run.sh

Comment thread jenkins/scripts/slurm_run.sh
@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66534 [ run ] triggered by Bot. Commit: 01809cd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66534 [ run ] completed with state SUCCESS. Commit: 01809cd
/LLM/main/L0_MergeRequest_PR pipeline #54167 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66679 [ run ] triggered by Bot. Commit: 01809cd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66679 [ run ] completed with state SUCCESS. Commit: 01809cd
/LLM/main/L0_MergeRequest_PR pipeline #54295 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --only-multi-gpu-test --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66769 [ ] completed with state FAILURE. Commit: ``

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --only-multi-gpu-test --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66957 [ run ] triggered by Bot. Commit: 01809cd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66957 [ run ] completed with state SUCCESS. Commit: 01809cd
/LLM/main/L0_MergeRequest_PR pipeline #54506 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67042 [ run ] triggered by Bot. Commit: 01809cd Link to invocation

@EmmaQiaoCh
EmmaQiaoCh force-pushed the repair-bot-bug6541343 branch from 01809cd to 2d010cb Compare August 18, 2026 08:52
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67047 [ run ] triggered by Bot. Commit: 2d010cb Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67042 [ run ] completed with state ABORTED. Commit: 01809cd

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67047 [ run ] completed with state SUCCESS. Commit: 2d010cb
/LLM/main/L0_MergeRequest_PR pipeline #54588 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67386 Bot args parsing error: CI requested by --post-merge or an approval-gated stage selector (*, *Post-Merge*, or *PerfSanity*) requires the ci: post-merge approved PR label. Ask a member of NVIDIA/trt-llm-ci-approvers to apply it.

Link to invocation

@EmmaQiaoCh EmmaQiaoCh added the ci: post-merge approved Approved by TRT-LLM CI approvers for broad post-merge CI requests label Aug 20, 2026
@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67617 [ run ] triggered by Bot. Commit: 2d010cb Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67617 [ run ] completed with state FAILURE. Commit: 2d010cb
/LLM/main/L0_MergeRequest_PR pipeline #55106 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

The only install lock lives under $resourcePathNode (/tmp) in
slurm_install.sh, which is node-local, so its wait loop fences just the
$SLURM_LOCALID peers on the same node -- a node can never observe another
node's lock. Nothing then stops slurm_run.sh from reaching
`eval $pytestCommand` on one node while another is still installing, and the
per-rank work in between skews the ranks further: non-zero ranks cover rank
0's coverage-config write with a blind `sleep 30`, and slurm_setup_runtime_env
shells out to pip3.

Pytest's first action is `import tensorrt_llm`, whose module-scope MPI
collective must be entered by every rank. Under --mpi=pmix, which is added
exactly when nodeCount > 1, that collective has a 300s fence timeout, so a
node whose pip3 install stalls (up to the 2700s retry budget) makes the
collective abort every rank rather than merely run late. The ranks die between
pytest setup and teardown, which leaves the nodeid in unfinished_test.txt and
makes generate_timeout_xml.py synthesize the "Test terminated unexpectedly"
this bug reports -- there is no traceback for the test body. Note that
PMIX_MCA_gds=hash does not mitigate this: a fence that times out never
exchanges the modex regardless of GDS mode, and the pml_ucx errors seen
alongside it are downstream of the same missing exchange.

Add a marker barrier on the shared $jobWorkspace immediately before
`eval $pytestCommand`. It counts SLURM_NTASKS rank markers rather than nodes,
so the fenced set is exactly the set that enters the aborting collective, and
placing it after the block that wipes SLURM_* keeps it a no-op for
single-node and disaggregated benchmark/server runs, which reach it with
SLURM_NTASKS unset. The marker directory is keyed per job and per step because
$jobWorkspace outlives a step, so a later step must not be released by an
earlier one's markers. The wait is bounded above the 2700s pip3 budget so a
genuinely dead rank fails the stage with a clear message instead of hanging
until the partition walltime.

Verified by asserting elapsed seconds, since a no-op barrier also returns 0:
single rank, unset workspace and unset SLURM_NTASKS return at 0s; a peer 25s
late makes rank 0 block 30s; a dead rank fails bounded with rc=1; markers from
another job and from an earlier step of the same job both correctly time out;
all ranks concurrent release at 0s; and only rank 0 logs progress. A live
2-node 8-rank probe with rank 7 delayed 20s converged every rank on both nodes
at 20-30s. The target test then passed end to end on a 2-node 8-rank pmix
launch (1 passed, 399.82s) with no PMIx fence errors, reaching all three
accuracy phases: GSM8K 94.845 against a 92.217 threshold and CnnDailymail
rouge1 30.240 against 26.716.

Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
@EmmaQiaoCh
EmmaQiaoCh force-pushed the repair-bot-bug6541343 branch from 2d010cb to 640b4a6 Compare August 20, 2026 08:40
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67760 [ run ] triggered by Bot. Commit: 640b4a6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #67760 [ run ] completed with state FAILURE. Commit: 640b4a6
/LLM/main/L0_MergeRequest_PR pipeline #55239 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68069 [ run ] triggered by Bot. Commit: 640b4a6 Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --only-multi-gpu-test --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68170 [ run ] triggered by Bot. Commit: 640b4a6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68069 [ run ] completed with state ABORTED. Commit: 640b4a6

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68170 [ run ] completed with state FAILURE. Commit: 640b4a6
/LLM/main/L0_MergeRequest_PR pipeline #55614 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --only-multi-gpu-test --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68268 [ run ] triggered by Bot. Commit: 640b4a6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68268 [ run ] completed with state SUCCESS. Commit: 640b4a6
/LLM/main/L0_MergeRequest_PR pipeline #55700 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68462 [ run ] triggered by Bot. Commit: 640b4a6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68462 [ run ] completed with state FAILURE. Commit: 640b4a6
/LLM/main/L0_MergeRequest_PR pipeline #55882 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot run --stage-list "2_Nodes" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68580 [ run ] triggered by Bot. Commit: 640b4a6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68580 [ run ] completed with state FAILURE. Commit: 640b4a6
/LLM/main/L0_MergeRequest_PR pipeline #55990 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@EmmaQiaoCh

Copy link
Copy Markdown
Collaborator

/bot skip --comment "Tested multi-gpus/nodes stages in previous CIs"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68633 [ skip ] triggered by Bot. Commit: 640b4a6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #68633 [ skip ] completed with state SUCCESS. Commit: 640b4a6
Skipping testing for commit 640b4a6

Link to invocation

@EmmaQiaoCh
EmmaQiaoCh merged commit add5e32 into NVIDIA:main Aug 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: full pre-merge approved ci: post-merge approved Approved by TRT-LLM CI approvers for broad post-merge CI requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants