-
Notifications
You must be signed in to change notification settings - Fork 12.3k
sampling: fix top_k <= 0 #5388
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
Merged
JohannesGaessler
merged 2 commits into
ggml-org:master
from
JohannesGaessler:sampling-fix-top-k
Feb 8, 2024
Merged
sampling: fix top_k <= 0 #5388
JohannesGaessler
merged 2 commits into
ggml-org:master
from
JohannesGaessler:sampling-fix-top-k
Feb 8, 2024
Conversation
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
7ede556
to
2f8e607
Compare
Green-Sky
approved these changes
Feb 7, 2024
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.
Does this fix the server behavior, when you set the "Show Probabilities" option ?
I don't know which issue you're talking about so I can't say. |
No it does not. Ignore me :) |
cebtenzzre
approved these changes
Feb 7, 2024
ggerganov
approved these changes
Feb 8, 2024
Co-authored-by: Georgi Gerganov <[email protected]>
1 task
I still see the same issue on the latest version (0.2.44) where the sampling is deterministic for K=0. |
jordankanter
pushed a commit
to jordankanter/llama.cpp
that referenced
this pull request
Mar 13, 2024
* sampling: fix top_k <= 0 * Update llama.cpp Co-authored-by: Georgi Gerganov <[email protected]> --------- Co-authored-by: Georgi Gerganov <[email protected]>
hodlen
pushed a commit
to hodlen/llama.cpp
that referenced
this pull request
Apr 1, 2024
* sampling: fix top_k <= 0 * Update llama.cpp Co-authored-by: Georgi Gerganov <[email protected]> --------- Co-authored-by: Georgi Gerganov <[email protected]>
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.
Fixes abetlen/llama-cpp-python#1154 .
(I assume) the issue is that top_k sampling is called directly rather than via the sampling queue.
top_k values <= 0 are then rounded up to
min_keep
instead of being set tocandidates.size
.This PR adds a corresponding check and two more related test cases.