-
-
Notifications
You must be signed in to change notification settings - Fork 11k
[BUGFIX] Fix crash in Eagle Speculative Decoding models when exceedin… #24662
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
|
👋 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 You ask your reviewers to trigger select CI tests on top of 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 If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. 🚀 |
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 introduces a bugfix to prevent crashes in Eagle Speculative Decoding when the input sequence length exceeds the draft model's capacity. The fix correctly adds a check to early-exit from the propose method.
My review identifies a critical issue with the implementation of this early exit. The returned empty tensor has a hardcoded shape and incorrect data type, which can lead to crashes or incorrect behavior in batched scenarios. I've provided a suggestion to fix this by dynamically creating the tensor with the correct shape and dtype. I've also recommended removing the newly introduced constant, as it becomes obsolete with the suggested fix.
332386b to
58adccd
Compare
|
Could you provide commands to reproduce the issue? |
|
Sure! Serving the model
Request that makes it crash |
|
Is it intended behavior for the draft model to have a shorter model length compared to the target model? If I understand the use case correctly, it's to use spec decoding only on short sequences and not on longer sequences. If that is intended, then perhaps we should not be even calling the drafting method in the GPUModelRunner at all, but rather skipping it altogether. |
|
See also #22935 which is a more restrictive approach that doesn't let the serving engine launch with |
vllm/v1/spec_decode/eagle.py
Outdated
| @@ -159,6 +159,14 @@ def propose( | |||
| sampling_metadata: SamplingMetadata, | |||
| mm_embeds: Optional[list[torch.Tensor]] = None, | |||
| ) -> torch.Tensor: | |||
| # do not attempt to forward if the input size is too big | |||
| if common_attn_metadata.seq_lens.max( | |||
| ) + self.num_speculative_tokens > self.draft_model_config.max_model_len: | |||
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.
feels more like a general spec decoding issue instead of eagle specific issue, could we add it to gpu_model_runner?
vllm/vllm/v1/worker/gpu_model_runner.py
Line 2152 in 01413e0
| self._draft_token_ids = self.propose_draft_token_ids( |
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.
done
|
This pull request has merge conflicts that must be resolved before it can be |
2bbc4cf to
3ea00d4
Compare
|
@tomasruizt @luccafong You are right, I adjusted the fix accordingly |
54e7eab to
abaf634
Compare
90e74e5 to
515a675
Compare
vllm-project#24662) Signed-off-by: AlonKejzman <alonkeizman@gmail.com>
vllm-project#24662) Signed-off-by: AlonKejzman <alonkeizman@gmail.com> Signed-off-by: sergiopaniego <sergiopaniegoblanco@gmail.com>
#24662) Signed-off-by: AlonKejzman <alonkeizman@gmail.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
vllm-project#24662) Signed-off-by: AlonKejzman <alonkeizman@gmail.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
vllm-project#24662) Signed-off-by: AlonKejzman <alonkeizman@gmail.com>
vllm-project#24662) Signed-off-by: AlonKejzman <alonkeizman@gmail.com>
vllm-project#24662) Signed-off-by: AlonKejzman <alonkeizman@gmail.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
…g draft model length
Purpose
Enable running Eagle Speculative Decoding in environments where the input may exceed the drafter model length but not the verifier's.
Test Plan
Running with inputs that are below the drafter model length, and then between the drafter and verifier.
Test Result
Successful.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.