Skip to content

[https://nvbugs/6501404][fix] Unwaive test_row_linear_norm_fusion[2-hidden:16-seqlen:2] - #16911

Merged
kris1025 merged 7 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6501404
Oct 29, 2026
Merged

kris1025 merged 7 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6501404

Conversation

@trtllm-agent

@trtllm-agent trtllm-agent commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR updates the NCCL symmetric allreduce path so the output tensor no longer unconditionally requests a window-backed allocation.

Previously, runNCCLAllReduceSymmetric() applied the registration threshold when deciding whether to copy the input into a new window, but always called createNCCLWindowTensor() for the output. Small messages could skip that input allocation while still entering the output window allocation/registration path. Window allocation is a collective, so taking that path on some ranks and not others is the failure mode this change avoids.

The new behavior requests a window-backed output tensor only when:

  • bufferSizeBytes >= minRegistrationThreshold

If no valid output window is obtained, the existing torch::empty_like(...) fallback is used. The threshold still honors TLLM_NCCL_MIN_REGISTRATION.

This is not the same predicate as the input path. The input can already be window-backed for a sub-threshold message: searchBuffer() returns a valid windowBuffer0 when the caller reused a previously registered tensor, and that pointer is used as sendbuf regardless of size. The output gate does not include windowBuffer0.isValid(). In that case ncclAllReduce sees a registered send buffer and a plain recv buffer. All ranks still take the same branches when SPMD inputs match, so this is a send/recv mix on the symmetric kernel (possible degrade / fallback), not an unpaired createNCCLWindowTensor hang.

Test coverage

  • Marked test_row_linear_norm_fusion as post_merge.
  • Added the H100 2-GPU post-merge test-list entry:
    • unittest/_torch/multi_gpu -m "post_merge" TIMEOUT (90)
  • Removed the stale waiver for:
    • unittest/_torch/multi_gpu/test_linear.py::test_row_linear_norm_fusion[2-hidden:16-seqlen:2]

Test plan

  • Run the H100 2-GPU post-merge multi-GPU unittest stage, including test_row_linear_norm_fusion[2-hidden:16-seqlen:2].
  • Confirm sub-threshold messages no longer call createNCCLWindowTensor for the output.
  • Check for regressions in the NCCL symmetric allreduce path.

Links

Dev Engineer Review

  • Updated runNCCLAllReduceSymmetric to request the output window only when bufferSizeBytes >= minRegistrationThreshold. This is intentionally size-only and does not mirror the input's windowBuffer0.isValid() reuse path.
  • Preserved the torch::empty_like fallback when symmetric-memory allocation is unavailable.
  • Passed outputTensor.data_ptr() directly to ncclAllReduce.
  • Preserved the supported fast path and TLLM_NCCL_MIN_REGISTRATION behavior.
  • Removed the waiver for unittest/_torch/multi_gpu/test_linear.py::test_row_linear_norm_fusion[2-hidden:16-seqlen:2].
  • No public API or configuration changes.

QA Engineer Review

  • Removed one entry from tests/integration/test_lists/waives.txt.
  • The affected regression test is no longer skipped by this waiver.
  • CBTS coverage data is unavailable.
  • Verdict: needs follow-up.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: b30ff5f3-48d9-45eb-817d-57bfb027f5bb

📥 Commits

Reviewing files that changed from the base of the PR and between 5ac2c94 and 9b71341.

📒 Files selected for processing (2)
  • cpp/tensorrt_llm/thop/allreduceOp.cpp
  • tests/integration/test_lists/waives.txt
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/integration/test_lists/waives.txt
  • cpp/tensorrt_llm/thop/allreduceOp.cpp

Walkthrough

runNCCLAllReduceSymmetric conditionally allocates a window-backed output tensor, falls back to a CUDA tensor when required, and passes the selected tensor to ncclAllReduce. A related integration-test waiver is removed.

Changes

Symmetric all-reduce output handling

Layer / File(s) Summary
Conditional output buffer allocation
cpp/tensorrt_llm/thop/allreduceOp.cpp, tests/integration/test_lists/waives.txt
Output window creation is gated by input-buffer validity or the registration threshold. Invalid or skipped allocation uses torch::empty_like(inputTensor). ncclAllReduce receives the selected tensor’s data pointer. The related test waiver is removed.

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

Suggested reviewers: crazydemo, niukuo, mzweilz, zongfeijing

Pre-merge checks: Passed 4
Check name Status Explanation
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.
Title check Passed The title uses the required NVBugs and fix format and accurately identifies the waiver removal. It does not mention the primary NCCL output-allocation fix, but it describes a real part of the changese…
Description check Passed The description is detailed and explains the issue, solution, affected behavior, test coverage, test plan, links, and review status. It does not reproduce the PR checklist, but the core required techn…
Full details: Title check

Explanation

The title uses the required NVBugs and fix format and accurately identifies the waiver removal. It does not mention the primary NCCL output-allocation fix, but it describes a real part of the changeset.

Full details: Description check

Explanation

The description is detailed and explains the issue, solution, affected behavior, test coverage, test plan, links, and review status. It does not reproduce the PR checklist, but the core required technical and testing information is present.

✨ Finishing Touches: 💡 1
⚔️ Resolve merge conflicts: 💡

✅ Conflict resolution request accepted.
❌ Error resolving conflicts.

  • Resolve merge conflict in branch repair-bot-bug6501404
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

🧹 Nitpick comments (1)
cpp/tensorrt_llm/thop/allreduceOp.cpp (1)

564-569: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Make the window allocation result const.

windowOutput and windowBuffer1 are never reassigned.

Proposed fix
-            auto [windowOutput, windowBuffer1] = createNCCLWindowTensor(rawComm, input.sizes(), input.scalar_type());
+            auto const [windowOutput, windowBuffer1]
+                = createNCCLWindowTensor(rawComm, input.sizes(), input.scalar_type());

As per coding guidelines, “declare unmodified variables const.”

🤖 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 `@cpp/tensorrt_llm/thop/allreduceOp.cpp` around lines 564 - 569, Declare the
structured-binding variables windowOutput and windowBuffer1 as const in the
createNCCLWindowTensor result within the surrounding allreduce operation,
preserving the existing validity check and outputTensor assignment.

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.

Nitpick comments:
In `@cpp/tensorrt_llm/thop/allreduceOp.cpp`:
- Around line 564-569: Declare the structured-binding variables windowOutput and
windowBuffer1 as const in the createNCCLWindowTensor result within the
surrounding allreduce operation, preserving the existing validity check and
outputTensor assignment.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 99f0fbf3-1e74-44af-92b9-b0dbc4a1acd8

📥 Commits

Reviewing files that changed from the base of the PR and between 9fe5853 and f74413d.

📒 Files selected for processing (1)
  • cpp/tensorrt_llm/thop/allreduceOp.cpp

@brnguyen2 brnguyen2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Making the output allocation follow the same gate as the input is the right consistency fix regardless of the bug — with a 64-byte tensor and a ~290 KB threshold at 2 ranks, the old code skipped registration for the input and then ran a full collective allocateAndRegisterBuffer for the output, which is both inconsistent and wasteful.

What I don't follow is the causal story. The failure in nvbugs/6501404 was on 2×H100, where NVLink is present, so minRegistrationThreshold is never SIZE_MAX on that path and the mechanism the new comment describes never fires there. allocateAndRegisterBuffer is also written specifically so every rank reaches the min-allreduce even when ncclMemAlloc fails asymmetrically. So this change plausibly removes a collective from the hot path, but it isn't shown to remove the one that hung — and the linked bug records that the failure could not be reproduced.

So I'd land the gating change on its own merits and keep the waiver until there's evidence the hang is actually gone. A concrete way to get that evidence without holding up this PR: open a separate draft PR that (a) removes the waiver, (b) adds instrumentation around the symmetric allreduce path (log per-rank windowBuffer0.isValid(), bufferSizeBytes, minRegistrationThreshold, and entry/exit of allocateAndRegisterBuffer), and (c) runs only the failing stage with the test list trimmed to test_row_linear_norm_fusion (and neighbors if needed) so repeated runs are cheap on capacity and turnaround. Re-run that until the hang reproduces; the instrumentation then tells you which rank diverged and why. Once you have a pre-fix hang and a post-fix pass on the same stage, dropping the waiver here is easy to justify.

Comment thread cpp/tensorrt_llm/thop/allreduceOp.cpp Outdated
Comment thread cpp/tensorrt_llm/thop/allreduceOp.cpp Outdated
Comment thread tests/integration/test_lists/waives.txt Outdated
@kris1025

Copy link
Copy Markdown
Collaborator

/bot run

@kris1025
kris1025 requested a review from a team as a code owner August 10, 2026 05:07
@kris1025
kris1025 requested a review from crazydemo August 10, 2026 05:07
@coderabbitai

coderabbitai Bot commented Aug 10, 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.

@kris1025

Copy link
Copy Markdown
Collaborator

/bot kill

@kris1025

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64957 [ run ] triggered by Bot. Commit: 28a72c6 Link to invocation

@kris1025 kris1025 self-assigned this Aug 10, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64957 [ run ] completed with state FAILURE. Commit: 28a72c6
/LLM/main/L0_MergeRequest_PR pipeline #52792 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

@kris1025

Copy link
Copy Markdown
Collaborator

/bot run

@trtllm-agent

This comment has been minimized.

@coderabbitai

This comment has been minimized.

@BowenFu

BowenFu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Bug engineer ownership

@kris1025, as the engineer assigned to the linked bug, you are responsible for driving this bot PR to resolution. Please coordinate review, address feedback and required code changes, get CI passing, and verify the original failure before driving it to merge. If the PR is obsolete or superseded, close it with a reason. Keep this PR updated with blockers and the next step.

@trtllm-agent
trtllm-agent force-pushed the repair-bot-bug6501404 branch 4 times, most recently from 42aa8ad to baeb776 Compare October 27, 2026 04:23
@kris1025

Copy link
Copy Markdown
Collaborator

I am not able to reproduce the bug. I would suggest to remove the test waiver and do nothing else.

HandongLi-01 and others added 7 commits October 28, 2026 02:12
…ration threshold

runNCCLAllReduceSymmetric allocated its window-backed output buffer with an
unconditional createNCCLWindowTensor, bypassing the minRegistrationThreshold
gate that the input path a few lines above already applies. That threshold is
set to SIZE_MAX when neither NVLink nor MNNVL is supported, so on such
topologies the collective ncclAllReduce plus cudaStreamSynchronize inside
allocateAndRegisterBuffer never completes and every rank hangs, which the CI
stage reports as "Test terminated unexpectedly".

Apply the same gate to the output allocation: request a window buffer only when
the input already obtained one or the message is at least as large as the
threshold. Gating on the threshold rather than on mIsNVLINKSupported /
mIsMNNVLSupported keeps the symmetric-memory fast path enabled wherever it
works and still honors TLLM_NCCL_MIN_REGISTRATION. The pre-existing
invalid-buffer fallback to torch::empty_like covers the skipped case, so no new
error path is introduced.

Signed-off-by: handongl <handongl@nvidia.com>
test_row_linear_norm_fusion needs 2 GPUs and has been flaky under
nvbugs/6501404. Mark it @pytest.mark.post_merge so it is dropped from the
blocking pre_merge 2-GPU glob (unittest/_torch/multi_gpu -m "not
post_merge") on l0_dgx_h100, and add a matching 2-GPU post_merge condition
block that collects it via -m "post_merge" so coverage is retained in the
non-blocking post_merge stage.

Signed-off-by: linquanh <linquanh@nvidia.com>
Signed-off-by: linquanh <linquanh@nvidia.com>
Signed-off-by: linquanh <linquanh@nvidia.com>
Signed-off-by: handongl <handongl@nvidia.com>

[nvbugs/6501404][chore] Sort ray_orchestrator waive entry

The file-contents-sorter pre-commit hook requires waives.txt to be
byte-sorted. The newly added ray_orchestrator waive was placed after the
sampler entry; reorder it before to satisfy the hook.

Signed-off-by: linquanh <linquanh@nvidia.com>
…RMS_NORM release

Rebasing onto main brings in the RMS_NORM release of the internal output
window in runNCCLAllReduceSymmetric (NVIDIA#20232), which reads windowBuffer1
after the fused fallback. The threshold-gated output allocation declared
windowBuffer1 inside the gate, so that read was out of scope.

Declare windowBuffer1 at function scope. It stays invalid unless the gate
allocates a valid window, which is exactly when outputTensor is
window-backed and must be released, so the release keeps its meaning.

Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
The failure does not reproduce, so this PR now only removes the
test_row_linear_norm_fusion[2-hidden:16-seqlen:2] waiver. Revert the
other changes it carried:

- the output-window gating in allreduceOp.cpp ("Gate NCCL symmetric
  output window on the registration threshold", "Gate output window on
  uniform threshold" and "Keep the output window handle in scope for the
  RMS_NORM release");
- the @pytest.mark.post_merge marker on test_row_linear_norm_fusion and
  the 2-GPU H100 post_merge block in l0_dgx_h100.yml ("Move
  test_row_linear_norm_fusion to post_merge");
- the DGX_H100-2_GPUs-PyTorch-Others-Post-Merge-1 stage in
  L0_Test.groovy ("Add H100 post-merge stage").

allreduceOp.cpp, test_linear.py, l0_dgx_h100.yml and L0_Test.groovy now
match the base branch, so test_row_linear_norm_fusion runs again in the
existing pre-merge `unittest/_torch/multi_gpu -m "not post_merge"` entry.

Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
@trtllm-agent
trtllm-agent force-pushed the repair-bot-bug6501404 branch from baeb776 to 7fc43aa Compare October 28, 2026 09:15
@kris1025

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81162 [ run ] triggered by Bot. Commit: 7fc43aa Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81162 [ run ] completed with state SUCCESS. Commit: 7fc43aa
/LLM/main/L0_MergeRequest_PR pipeline #66856 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

@kris1025

Copy link
Copy Markdown
Collaborator

/bot run

@kris1025

Copy link
Copy Markdown
Collaborator

update the PR title.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81325 [ run ] triggered by Bot. Commit: 7fc43aa Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81325 [ run ] completed with state SUCCESS. Commit: 7fc43aa
/LLM/main/L0_MergeRequest_PR pipeline #67008 completed with status: 'SUCCESS'

CI Report

Link to invocation

@kris1025 kris1025 changed the title [https://nvbugs/6501404][fix] Request the output window only when bufferSizeBytes >= minRegistrationThreshold [https://nvbugs/6501404][fix] Unwaive test_row_linear_norm_fusion[2-hidden:16-seqlen:2] Oct 29, 2026
@kris1025
kris1025 dismissed chzblych’s stale review October 29, 2026 05:55

The PR is much simpler now, only a single test is unwaived.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖 Coding Agent task started to fix merge conflicts.

View Coding task

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@kris1025
kris1025 merged commit a42093f into NVIDIA:main Oct 29, 2026
11 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.