Skip to content

Add Eagle-3 Qwen support (follow-up to #20436) #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 17, 2025

Conversation

rahul-tuli
Copy link
Owner

@rahul-tuli rahul-tuli commented Jul 16, 2025

Summary

This PR adds support for Eagle-3 speculative decoding with Qwen models, as a follow-up to vllm-project#20436.

The changes enable Qwen models to work with Eagle-3 draft models in speculators format.

Related Issues

Changes

  • Added Qwen support to Eagle-3 implementation
  • Proper handling of Qwen model architecture in Eagle-3 speculative decoding

Testing

Tested with the following verification script:

#\!/usr/bin/env python3
"""
Verification script for Qwen Eagle-3 support.
"""

from vllm import LLM, SamplingParams

# Initialize vLLM with Qwen model and Eagle-3 draft model
llm = LLM(
    model="Qwen/Qwen2.5-7B-Instruct",
    speculative_config={
        "method": "eagle",
        "model": "nm-testing/Qwen3-8B-Eagle3-speculators-converted",
        "num_speculative_tokens": 5
    },
    max_model_len=1024,
    enforce_eager=True
)

# Test generation
outputs = llm.generate(
    ["The future of AI is"], 
    SamplingParams(max_tokens=20, temperature=0)
)

print(f"Generated: {outputs[0].outputs[0].text}")
print("✅ Eagle-3 with Qwen works\!")

Output confirms that Eagle-3 speculative decoding works correctly with Qwen models.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR adds support for Eagle-3 speculative decoding with Qwen models. The return type hint in Qwen2Model.forward is incorrect and should be addressed.

@rahul-tuli rahul-tuli merged commit a3dd2d0 into feat/speculators-eagle-support Jul 17, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants