Support Qwen2.5 VL eagle3#118
Draft
rahul-tuli wants to merge 3 commits into
Draft
Conversation
- Add SupportsEagle3 interface to Llama4ForConditionalGeneration and Llama4ForCausalLM - Implement custom auxiliary hidden state layers (1, 23, 44) for Eagle3 speculative decoding - Enable multimodal input handling in Eagle3LlamaForCausalLM with text-only inference mode - Add proper dimension adaptation for auxiliary hidden states from multimodal verifiers - Implement dynamic Eagle3 auxiliary layer configuration from speculators config - Add GPU model runner method to read eagle_aux_hidden_state_layer_ids from draft config - Update auxiliary layer configuration logic to use speculative config dynamically - Simplify model implementations to provide fallback defaults This is the first successful implementation of Eagle3 speculative decoding with multimodal Llama4 models, supporting custom layer extraction and text-only drafter processing while leveraging multimodal context from auxiliary hidden states. The implementation now dynamically reads auxiliary layer configuration from the draft model's speculative config, eliminating hardcoded layer IDs.
- Fix aux_hidden_state_layers initialization syntax error in qwen2.py - Add missing return statement in qwen2_5_vl.py get_eagle3_aux_hidden_state_layers - Improve error handling with hasattr check instead of assert - Clean up method delegation to use direct return from language_model - Add fallback default auxiliary layers for Qwen2.5VL models These fixes enable Eagle3 speculative decoding support for Qwen2.5VL models. Successfully tested with Qwen2.5VL-7B + Eagle3 configuration.
1f6fd40 to
5e93541
Compare
cac1941 to
1037b36
Compare
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.
VLLM_USE_V1=1 \ CUDA_VISIBLE_DEVICES=6 \ python examples/offline_inference/spec_decode.py \ --method "eagle3" \ --tp 1 \ --print-output \ --model-dir "Qwen/Qwen2.5-VL-7B-Instruct" \ --eagle-dir "nm-testing/MOCK-UP-Eagle3ForQwen2.5VL7B" \ --dataset_name "hf" \ --dataset_path "philschmid/mt-bench" \ --num-spec-tokens 3Results: