[None][perf] Fuse MiniMax-M3 prefill projections - #16852
Merged
pcicotti merged 1 commit intoJul 28, 2026
Merged
Conversation
peihu-nv
force-pushed
the
peihengh/m3-prefill-direct-post16755-20260724
branch
from
July 27, 2026 15:26
b6e3360 to
36046b8
Compare
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
peihu-nv
force-pushed
the
peihengh/m3-prefill-direct-post16755-20260724
branch
from
July 27, 2026 15:36
36046b8 to
cff4491
Compare
peihu-nv
marked this pull request as ready for review
July 27, 2026 15:37
peihu-nv
requested review from
2ez4bz,
JunyiXu-nv,
PerkzZheng,
kris1025 and
lori-ren
July 27, 2026 15:37
pcicotti
approved these changes
Jul 28, 2026
2 tasks
ZhanruiSunCh
pushed a commit
that referenced
this pull request
Jul 29, 2026
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
1 task
brb-nv
pushed a commit
to brb-nv/TensorRT-LLM
that referenced
this pull request
Aug 25, 2026
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
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
Prerequisite
Description
MiniMax-M3 currently projects main Q/K/V and index-Q/index-K separately, then
runs separate normalization, RoPE, quantization, and paged-cache insertion
steps. For long-context prefill, those extra projections and producer launches
are visible in both the critical path and the Nsight Systems trace.
This PR adds an opt-in MiniMax-M3 prefill path that:
MiniMax-M3 TP sharding and replication geometry;
Q/K/index-Q/index-K normalization and RoPE, converts the outputs to FP8, and
directly inserts main K/V plus index-K into their paged caches; and
paths, avoiding intermediate producer tensors and cache-write launches.
The prototype is disabled by default through
fuse_qkv_index_projection=False. It currently targets pure disaggregatedprefill workers. Decode remains disabled based on its separate evaluation and
is outside the performance scope reported here; mixed workers remain
unsupported and unvalidated. Unsupported prefill geometry, dtype, and layout
combinations retain the compatibility path.
The completed matched GB300 NVL72 2P8D prefill-isolation A/B used TP2/EP2
attention-DP on the 2-GPU CTX worker, TP8/EP8 attention-DP on the 8-GPU GEN
worker, concurrency 256, exact 8K input, and configured 1-token output. The
baseline was Slurm job
2490293; the candidate was2490294, with the packedoption enabled only on CTX and disabled on GEN in both runs. Both completed
2,560/2,560 requests:
The client JSON recorded two output tokens per request despite the configured
random_osl=1; this was identical for both variants and does not affect therelative A/B comparison. The result isolates the prefill benefit; decode
remains disabled and outside the reported A/B scope.
Test Coverage
2488228 passed.
0-7, including weights, scales, sharding, and replication.
(2090/2090 modules per rank).
gates passed in Slurm job 2488379 with the fused projection enabled.
2,560/2,560 requests with exact 8K input and concurrency 256. Enabling the
packed projection only on CTX improved total token throughput by 8.36% and
mean TTFT by 7.69%.
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.