[https://nvbugs/6463987][fix] Pin NCCL to 2.29.7 for GB300 GLM-5-NVFP4 perf - #17160
[https://nvbugs/6463987][fix] Pin NCCL to 2.29.7 for GB300 GLM-5-NVFP4 perf#17160chenfeiz0326 wants to merge 1 commit into
Conversation
…-5-NVFP4 perf ## Summary - Pins libnccl2 to 2.29.7 in `docker/common/install_cuda_libs.sh` and caps `nvidia-nccl-cu13<=2.29.7` in `requirements.txt` to avoid the NCCL 2.30.4 small-message MoE-a2a regression on GB300. ## Root cause (nvbugs/6463987) On GB300 with GLM-5-NVFP4 con1 (dep=2 tep=4, 75 MoE layers, tiny top-k=8 payloads), NCCL 2.30.4 exhibits **bimodal** per-process algorithm selection for the MoE all-to-all dispatch. A same-node A/B on aws-cmh with the b2 wheel (PR NVIDIA#15087 itself), everything else identical, shows: | Config | n | median | CV | fast/slow | |-------------------------------------|--:|-------:|-------:|-----------| | b1 (pre-PR#15087, native NCCL 2.29.7)| 6 | 4.03 | 1.94% | 6/0 ✅ | | b2 + LD_PRELOAD NCCL 2.29.7 | 5 | 4.15 | 1.33% | 5/0 ✅ | | b2 (PR#15087, native NCCL 2.30.4) | 6 | 3.38 | 27.0% | 3/3 ⚠ | | bad (position 28, native NCCL 2.30.4)| 6 | 2.59 | 25.4% | 2/4 ⚠ | Swapping only NCCL to 2.29.7 on a b2 wheel (cuBLAS 13.4.1.2, cuDNN 9.22, torch 2.11.0, and container all unchanged) restores b1-equivalent stable perf across 5 different aws-cmh GB300 nodes. ## Mechanism Nsys GPU-time analysis of b2 slow-branch reps shows 87% of GPU time in `moeA2ADispatchKernel` + `moeA2ASanitizeExpertIdsKernel` at ~4.85 ms/call (780 calls per rep). On the fast branch the same kernels run at 17.3 microseconds/call — a 280× swing between algorithm picks. All non-a2a kernels (Cutlass DSL, cuBLAS, MLA-DSA attention) are unchanged between branches. GLM-5's 75-MoE-layer stack multiplies the per-a2a delta into the observed ~1.5-2× end-to-end regression. This is a NCCL 2.30 internal-tactic selection issue, not a TRT-LLM code change. Upstream NCCL should be notified; this PR is the workaround while that is investigated. ## Alternatives considered - **PR NVIDIA#16601** (revert whole 26.05 stack): correct in spirit but wider than needed; also reverts cuBLAS, cuDNN, torch, container. Closed. - **PR NVIDIA#16623** (cuBLAS-only downgrade 13.4.1.2 → 13.4.0.1): ruled out by nsys — cuBLAS kernels are byte-identical between fast/slow branches. Closed. This PR is the surgical minimum. ## Test plan - [x] Verify on aws-cmh GB300 con1 with same-node A/B (5 reps unpinned, 6 reps pinned nvl72d083-T17): all fast, CV<2% - [ ] CI perf-sanity to confirm nothing else regresses (relies on this PR's container rebuild) - [ ] After merge: watch main HEAD reproduce for 5 reps to confirm sticky ## Container rebuild The pyxis container image (`LLM_SBSA_DOCKER_IMAGE`) bakes libnccl2 from the apt-installed package. This PR changes `install_cuda_libs.sh`, so the `jenkins/current_image_tags.properties` tag must be re-generated by the CI build for the fix to take effect at runtime. Otherwise the container's baked-in NCCL 2.30.4 will still be loaded ahead of the pip wheel. ## Links - Bug: https://nvbugs/6463987 - Data: computelab:/home/scratch.chenfeiz_gpu/repo/20260801-nccl29-fix-verify/ - Prior triage: computelab:/home/scratch.chenfeiz_gpu/repo/20260730xxx/ Signed-off-by: chenfeiz0326 <203214996+chenfeiz0326@users.noreply.github.com>
WalkthroughThe pull request updates the default NCCL package version in the CUDA installation script and lowers the ChangesNCCL Version Alignment
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 `@requirements.txt`:
- Line 29: Regenerate the dependency metadata from requirements.txt so
security_scanning/pyproject.toml and its lock files consistently cap
nvidia-nccl-cu13 at 2.29.7, matching the declared requirement and Docker
installer.
🪄 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: 4377c4a1-6abe-459d-8db6-f96fca003e76
📒 Files selected for processing (2)
docker/common/install_cuda_libs.shrequirements.txt
| # https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-26-05.html#rel-26-05 uses 2.30.4 | ||
| # torch 2.11.0+cu130 depends on nvidia-nccl-cu13==2.28.9 | ||
| nvidia-nccl-cu13>=2.28.9,<=2.30.4 | ||
| nvidia-nccl-cu13>=2.28.9,<=2.29.7 |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n -C 3 \
'nvidia-nccl-cu13|NCCL_VER|2\.29\.7|2\.30\.4' \
requirements.txt \
security_scanning/pyproject.toml \
security_scanning/examples/auto_deploy/poetry.lock \
docker/common/install_cuda_libs.sh
rg -n -C 4 \
'security_scanning|requirements\.txt|install_cuda_libs\.sh' \
. || trueRepository: NVIDIA/TensorRT-LLM
Length of output: 50377
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- security_scanning/pyproject.toml ---'
cat -n security_scanning/pyproject.toml | sed -n '1,45p'
printf '%s\n' '--- lock metadata ---'
cat -n security_scanning/examples/auto_deploy/poetry.lock | sed -n '2378,2400p;4122,4140p'
printf '%s\n' '--- lock generator ---'
cat -n scripts/generate_lock_file.py | sed -n '40,175p'
printf '%s\n' '--- NCCL references in dependency/config files ---'
rg -n -i \
'nvidia[-_]nccl[-_]cu13|NCCL_VER|libnccl|nccl4py' \
--glob 'requirements*.txt' \
--glob 'pyproject.toml' \
--glob 'poetry.lock' \
--glob '*.sh' \
--glob 'Dockerfile*' \
. | head -n 300Repository: NVIDIA/TensorRT-LLM
Length of output: 17256
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- tracked dependency declarations ---'
python3 - <<'PY'
from pathlib import Path
import re
pattern = re.compile(r'nvidia[-_]nccl[-_]cu13|NCCL_VER|libnccl', re.I)
for path in sorted(Path('.').rglob('*')):
if not path.is_file() or any(part in {'.git', 'node_modules', 'build', 'dist'} for part in path.parts):
continue
if path.name not in {'requirements.txt', 'requirements-dev.txt', 'requirements-windows.txt',
'pyproject.toml', 'poetry.lock'} and not path.name.startswith('Dockerfile') \
and path.suffix not in {'.sh', '.groovy'}:
continue
try:
lines = path.read_text(errors='replace').splitlines()
except OSError:
continue
matches = [(i, line) for i, line in enumerate(lines, 1) if pattern.search(line)]
if matches:
print(path)
for i, line in matches:
print(f' {i}: {line}')
PY
printf '%s\n' '--- generation and security-scan integration ---'
rg -n -C 5 \
'generate_lock_file|security_scanning|poetry (install|lock)|black duck|Black Duck' \
jenkins scripts security_scanning \
--glob '*.groovy' --glob '*.py' --glob '*.toml' --glob '*.md' --glob '*.yml' --glob '*.yaml' \
| head -n 240
printf '%s\n' '--- changed paths ---'
git status --short
git diff --statRepository: NVIDIA/TensorRT-LLM
Length of output: 7955
Regenerate the security-scanning dependency files.
security_scanning/pyproject.toml still permits nvidia-nccl-cu13 through 2.30.4, while requirements.txt and the Docker installer cap it at 2.29.7. Regenerate security_scanning/pyproject.toml and its lock files from requirements.txt.
🤖 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 `@requirements.txt` at line 29, Regenerate the dependency metadata from
requirements.txt so security_scanning/pyproject.toml and its lock files
consistently cap nvidia-nccl-cu13 at 2.29.7, matching the declared requirement
and Docker installer.
Summary
docker/common/install_cuda_libs.shand capsnvidia-nccl-cu13<=2.29.7inrequirements.txtto work around a NCCL 2.30.4 small-message MoE all-to-all regression on GB300 (nvbugs/6463987).Verified on main HEAD
5 unpinned reps of
perf/test_perf_sanity.py::test_e2e[aggr_upload-ctx_only-gb300_glm-5-fp4_1k1k_con1_ctx1_dep2_gen1_tep4_eplb0_mtp3_ccb-NIXL]on aws-cmh GB300 for each config. Both against main HEADa9544e0ded. 10 distinct nodes across the two sets:slurm-*.outconfirms the intended NCCL version was loaded at runtime (NCCL version 2.30.4+cuda13.2for tot;NCCL version 2.29.7+cuda13.2for tot+PR)Root cause
On GB300 with GLM-5-NVFP4 con1 (dep=2, tep=4, 75 MoE layers, MTP-3 speculative, tiny top-k=8 payloads), NCCL 2.30.4 exhibits bimodal per-process algorithm selection in the MoE all-to-all dispatch kernel. Same-node isolation A/B on aws-cmh, everything else identical, singles out NCCL as the sole variable:
Swapping only NCCL to 2.29.7 on the b2 wheel (same cuBLAS 13.4.1.2, same cuDNN 9.22, same torch 2.11.0, same container) restores b1-equivalent stable perf across 5 different aws-cmh GB300 nodes.
Mechanism
Nsys GPU-time analysis of b2 slow-branch reps shows 87% of GPU time in the MoE a2a kernels:
moeA2ADispatchKernel<BlockPolicy, 8>: 780 calls × 4.85 ms = 3.78 smoeA2ASanitizeExpertIdsKernel: 780 calls × 4.84 ms = 3.77 sOn the fast branch (one rep out of 5 caught a partial fast-a2a state), the same kernels run at 17.3 µs/call — a 280× swing between algorithm picks. All non-a2a kernels (Cutlass DSL, cuBLAS, MLA-DSA attention) are unchanged (within 1-2 %) between branches.
GLM-5's 75-MoE-layer stack multiplies the per-a2a delta into the observed 1.5-2× end-to-end regression.
This is an NCCL 2.30 internal-tactic selection issue, not a TRT-LLM code change. Upstream NCCL should be notified; this PR is the workaround while that is investigated.
Alternatives considered
This PR is the surgical minimum: one package downgrade in two files.
Container rebuild requirement
The pyxis container image (
LLM_SBSA_DOCKER_IMAGEfromjenkins/current_image_tags.properties) bakes libnccl2 from the apt-installed package. This PR changesinstall_cuda_libs.sh, so the image tag must be re-generated by the CI build for the fix to take effect at runtime. Otherwise the container's baked-in NCCL 2.30.4 will still be loaded ahead of the pip wheel and the fix will not apply.The main-HEAD verification above used LD_PRELOAD to force-load the pip-installed libnccl.so.2 (2.29.7) over the container's baked-in libnccl2 (2.30.4) — this is how the same numbers this PR is expected to produce were reproduced without rebuilding the container. Once the container rebuild lands from CI, the runtime NCCL will be 2.29.7 natively and the LD_PRELOAD workaround will not be needed.
Test plan
Links