Repository navigation
[None][perf] Add a global split to sparse MLA decode for low-row decode on SM107 - #22252
Merged
yizhang-nv merged 2 commits intoNov 16, 2026
Merged
yizhang-nv merged 2 commits into
yizhang-nv merged 2 commits into
Conversation
Signed-off-by: yt0428 <[email protected]>
…n SM107 Run the global16 split for 1 to 8 rows on SM107 whenever the rows x 16 CTAs fit in one wave of the SMs, instead of only rows 4 and 8 on exactly 212 SMs. Rows above 8 keep the cluster split. Tests cover global rows 1-9 and 16 and a CPU-only row-gate check. Signed-off-by: yt0428 <[email protected]>
yt0428
requested review from
Wanli-Jiang,
WeiHaocheng,
litaotju,
xxi-nv and
yuxianq
as code owners
November 13, 2026 09:37
Collaborator
Author
|
/bot skip --comment "Format check only" |
Collaborator
|
PR_Github #84735 [ skip ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #84735 [ skip ] completed with state |
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 17, 2026
… for low-row decode on SM107 Port of feat/mistral-large-4 cf9dd3f (NVIDIA#22252) onto this branch, where the op and its kernel live in the family (ops/attention/cute_dsl_ds_mla_sparse_decode and kernels/_ds_mla_sparse_decode_kernel) and the op test under the family's ops tests. On SM107, a decode call with 1 to 8 rows whose 16 CTAs per row fit in one wave of the SMs runs 16 independent split CTAs per row and one combine launch, instead of the cluster split. Each call allocates its FP32 partial workspace through PyTorch, so stream and CUDA-graph pool lifetimes are kept. Other shapes and devices keep the cluster path. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 17, 2026
The ops the SM107 decode ports bring (NVIDIA#22249, NVIDIA#22250, NVIDIA#22251, NVIDIA#22252) are tested on sm_107 only; feat/mistral-large-4 lists none of their tests. l0_gr100 now runs the split radix top-k test, the sparse MLA decode test (its global-split cases need sm_107) and the sm_107 tp target's test directory (low_m_cublas_mm and the fused FP8 GEMV). Signed-off-by: Yi Zhang <[email protected]>
1 task
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 20, 2026
… for low-row decode on SM107 Port of feat/mistral-large-4 cf9dd3f (NVIDIA#22252) onto this branch, where the op and its kernel live in the family (ops/attention/cute_dsl_ds_mla_sparse_decode and kernels/_ds_mla_sparse_decode_kernel) and the op test under the family's ops tests. On SM107, a decode call with 1 to 8 rows whose 16 CTAs per row fit in one wave of the SMs runs 16 independent split CTAs per row and one combine launch, instead of the cluster split. Each call allocates its FP32 partial workspace through PyTorch, so stream and CUDA-graph pool lifetimes are kept. Other shapes and devices keep the cluster path. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 20, 2026
The ops the SM107 decode ports bring (NVIDIA#22249, NVIDIA#22250, NVIDIA#22251, NVIDIA#22252) are tested on sm_107 only; feat/mistral-large-4 lists none of their tests. l0_gr100 now runs the split radix top-k test, the sparse MLA decode test (its global-split cases need sm_107) and the sm_107 tp target's test directory (low_m_cublas_mm and the fused FP8 GEMV). Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 23, 2026
… for low-row decode on SM107 Port of feat/mistral-large-4 cf9dd3f (NVIDIA#22252) onto this branch, where the op and its kernel live in the family (ops/attention/cute_dsl_ds_mla_sparse_decode and kernels/_ds_mla_sparse_decode_kernel) and the op test under the family's ops tests. On SM107, a decode call with 1 to 8 rows whose 16 CTAs per row fit in one wave of the SMs runs 16 independent split CTAs per row and one combine launch, instead of the cluster split. Each call allocates its FP32 partial workspace through PyTorch, so stream and CUDA-graph pool lifetimes are kept. Other shapes and devices keep the cluster path. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 23, 2026
The ops the SM107 decode ports bring (NVIDIA#22249, NVIDIA#22250, NVIDIA#22251, NVIDIA#22252) are tested on sm_107 only; feat/mistral-large-4 lists none of their tests. l0_gr100 now runs the split radix top-k test, the sparse MLA decode test (its global-split cases need sm_107) and the sm_107 tp target's test directory (low_m_cublas_mm and the fused FP8 GEMV). Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 23, 2026
… for low-row decode on SM107 Port of feat/mistral-large-4 cf9dd3f (NVIDIA#22252) onto this branch, where the op and its kernel live in the family (ops/attention/cute_dsl_ds_mla_sparse_decode and kernels/_ds_mla_sparse_decode_kernel) and the op test under the family's ops tests. On SM107, a decode call with 1 to 8 rows whose 16 CTAs per row fit in one wave of the SMs runs 16 independent split CTAs per row and one combine launch, instead of the cluster split. Each call allocates its FP32 partial workspace through PyTorch, so stream and CUDA-graph pool lifetimes are kept. Other shapes and devices keep the cluster path. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 23, 2026
The ops the SM107 decode ports bring (NVIDIA#22249, NVIDIA#22250, NVIDIA#22251, NVIDIA#22252) are tested on sm_107 only; feat/mistral-large-4 lists none of their tests. l0_gr100 now runs the split radix top-k test, the sparse MLA decode test (its global-split cases need sm_107) and the sm_107 tp target's test directory (low_m_cublas_mm and the fused FP8 GEMV). Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 24, 2026
… for low-row decode on SM107 Port of feat/mistral-large-4 cf9dd3f (NVIDIA#22252) onto this branch, where the op and its kernel live in the family (ops/attention/cute_dsl_ds_mla_sparse_decode and kernels/_ds_mla_sparse_decode_kernel) and the op test under the family's ops tests. On SM107, a decode call with 1 to 8 rows whose 16 CTAs per row fit in one wave of the SMs runs 16 independent split CTAs per row and one combine launch, instead of the cluster split. Each call allocates its FP32 partial workspace through PyTorch, so stream and CUDA-graph pool lifetimes are kept. Other shapes and devices keep the cluster path. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 24, 2026
The ops the SM107 decode ports bring (NVIDIA#22249, NVIDIA#22250, NVIDIA#22251, NVIDIA#22252) are tested on sm_107 only; feat/mistral-large-4 lists none of their tests. l0_gr100 now runs the split radix top-k test, the sparse MLA decode test (its global-split cases need sm_107) and the sm_107 tp target's test directory (low_m_cublas_mm and the fused FP8 GEMV). Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 26, 2026
… for low-row decode on SM107 Port of feat/mistral-large-4 cf9dd3f (NVIDIA#22252) onto this branch, where the op and its kernel live in the family (ops/attention/cute_dsl_ds_mla_sparse_decode and kernels/_ds_mla_sparse_decode_kernel) and the op test under the family's ops tests. On SM107, a decode call with 1 to 8 rows whose 16 CTAs per row fit in one wave of the SMs runs 16 independent split CTAs per row and one combine launch, instead of the cluster split. Each call allocates its FP32 partial workspace through PyTorch, so stream and CUDA-graph pool lifetimes are kept. Other shapes and devices keep the cluster path. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 26, 2026
The ops the SM107 decode ports bring (NVIDIA#22249, NVIDIA#22250, NVIDIA#22251, NVIDIA#22252) are tested on sm_107 only; feat/mistral-large-4 lists none of their tests. l0_gr100 now runs the split radix top-k test, the sparse MLA decode test (its global-split cases need sm_107) and the sm_107 tp target's test directory (low_m_cublas_mm and the fused FP8 GEMV). Signed-off-by: Yi Zhang <[email protected]>
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.
@coderabbitai summary
Description
Adds a global-workspace split-K variant (
global16) to the CuTe DSL sparse MLA decode kernel for low-row decode on SM107 (VR200).At 1–8 generation rows, the existing cluster split runs too few CTAs to fill the GPU. The global variant instead runs 16 independent split CTAs per row, writing FP32 partials (516 elements per row, split and head: the 512-wide normalized output plus LSE) to a per-call workspace, then merges them with one combine launch.
What changes
_ds_mla_sparse_decode_kernel.py: the global-partials path and the combine kernel sit behind a compile-timeglobal_partialsflag that defaults to False. The cluster variants compile to the same code as before.cute_dsl_ds_mla_sparse_decode.py:build()compiles the global variant only when the device capability is (10, 7).1 <= rows <= 8androws * 16 <= num_sms.Impact on other targets: only the Mistral Large 4 NVFP4 targets call this op (sm_103 tp4/tep4, sm_107 tp4/tep4). Behaviour on SM103 is unchanged. On SM107,
sm_107__tep4takes the global path at the same row counts assm_107__tp4.VR200 results
These were measured with the earlier gate, which ran the global path at rows 4 and 8 on 212 SMs.
At rows 16, global16 was 18–20% slower than the cluster split, so rows 16 stay on the cluster split.
Not measured yet: the gate now runs global16 at rows 1–8 whenever they fit in one wave, instead of only rows 4 and 8. Rows 1, 2, 3, 5, 6 and 7 on the global path have not been timed on GPU.
Test Coverage
tests/unittest/_torch/modeling_v2/attention/test_modeling_v2_cute_dsl_ds_mla_sparse_decode.pytest_global_split_boundaries_and_dynamic_graph: heads 8/16, rows 1–8 and 16, NoPE on/off, with dynamic CUDA graph replay.test_global_split_concurrent_graph_workspaces: concurrent graphs with independent workspaces, run directly and through the wrapper.test_global_split_at_1m_large_address(large): 1M-key pools above 4 GiB.test_global_split_row_gate(CPU-only): the rows × SMs gate.test_low_row_wrapper_padded_query_and_graph: rows 1–9 and 16 through the wrapper, with a padded query.The global-split GPU tests also run on B300 pre-merge.
On VR200 the rows-4/8 version passed 14 focused tests, 4 real 1M-pool tests, 24 bitwise checks against the cluster path, 22 wrapper-wiring tests, and 108 fallback cells × 100 graph replays. The widened row gate's tests have not run on GPU yet.
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.🤖 Generated with Claude Code