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

Prevent recompilation during greedy search #138

Merged

Conversation

bocchris-aws
Copy link
Contributor

Before moving tensors to the CPU to be processed by the logit_processor in greedy search, we dynamically slice it to seq_length. Since with each iteration of generating the next tokens this variable increases, recompilation is triggered. This PR changes the order and moves the tensor to CPU before slicing it to prevent recompilation.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@michaelbenayoun michaelbenayoun merged commit ada9f36 into huggingface:main Jul 18, 2023
7 of 13 checks passed
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.

3 participants