Skip to content
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

const cuttoff in sample_topp #313

Closed
wants to merge 1 commit into from

Conversation

Majdoddin
Copy link
Contributor

Refs #246 #276

This works because, practically, the probabilities that get sampled are more than 0.001. Therefore smaller values can be safely filtered (the cuteoff used in #276 evaluates to ~0.00003).
#276 reduces the sizes of the to be sorted array from 32000 to an average of 172, this PR further reduces it to 12.

There are other possible ways to further optimize the code, but as topp is no more a bottleneck, it doesn't affect the token/s much, thus I don't know if it would be interesting.

@karpathy
Copy link
Owner

I like the current version as it is a bit more principled. I don't think the current setting regresses tok/s noticeable already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants