Repository navigation
[Bugfix][MiniMax-M3] Don't emit MXFP8 from the input norm under sequence parallelism - #65496
Merged
Merged
Conversation
…arallelism With MegaMoE, TP > 1 and EP, MiniMax-M3 runs sequence parallelism and all-gathers the input norm output before attention. When qkv_proj takes MXFP8 input, the fused norm returns a QuantizedActivation, which the all-gather cannot handle, so startup fails in the profile run with "'QuantizedActivation' object has no attribute 'contiguous'". Under sequence parallelism, return the unquantized norm output and let qkv_proj quantize the gathered activations. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yifei Wang <yifei.w@inferact.ai>
xsxszab
marked this pull request as ready for review
November 3, 2026 20:28
zyongye
approved these changes
Nov 3, 2026
|
✅ @xsxszab, CI is now available for this PR.
|
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #99686 for commit ℹ️ This PR is 16 commits behind upstream |
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
MiniMax-M3 on NVIDIA fails at startup when MegaMoE, TP > 1 and EP are combined and
qkv_projtakes MXFP8 input (e.g.MiniMaxAI/MiniMax-M3.1-Flash). With sequence parallelism (SP, #64659), the input norm output is all-gathered before attention; since #64852 that output is aQuantizedActivation, which the all-gather cannot take. This PR keeps the norm output in BF16 under SP and letsqkv_projquantize after the gather.Claims
AttributeError: 'QuantizedActivation' object has no attribute 'contiguous'in the profile run for TP > 1 + EP +--moe-backend deep_gemm_mega_moe(SP is enabled automatically in that setup).VLLM_ENABLE_GEMM_RS=1), in line with the 95.5–96.1% that [Perf][MiniMax-M3] Sequence parallelism and GEMM-RS for TP + MegaMoE #64659 reports for TP4 with and without SP.Validation
MiniMaxAI/MiniMax-M3.1-Flashon 4× B300, main at39dbf51839. GSM8K is the full 1319 questions, 5-shot, chat mode with thinking off.VLLM_ENABLE_GEMM_RS=1Commands
The serve command is the one from #64659's validation, without the NVFP4 KV and indexer caches: their Q8KV4 prefill kernel needs CUDA 13.4+, and this cluster has 13.1. The crash path does not depend on the KV cache dtype.
No unit test is added: the failure needs SP end to end (4 SM100 GPUs in one NVLink domain and the M3.1 checkpoint), which CI does not have, as noted in #64659.
pre-commit run --hook-stage manualpasses on the changed file.Details
Root cause.
forward_input_normasks the norm for MXFP8 output wheneverqkv_projcan consume it, assuming the activation goes straight from the norm toqkv_proj. Under SP,forward_after_input_normall-gathers it first, andsp_all_gatheronly handles tensors.QuantizedActivationis a dataclass holding the E4M3 data and UE8M0 scales, so the custom all-gather fails on.contiguous().Scope. Only the plain norm branch is reachable under SP: MegaMoE never defers its finalize (no
MoEOutputinput), and SP layers never defer the FFN all-reduce, sofuse_input_allreducestays off. With SP off, the condition evaluates exactly as before. The dense MLP already handles SP this way: it all-gathers BF16 and quantizes after the gather.Tradeoff. Under SP the fused norm+quant is not used. The data flow is the same as when #64659 measured SP (before #64852), with the BF16 norm now on #64852's Triton kernel. Gathering the MXFP8 data and scales instead would halve the all-gather bytes, but the 128x4 swizzled scales cannot be concatenated by rows: it needs unswizzled scales from the norm kernel and a swizzle after the gather. That is left as a follow-up.
Duplicate check. Searched open and closed PRs and issues for the error message,
QuantizedActivation+ all-gather, and MiniMax SP + MXFP8; no existing fix.AI assistance (Claude Code) was used to find the root cause, write the change and run the validation; I reviewed every changed line.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.