[Bugfix][Mooncake] Fix mixed-TP GQA and indexer cache transfers for MiniMax-M3 - #55523
Draft
zhewenl wants to merge 1 commit into
Draft
[Bugfix][Mooncake] Fix mixed-TP GQA and indexer cache transfers for MiniMax-M3#55523zhewenl wants to merge 1 commit into
zhewenl wants to merge 1 commit into
Conversation
…tion models Classify MLA-typed cache regions independently of the model-wide TP rule. Validate their equal block lengths and reuse the replicated sender plan while retaining TP-ratio slicing for GQA regions. Cover mixed region validation in both TP directions and producer-rank selection for the indexer side cache. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: zhewenl <zhewenl@users.noreply.github.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Purpose
Fix Mooncake heterogeneous-TP transfers for MiniMax-M3's mixed GQA and lightning-indexer caches. With prefill TP4 and decode TP1/DP8, the main GQA block is TP-sharded, while the indexer registers an
MLAAttentionSpecand holds the full block on every TP rank. The engine-wide TP-ratio validation rejects that indexer region:Classify replication per transfer region from the layer's MLA spec type. Validate replicated regions with equal block lengths and reuse the existing whole-block replicated sender plan; retain TP-ratio slicing for the main GQA regions. The producer derives the classification from its local layer specs for aligned local/remote regions, so the wire format does not change. Per-rank KV head counts are not used to infer replication.
The diff contains only transfer-region classification, validation, sender planning, and corresponding tests. Scheduler and receive-failure handling are unchanged.
Related work
Tests
On OSS base
f4eccdade, 74 passed:PYTHONPATH=$PWD HF_HUB_OFFLINE=1 /home/zhewen/repos/vllm/.venv/bin/python -m pytest \ tests/v1/kv_connector/unit/test_mooncake_connector.py \ tests/v1/kv_connector/unit/test_mooncake_connector_hma.py \ tests/v1/kv_connector/unit/test_mooncake_connector_hybrid_mamba.py \ tests/v1/kv_connector/unit/test_mooncake_stats.py -q /home/zhewen/repos/vigil/.venv/bin/pre-commit run --files \ vllm/distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py \ tests/v1/kv_connector/unit/test_mooncake_connector.pyAll applicable pre-commit hooks passed, including ruff and mypy. New tests validate mixed GQA/MLA lengths in both TP directions, reject genuinely mismatched regions, check per-layer classification, and exercise sender offsets and the single sending rank for the replicated indexer. The older serving baseline's corresponding suites also pass: 72 passed.
Model evaluation
PASS: TP-only patch, 2026-09-06, vigil Slurm job 12216 on 12 GB300 GPUs. MiniMax-M3, prefill TP4 on one node and decode TP1/DP8 on two nodes; GSM8K 5-shot, greedy, concurrency 512.
For compatibility with the installed compiled artifacts, serving used
78edd1f70eplus the existing local baseline changes and only this TP patch, in/home/zhewen/repos/vllm-wt-m3-tp-onlyvia PYTHONPATH. The runtime scheduler matched the original local baseline byte-for-byte, and the connector's receive-failure methods were unchanged. The separate router fixes (valid prefill DP rank and P-leg status checking) were present. This is a fresh run of the isolated patch, not the earlier combined TP/failure patch's result.All-successful P/D access logs, positive transfer metrics, and zero fallback signatures establish real transfer coverage. Transfer counts are sampled metric-interval totals rather than unique requests. Local run evidence is under
vigil/logs/1p1d_tp4_dep8_mooncake_gsm8k_tp_only/2026-09-06/20260906_014958/: results, source hashes, actual runtime diff, and unit/lint logs.AI assistance
AI assistance (Codex) was used to prepare the implementation, regression tests, and validation report. The transfer-region design was isolated from the earlier combined patch developed with Kimi Code/Codex assistance. The reported tests were executed in the shared development environment.