Skip to content

[None][perf] Custom decode kernels for MinimaxM3 - rebased - #17268

Merged
brb-nv merged 1 commit into
NVIDIA:feat/m3_with_msafrom
brb-nv:user/brb/port-vllm-kernels-rebase
Aug 5, 2026
Merged

[None][perf] Custom decode kernels for MinimaxM3 - rebased#17268
brb-nv merged 1 commit into
NVIDIA:feat/m3_with_msafrom
brb-nv:user/brb/port-vllm-kernels-rebase

Conversation

@brb-nv

@brb-nv brb-nv commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

This MR adds a few custom decode kernels for MinimaxM3 ported from vLLM.

Special thanks to the original contributors!

Test Coverage

$ pytest tests/integration/defs/accuracy/test_llm_api_pytorch.py::TestMiniMaxM3::test_nvfp4[use_msa=True-eval_mode=default] -s -v

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-compatible or api-breaking. For api-breaking, include BREAKING in 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.

@brb-nv

brb-nv commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63868 [ run ] triggered by Bot. Commit: 0332348 Link to invocation

@brb-nv
brb-nv requested a review from pcastonguay August 5, 2026 00:27
@brb-nv
brb-nv force-pushed the user/brb/port-vllm-kernels-rebase branch from 0332348 to 9fdbcfd Compare August 5, 2026 00:29
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
@brb-nv
brb-nv force-pushed the user/brb/port-vllm-kernels-rebase branch from 9fdbcfd to 09893da Compare August 5, 2026 00:33
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63868 [ run ] completed with state SUCCESS. Commit: 0332348
/LLM/main/L0_MergeRequest_PR pipeline #51807 completed with status: 'SUCCESS'

CI Report

Link to invocation

@peihu-nv peihu-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brb-nv
brb-nv merged commit 727c683 into NVIDIA:feat/m3_with_msa Aug 5, 2026
6 checks passed
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request Aug 20, 2026
…wiring

The MiniMax-M3 decode path currently runs its generation rows through
fmha_sm100, which schedules a generation row like a context row. Three
kernels ported from vLLM replace that: a CuTe DSL indexer scoring kernel, a
Triton sparse block decode kernel and a trtllm-gen dense decode kernel.

This lands the kernels, their custom-op registration and their correctness
tests. Nothing dispatches to them yet: the MSA backend, indexer and cache
manager are untouched, so the decode path is byte-for-byte what it was and
the kernels are reachable only from the tests and the microbenchmark. The
dispatch is a follow-up, since it rests on the device-side length patching
and the fused per-layer cache writes that are still landing on
feat/m3_with_msa.

Split out of NVIDIA#17268 on feat/m3_with_msa, which carries the same kernels plus
that wiring. Two additions differ from it. msa_indexer gains only
cutedsl_score_runner and _cutedsl_score, the self-contained entry points the
scorer test drives, and not the run_indexer dispatch that calls them. The
tests reach fmha_sm100 through a local _flat_page_table helper, because
build_kv_page_indices does not take a block table until NVIDIA#16875; the helper
feeds it the slot map that block table implies, so the A/B comparisons still
run against the production page-table builder rather than a test-local copy.

The CuTe DSL indexer decode kernel and its tests were originally contributed
to vLLM by Thien Tran (vllm-project/vllm#48582), as were the CuTe utilities
(vllm-project/vllm#43273). The Triton sparse decode kernel and its tests
were originally contributed to vLLM by Kaichao You
(vllm-project/vllm#45381). Thanks to both.

No test-list change: l0_b300 already collects unittest/_torch/attention
wholesale, so the three new files are picked up there, and each skips itself
off SM100/SM103.

(cherry picked from commit 727c683)
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request Aug 20, 2026
…wiring

The MiniMax-M3 decode path currently runs its generation rows through
fmha_sm100, which schedules a generation row like a context row. Three
kernels ported from vLLM replace that: a CuTe DSL indexer scoring kernel, a
Triton sparse block decode kernel and a trtllm-gen dense decode kernel.

This lands the kernels, their custom-op registration and their correctness
tests. Nothing dispatches to them yet: the MSA backend, indexer and cache
manager are untouched, so the decode path is byte-for-byte what it was and
the kernels are reachable only from the tests and the microbenchmark. The
dispatch is a follow-up, since it rests on the device-side length patching
and the fused per-layer cache writes that are still landing on
feat/m3_with_msa.

Split out of NVIDIA#17268 on feat/m3_with_msa, which carries the same kernels plus
that wiring. Two additions differ from it. msa_indexer gains only
cutedsl_score_runner and _cutedsl_score, the self-contained entry points the
scorer test drives, and not the run_indexer dispatch that calls them. The
tests reach fmha_sm100 through a local _flat_page_table helper, because
build_kv_page_indices does not take a block table until NVIDIA#16875; the helper
feeds it the slot map that block table implies, so the A/B comparisons still
run against the production page-table builder rather than a test-local copy.

The CuTe DSL indexer decode kernel and its tests were originally contributed
to vLLM by Thien Tran (vllm-project/vllm#48582), as were the CuTe utilities
(vllm-project/vllm#43273). The Triton sparse decode kernel and its tests
were originally contributed to vLLM by Kaichao You
(vllm-project/vllm#45381). Thanks to both.

No test-list change: l0_b300 already collects unittest/_torch/attention
wholesale, so the three new files are picked up there, and each skips itself
off SM100/SM103.

(cherry picked from commit 727c683)
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request Aug 21, 2026
…wiring

The MiniMax-M3 decode path currently runs its generation rows through
fmha_sm100, which schedules a generation row like a context row. Three
kernels ported from vLLM replace that: a CuTe DSL indexer scoring kernel, a
Triton sparse block decode kernel and a trtllm-gen dense decode kernel.

This lands the kernels, their custom-op registration and their correctness
tests. Nothing dispatches to them yet: the MSA backend, indexer and cache
manager are untouched, so the decode path is byte-for-byte what it was and
the kernels are reachable only from the tests and the microbenchmark. The
dispatch is a follow-up, since it rests on the device-side length patching
and the fused per-layer cache writes that are still landing on
feat/m3_with_msa.

Split out of NVIDIA#17268 on feat/m3_with_msa, which carries the same kernels plus
that wiring. Two additions differ from it. msa_indexer gains only
cutedsl_score_runner and _cutedsl_score, the self-contained entry points the
scorer test drives, and not the run_indexer dispatch that calls them. The
tests reach fmha_sm100 through a local _flat_page_table helper, because
build_kv_page_indices does not take a block table until NVIDIA#16875; the helper
feeds it the slot map that block table implies, so the A/B comparisons still
run against the production page-table builder rather than a test-local copy.

The CuTe DSL indexer decode kernel and its tests were originally contributed
to vLLM by Thien Tran (vllm-project/vllm#48582), as were the CuTe utilities
(vllm-project/vllm#43273). The Triton sparse decode kernel and its tests
were originally contributed to vLLM by Kaichao You
(vllm-project/vllm#45381). Thanks to both.

No test-list change: l0_b300 already collects unittest/_torch/attention
wholesale, so the three new files are picked up there, and each skips itself
off SM100/SM103.

(cherry picked from commit 727c683)
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request Aug 24, 2026
…wiring

The MiniMax-M3 decode path currently runs its generation rows through
fmha_sm100, which schedules a generation row like a context row. Three
kernels ported from vLLM replace that: a CuTe DSL indexer scoring kernel, a
Triton sparse block decode kernel and a trtllm-gen dense decode kernel.

This lands the kernels, their custom-op registration and their correctness
tests. Nothing dispatches to them yet: the MSA backend, indexer and cache
manager are untouched, so the decode path is byte-for-byte what it was and
the kernels are reachable only from the tests and the microbenchmark. The
dispatch is a follow-up, since it rests on the device-side length patching
and the fused per-layer cache writes that are still landing on
feat/m3_with_msa.

Split out of NVIDIA#17268 on feat/m3_with_msa, which carries the same kernels plus
that wiring. Two additions differ from it. msa_indexer gains only
cutedsl_score_runner and _cutedsl_score, the self-contained entry points the
scorer test drives, and not the run_indexer dispatch that calls them. The
tests reach fmha_sm100 through a local _flat_page_table helper, because
build_kv_page_indices does not take a block table until NVIDIA#16875; the helper
feeds it the slot map that block table implies, so the A/B comparisons still
run against the production page-table builder rather than a test-local copy.

The CuTe DSL indexer decode kernel and its tests were originally contributed
to vLLM by Thien Tran (vllm-project/vllm#48582), as were the CuTe utilities
(vllm-project/vllm#43273). The Triton sparse decode kernel and its tests
were originally contributed to vLLM by Kaichao You
(vllm-project/vllm#45381). Thanks to both.

No test-list change: l0_b300 already collects unittest/_torch/attention
wholesale, so the three new files are picked up there, and each skips itself
off SM100/SM103.

(cherry picked from commit 727c683)
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request Aug 24, 2026
…wiring

The MiniMax-M3 decode path currently runs its generation rows through
fmha_sm100, which schedules a generation row like a context row. Three
kernels ported from vLLM replace that: a CuTe DSL indexer scoring kernel, a
Triton sparse block decode kernel and a trtllm-gen dense decode kernel.

This lands the kernels, their custom-op registration and their correctness
tests. Nothing dispatches to them yet: the MSA backend, indexer and cache
manager are untouched, so the decode path is byte-for-byte what it was and
the kernels are reachable only from the tests and the microbenchmark. The
dispatch is a follow-up, since it rests on the device-side length patching
and the fused per-layer cache writes that are still landing on
feat/m3_with_msa.

Split out of NVIDIA#17268 on feat/m3_with_msa, which carries the same kernels plus
that wiring. Two additions differ from it. msa_indexer gains only
cutedsl_score_runner and _cutedsl_score, the self-contained entry points the
scorer test drives, and not the run_indexer dispatch that calls them. The
tests reach fmha_sm100 through a local _flat_page_table helper, because
build_kv_page_indices does not take a block table until NVIDIA#16875; the helper
feeds it the slot map that block table implies, so the A/B comparisons still
run against the production page-table builder rather than a test-local copy.

The CuTe DSL indexer decode kernel and its tests were originally contributed
to vLLM by Thien Tran (vllm-project/vllm#48582), as were the CuTe utilities
(vllm-project/vllm#43273). The Triton sparse decode kernel and its tests
were originally contributed to vLLM by Kaichao You
(vllm-project/vllm#45381). Thanks to both.

No test-list change: l0_b300 already collects unittest/_torch/attention
wholesale, so the three new files are picked up there, and each skips itself
off SM100/SM103.

(cherry picked from commit 727c683)
Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request Aug 25, 2026
)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants