Skip to content

[https://nvbugs/6567403][fix] Revert #17010 to unblock DGX_H100 PyTorch-Others-1 stage timeout - #17352

Merged
QiJune merged 1 commit into
NVIDIA:mainfrom
xxi-nv:revert-17010-cuda-graph-output-refs
Aug 6, 2026
Merged

[https://nvbugs/6567403][fix] Revert #17010 to unblock DGX_H100 PyTorch-Others-1 stage timeout#17352
QiJune merged 1 commit into
NVIDIA:mainfrom
xxi-nv:revert-17010-cuda-graph-output-refs

Conversation

@xxi-nv

@xxi-nv xxi-nv commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Reverts #17010 (commit 60e7fcaeaf), which regressed the
DGX_H100-4_GPUs-PyTorch-Others-1 stage from ~67-83 min to a 244-267 min
wall-time kill. The stage has been failing for essentially every PR whose base
contains this commit since 2026-08-05 00:24 UTC, including PostMerge on main.

Evidence that #17010 is the cause

1. PostMerge on main flips exactly at this commit (PostMerge runs main
directly, with no PR code):

build commit start (UTC) Others-1
2885 43d6fa410c 08-04 16:42 72 min SUCCESS
2886 91fb4433c5 08-05 06:05 262 min FAILURE
2887 50edd73817 08-05 16:01 251 min FAILURE

2. Two independent bad ranges intersect in a single commit. The main bad
range 43d6fa410c..91fb4433c5 (17 commits) intersected with PR #17119's bad
range 5dab9bf760..e7e9da5148 (20 commits) leaves exactly 60e7fcaeaf.

3. Containing the commit predicts the timeout, over 22 builds spanning 14
different PRs plus main (ancestry checked via the GitHub compare API):

SUCCESS FAILURE
base does not contain 60e7fcaeaf 10 0
base contains 60e7fcaeaf 0 11

One near-counterexample (PR #17130, 230 min) had test_trtllm_bench_llmapi_launch
pass in 123.5 s, so it is a different failure.

4. Within-PR control. PR #12733 ran 70 min SUCCESS on 08-05 01:58 with a base
that lacks the commit, then 250 min FAILURE on 08-06 01:16 after rebasing onto a
base that has it — same PR code, only the base changed.

5. The stall is in test_trtllm_bench_llmapi_launch, which normally takes
118-125 s. With the commit it either hangs until the pytest session is killed
(no test records uploaded for the whole stage) or fails with
subprocess.CalledProcessError from mpirun.

Why the change breaks it

#17010 added a strong reference to every captured CUDA graph's output tensor,
held for the runner's lifetime, where previously only a weak ref was kept. That
pins one output buffer per graph key, so the capture-time output storage can no
longer return to the shared graph memory pool. test_trtllm_bench_llmapi_launch
is a pytorch-backend, CUDA-graph, mpirun tp=2 workload, which is where the
pinned memory shows up first.

Reverting restores the original weak-ref-only behavior. The nvbugs/6525011
waives that #17010 removed are restored, so TestLagunaXS::test_fp8 is skipped
again on B200/B300 until a non-regressing fix for that bug lands.

Also removes the nvbugs/6567403 waives

The three MoE multi-GPU cases waived in #17344 were only collateral damage — the
stage was killed before they could finish, and they pass in 45-76 s whenever the
stage completes normally (e.g. PostMerge build 2885: 45.5 s / 68.4 s / 75.8 s).
They are un-waived here so this PR's CI actually exercises them and the fix can
be verified end to end.

Test Coverage

DGX_H100-4_GPUs-PyTorch-Others-1 — the stage that regressed. It must return to
the ~67-83 min range with test_trtllm_bench_llmapi_launch and all three MoE
multi-GPU cases passing.

PR Checklist

  • PR title follows [JIRA/NVBUG/None][type] Summary
  • Commit is signed off (DCO)
  • Test coverage identified above
  • No new dependencies

Dev Engineer Review

  • Removed strong references to CUDA graph capture outputs from the decoder and encoder graph runners.
  • Restored weak-reference behavior to allow capture-time storage to return to the shared graph memory pool.
  • Removed cleanup for the deleted reference dictionaries.
  • Restored nvbugs/6525011 waives for TestLagunaXS::test_fp8 on B200 and B300.
  • Removed nvbugs/6567403 waives for three DGX_H100 configurable MoE multi-GPU cases.
  • The changes are scoped to the reported timeout regression. No public API changes are present.
  • The test-list changes use the existing waive format and bug references. No duplicate or unrelated entries were identified.
  • Verdict: sufficient.

QA Engineer Review

  • This change modifies only tests/integration/test_lists/waives.txt.
  • Added TestLagunaXS::test_fp8 waives for the B200 and B300 suites under nvbugs/6525011.
  • Removed three DGX_H100 configurable MoE multi-GPU waives under nvbugs/6567403.
  • No test-db or QA test files were modified.
  • CBTS coverage data is unavailable.
  • Verdict: needs follow-up.

… stage timeout

This reverts commit 60e7fca (NVIDIA#17010), which made DGX_H100-4_GPUs-PyTorch-Others-1 time out at 244-267 min instead of the usual 67-83 min.

Evidence:
- PostMerge on main flipped at this commit: build 2885 (43d6fa4) succeeded
  in 72 min, build 2886 (91fb443) failed at 262 min.
- Intersecting the main bad range (43d6fa4..91fb443) with PR 17119 bad
  range (5dab9bf..e7e9da5) leaves exactly this commit.
- Across 22 builds from 14 PRs plus main, containing this commit predicts the
  timeout: 10 SUCCESS / 0 FAILURE without it, 0 SUCCESS / 11 FAILURE with it.
- The stage stalls in test_trtllm_bench_llmapi_launch, which otherwise runs in
  118-125 s; it hangs until the session is killed or fails from mpirun.

Keeping a strong reference to every captured CUDA graph output tensor for the
runner lifetime pins one output buffer per graph key, so the capture-time
storage can no longer return to the shared graph memory pool.

The nvbugs/6567403 waives are removed too: the three MoE multi-GPU cases were
only collateral damage and pass in 45-76 s once the stage completes normally.

The nvbugs/6525011 waives removed by NVIDIA#17010 are restored by this revert.

Signed-off-by: xxi <xxi@nvidia.com>
@xxi-nv

xxi-nv commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Please don't merge, this is a CI test

@xxi-nv

xxi-nv commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "DGX_H100-4_GPUs-PyTorch-Others-1" --add-multi-gpu-test --detailed-log

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change removes strong captured-output references from decoder and encoder CUDA graph runners. It also updates integration test waivers for B200, B300, and DGX_H100 platforms.

Changes

CUDA graph output lifetime

Layer / File(s) Summary
Remove strong output caches
tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py
Decoder and encoder graph runners no longer store captured outputs in strong-reference caches or clear those caches during cleanup.

Integration test waivers

Layer / File(s) Summary
Update platform test waivers
tests/integration/test_lists/waives.txt
Adds B200 and B300 skips for TestLagunaXS::test_fp8 and removes three DGX_H100 configurable MoE skips.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: bowenfu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the revert and its purpose of unblocking the DGX_H100 PyTorch-Others-1 stage.
Description check ✅ Passed The description explains the regression, evidence, technical cause, solution, test coverage, and checklist items in the required sections.
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/integration/test_lists/waives.txt (1)

1-1: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the NVIDIA copyright header.

tests/integration/test_lists/waives.txt has no NVIDIA copyright header. Add the repository-standard header and set the year to 2026 for this modified file.

As per coding guidelines, add the NVIDIA copyright header to all new files and update the copyright year on modified files.

🤖 Prompt for 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.

In `@tests/integration/test_lists/waives.txt` at line 1, Add the
repository-standard NVIDIA copyright header to
tests/integration/test_lists/waives.txt, using 2026 as the copyright year while
preserving the existing waiver entry unchanged.

Source: Coding guidelines

🤖 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.

Outside diff comments:
In `@tests/integration/test_lists/waives.txt`:
- Line 1: Add the repository-standard NVIDIA copyright header to
tests/integration/test_lists/waives.txt, using 2026 as the copyright year while
preserving the existing waiver entry unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 10530326-fe14-4858-a675-bcbcd1c2f519

📥 Commits

Reviewing files that changed from the base of the PR and between 4f55d80 and 8a13e92.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64277 [ run ] triggered by Bot. Commit: 8a13e92 Link to invocation

@BowenFu BowenFu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The revert itself checks out and I'm not blocking on the mechanics — but I'm not the right first approver on the CUDA-graph output lifetime, so leaving this for someone who owns it.

Verified for the PR:

  • Byte-for-byte inverse of #17010 in both runners (CUDAGraphRunner and EncoderCUDAGraphRunner): the dict init, the per-key assignment and the clear() ordering all come back out. No residual _graph_output_refs reference anywhere under _torch/pyexecutor/ at this head, so nothing is left assuming a strong ref is held.
  • The two restored waives are exactly the two #17010 removed; nvbugs/6525011 has no other entries, so nothing extra gets silenced.
  • Removing the three nvbugs/6567403 lines is clean: this branch is based on merged #17344, so ordinary merge order into main applies without conflict.

The one thing worth deciding explicitly, since it's what the revert gives back: #17010 asserts in its comment that the weak ref lets capture-time output storage be reused while the graph is still replayable. That same pattern lives in tensorrt_llm/_torch/visual_gen/cuda_graph_runner.py:83-87, but with a caller-specific rationale — VisualGen keeps two graph keys' outputs live at once (true CFG combines the positive and negative Qwen-Image-Edit transformer outputs), which is what makes the aliasing reachable there. The pyexecutor runner has no caller that holds two keys' outputs simultaneously, so the same justification doesn't transfer, and what it does cost is one pinned output buffer per graph key for the runner's lifetime — which is the measured DGX-H100 regression.

Also worth knowing: #17354 merged at 08:52Z waiving test_trtllm_bench_llmapi_launch, so the stage is no longer blocked and this doesn't have to land as an emergency. But #17010 is on main, so the pinned-buffer cost is shipping to every 4-GPU CUDA-graph deployment, not just to CI — that's the argument for landing the revert rather than living on the waive.


self.graphs[key] = graph
self._graph_output_refs[key] = output
graph_output = make_weak_ref(output)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is what the revert restores: graph_outputs[key] goes back to weak-ref-only, with no owning copy retained.

The pinning that #17010 added was one output buffer per graph key held for the runner's lifetime — with a batch-size × draft-len key space that is not a small number of buffers, which is why a tp=2 mpirun CUDA-graph workload was the first thing to fall over.

If the hazard #17010 described is real for this runner (and not just for the VisualGen one it appears to be modelled on), the fix wants to be capture() returning the owning output rather than a lifetime-long strong-ref dict — otherwise this reopens nvbugs/6525011 with the memory cost simply traded back.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64277 [ run ] completed with state SUCCESS. Commit: 8a13e92
/LLM/main/L0_MergeRequest_PR pipeline #52178 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@QiJune
QiJune merged commit 9a2ff2e into NVIDIA:main Aug 6, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants