Repository navigation
[MiniMax-M3] Support sequence parallelism with pipeline parallelism - #65537
Merged
Merged
Conversation
Keep model-level sequence parallelism on under PP: all-gather the token shards before a non-last stage returns its IntermediateTensors, and re-shard hidden states and residual on entry to the next stage. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yifei Wang <yifei.w@inferact.ai>
…allelism With PP>1 the decoder layer builds the dense MLP with reduce_results=True, so under SP its down_proj all-reduced the output before the reduce-scatter summed it across TP ranks again. Let the reduce-scatter be the only reduction. 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 4, 2026 08:16
WoosukKwon
approved these changes
Nov 4, 2026
|
✅ @xsxszab, CI is now available for this PR.
|
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #99979 for commit ℹ️ This PR is 36 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 enables model-level sequence parallelism (SP) for TP + EP + MegaMoE (#64659), keeping the residual stream sharded by token across TP ranks, but only when pipeline parallelism (PP) is off. This PR keeps SP on under PP, handling stage boundaries the same way as DeepSeek-V4.1: non-last stages all-gather the token shards before returning
IntermediateTensors, and the next stage re-shards them on entry. No other open PR enables this combination.Claims
Validation
MiniMaxAI/MiniMax-M3.1-Flashon B300, TP2 + EP + MegaMoE.Prompt logprobs. Six fixed prompts via
/v1/completionswithprompt_logprobs: 0(405 scored positions). PP2 and PP4 with this PR match PP1 at every position (max |Δ| = 0).GSM8K (1319 questions, chat, thinking disabled):
DSpark draft acceptance (
num_speculative_tokens=7): 0.524 at PP1; 0.521 and 0.523 at PP2 with this PR; 0.526 at PP2 on main.Throughput, PP2 × TP2, output tok/s of two interleaved runs per arm:
Commands
Details
PP transport sends 1/TP of each
IntermediateTensorsentry from every TP rank and all-gathers it on the receiver, so stage outputs must cover all tokens and be identical across TP ranks. The change:pipeline_parallel_size == 1from_use_sequence_parallel.residualtogether withhidden_states.hidden_states,residualand the aux hidden states into one tensor and all-gather it once. On the last rank, aux states received from earlier stages are already full and are appended after the local gather, as before.down_projwithreduce_results=Falseunder SP. With PP > 1 the decoder layer asks each FFN to reduce its own output, but under SP the dense MLP already reduce-scatters thedown_projoutput, so an extra all-reduce would sum it twice.AI assistance (Claude) was used to investigate, implement and validate this change. The submitter reviewed every changed line and the validation results.
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.