Repository navigation
[Transformers backend] Support EAGLE3 aux hidden states with pipeline parallelism and layer 0 - #66546
Merged
Merged
Conversation
… parallelism Relay aux hidden states between PP ranks the same way as native Llama, keep the input embedding on the last rank when the drafter may share it, and record aux hidden states from the real decoder layer class on ranks whose last layer is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
6 of 14 tasks
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
hmellor
added a commit
to hmellor/vllm
that referenced
this pull request
Nov 9, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
6 tasks done
Four 32-token prompts let one greedy path that changes under compilation swing the backend's acceptance by 20%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Computing the embeddings in eager code handed the piecewise CUDA graphs a fresh tensor each step, causing an illegal memory access on replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
hmellor
marked this pull request as ready for review
November 9, 2026 17:40
hmellor
requested review from
ApostaC,
TheEpicDolphin,
WoosukKwon,
ivanium,
njhill,
orozery,
wzhao18 and
yewentao256
as code owners
November 9, 2026 17:40
Isotr0py
approved these changes
Nov 9, 2026
16 prompts x 64 tokens keep every PP size within 3% of PP=1 for both impls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
…d-aux-pp Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> # Conflicts: # tests/v1/e2e/spec_decode/eagle/test_eagle3_pp.py # vllm/model_executor/models/interfaces.py # vllm/v1/worker/gpu/spec_decode/eagle/eagle3_utils.py
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #101185 for commit ℹ️ This PR is 1 commit behind upstream |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
…o transformers-backend-aux-pp
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #101187 for commit |
2 of 5 tasks
15 of 28 tasks
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
Support EAGLE3 aux hidden states with pipeline parallelism, and aux hidden state layer 0, in the Transformers modeling backend, matching native Llama. Part of serving Llama with the backend (#66547). The layer 0 changes moved here from #66413.
Claims
supports_aux_hidden_states_over_ppand pass aux hidden states between PP ranks withEagleModelMixin's helpers, as native Llama does.spec_decode_needs_target_embed), so drafters withoutembed_tokenscan share it._target_classbecomingPPMissingLayeron rank 0, which made the aux recorders hook the PP placeholders instead of the decoder layers._can_record_outputsand never reaches the decoder layers inside thelanguage_modelsub-model; that's a separate fix._layer_names[-1]raised. It's recorded with anOutputRecorderon the input embedding, so it stays inside the compiled graph like the other layers (computing it in eager code hands the piecewise CUDA graphs a new tensor each step and crashes with an illegal memory access on replay). When the caller passesinputs_embeds, those are used directly.extract_hidden_statesworks withmodel_impl="transformers"; the draft config no longer inherits the target'smodel_impl.Validation
B200, Llama-3.1-8B-Instruct +
yuhuili/EAGLE3-LLaMA3.1-Instruct-8B, 3 speculative tokens, 6 prompts × 128 greedy tokens:Mean acceptance length. On
mainthe backend at PP=2 fails at startup (TransformersForCausalLM does not support eagle3 with pipeline parallelism).pytest tests/v1/worker/test_eagle3_aux_hidden_states_pp.py pytest tests/v1/kv_connector/extract_hidden_states_integration/test_extraction.py -k test_extract_layer_zero_is_input_embeddings pytest "tests/v1/e2e/spec_decode/eagle/test_eagle3_pp.py::test_eagle3_pipeline_parallel_acceptance"test_eagle3_aux_hidden_states_pp.py: 20 passed.test_extract_layer_zero_is_input_embeddingsfails onmain([vllm]: max abs diff 158 vs the embeddings;[transformers]:ExtractHiddenStatesModelnot found) and passes here; it runs with compilation, which also covers the CUDA graph crash above.test_eagle3_pp.py(4 GPUs, PP=1/2/4): bothmodel_impls pass. With its original 4 prompts × 32 tokens the backend failed at PP=2 (1.628 < 2.048 × 0.95): compiled numerics changed one prompt's greedy path, which moved the mean that much. Across 64 prompts × 64 tokens on Llama-3.2-1B, acceptance is 1.450 to 1.471 for every impl, PP size (1/2/4) and CUDA graph mode, so the test now uses 16 prompts × 64 tokens (PP=1/2/4 acceptance: native 1.443/1.487/1.460, backend 1.468/1.475/1.467).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