-
-
Couldn't load subscription status.
- Fork 10.8k
Adjusting invalid k values in top-k selection beyond vocabulary limits #14234
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: Ye Cao <caoye.cao@alibaba-inc.com>
|
👋 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 🚀 |
|
Thanks @dashanji! Would it be possible to move this to where the requests are added to the batch? |
|
Do you know how can the logits shape exceed the vocab size in the first place? |
Sorry, I have no idea at present. Maybe I need to explore further. |
@DarkLight1337 IIUC this isn't related to the logits shape exceeding the vocab size but rather guarding against arbitrary provided top_k values which may be larger than the vocab size (and thus larger than the logits token dimension). |
I see. Still, shouldn't we prohibit (or at least warn about) such values in the first place instead of silently clamping them? |
|
@DarkLight1337 I think it's kind of unlikely/obscure for someone to pass such large values and if they do the clamping behaviour is technically still correct so I don't think there's any need for a warning. @dashanji actually when I looked closer at this I found that there's a more significant bug. I've opened another PR for that #14301 which should address this too. I'll include you as a coauthor on that. |
|
Thanks to @njhill for the quick fix, it works! |
Clamp
kto [1, vocab_size-1] when it's out of vocab size.FIX #14181