[Model Runner V2] Spec decode rejection sampler logprobs support#37237
Merged
WoosukKwon merged 1 commit intovllm-project:mainfrom Mar 19, 2026
Conversation
b14c905 to
d3671ed
Compare
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces logprobs support for speculative decoding with rejection sampling. The changes primarily involve a significant refactoring of the probabilistic rejection sampling implementation, including new and modified Triton kernels to support greedy sampling and efficiently gather draft logits. A new kernel is also added to flatten sampled tokens for logprob computation. While the overall approach is sound, I've identified a critical correctness issue where draft logits are not temperature-scaled, and a high-severity bug related to tensor initialization that could result in incorrect token IDs.
f862803 to
79a48b3
Compare
Collaborator
|
@TheEpicDolphin Can you please rebase? Sorry for the delay! |
Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
79a48b3 to
d9a477f
Compare
fxdawnn
pushed a commit
to fxdawnn/vllm
that referenced
this pull request
Mar 19, 2026
…m-project#37237) Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
SouthWest7
pushed a commit
to SouthWest7/vllm
that referenced
this pull request
Mar 27, 2026
…m-project#37237) Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
khairulkabir1661
pushed a commit
to khairulkabir1661/vllm
that referenced
this pull request
Mar 27, 2026
…m-project#37237) Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
Monishver11
pushed a commit
to Monishver11/vllm
that referenced
this pull request
Mar 27, 2026
…m-project#37237) Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai> Signed-off-by: Monishver Chandrasekaran <monishverchandrasekaran@gmail.com>
JiantaoXu
pushed a commit
to JiantaoXu/vllm
that referenced
this pull request
Mar 28, 2026
…m-project#37237) Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
vrdn-23
pushed a commit
to vrdn-23/vllm
that referenced
this pull request
Mar 30, 2026
…m-project#37237) Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai> Signed-off-by: Vinay Damodaran <vrdn@hey.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Following up on #35461, specifically with the logprobs support.
In order to get the top logprobs using
compute_topk_logprobs, I need the sampled token ids shape to be [num_logits]. For strict rejection sampling, this is easy because the Sampler already returns the ground-truth target token ids. But in probabilistic rejection sampling, we don't sample target token ids (it would be a waste of compute). So we need to get the output sampled token ids first, and then flatten them from[num_reqs, num_speculative_steps + 1]=>[num_logits]. I do this using a simple_flatten_sampled_kernel. This works, and allows us to get the top logprobs.Testing
Served 8 requests (temperature = 0) concurrently. Below are the prompts and responses including the top-3 logprobs:
0. Explain the theory of relativity in simple terms.
1. What is the capital of France?
2. Write a haiku about coding.
3. List three benefits of regular exercise.
4. How does a refrigerator keep food cold?
5. What is the difference between HTTP and HTTPS?
6. Suggest a short book to read on a rainy day.
7. 2+2=?
Next Steps