Repository navigation
Conversation
Why. Upstream main at ba42481, NVIDIA's GLM-5.3-Flash snapshot and the locked cuBLAS 13.4.1.3, on four SM120 GPUs: these seven cases, run in one pytest process in this order with FLARE_RUN_CUDA_TESTS=1 and FLARE_GLM53_SNAPSHOT pointing at the snapshot, pytest \ tests/recipes/test_glm53_moe_overlap.py::test_autotuned_shared_routed_graph[2-True-False-False-1] \ tests/recipes/test_glm53_mla_cuda.py::test_glm_mla_checkpoint_native_replay[1-decode-2-True] \ tests/recipes/test_glm53_mla_cuda.py::test_glm_mla_checkpoint_native_replay[1-decode-1-False] \ tests/recipes/test_glm53_mla_cuda.py::test_glm_mla_checkpoint_native_replay[1-decode-2-False] \ tests/recipes/test_glm53_mla_cuda.py::test_glm_mla_checkpoint_native_replay[1-prefill-65-True] \ tests/recipes/test_glm53_mla_cuda.py::test_glm_mla_checkpoint_native_replay[2-decode-1-True] \ tests/recipes/test_glm53_mla_cuda.py::test_glm_mla_checkpoint_native_replay[2-decode-2-True] end with the last case raising CUBLAS_STATUS_INTERNAL_ERROR in cublasGemmStridedBatchedEx, called by torch.bmm in _bmm_out (ignition/components/linear.py) and reached through the MLA query absorb, followed by CUDA_ERROR_ILLEGAL_ADDRESS. Removing any one of the five TP1 and TP2 replay cases removes the error, so the failure depends on state accumulated in the process. It reproduced twice. With the cuBLAS 13.6.1.10 libraries in place of 13.4.1.3 (same tree, same FlashInfer 598c8547) the sequence raises no cuBLAS or CUDA error. The same torch.bmm call failed one TP4 preparation of local-inference-lab/GLM-5.3-Flash-NVFP4 at revision 378ca54585c46542bad1f3cb3ed0d73ae51cdb62 at warmup 44 of 108, the speculative verification graph of two requests with six rows each, with 13.4.1.3. Six other preparations with 13.4.1.3 passed, and preparations with 13.6.1.10 pass. Whether the two failures are the same defect is not established. The cause is not established either. The cuBLAS "Patch Release 13.6.1" notes list fixes for out-of-bounds reads in strided batched GEMMs whose shared operand has zero or overlapping strides on SM120 and SM121, which could explain it; the operand layout that triggers this failure has not been identified. Isolated single-call torch.bmm probes do not reproduce it; the multi-case sequence does. Pinning the fixed release removes the failure without waiting for the cause. What changed. pyproject.toml overrides nvidia-cublas to 13.6.1.10 and uv.lock records its wheels; the lock file differs from main's only in the nvidia-cublas entries and the override in its manifest. cuda-toolkit 13.2.2, which torch 2.14.1+cu132 requires, depends on nvidia-cublas==13.4.1.3.*, so a direct requirement conflicts with it and the override replaces that dependency. The override is unconditional: the package publishes wheels for x86_64 and aarch64 only, and re-locking without a platform marker selects the same wheels. It applies to the preparation of every recipe on both architectures, uv only. docs/model-preparation.md states the requirement. Two docs/TODO.txt entries, whose close condition is a locked cuBLAS that no longer fails, are removed: "Resolve the CUDA illegal memory access of the GLM MLA replay tests with cuBLAS 13.4.1.3" and "Explain the one TP4 preparation failure of glm-5.3-flash-nvfp4 at warmup 44". Result. Preparation uses cuBLAS 13.6.1.10 and the seven-case sequence raises no cuBLAS or CUDA error. Native serving (flare run) does not load cuBLAS, so existing cores are unchanged; cores exported with this change can select different BF16 GEMM algorithms. Evidence, with 13.6.1.10 libraries on SM120 unless stated. With 13.4.1.3 the seven cases above end in the cuBLAS error, twice; with 13.6.1.10 they raise no cuBLAS or CUDA error. A TP4 export of local-inference-lab/GLM-5.3-Flash-NVFP4 at the revision above, with the libraries mounted read-only over a validation environment that also carried unmerged changes, passes all 108 warmups and graph-memory captures and exports; all four ranks map the new library. With 13.4.1.3 the same export fails at warmup 44. An isolated installation of the locked package passes a Gemma 4 E2B TP1 export (concurrency 1, prefill 128, no MTP, Inductor compilation disabled). A TP4 export of nvidia/GLM-5.3-Flash-FP4-Local at revision 76348ddb2be2e35e39ecfc00e75dc07703f4f3d5 with --autotune-effort off exits 0 in 3319 s; a check that every kernel argument that looks like a device address lies inside a recorded allocation finds 0 violations in 114 graphs on each of the four ranks. A TP4 export of DeepSeek V4.1 Flash completes every warmup and capture; that recipe does not call torch.bmm, so the export shows only that the new wheel does not break its preparation; the same address check on its core finds 0 violations in 149 graphs on each of four ranks. uv lock --check passes, and a dry run of uv sync --locked --extra prepare --extra test resolves nvidia-cublas 13.6.1.10. Relation to NVIDIA#331. NVIDIA#331 moves warmup execution in capture_forwards onto a dedicated stream that does not capture, and changes which stream's cuBLAS workspace is cached and where it is allocated. It does not change the operands of the GEMM, and the seven test cases above capture their graphs without calling capture_forwards. The sequence has not been re-run on a main that includes NVIDIA#331. Not verified: every other recipe, SM103, SM121, aarch64, any numerical comparison of exported cores between the two versions, generation accuracy, a re-run of the sequence on a main that includes NVIDIA#331, and installation by uv sync --locked from this branch beyond the dry run. Signed-off-by: yatesdr <6937857+yatesdr@users.noreply.github.com> Design-Signed-Off-By: yatesdr; design-review=1af4
Collaborator
Author
|
Checked 40d1c1f. The override is minimal and correct. The lock entries match PyPI's wheels for x86_64 and aarch64. Blocking
Should fix
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closed without merging. The review asked for the seven-case reproduction and the TP4 preparation to be repeated on a main that includes #331, with cuBLAS 13.4.1.3 and 13.6.1.10. No GPU host is free for that now, and the existing evidence does not justify an override that sets aside
cuda-toolkit's requirement: TP4 preparations oflocal-inference-lab/GLM-5.3-Flash-NVFP4with the locked 13.4.1.3 failed once in eight runs, and the only repeatable failure is the test sequence below, measured onba42481abefore #331.docs/TODO.txton main already records both failures with their close conditions. If 13.4.1.3 still fails that sequence on current main, this will come back with that evidence.Re-run on current main (
a2bf7860, which includes #331 and FlashInfer1d76585b), four SM120 GPUs withCUDA_VISIBLE_DEVICES=0,1, NVIDIA'sGLM-5.3-Flash-FP4-Localsnapshot at76348ddb, one pytest process per run: with the locked cuBLAS 13.4.1.3 (libcublas sha256d089edf0…, the build that crashed onba42481a) the seven-case sequence passed 7/7 in three complete runs, with noCUBLAS_STATUSerror and no illegal address; a fourth run, the first on a cold kernel cache, failed one case with "planned Triton program has not been compiled", unrelated to cuBLAS. With 13.6.1.10 (f7e672d9…) it passed 7/7 twice. The override is not needed on current main.Preparation fails inside cuBLAS 13.4.1.3, the version
uv.lockpins, in astrided batched GEMM that GLM-5.3-Flash's MLA path calls through
torch.bmm.cuBLAS 13.6.1.10 does not fail in the same conditions. This change overrides
nvidia-cublasto 13.6.1.10 for preparation. The cause of the failure in13.4.1.3 is not established.
Why
Upstream main at
ba42481a, NVIDIA's GLM-5.3-Flash snapshot and cuBLAS13.4.1.3, on four SM120 GPUs. These seven cases, run in one pytest process in
this order with
FLARE_RUN_CUDA_TESTS=1andFLARE_GLM53_SNAPSHOTpointing atthe snapshot, end with a CUDA error:
The last case raises
CUBLAS_STATUS_INTERNAL_ERRORincublasGemmStridedBatchedEx, called bytorch.bmmin_bmm_out(
ignition/components/linear.py) and reached through the MLA query absorb,followed by
CUDA_ERROR_ILLEGAL_ADDRESS. Removing any one of the five TP1 andTP2 replay cases removes the error, so the failure depends on state
accumulated in the process. It reproduced twice. With the cuBLAS 13.6.1.10
libraries in place of 13.4.1.3 (same tree, same FlashInfer
598c8547) thesequence raises no cuBLAS or CUDA error.
The same
torch.bmmcall failed one TP4 preparation oflocal-inference-lab/GLM-5.3-Flash-NVFP4(revision378ca54585c46542bad1f3cb3ed0d73ae51cdb62) at warmup 44 of 108, thespeculative verification graph of two requests with six rows each, with
13.4.1.3. Six other preparations with 13.4.1.3 passed, and preparations with
13.6.1.10 pass. Whether the two failures are the same defect is not
established.
The cuBLAS "Patch Release 13.6.1" notes list fixes for out-of-bounds reads in
strided batched GEMMs whose shared operand has zero or overlapping strides on
SM120 and SM121. That could explain the failures, but the operand layout that
triggers them has not been identified. Isolated single-call
torch.bmmprobesdo not reproduce the failure; the multi-case sequence does. Pinning the fixed
release removes the failure without waiting for the cause.
What changes
pyproject.tomloverridesnvidia-cublasto 13.6.1.10 anduv.lockrecordsits wheels. The lock file differs from main's only in the
nvidia-cublasentries (13.4.1.3 to 13.6.1.10, x86_64 and aarch64 wheels) and the override in
its manifest.
cuda-toolkit13.2.2, which torch 2.14.1+cu132 requires, depends onnvidia-cublas==13.4.1.3.*, so a direct requirement conflicts with it; theoverride replaces that dependency.
aarch64 only, and re-locking without a platform marker selects the same
wheels. It applies to the preparation of every recipe on both architectures,
with
uvonly.docs/model-preparation.mdstates the requirement.docs/TODO.txtentries, whose close condition is a locked cuBLAS thatno longer fails, are removed: "Resolve the CUDA illegal memory access of the GLM MLA replay tests with
cuBLAS 13.4.1.3" (with 13.6.1.10 the sequence raised no error on
ba42481a) and "Explain theone TP4 preparation failure of glm-5.3-flash-nvfp4 at warmup 44" (preparations
with 13.6.1.10 pass).
Result
Preparation uses cuBLAS 13.6.1.10 and the seven-case sequence raises no cuBLAS
or CUDA error. Native serving (
flare run) does not load cuBLAS, so existingcores are unchanged. Cores exported with this change can select different BF16
GEMM algorithms.
Evidence
All with 13.6.1.10 libraries on SM120 unless stated.
13.6.1.10 they raise no cuBLAS or CUDA error. On
ba42481asix of them alsofail an output comparison of the replay test with either version.
local-inference-lab/GLM-5.3-Flash-NVFP4at the revisionabove, with the libraries mounted read-only over a validation environment that
also carried unmerged changes, passes all 108 warmups and graph-memory
captures and exports; all four ranks map the new library. With 13.4.1.3 the
same export fails at warmup 44.
export (concurrency 1, prefill 128, no MTP, Inductor compilation disabled).
nvidia/GLM-5.3-Flash-FP4-Localat revision76348ddb2be2e35e39ecfc00e75dc07703f4f3d5with--autotune-effort offexits0 in 3319 s. A check that every kernel argument that looks like a device
address lies inside a recorded allocation finds 0 violations in 114 graphs on
each of the four ranks.
recipe does not call
torch.bmm, so the export shows only that the new wheeldoes not break its preparation. The same address check on its core finds 0
violations in 149 graphs on each of four ranks.
uv lock --checkpasses, and a dry run ofuv sync --locked --extra prepare --extra testresolvesnvidia-cublas13.6.1.10.
Relation to #331
#331 moves warmup execution in
capture_forwardsonto a dedicated stream thatdoes not capture, and changes which stream's cuBLAS workspace is cached and
where it is allocated. It does not change the operands of the GEMM, and the
seven test cases above capture their graphs without calling
capture_forwards.The sequence has not been re-run on a main that includes #331.
Not verified
Every other recipe, SM103, SM121, aarch64, any numerical comparison of exported
cores between the two versions, generation accuracy, a re-run of the sequence on
a main that includes #331, and installation by
uv sync --lockedfrom thisbranch beyond the dry run.
Discord: D-Rock