Conversation
Signed-off-by: Jingchun Gao <gaojingchun1@huawei.com>
Signed-off-by: Jingchun Gao <gaojingchun1@huawei.com>
gjc0824
requested review from
ProExpertProg,
WoosukKwon,
houseroad,
mgoin,
njhill,
robertgshaw2-redhat,
sighingnow,
tlrmchlsmth,
vadiklyutiy,
yewentao256 and
youkaichao
as code owners
June 18, 2026 06:12
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
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
Enable MTP (Multi-Token Prediction) and Eagle3 speculative decoding to run when the target model is sharded with Pipeline Parallelism (PP > 1) in PD-disaggregated (prefill/decode split) deployments. Previously this combination failed because several code paths treated the drafter as if it were partitioned across pipeline stages like the target model, when in fact local drafters (Eagle, MTP) are loaded only on the last PP rank with an effective PP size of 1.
Root cause & fixes:
Config rejected valid draft models (
vllm/config/model.py):ModelConfig.verify_with_parallel_configraisedNotImplementedError("Pipeline parallelism is not supported...")for Eagle/MTP drafters, since it checked the target-model PP registry for any model under PP > 1. Drafters run locally on the last rank, so this check is now skipped whenrunner_type == "draft".Drafter layer count was wrong under PP (
deepseek_eagle3.py,llama_eagle3.py): Eagle3 drafters computedtarget_layer_numviaget_num_layers(parallel_config), which returns the per-rank shard size. Under PP the drafter (on the last rank) only saw a fraction of the layers, corruptinglayer_typesindexing. Switched toget_total_num_hidden_layers().Qwen3.5 MTP forward assumed PP intermediates (
qwen3_5_mtp.py):forwardbranched onis_first_rankand readIntermediateTensorson non-first ranks. Because the MTP drafter is local to the last rank, it now always combines token embeddings with the target hidden states and never consumes PP intermediates from previous stages.Drafter initialized on every PP rank (
vllm/v1/worker/gpu_model_runner.py): drafter attention-backend and cudagraph-dispatcher init ran on all ranks even though only the last rank loads the drafter. Both are now guarded byget_pp_group().is_last_rank.Unsafe on the decode side (
vllm/config/vllm.py): added_validate_spec_decode_pp_config()— MTP + PP > 1 is permitted only on the prefill (producer) side (kv_role='kv_producer') of a PD deployment, since the decode-side verification loop cannot coordinate draft-token propagation across pipeline stages. A clearValueErroris raised otherwise, guiding users toward data parallelism + MTP on the decode side.Non-invasive: PP = 1 and non-speculative-decode code paths are completely unaffected.
Test Plan
Behavior is verified end-to-end (no repo unit tests added). Validate with a PD-disaggregated serving setup:
Producer (prefill) — PP = 2 + MTP:
Consumer (decode) — PP = 1:
Negative config checks:
kv_producer→ expect the newValueError.NotImplementedError.Test Result
Functional verification (deterministic from the code paths):
kv_producer→ accepted; MTP + PP > 1 without a producer role → raises the documentedValueError.NotImplementedError).target_layer_numreflects the total hidden-layer count (not the per-rank shard), giving correctlayer_typesindexing in the Eagle3 drafter.End-to-end PD serving (PP = 2 + MTP on the producer) produced correct outputs:
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.