Repository navigation
Conversation
Add opt-in `--enable-sequence-parallel` and `--enable-async-tp` for the Transformers modeling backend, implemented eagerly with module hooks so they do not depend on torch.compile and work with CUDA graphs and MRV2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Contributor
|
Documentation preview: https://vllm--60653.org.readthedocs.build/en/60653/ |
This branch has not been 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
Add opt-in sequence parallelism (SP) and async TP to the Transformers modeling backend, implemented eagerly with module hooks rather than as a
torch.compilepass. This restores both features for Transformers backend models after #60517 removes the compile-basedSequenceParallelismPass/AsyncTPPass, and unlike those passes it works on Model Runner V2 and with any token count.Claims
--enable-sequence-parallelshards the residual stream across TP ranks between the first and last decoder layer of each pipeline stage. Each child of a decoder layer that reduces across TP (attention, MLP, MoE, MLA, ...) all-gathers its input and reduce-scatters its output instead of all-reducing it, so norms and residual adds only process1 / tp_sizeof the tokens.--enable-async-tp(implies SP) fuses the collectives with the adjacent unquantized GEMMs viatorch.ops.symm_mem.fused_all_gather_matmul/fused_matmul_reduce_scatter. Quantized linears fall back to plain collectives.use_sequence_parallel_moe, where the experts take the sharded tokens directly), MLA, quantized models, PP, Eagle3,torch.compileand CUDA graphs.fx_utils.tracenow traces a fuser's per-instanceforward(needed to find the fused QKV/gate-up linears for async TP).Validation
B200, TP=2,
torch.compile+FULL_AND_PIECEWISECUDA graphs unless stated.test_distributed(Llama-3.2-1B vs HF): TP / SP / async TPtest_quantizationwith TP=2 + SP (AWQ, GPTQ × eager, compiled)use_sequence_parallel_moe): EP vs EP + SPVLLM_GPU_SYNC_CHECK=error(Llama SP, Llama async TP, OLMoE SP)tests/models/transformers/fusers(CPU)Plain TP is deterministic run to run on Granite, but SP varies by about one bf16 logit step at one near-tie token (probabilities 0.5/0.5 vs 0.62/0.38 across two runs). The cause is not yet identified.
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.
🤖 Generated with Claude Code