[Qwen4Exp] Pipeline-stage ownership for PLE, the MTP drafter and the vision tower

Each pipeline stage builds only the parts it owns: PLE when every PLE layer
lives on stage 0, MTP under PP (port of vLLM PR #46994 minus its ROCm MLA file
and tests) with the drafter on the last stage, and the vision tower on the
first stage only.

Co-Authored-By: Hinata <hinata@idihore.id>
Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
2026-10-09 19:43:53 +07:00
co-authored by Hinata
parent 461a8a0f82
commit 7e5f658d75
5 changed files with 170 additions and 18 deletions
+5 -1
View File
@@ -288,7 +288,11 @@ class Qwen4ExpMultiTokenPredictor(nn.Module):
hidden_size = self.hidden_size
prev_block_output: torch.Tensor | None = None
if get_pp_group().is_first_rank:
# Branch on the inputs, not the rank (vllm PR #46994's rule, applied
# there to Qwen3_5MTP / DeepSeek MTP): the drafter is built entirely on
# the LAST pipeline stage, where is_first_rank is False, and it always
# starts from the target's hidden state + token ids it embeds itself.
if intermediate_tensors is None:
assert hidden_states is not None
if inputs_embeds is None:
assert input_ids is not None