-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Core][Speculative Decoding] Add multi-query verifier for speculative decoding without batch expansion #6185
Conversation
f70e276
to
e166a2a
Compare
Have you tested this PR:#5691, which performance is better? |
These two PRs shouldn't have too many differences in implementation, so the performance should be roughly the same. One comment for #5691: it must be done carefully for prompt tokens processing in sampling_metadata.py, as the prompt tokens of sequences would affect the applying penalities logic in sampler. |
@sighingnow Thanks for your kindly reply. Does this PR support cuda graph now. |
Hi @mpjlu I have just tried some correctness test and found that this PR cannot work as expected with cuda graph. Apologize for the misinformation. |
I will take a pass this week. also cc @LiuXiaoxuanPKU one major challenge is cuda graph support. it will be necessary since the pytorch dispatch and scheduling overhead is large for small batch sizes. btw if you have performance numbers to prove ^ wrong, please share |
…sion. Signed-off-by: Tao He <[email protected]> Signed-off-by: Tao He <[email protected]>
e166a2a
to
6b9d365
Compare
@cadedaniel @mpjlu @LiuXiaoxuanPKU The cuda graph of both draft model and target model (with multi-query verifier) has been added. |
Hi @sighingnow , thanks for adding this. Feedback:
One way forward is to merge the MultiQueryTop1Scorer without cuda graph support, then once #6052 is done we can integrate the two. What do you think? |
Hi @cadedaniel, If the PR #6052 will be merged soon, I prefer waiting it been merged then rebasing this PR, to avoid conflicts and merging effort. |
I am not sure how soon it will be merged. cc @LiuXiaoxuanPKU |
Hi @sighingnow, sorry for the very late reply. After digging into #6052, we find there is correctness issue with cudagraph + flash_attn_varlen_func. We will look into the support. However, at the same time, we can move forward with this PR. Could you clean a bit and let us know when it's good to review. Thanks for the contribution and sorry for the delayed reply! |
cc @comaniac any thoughts on how this cuda graph approach works with model runner / prepare inputs ? |
Took a brief look. The approach is ok in general, but I could see that some more overheads are introduced due to more tensors/logic being processed. I could review the PR once it's rebased and ready to eliminate the overheads as possible. |
One alternative is to move this to a custom model runner, just for spec decode. Do you think that's better or worse than the current approach? |
In general I imagine that would have lots of code duplications, and this logic (without CUDA graph) should be very similar as prefix caching. Another way is maybe we quickly support a version without CUDA graph first and see how good/bad is? |
SGTM. @sighingnow we can merge this PR as is if we remove the cuda graph stuff, or we can add cuda graph stuff (using one of the two approaches @comaniac mentions above) |
I will rebase and fixes the cudagraph issue, add testsing cases for this PR during this weekend, thanks all for your careful review. |
This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you! |
This pull request has merge conflicts that must be resolved before it can be |
FIX P1 part of #4630 (link existing issues this PR will resolve)
BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE
PR Checklist (Click to Expand)
Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]
for bug fixes.[CI/Build]
for build or continuous integration improvements.[Doc]
for documentation fixes and improvements.[Model]
for adding a new model or improving an existing model. Model name should appear in the title.[Frontend]
For changes on the vLLM frontend (e.g., OpenAI API server,LLM
class, etc.)[Kernel]
for changes affecting CUDA kernels or other compute kernels.[Core]
for changes in the core vLLM logic (e.g.,LLMEngine
,AsyncLLMEngine
,Scheduler
, etc.)[Hardware][Vendor]
for hardware-specific changes. Vendor name should appear in the prefix (e.g.,[Hardware][AMD]
).[Misc]
for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
format.sh
to format your code.docs/source/
if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.Notes for Large Changes
Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with
rfc-required
and might not go through the PR.What to Expect for the Reviews
The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:
action-required
label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.Thank You
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!