Skip to content

[#12715][fix] Disable NCCL window buffers on GB10#15559

Merged
hyukn merged 1 commit into
NVIDIA:mainfrom
nv-lschneider:fix/gb10-nccl-window-guard
Jun 25, 2026
Merged

[#12715][fix] Disable NCCL window buffers on GB10#15559
hyukn merged 1 commit into
NVIDIA:mainfrom
nv-lschneider:fix/gb10-nccl-window-guard

Conversation

@nv-lschneider

@nv-lschneider nv-lschneider commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • Improvements

    • Enhanced NCCL window buffer support detection with more robust runtime version and device attribute validation.
    • Simplified multi-GPU all-reduce communication strategy selection by removing platform-specific compatibility workarounds.
  • Tests

    • Added unit tests to validate NCCL window buffer support detection across varying platform and runtime configurations.

Description

PR #12902 avoided the NCCL symmetric allreduce path, but the same unsupported NCCL window registration could still be reached through other callers, including the fused GEMM output path:

FP4GemmRunner::runGemm -> createNCCLWindowTensor -> ncclCommGroupRegisterSymmetric

This change makes the workaround more holistic by guarding the native NCCL window allocator itself. On GB10/integrated SM 121 platforms with NCCL runtime versions older than 2.30.4, TRT-LLM now skips NCCL window buffer registration and falls back to regular tensors. The platform/version check is cached process-wide, so the normal path remains cheap after the first query,
and newer NCCL versions avoid the platform probe entirely.

The Python-side GB10 workaround is removed so the behavior is centralized in the C++ NCCL window path used by all callers.

Test Coverage

  • Added unit coverage for the GB10/NCCL runtime-version gate in cpp/tests/unit_tests/multi_gpu/ncclUtilsTest.cpp.

  • Verified git diff --check.

  • Verified Python syntax with python3 -m py_compile for the edited Python files.

  • Reproduced the crash on unpatched rc18 with dual-node serving:

    • Qwen3-0.6B failed in ncclCommGroupRegisterSymmetric.
    • TinyLlama failed in the same NCCL symmetric/window path.
  • Verified patched rc18 dual-node serving:

    • Qwen3-0.6B completed successfully with the native guard firing.
    • TinyLlama completed successfully with the native guard firing.
  • Please check this after reviewing the above items as appropriate for this PR.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

NCCL window buffer support detection is refactored from an inline header implementation and a Python-side workaround into C++ helper functions with compile-time gating, runtime ncclGetVersion querying, GB10 platform inspection via CUDA device attributes, and std::call_once caching. The parallel Python GB10/NCCL_SYMMETRIC workaround is removed.

Changes

NCCL Window Buffer Support Refactor

Layer / File(s) Summary
C++ window support detection: declarations, implementation, and caching
cpp/tensorrt_llm/common/ncclUtils.h, cpp/tensorrt_llm/common/ncclUtils.cpp, cpp/tests/unit_tests/multi_gpu/ncclUtilsTest.cpp
Header replaces the inline isNcclWindowSupported() body with a forward declaration and adds isNcclWindowSupportedForPlatform(realSmVersion, isIntegrated, ncclRuntimeVersion). Implementation adds unnamed-namespace helpers that gate on compile-time NCCL version, query ncclGetVersion, inspect CUDA device integrated attribute and real SM version for GB10, emit warnings on failure, and cache via std::call_once. NCCLWindowAllocator::requestBuffer delegates to the cached helper. Unit test validates isNcclWindowSupportedForPlatform across version/platform combinations.
Python GB10 workaround removal
tensorrt_llm/_torch/distributed/ops.py, tensorrt_llm/_torch/custom_ops/torch_custom_ops.py
Removes ctypes/find_library imports, GB10 NCCL runtime probing, and _init_gb10_nccl_symmetric_workaround call from AllReduce.__init__. AllReduceRunner.get_valid_tactics now unconditionally includes both NCCL_SYMMETRIC and NCCL; forward always falls back to NCCL_SYMMETRIC on autotuner cache miss.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
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 PR title clearly describes the main change: disabling NCCL window buffers on GB10 platforms. It is concise, specific, and directly relevant to the primary objective of the changeset.
Description check ✅ Passed The PR description comprehensively explains the issue, the solution approach, test coverage provided, and verification steps. It addresses the key sections of the template including problem statement, approach, and testing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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

🧹 Nitpick comments (2)
cpp/tensorrt_llm/common/ncclUtils.h (1)

167-174: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use Doxygen comments for the new header API.

These declarations are externally visible, but the comments use plain //, so generated API docs will not pick them up consistently.

Documentation fix
-// Returns true if NCCL window buffers (ncclMemAlloc / ncclCommWindowRegister)
-// are supported for the given real SM version, integrated-device flag, and runtime NCCL version.
-// Exposed for focused unit testing of platform/version gates.
+//! Returns true if NCCL window buffers (ncclMemAlloc / ncclCommWindowRegister)
+//! are supported for the given real SM version, integrated-device flag, and runtime NCCL version.
+//! Exposed for focused unit testing of platform/version gates.
 bool isNcclWindowSupportedForPlatform(int realSmVersion, bool isIntegrated, int ncclRuntimeVersion);
 
-// Returns true if the compile-time and runtime NCCL versions support window buffers
-// and the current CUDA device is not in a known-unsupported platform/version set.
+//! Returns true if the compile-time and runtime NCCL versions support window buffers
+//! and the current CUDA device is not in a known-unsupported platform/version set.
 bool isNcclWindowSupported();

As per coding guidelines, “Follow Doxygen rules for documenting class interfaces and function prototypes; use //! for C++ style comments and //!< for member comments.”

🤖 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/common/ncclUtils.h` around lines 167 - 174, The comment
blocks for the public function declarations isNcclWindowSupportedForPlatform and
isNcclWindowSupported are using plain C++ style comments (//), but Doxygen
documentation requires the //! format to be picked up by documentation
generation tools. Convert all plain // comments immediately preceding these two
function declarations to use the //! format instead to ensure they are properly
documented in generated API documentation.

Source: Coding guidelines

cpp/tensorrt_llm/common/ncclUtils.cpp (1)

167-191: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Route the production gate through the tested helper.

Line 167 reconstructs the GB10 predicate instead of using isNcclWindowSupportedForPlatform(), so the unit test can drift from production behavior. Reuse the helper after the version/platform queries.

Refactor to keep production and tests coupled
-    bool const supported = !isGb10Platform(realSmVersion, isIntegrated != 0);
+    bool const supported = isNcclWindowSupportedForPlatform(
+        realSmVersion, isIntegrated != 0, version);
🤖 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/common/ncclUtils.cpp` around lines 167 - 191, The code at
line 167 reconstructs the GB10 platform predicate logic directly instead of
reusing the isNcclWindowSupportedForPlatform() helper function, which causes
production and test logic to diverge. Replace the line that creates the
supported variable by calling isNcclWindowSupportedForPlatform(realSmVersion,
isIntegrated != 0, version) and using its return value directly, ensuring the
helper function is invoked after version validation checks to keep the
production gate logic centralized.
🤖 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 `@cpp/tensorrt_llm/common/ncclUtils.cpp`:
- Around line 131-164: The isNcclWindowSupported() function makes local
decisions about NCCL window support based on CUDA queries that may fail
independently on different ranks, causing those ranks to return different
values. When requestBuffer() returns early at line 405 based on this decision,
some ranks may skip reaching the collective ncclAllReduce at line 574, causing
other ranks to deadlock waiting on it. To fix this, add a cross-rank
synchronization barrier before the early return in requestBuffer() at line 405
to ensure all ranks agree on the NCCL window support decision, or alternatively
move the synchronization logic into isNcclWindowSupported() itself so the
consensus is reached before any rank returns.

---

Nitpick comments:
In `@cpp/tensorrt_llm/common/ncclUtils.cpp`:
- Around line 167-191: The code at line 167 reconstructs the GB10 platform
predicate logic directly instead of reusing the
isNcclWindowSupportedForPlatform() helper function, which causes production and
test logic to diverge. Replace the line that creates the supported variable by
calling isNcclWindowSupportedForPlatform(realSmVersion, isIntegrated != 0,
version) and using its return value directly, ensuring the helper function is
invoked after version validation checks to keep the production gate logic
centralized.

In `@cpp/tensorrt_llm/common/ncclUtils.h`:
- Around line 167-174: The comment blocks for the public function declarations
isNcclWindowSupportedForPlatform and isNcclWindowSupported are using plain C++
style comments (//), but Doxygen documentation requires the //! format to be
picked up by documentation generation tools. Convert all plain // comments
immediately preceding these two function declarations to use the //! format
instead to ensure they are properly documented in generated API documentation.
🪄 Autofix (Beta)

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: 8a24e9d6-847c-48eb-ac0a-8f99c9c56d18

📥 Commits

Reviewing files that changed from the base of the PR and between 8412a17 and 6c4718c.

📒 Files selected for processing (5)
  • cpp/tensorrt_llm/common/ncclUtils.cpp
  • cpp/tensorrt_llm/common/ncclUtils.h
  • cpp/tests/unit_tests/multi_gpu/ncclUtilsTest.cpp
  • tensorrt_llm/_torch/custom_ops/torch_custom_ops.py
  • tensorrt_llm/_torch/distributed/ops.py
💤 Files with no reviewable changes (1)
  • tensorrt_llm/_torch/distributed/ops.py

Comment thread cpp/tensorrt_llm/common/ncclUtils.cpp
Signed-off-by: Ludwig Schneider <lschneider@nvidia.com>
@nv-lschneider
nv-lschneider force-pushed the fix/gb10-nccl-window-guard branch from 6c4718c to 004ac9b Compare June 23, 2026 22:23
@nv-lschneider nv-lschneider changed the title Disable NCCL window buffers on GB10 [#12715][fix] Disable NCCL window buffers on GB10 Jun 23, 2026
@nv-lschneider

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55334 [ run ] triggered by Bot. Commit: 004ac9b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55334 [ run ] completed with state FAILURE. Commit: 004ac9b
/LLM/main/L0_MergeRequest_PR pipeline #44285 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

@nv-lschneider

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55510 [ run ] triggered by Bot. Commit: 004ac9b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55510 [ run ] completed with state SUCCESS. Commit: 004ac9b
/LLM/main/L0_MergeRequest_PR pipeline #44434 completed with status: 'SUCCESS'

CI Report

Link to invocation

@hyukn hyukn 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.

LGTM

@hyukn
hyukn merged commit e828cac into NVIDIA:main Jun 25, 2026
9 of 10 checks passed
@nv-lschneider
nv-lschneider deleted the fix/gb10-nccl-window-guard branch June 25, 2026 13:07
BrianLi23 pushed a commit to BrianLi23/TensorRT-LLM that referenced this pull request Jul 9, 2026
Signed-off-by: Ludwig Schneider <lschneider@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants