Skip to content

[https://nvbugs/6463987][perf] Pin cuBLAS to 13.4.0.1 to work around GB300 NVFP4 GEMM heuristic regression - #16623

Closed
chenfeiz0326 wants to merge 1 commit into
NVIDIA:mainfrom
chenfeiz0326:user/chenfeiz/perf-6463987-cublas-pin
Closed

[https://nvbugs/6463987][perf] Pin cuBLAS to 13.4.0.1 to work around GB300 NVFP4 GEMM heuristic regression#16623
chenfeiz0326 wants to merge 1 commit into
NVIDIA:mainfrom
chenfeiz0326:user/chenfeiz/perf-6463987-cublas-pin

Conversation

@chenfeiz0326

@chenfeiz0326 chenfeiz0326 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Surgical alternative to #16601 for the GB300 GLM-5-NVFP4 ctx_only 32% throughput regression (nvbug 6463987).

Changes only one version pin in docker/common/install_tensorrt.sh:

-CUBLAS_VER="13.4.1.2-1"
+CUBLAS_VER="13.4.0.1-1"

Keeps everything else on the 26.05 stack:

  • LLM_*_DOCKER_IMAGE tags — unchanged (26.05 image kept)
  • cuDNN 9.22.0.52 — unchanged
  • NCCL 2.30.4 — unchanged
  • torch upper bound <=2.13.0a0 — unchanged
  • nvidia-nccl-cu13<=2.30.4 in requirements.txt — unchanged

Root cause

PR #15087 rolled up cuBLAS 13.4.0.1 → 13.4.1.2, cuDNN 9.21 → 9.22, and NCCL 2.29.7 → 2.30.4 in one commit alongside the container bump. The delta on this bug is prefill-GEMM-shaped, not comm- or warmup-shaped:

  • Per-request TTFT: 247 ms → 352 ms (+42%)
  • output_token_throughput: 4.07 → 2.75 (-32%)
  • Startup got faster (7m10s → 5m50s), ruling out JIT/warmup/autotuner-search as the driver.
  • Runtime torch strings confirm the container swap (nv26.04.48445190nv26.05).

The prefill GEMM shape class (GLM-5 dense-attention Q/K/V + MLP at 1024×hidden×dp_slice on GB300 SM100) is exactly what a per-shape cuBLAS heuristic table change would hit. Full triage lives in the bug's history report; the module ranking there is gemm_quantization (primary), communication (secondary), gpu_kernel (tertiary).

Why this is preferred over #16601

Per the reviewer's comment on #16601:

[We should] investigate pinning cuBLAS specifically while maintaining the newer NGC base image, plus formally file the cuBLAS issue for permanent resolution.

Comparison:

Property #16601 (full revert) This PR
Files touched 3 1
Container base 26.04 (reverted) 26.05 (kept)
cuDNN 9.21 (reverted) 9.22 (kept)
NCCL 2.29.7 (reverted) 2.30.4 (kept)
torch upper bound 2.12.0a0 (reverted) 2.13.0a0 (kept)
Undoes 26.05 security/perf fixes Yes No
Blast radius Whole stack cuBLAS only
Reversible when cuBLAS is fixed Requires re-doing the full upgrade 1-line CUBLAS_VER bump

The header/lib symlink guards added in #15087 (if [ -d "${CUBLAS_HDR_DIR}" ] at install_tensorrt.sh:83 and :96) are already conditional, so they no-op cleanly when the older cuBLAS is installed — no additional cleanup needed.

Verification (lyris GB300, same wheel tensorrt_llm-1.3.0rc21, cuda_arch=103-real, target origin/main at c77bc6ed6)

All four runs use the same 26.05 pyxis image and the same wheel. The only variable is cuBLAS runtime version — simulated by apt-get install --allow-downgrades libcublas-13-2=13.4.0.1-1 + symlink repoint inside the container before pytest starts. readlink -f /usr/local/cuda/lib64/libcublas.so was confirmed to resolve to .../libcublas.so.13.4.0.1 in every fix run.

Config Node cuBLAS output_token_throughput mean_ttft_ms
baseline (26.05 stock) theia0198 13.4.1.2 2.84 351.7
fix (26.05 + downgrade) theia0082 13.4.0.1 3.09 322.3
fix (26.05 + downgrade) theia0197 13.4.0.1 4.19 236.8
fix (26.05 + downgrade) theia0085 13.4.0.1 3.01 332.0

Reference numbers from the bug (oci-aga same-node CV 1.8%):

  • good_commit = 4.07
  • bad_commit = 2.75

The one fix run on a healthy node (theia0197: 4.19 > good_commit 4.07) shows full recovery. The other two fix nodes hit the same 3-ish range regardless of cuBLAS — consistent with the known GB300 node variance pattern where sub-3-tps/s workloads see wide per-node scatter that dominates any per-attempt measurement. The regression itself only reproduces cleanly on ~1/4 of nodes we've tested — hence the deep same-node methodology used in the original triage.

Baseline TTFT (351.7 ms) matches the bug's bad_commit_perf mean TTFT (352 ms) almost exactly, and fix-run2 TTFT (236.8 ms) is even better than the bug's good_commit_perf mean TTFT (247 ms). This gives the strongest signal that cuBLAS is the operative variable on the healthy node.

Follow-up (in parallel, not blocking)

  • File an NVBug against cuBLAS 13.4.1.2 with the exact shape (GLM-5 NVFP4 dense GEMM 1024×hidden×dp_slice on GB300 SM100) so the heuristic table can be retuned upstream.
  • Once cuBLAS ships a fixed 13.4.1.3+ or 13.4.2, drop this pin (single-line CUBLAS_VER bump + delete the NOTE comment) and remove the TODO.

Note on CI image

docker/common/install_tensorrt.sh only runs when the pyxis image is rebuilt. The LLM_*_DOCKER_IMAGE tags in jenkins/current_image_tags.properties are not changed by this PR, so CI-pytest will keep using the current 26.05 image until the periodic image-rebuild job produces a 26.05 image variant with the pinned cuBLAS. That's the same flow every other change to install_tensorrt.sh uses — no additional wiring needed.

Test plan

  • Manually reproduced regression baseline on lyris GB300 (theia0198: 2.84 output_token_throughput, 351.7 ms TTFT) matching bug's bad_commit=2.75 exactly.
  • Verified runtime cuBLAS downgrade to 13.4.0.1 via ctypes probe (cublasGetVersion_v2 returns 130400) inside the pyxis container.
  • Verified full recovery on a healthy node (theia0197: 4.19 output_token_throughput, 236.8 ms TTFT) > bug's good_commit=4.07.
  • CI (pre-merge L0/L1 + post-merge) will exercise the image rebuild + all downstream tests.

Closes #16601.

Related:

Summary by CodeRabbit

  • Bug Fixes
    • Updated the bundled cuBLAS version to avoid a known GEMM performance regression.
    • Improved compatibility and performance for TensorRT-based workloads using cuBLAS.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The TensorRT installation script pins cuBLAS to 13.4.0.1-1 instead of 13.4.1.2-1 and documents the GEMM heuristic regression workaround and reversion TODO.

Changes

cuBLAS Installation Pin

Layer / File(s) Summary
Update cuBLAS package pin
docker/common/install_tensorrt.sh
CUBLAS_VER is changed to 13.4.0.1-1, with comments documenting the cuBLAS 13.4.1.2 GEMM heuristic regression and a future reversion TODO.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: pengbowang-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title accurately describes the main change: pinning cuBLAS to 13.4.0.1 to address the GB300 GEMM regression.
Description check ✅ Passed The description is detailed and covers the issue, fix, verification, and test plan, though it does not follow the template sections exactly.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@chenfeiz0326
chenfeiz0326 requested a review from EmmaQiaoCh July 20, 2026 11:45
Comment thread docker/common/install_tensorrt.sh
…GB300 NVFP4 GEMM heuristic regression

cuBLAS 13.4.1.2 (introduced by PR NVIDIA#15087 in the 26.05 stack upgrade)
picks a slower NVFP4 GEMM plan on GB300 for the GLM-5 dense-attention
prefill shapes, driving output_token_throughput -32% (4.07 -> 2.75) and
per-request TTFT +42% (247 ms -> 352 ms) on
aggr_upload-ctx_only-gb300_glm-5-fp4_1k1k_con1_ctx1_dep2_gen1_tep4_eplb0_mtp3_ccb-NIXL.

This is a surgical alternative to NVIDIA#16601, which fully reverted the
26.05 -> 26.04 stack (container tag + cuBLAS + cuDNN + NCCL + torch upper
bound in a single blob). Per reviewer feedback, we prefer to pin cuBLAS
specifically while keeping the newer NGC base image, so downstream fixes
in cuDNN 9.22, NCCL 2.30, and torch 2.13a0 are retained.

Only docker/common/install_tensorrt.sh changes:
    CUBLAS_VER="13.4.1.2-1" -> "13.4.0.1-1"

The header/lib symlink guards added in NVIDIA#15087 (CUBLAS_HDR_DIR /
CUBLAS_LIB_DIR checks) are already conditional (if [ -d ... ]) so they
no-op cleanly when the older cuBLAS is installed. No other code paths
change.

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
@chenfeiz0326
chenfeiz0326 force-pushed the user/chenfeiz/perf-6463987-cublas-pin branch from d71ef3f to 15b3722 Compare July 21, 2026 02:41
@chenfeiz0326

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "Build-Docker-Images"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60551 [ run ] triggered by Bot. Commit: 15b3722 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60551 [ run ] completed with state FAILURE. Commit: 15b3722
/LLM/main/L0_MergeRequest_PR pipeline #48864 (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

@chenfeiz0326

Copy link
Copy Markdown
Collaborator Author

Perf verification result: the fix does not recover perf — the regression is 100% GB300 node variance.

Re-ran 3 baseline + 3 fix with the same wheel and same 26.05 image on lyris GB300, collecting the runtime cuBLAS version in every job:

Config Node cuBLAS output_token_throughput mean_ttft_ms
baseline (26.05 stock) theia0287 13.4.1.2 4.18 239.3
baseline (26.05 stock) theia0180 13.4.1.2 4.46 224.3
baseline (26.05 stock) theia0284 13.4.1.2 2.61 382.7
fix (26.05 + cuBLAS 13.4.0.1) theia0198 13.4.0.1 2.77 360.9
fix (26.05 + cuBLAS 13.4.0.1) theia0072 13.4.0.1 2.79 357.8
fix (26.05 + cuBLAS 13.4.0.1) theia0054 13.4.0.1 4.32 231.0

Baseline mean 3.75, fix mean 3.29 — both CV ~28%. Neither config is significantly different from the other; the 32% "regression" in the bug is entirely explained by GB300 node identity. Some nodes hit 4.2–4.5 tok/s regardless of cuBLAS version; other nodes hit 2.6–2.8 tok/s regardless of cuBLAS version. cuBLAS 13.4.0.1 vs 13.4.1.2 has no measurable perf effect on this workload.

This also invalidates the verification for PR #16601: its 4.16 measurement was probably a fast node with the full-revert stack, but the same node would have measured ~4.2 with the original 26.05 stack too. The verification signal was not real.

The original triage's own note (bug_repro's raw data on oci-aga same-node CV 1.8%) flagged this pattern — the tight in-config numbers came from the two commits landing on the SAME node, which the oci-aga scheduler happened to do. On lyris, when the scheduler lands the two configs on different nodes, the ~30% node-variance effect washes out any config-level signal.

Closing this PR. The right next step is to route the bug to whoever owns the GB300 node-quality investigation on lyris/oci-aga, not to a cuBLAS version pin. Same for #16601 — it was closed as superseded by this PR, but its own perf claim was similarly node-variance-dominated.

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.

4 participants