Repository navigation
[None][perf] Use a split radix Top-K for Mistral Large 4 DSpark verification on SM107 - #22249
Merged
yizhang-nv merged 4 commits intoNov 16, 2026
Merged
Conversation
Signed-off-by: yt0428 <[email protected]>
Signed-off-by: yt0428 <[email protected]>
The P10 split stage's first pass (digit 31..20 histogram and the negative-NaN count) now reads 256-bit vectors from the 8-column boundary at or below each partition start, filtering neighbouring columns by predicate. Selection, the emit pass and the merge are unchanged. Logits whose rows are not 32-byte aligned, or whose width or row stride is not a multiple of 8, use the native op; the scorer arena's production views satisfy these conditions. Validation on VR200 (SM107): - T0: 32 unit tests pass, including new tests for partition starts at every offset inside a vector and for the unaligned-layout fallback. Harness correctness at the fast and 1M production widths passes (264 checks, 6600 dynamic CUDA graph replays). - T1 (frozen protocol, 3 seeds x hot/cycling x 5 interleaved blocks, epsilon 1%): committed P10 -> vectorized P10 weighted complete call 28.30 -> 24.32 us (-14.1%), B1 -12.9%, 5/5 blocks; 334K -17%, 487K -22%, full 1M rows -27%; rows up to 16K within +-1%. Against native the weighted reduction is -39.5% (was -29.7%), and full 1M rows move from +0.9% to -26.6%. All protection shapes pass. - T3 (C4/TP4, one AB pair, original 393-trajectory protocol, same node): ITL p50 4.390 -> 4.419 ms (-0.64% speed, within noise), 243/243 requests and zero errors in both arms. 110 equal-length paired requests show a 0.51% lower mean ITL for B. The C4 context mix (median 66K, none above 524K) predicts about 0.6%, so no end-to-end gain is established for C4; long-context (C1/TP8 or near 1M) end-to-end runs were not performed. Signed-off-by: yt0428 <[email protected]>
… scorer widths Build and dispatch the SM107 split radix selector for any decode scorer width from 20480 to 1048584 columns, instead of only the 1048584-column width with a 1048832-column row stride. Below 20480 columns the native op never splits a row into ten blocks, so the selector would always fall back; 1048584 is the split kernel's widest row. split_radix_topk_decode already keeps the native op when the native op would not split the call into ten blocks, or when the rows are not 32-byte aligned with a width that is a multiple of 8, so the exact width and stride checks at the call site are dropped. next_n 4, rows 4/8/16, fp32 logits and top-k 2048 are still required. Component timings so far cover the 1048584-column width only. 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:36
Collaborator
Author
|
/bot skip --comment "Format check only" |
Collaborator
|
PR_Github #84737 [ skip ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #84737 [ skip ] completed with state |
Closed
1 task done
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 17, 2026
…fication on SM107 Port of feat/mistral-large-4 3976d54 (NVIDIA#22249) onto this branch. The selector and its kernel live in the family (ops/attention/ cute_dsl_radix_topk_decode and kernels/_radix_topk_decode), and the native fallback is the family's indexer_topk_decode; the op test sits under the family's ops tests. The sm_107 tp target selects the decode indexer's top-k for DSpark verification (next_n 4, 4/8/16 rows, 20480 to 1048584 columns) with split_radix_topk_decode: ten partitions per row and a radix merge. A call the native op would not split into ten blocks, or whose rows are not 32-byte aligned with a width that is a multiple of 8, keeps the native op. next_n 1 keeps the one-CTA-per-row selector. 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
This was referenced Nov 17, 2026
Merged
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 20, 2026
…fication on SM107 Port of feat/mistral-large-4 3976d54 (NVIDIA#22249) onto this branch. The selector and its kernel live in the family (ops/attention/ cute_dsl_radix_topk_decode and kernels/_radix_topk_decode), and the native fallback is the family's indexer_topk_decode; the op test sits under the family's ops tests. The sm_107 tp target selects the decode indexer's top-k for DSpark verification (next_n 4, 4/8/16 rows, 20480 to 1048584 columns) with split_radix_topk_decode: ten partitions per row and a radix merge. A call the native op would not split into ten blocks, or whose rows are not 32-byte aligned with a width that is a multiple of 8, keeps the native op. next_n 1 keeps the one-CTA-per-row selector. 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
…fication on SM107 Port of feat/mistral-large-4 3976d54 (NVIDIA#22249) onto this branch. The selector and its kernel live in the family (ops/attention/ cute_dsl_radix_topk_decode and kernels/_radix_topk_decode), and the native fallback is the family's indexer_topk_decode; the op test sits under the family's ops tests. The sm_107 tp target selects the decode indexer's top-k for DSpark verification (next_n 4, 4/8/16 rows, 20480 to 1048584 columns) with split_radix_topk_decode: ten partitions per row and a radix merge. A call the native op would not split into ten blocks, or whose rows are not 32-byte aligned with a width that is a multiple of 8, keeps the native op. next_n 1 keeps the one-CTA-per-row selector. 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
…fication on SM107 Port of feat/mistral-large-4 3976d54 (NVIDIA#22249) onto this branch. The selector and its kernel live in the family (ops/attention/ cute_dsl_radix_topk_decode and kernels/_radix_topk_decode), and the native fallback is the family's indexer_topk_decode; the op test sits under the family's ops tests. The sm_107 tp target selects the decode indexer's top-k for DSpark verification (next_n 4, 4/8/16 rows, 20480 to 1048584 columns) with split_radix_topk_decode: ten partitions per row and a radix merge. A call the native op would not split into ten blocks, or whose rows are not 32-byte aligned with a width that is a multiple of 8, keeps the native op. next_n 1 keeps the one-CTA-per-row selector. 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
…fication on SM107 Port of feat/mistral-large-4 3976d54 (NVIDIA#22249) onto this branch. The selector and its kernel live in the family (ops/attention/ cute_dsl_radix_topk_decode and kernels/_radix_topk_decode), and the native fallback is the family's indexer_topk_decode; the op test sits under the family's ops tests. The sm_107 tp target selects the decode indexer's top-k for DSpark verification (next_n 4, 4/8/16 rows, 20480 to 1048584 columns) with split_radix_topk_decode: ten partitions per row and a radix merge. A call the native op would not split into ten blocks, or whose rows are not 32-byte aligned with a width that is a multiple of 8, keeps the native op. next_n 1 keeps the one-CTA-per-row selector. 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
…fication on SM107 Port of feat/mistral-large-4 3976d54 (NVIDIA#22249) onto this branch. The selector and its kernel live in the family (ops/attention/ cute_dsl_radix_topk_decode and kernels/_radix_topk_decode), and the native fallback is the family's indexer_topk_decode; the op test sits under the family's ops tests. The sm_107 tp target selects the decode indexer's top-k for DSpark verification (next_n 4, 4/8/16 rows, 20480 to 1048584 columns) with split_radix_topk_decode: ten partitions per row and a radix merge. A call the native op would not split into ten blocks, or whose rows are not 32-byte aligned with a width that is a multiple of 8, keeps the native op. next_n 1 keeps the one-CTA-per-row selector. 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 CuTe DSL split radix Top-K selector for the indexer's DSpark verification step (next_n = 4) in the Mistral Large 4 SM107 (VR200) decode target, replacing the native
indexer_topk_decodeop for the shapes it covers.Kernel (
catalog/attention/_radix_topk_decode.py,cute_dsl_radix_topk_decode.py)build_splitcompiles the selector.split_radix_topk_decodekeeps the native op whenever:Dispatch (
mistral_large_4_nvfp4__sm_107__tp4/modeling.py)_select_indexer_decoderoutes each call to one of three selectors:VR200 results
Not measured yet
Known differences
Test Coverage
tests/unittest/_torch/modeling_v2/attention/test_modeling_v2_split_radix_topk_decode.pychecks the selector against the native op. Cases cover:On VR200: 32/32 unit tests pass, plus 264 harness correctness checks at the fast and 1M widths with 6600 graph replays.
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