[TRTLLM-13969][perf] Optimize M3 head-mismatched KV transfer - #1
Closed
peihu-nv wants to merge 2 commits into
Closed
Conversation
peihu-nv
marked this pull request as ready for review
July 8, 2026 23:59
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
peihu-nv
force-pushed
the
peihengh/trtllm-m3-disagg-structured-bounce
branch
from
July 9, 2026 17:45
f7db3c1 to
a09a14f
Compare
peihu-nv
changed the base branch from
feat/branch_m3
to
peihengh/trtllm-13969-minimax-m3-disagg
July 9, 2026 17:47
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Collaborator
Author
|
Superseded by direct push to brb-nv:feat/branch_m3. Final side-branch commits:
The C bounce changes were squashed and validated on Lyris with MiniMax M3 MSA DEP2→TEP2 disagg, including structured bounce enabled with 1024 MiB. |
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
This PR is stacked on the MiniMax M3 disaggregated-serving enablement branch:
peihengh/trtllm-13969-minimax-m3-disagg.Generic native bounce (NVIDIA#15618) provides the transfer-performance foundation by
gathering fragmented KV data into a contiguous buffer and issuing a coalesced
NIXL write. Enabling it unchanged is not safe for MiniMax M3 because M3 combines
head-sharded NHD K/V with a replicated
INDEX_KEYside cache:INDEX_KEYbytes equallyamong writers.
transfer fragments for an exact-8K request.
This change teaches the bounce path about MiniMax M3's V2 pool layout:
PoolBufferMapperpath, not only the legacyNHDHeadMismatchMapperpath;gather/scatter specs;
outside a reservation.
The optimization remains opt-in behind
TRTLLM_KV_BOUNCE_STRUCTURED_NHD=1;default behavior is unchanged.
After the pool-level-view refactor in the base MiniMax PR, structured staging
now reports
sections=1for the coalesced V2 pool view instead of the olderper-layer
sections=60. That is expected and is the desired lower-view-countbehavior.
Latest exact-8K MSA DEP2→TEP2 comparison on GB300:
C engaged structured staging successfully:
Test Coverage
af6641bd8epassed, including Ruff, formatting, DCO,diff --check, and repository hooks.2326035):5 passed, 43 warnings in 32.55sPoolBufferMapperstructured staging, V2buffer_entries/buffer_roles/buffer_mapper_kindsdispatch, andtransfer.pyconsuming the V2 structured-staging interface.2326036):sections=1, direct_rest=False;Invalid role, data mismatch, tail rejection, event-loop failure,TypeError, or bad-request marker was present.232592123259232326036Note: the exact-8K perf harness currently sets
max_num_tokens=8192, equal tothe prompt length, while requesting
SamplingParams(max_tokens=1). Those timingruns validate prefill/KV-transfer behavior, not generation quality. Generation
quality is covered by the separate 32-token MSA functional run and will be
rechecked with a non-empty decode-budget quality run.
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.