-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
[V1][Bugfix][Spec Decode] Fix incorrect outputs in V1 speculative decoding due to batch indexing #14645
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
Signed-off-by: Benjamin Chislett <[email protected]>
Signed-off-by: Benjamin Chislett <[email protected]>
|
👋 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.
@benchislett Thanks for the bug fix!
|
@LiuXiaoxuanPKU Please take a look! |
LiuXiaoxuanPKU
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.
LGTM, thanks for the fix!
…oding due to batch indexing (vllm-project#14645) Signed-off-by: Benjamin Chislett <[email protected]> Signed-off-by: Richard Liu <[email protected]>
…oding due to batch indexing (vllm-project#14645) Signed-off-by: Benjamin Chislett <[email protected]> Signed-off-by: Louis Ulmer <[email protected]>
…oding due to batch indexing (vllm-project#14645) Signed-off-by: Benjamin Chislett <[email protected]>
…oding due to batch indexing (vllm-project#14645) Signed-off-by: Benjamin Chislett <[email protected]> Signed-off-by: Mu Huai <[email protected]>
In
gpu_model_runner.py, the requests in the batch are ordered according toself.input_batch.req_ids. However, the speculative decoding code is inferring the batch order from the keys of the dictionaryscheduler_output.num_scheduled_tokenswhich is not necessarily ordered in the same way.When multiple requests in the batch have different speculative lengths, the grouping of output probability slices into speculative decoding requests depends on this ordering. The existing end-to-end test is insufficient to capture this effect as the batch size is not large enough and the requests are too similar. I have updated the E2E test with a large batch of mixed requests, some of which will have full ngram completion and some which will not. Running this test on the main branch leads to many failures where one completion will have tokens "leaked" from other requests.
This one-line fix resolves the issue completely.