-
-
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
[Bugfix] Unify rank computation across regular decoding and speculative decoding #7899
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,8 @@ def get_sampled_token_logprobs( | |
sampled_token_ids, ] | ||
expanded_selected_logprobs = selected_logprobs.unsqueeze(-1).expand( | ||
-1, -1, vocab_size) | ||
sampled_token_ids_ranks = (logprob_tensor >= | ||
expanded_selected_logprobs).sum(-1) | ||
sampled_token_ids_ranks = (logprob_tensor > | ||
expanded_selected_logprobs).sum(-1).add_(1) | ||
Comment on lines
+46
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a comment on why we add? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the regular decoding it was just like that as well. Since you already approved I did not change it so you don't need to reapprove. |
||
|
||
return sampled_token_ids_ranks, selected_logprobs | ||
|
||
|
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.
is there a better way we can do this besides importing a private function? maybe copying one of these https://github.com/vllm-project/vllm/blob/main/tests/spec_decode/e2e/test_logprobs.py ?
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.
actually this will be faster to test, let's keep it as is