Repository navigation
[ROCm][MiniMax-M3.1] Improve TP4 decode and native INT4 reduction - #63528
Closed
Fangzhou-Ai wants to merge 5 commits into
Closed
Fangzhou-Ai wants to merge 5 commits into
Fangzhou-Ai wants to merge 5 commits into
Conversation
… ROCm Squash of the MiniMax-M3.1 serving branch on top of 7879f36. NVIDIA: - Route NVFP4 routed experts in MXFP8 checkpoints to the CT NVFP4 MoE - NVFP4 KV cache on the MSA sparse attention path, served only by the CUTLASS Q8KV4 kernels (E4M3 query) on SM100/SM103/SM107 - NVFP4 index-K cache via the MSA Q8KV4/Q8KV8 indexers; opt-in decode context parallelism for the NVFP4 indexer at TP4 - Vendor fmha_sm100 from vllm-project/MSA dev 25c1447 - NVFP4 MSA decode past 512 sequences: Q8KV4 limits, bounded indexer and plan memory - Decode metadata before the forward: 13 ops -> 2; in-place indexer I/O, no counter reset, PDL chain for the NVFP4 sparse decode - DeepGEMM NVFP4 MegaMoE on the unified DeepGemmMegaMoEExperts layer; per-token FC1 input scales outside MegaMoE; split staging rows over programs - Fuse small-batch MoE finalize into the all-reduce + Gemma norm + MXFP8 quant - QKV+indexer MXFP8 GEMM with fused epilogue; SM100 fused dense GEMM1 - Fused QK-norm/RoPE/KV insert: persistent row-group kernel - Read aux hidden states after the deferred TP all-reduce - FA4: pass no FP8 descale for a unit per-tensor scale - Keep KV cache zeroing for mixed-precision UniformTypeKVCacheSpecs groups - Clear per-token A4 metadata for NVFP4 W4A16 MoE kernels (Marlin only) - Hand the Q8KV4 prefill a per-device split workspace - Align image preprocessing: long-side resize with detail tiers, fp32 patch embedding - NIXL KV-head re-sharding for per-head-contiguous NVFP4 pages; BLHNC layout for NIXL transfer - SimpleCPUOffload: 1 GiB HugeTLB host buffer + PreferCE batch copies Spec decode: - DSpark for MiniMax-M3.1: draft model, fixes and perf; default the draft to the checkpoint's dspark/ subfolder - Fuse the draft's q/k norm + RoPE and its context-K/V write - FLASHINFER_TS: prims_ts paged decode for non-causal draft blocks - Store the draft tokens' K/V under torch.compile - Markov sampling: one step helper, bias in the Gumbel kernel - DFlash: pad the prepared inputs in wide blocks on every platform ROCm: - Re-quantize the NVFP4 routed experts to MXFP8 (or MXFP4) at load; NVFP4 -> MXFP4 re-quantization and fused shared experts through the online quantization API - Mono decode (one FlyDSL launch per layer): native MXFP8 shared expert, top-16 sort/merge, aux hidden states, indexer CP - NVFP4 KV + NVFP4 indexer on gfx950, decode indexer CP - Tune small-M MXFP8 linears - Sequence-parallel prefill under pure TP (opt-in), with MXFP4 MoE support; TBO/DBO under pure TP; warm the microbatch threads' hipBLASLt handles at init - gfx942: avoid the load-time FP8 MoE quant crash; fall back from the fused QK-norm - Keep the NVFP4 KV-insert helpers CUDA-only so the fused kernel builds on HIP Co-authored-by: Taoyu Zhu <zhutaoyu97@gmail.com> Co-authored-by: Hongxia Yang <hongxia.yang@amd.com> Co-authored-by: qizixi <22851944+zixi-qi@users.noreply.github.com> Co-authored-by: indivats <Indira.Vats@amd.com> Co-authored-by: andyluo7 <43718156+andyluo7@users.noreply.github.com> Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com> Co-authored-by: fxmarty-amd <felmarty@amd.com> Co-authored-by: Jiejing Zhang <280536569+jiejingzhangamd@users.noreply.github.com> Co-authored-by: Prasun Gera <pgera@users.noreply.github.com> Co-authored-by: Dao Le <daole@inferact.ai> Co-authored-by: Isotr0py <mozf@inferact.ai> Co-authored-by: Neha Prakriya <neha.prakriya@amd.com> Co-authored-by: Summer Yang <girasoley@inferact.ai> Co-authored-by: Zhewen Li <jerven.vllm@gmail.com> Co-authored-by: Zijing Liu <liuzijing2014@users.noreply.github.com> Co-authored-by: xiaozhoupy <peiyuanzhou1994@gmail.com> Co-authored-by: v <v@inferact.ai> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yongye Zhu <zyy1102000@gmail.com>
TP4 (tested on GB300 with DSpark k=7) and DEP8 over two GB300 trays on DeepGEMM NVFP4 MegaMoE, both with NVFP4 KV and indexer caches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yongye Zhu <zyy1102000@gmail.com>
…k count (vllm-project#63270) Signed-off-by: Yamini Preethi Kamisetty <YaminiPreethi.Kamisetty@amd.com> Signed-off-by: Taoyu Zhu <zhutaoyu97@gmail.com> Co-authored-by: Yamini Preethi Kamisetty <YaminiPreethi.Kamisetty@amd.com>
Co-authored-by: Codex <codex@openai.com> Signed-off-by: Fangzhou Ai <31551580+Fangzhou-Ai@users.noreply.github.com>
Contributor
|
Documentation preview: https://vllm--63528.org.readthedocs.build/en/63528/ |
Use wave-major packets, peer prefetch and parallel flag polling for the BF16-cast TP4 path while preserving the existing INT4 arithmetic. Cover graph shape and codec transitions with late peers in four-GPU CI. Co-authored-by: Codex <codex@openai.com> Signed-off-by: Fangzhou Ai <31551580+Fangzhou-Ai@users.noreply.github.com>
zyongye
force-pushed
the
minimax-m31-flash
branch
from
October 27, 2026 16:31
1682a05 to
a0ea941
Compare
Contributor
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
6 tasks done
zyongye
force-pushed
the
minimax-m31-flash
branch
from
October 29, 2026 07:00
a0ea941 to
d0ebc06
Compare
zyongye
force-pushed
the
minimax-m31-flash
branch
3 times, most recently
from
October 29, 2026 17:08
1f5ea52 to
f4ca759
Compare
khluu
force-pushed
the
minimax-m31-flash
branch
from
October 29, 2026 20:59
f4ca759 to
f4bf304
Compare
2 of 6 tasks
Collaborator
Author
|
waiting for official minimax m3.1 landing |
Fangzhou-Ai
temporarily deployed
to
recipes-preview
October 30, 2026 05:40 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Overview
Improve MiniMax M3.1 TP4 decode on MI355X with context-parallel NVFP4 indexing, batch-sharded sampling, bounded native MXFP8 tile tuning, and a faster native INT4 QuickReduce transport. Stacked on #63232 at
8d0f05a0c33c91cc4d3f0a6f189474420af47174.Claims
These are separate measurements, with the configurations below; the percentages are not additive.
Validation
All serving comparisons use four MI355X GPUs per arm, the same pinned AMD Quark checkpoint, TP4, seven drafts with synthetic AL4.04, NVFP4 main/index KV, BF16 draft KV, DBO and prefix caching. Software: Torch 2.13.0+rocm10.0.0, Triton 3.8.0+git669b31ac, AITER 0.1.26, fastokens 0.2.0.
1000/P90 ITL)The original combined-patch comparison used historical index-top-k frequency 2. The transport comparison uses frequency 1 and reverses the GPU placements from the first screening pair. Each comparison has one run per arm, 354 completed warmups per arm, and zero request errors. The larger 6.9% interactivity effect in the first transport screening pair did not reproduce; it is excluded from the claims. The two arms of the transport comparison share the same separate draft-attention patch; only the native extension changes. That attention patch is outside this PR. There is no end-to-end claim for all changes combined on a fresh final-branch replay.
Cold collective measurements use the public
QuickAllReduceAPI, the same physical four-GPU group, A–B–B–A startup order (two runs per revision), seven samples/run, and five HIP-graph replays/sample. Inputs rotate through more than 400 MiB. Each sample takes the maximum across ranks; the table reports the median of the two run medians. Allocation, reference computation, setup, capture and warmup are outside timing; codec, casts, peer transfers and flags are inside.M256 run medians span 32.888–32.913 µs originally and 21.552–21.593 µs after the change.
Correctness, evaluation and check commands
LLMregressions: 3 passed, checking CP execution on every rank with DBO configured and activation of batch-sharded sampling. The relevant cases fail on the original model branch.Run in the prepared uv environment with the native extension rebuilt for the revision under test:
Full-tree CI at the previous draft head failed in 21 files byte-identical to #63232; scoped checks passed. The previous hosted strict docs build failed on seven inherited cross-reference warnings; its full non-strict local build passed. This update checks the complete added documentation section rather than claiming a new full-site build.
Public-API collective benchmark reproducer
Rebuild the native extension for each revision using the incremental compilation workflow. Save the script below as
benchmarks/kernels/benchmark_rocm_int4_quick_reduce.pyand run A–B–B–A on the same four GPUs:Details
The CP initializer no longer rejects every DBO configuration at startup; the existing runtime guard retains the local fallback for actual microbatches. Seven-draft verification uses two existing four-row score tiles per request. TP4, gfx950, DCP size 1 and explicit
indexer_decode_cpremain required. CP buffers add about 33 MiB/rank at a 1M context limit. AMD model wrappers expose the existing local-logit hooks for target and DSpark batch-sharded sampling. Eleven host-dispatch lines tune four native MXFP8 projection shapes at 33–64 rows (QKV only 49–64), preserving the representation and arithmetic.The new transport coalesces peer accesses and parallelizes flag polling while preserving the existing INT4 codec, scales, addition order and BF16 casts. It is gated to gfx950, TP4, INT4 and BF16-to-FP16 casting. Other modes keep the existing transport. It adds 348 kernel lines and raises measured VGPR use from 87 to 128 and private storage from 0 to 72 bytes; the serving benefit is modest despite the larger collective speedup. Existing thresholds and the default codec are unchanged. Enable it with
VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4; QuickReduce remains disabled by default.Duplicate-work checks read #63232's discussion and searched open PRs for its number, MiniMax CP/DBO/indexer/sampling, native MXFP8 tuning, and TP4 INT4 QuickReduce. #59478 changes the backend to AITER FlyDSL; this patch retains the native implementation and its checked arithmetic. #61020/#61021 are fused epilogues, #61099 concerns offset width, and #55346 changes saturation behavior. #62509 has a broader native tile table and QKV quantization fusion; this PR retains the four bounded tile choices already measured here. The earlier distinction from #45875 was documented in its discussion before this draft was opened. No second PR for the native transport is being opened.
The additional packed MXFP8 backend, draft-attention follow-up, MoE sorting and fused scale/add experiments are outside this update. Performance results from those variants are not claimed here. Raw all-rank traces, benchmark scripts and request logs are preserved in the investigation artifacts.
AI assistance was used to investigate, implement and validate this change. The submitting human's earlier line-review/test confirmation covers the original 13-file change. Human review and execution of relevant tests for the newly added transport lines remain pending; the PR stays draft and no re-review is requested.
Pull Request Checklist
/pr-checklistskill. (Mandatory for agents, optional for humans).BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing (anything written below this line will be removed by GitHub Actions)