forked from quic/efficient-transformers
-
Notifications
You must be signed in to change notification settings - Fork 0
Optimizations #2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
Merged
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
Signed-off-by: quic-sanising <quic_sanising@quicinc.com>
Perform random sampling only on topk_values_asc Only need logits for probs when self.return_pdfs is True
quic-sanising
added a commit
that referenced
this pull request
Apr 24, 2025
* Initial commit * Reformat code * Fix bug * Add Gumbel-Max trick based random sampling * Bring up to date * Use Gumbel-Max Trick based Random Sampling as default * Clip k to max value * Add docstring for sampling parameters * Fix bug * Add support for continuous batching * Fix ONNX error for batch_size 1 treated as a Constant * Undo docstring deletion * Remove device and unncessary reshapes * Revert batch_size to 1 * Remove vocab_size from dynamic axes * Change condition * Change size of each sampling parameter to (batch_size, 1) * Reformat code * Add optimizations * Identify optimizations * Fix bug * Fix merge issue * Optimizations: Perform random sampling only on topk_values_asc Only need logits for probs when self.return_pdfs is True * Remove where clause for temperature * Remove boolean type casting for retain state * Always return next_tokens * Fix bug * Reformat code * Initialize retain states * Optimize imports * Remove torch.index_select() * Change dtype of penalty buffers to bool --------- Signed-off-by: quic-sanising <quic_sanising@quicinc.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
No description provided.