-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
[bug fix] Fix llama4 spec decoding #22691
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a crash in the Llama4 speculative decoding path. The issue occurred when a model used Rotary Position Embeddings (RoPE) with global attention, where the code would incorrectly attempt to use ChunkedLocalAttention without a valid attention_chunk_size, leading to a TypeError. The fix correctly introduces a check for config.attention_chunk_size before selecting the attention mechanism. This ensures that ChunkedLocalAttention is only used when explicitly configured, falling back to the standard Attention class otherwise. The change is well-implemented, directly solves the reported crash, and improves the robustness of the model's attention mechanism selection. The provided test results confirm the fix is effective.
|
👋 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 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 🚀 |
WoosukKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luccafong Could you please review?
luccafong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing!
Signed-off-by: qizixi <[email protected]>
e1ec6b6 to
a174e7a
Compare
houseroad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]> Signed-off-by: Duncan Moss <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]> Signed-off-by: Xiao Yu <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]>
Signed-off-by: qizixi <[email protected]> Co-authored-by: Lu Fang <[email protected]>
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.Purpose
Fix llama4 spec decoding path where draft model uses rope + global attention, under the current code ChunkedLocalAttention would be used which would result in a crash.
Test Plan
Test Result
(Optional) Documentation Update