Repository navigation
[None][perf] Use a direct BF16 GEMM for Mistral Large 4 narrow decode projections on SM107 - #22251
Merged
yizhang-nv merged 3 commits intoNov 16, 2026
Conversation
Signed-off-by: yt0428 <[email protected]>
Extend the fixed direct-kernel table from 4 to 10 shapes, adding draft 6x576 and 12x576 and target 8x576, 8x512, 8x160 and 16x160 at K=6144. 16x512, 16x576 and larger M stay on cuBLAS. Tests cover explicit fallback shapes. Signed-off-by: yt0428 <[email protected]>
… ops low_m_cublas_mm is called only by the mistral_large_4_nvfp4__sm_107__tp4 target, so it moves out of the shared catalog/gemm/cublas_mm.py into that target's ops/gemm/low_m_cublas_mm.py, following the modeling_v2 op-ownership rule. The table, tactic gate and entry move unchanged; the entry still subclasses the shared CublasMm and falls back to it. Its tests move from the shared cublas_mm test to the owned-entry path tests/unittest/_torch/modeling_v2/models/mistral_large4/ mistral_large_4_nvfp4__sm_107__tp4/gemm/test_modeling_v2_low_m_cublas_mm.py, which skips without a CUDA device instead of asserting at import, since the CPU stage collects that directory. catalog/gemm/cublas_mm.py and its test match the base branch again. Signed-off-by: yt0428 <[email protected]>
yt0428
requested review from
Wanli-Jiang,
WeiHaocheng and
litaotju
as code owners
November 13, 2026 09:37
Collaborator
Author
|
/bot skip --comment "Format check only" |
Collaborator
|
PR_Github #84739 [ skip ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #84739 [ skip ] completed with state |
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 17, 2026
… decode projections Port of feat/mistral-large-4 3dfa750 (NVIDIA#22251) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22251's __sm_107__tp4). The target's test directory gets package markers, as the other targets' do. The sm_107 tp target's BF16 projections go through low_m_cublas_mm, a target-local op: the narrow decode shapes of the target and draft kv_a and indexer projections (M up to 16 rows, N 160 to 576, K 6144) run a direct kernel with a fixed tactic each; every other shape takes the cublas_mm entry. 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
… decode projections Port of feat/mistral-large-4 3dfa750 (NVIDIA#22251) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22251's __sm_107__tp4). The target's test directory gets package markers, as the other targets' do. The sm_107 tp target's BF16 projections go through low_m_cublas_mm, a target-local op: the narrow decode shapes of the target and draft kv_a and indexer projections (M up to 16 rows, N 160 to 576, K 6144) run a direct kernel with a fixed tactic each; every other shape takes the cublas_mm entry. 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
… decode projections Port of feat/mistral-large-4 3dfa750 (NVIDIA#22251) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22251's __sm_107__tp4). The target's test directory gets package markers, as the other targets' do. The sm_107 tp target's BF16 projections go through low_m_cublas_mm, a target-local op: the narrow decode shapes of the target and draft kv_a and indexer projections (M up to 16 rows, N 160 to 576, K 6144) run a direct kernel with a fixed tactic each; every other shape takes the cublas_mm entry. 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
… decode projections Port of feat/mistral-large-4 3dfa750 (NVIDIA#22251) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22251's __sm_107__tp4). The target's test directory gets package markers, as the other targets' do. The sm_107 tp target's BF16 projections go through low_m_cublas_mm, a target-local op: the narrow decode shapes of the target and draft kv_a and indexer projections (M up to 16 rows, N 160 to 576, K 6144) run a direct kernel with a fixed tactic each; every other shape takes the cublas_mm entry. 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
… decode projections Port of feat/mistral-large-4 3dfa750 (NVIDIA#22251) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22251's __sm_107__tp4). The target's test directory gets package markers, as the other targets' do. The sm_107 tp target's BF16 projections go through low_m_cublas_mm, a target-local op: the narrow decode shapes of the target and draft kv_a and indexer projections (M up to 16 rows, N 160 to 576, K 6144) run a direct kernel with a fixed tactic each; every other shape takes the cublas_mm entry. 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
… decode projections Port of feat/mistral-large-4 3dfa750 (NVIDIA#22251) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22251's __sm_107__tp4). The target's test directory gets package markers, as the other targets' do. The sm_107 tp target's BF16 projections go through low_m_cublas_mm, a target-local op: the narrow decode shapes of the target and draft kv_a and indexer projections (M up to 16 rows, N 160 to 576, K 6144) run a direct kernel with a fixed tactic each; every other shape takes the cublas_mm entry. 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
Routes the narrow BF16 decode projections (N = 160, 512, 576 at K = 6144) of the Mistral Large 4 SM107 (VR200) decode target to FlashInfer's direct dense BF16 GEMM kernel with fixed tactics, instead of cuBLAS. At M ≤ 16 these projections are launch- and latency-bound under cuBLAS.
What changes
New entry
low_m_cublas_mm(LowMCublasMm, a subclass of the sharedCublasMm), in themistral_large_4_nvfp4__sm_107__tp4target's ownops/gemm/low_m_cublas_mm.py. It lives there, not incatalog/, because only this target calls it. This follows the modeling_v2 op-ownership rule.A fixed table of 10 (M, N, K) cells maps to direct-kernel tactics: draft 3/6/12×576; target 4×{576, 512, 160}, 8×{576, 512, 160} and 16×160.
Every call is gated on:
Anything else, including FP32 router logits and collective output buffers, runs
torch.ops.trtllm.cublas_mmas before. There is no mutable tactic cache.The target imports
low_m_cublas_mm as cublas_mm, so its call sites are unchanged.catalog/gemm/cublas_mm.pyis not modified.VR200 results
Measured on the first 4 cells (3×576, 4×160, 4×512, 4×576):
Not measured yet
Merge note: this PR and the fused FP8 linear PR each add one import line at the same spot in the target's
modeling.py. Whichever merges second keeps both lines; nothing else overlaps. Both PRs add the sameops/__init__.pyandops/gemm/__init__.py.Test Coverage
tests/unittest/_torch/modeling_v2/models/mistral_large4/mistral_large_4_nvfp4__sm_107__tp4/gemm/test_modeling_v2_low_m_cublas_mm.pytest_modeling_v2_claims.pygates cover the new owned entry.On VR200 the original 4-cell version passed 33 tests, plus 63 fallback cases with 6300 graph replays. The 10-cell table has 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