Repository navigation
[FA4] Keep stream last in the SM100 MLA kernel so disk-cached objects load - #42926
Merged
nvpohanh merged 3 commits intoOct 7, 2026
Merged
Conversation
sgl-project#42239 added `mValue` to `FlashAttentionMLAForwardSm100.__call__` as a keyword-only parameter after `stream`. The MLA (qv) path in interface.py calls the kernel with 17 positional arguments. A fresh compile accepts that, but the object the persistent CuTe JIT cache exports and later reloads requires every parameter before the implicit TVM-FFI stream. So every process after the first on a runner fails with "Expects 18 parameters", which breaks test_full_cuda_graph_prefill.py on B200 CI. Put `mValue` before `stream`, restore the stream-last comment, and pass `mValue=None` explicitly at the qv compile and call sites. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nvpohanh
requested review from
BBuf,
DarkSharpness,
HaiShaw,
HydraQYH,
celve and
yuan-luo
as code owners
October 7, 2026 07:23
5 tasks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
/rerun-test test/registered/cuda_graph/full_prefill/test_full_cuda_graph_prefill.py |
Contributor
|
🚀 |
Collaborator
Author
|
/rerun-test test/registered/cuda_graph/full_prefill/test_full_cuda_graph_prefill.py::TestFullCudaGraphChunkedPrefix.test_cached_prefix_replays_full_cuda_graph test/registered/cuda_graph/full_prefill/test_full_cuda_graph_prefill.py::TestFullCudaGraphChunkedPrefix.test_cached_prefix_replays_two_64_token_full_cuda_graph_chunks test/registered/cuda_graph/full_prefill/test_full_cuda_graph_prefill.py |
Contributor
|
🚀 |
Collaborator
Author
|
force-merge this since this is a very limited-scope change and will unblock CI stage-b |
nvpohanh
added a commit
to weireweire/sglang
that referenced
this pull request
Oct 7, 2026
Picks up sgl-project#42926, which fixes the unrelated CI failure https://github.com/sgl-project/sglang/actions/runs/37585780457/job/112679907079 Co-Authored-By: Claude Opus 5.5 <[email protected]>
nvpohanh
added a commit
to weireweire/sglang
that referenced
this pull request
Oct 7, 2026
Picks up sgl-project#42926, which fixes the unrelated CI failure https://github.com/sgl-project/sglang/actions/runs/37586111162/job/112680714957 Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 of 5 tasks
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.
[by Claude Code]
Fixes #42925
Motivation
Since #42239 merged,
test/registered/cuda_graph/full_prefill/test_full_cuda_graph_prefill.pyfails on the B200 PR Test Base job (base-b-test-4-gpu-b200 (0)) with:#42239 added
mValuetoFlashAttentionMLAForwardSm100.__call__as a keyword-only parameter afterstream. The MLA (qv) path ininterface.pycalls the kernel with 17 positional arguments. A freshly compiled kernel accepts that, but the persistent CuTe JIT cache exports the kernel to disk. When a later process reloads it, the loaded TVM-FFI function requires every parameter before the implicit stream, so the call fails. The first process on a runner passes (which is why #42239's own CI passed), and later ones fail. See #42925 for the failing jobs.Modifications
flash_fwd_mla_sm100.py: movemValuebeforestreamso thatstreamstays the last parameter.flash_attn/cute/interface.py: passNoneformValueexplicitly at theqvcompile and call sites. OnlyFlashAttentionMLAForwardSm100uses this branch (qvis asserted Blackwell-only).forward_gqa(#42239's GQA-512 path) passesmValueandstreamby keyword, so it is unaffected.Accuracy Tests
Tested on a B200 (CuTe DSL 4.8.0, tvm-ffi 0.1.11, the same versions as CI). Each check runs as two processes against one fresh
SGLANG_CUTE_AOT_CACHE_DIR, so process 2 loads the object that process 1 exported.2889158792(process 1 / process 2)flash_attn_with_kvcache(q=q_rope, qv=q_nope, ...), 16 heads, rope 64 + latent 512, page size 1, causalTypeError: Expects 18 parametersflash_attn_gqa_512, 16 q heads / 2 kv heads, d=512, causal and non-causalSpeed Tests and Profiling
Not applicable. This changes only the kernel signature and its call site; the kernel body is unchanged.
Checklist
test_full_cuda_graph_prefill.pycovers this path on B200.Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #37588102320
Latest PR Test (Extra): ❌ Run #37588102170
Latest PR Test (AMD ROCm 10): ❌ Run #37588102252