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

Fix recompilation in greedy sampling #137

Closed
wants to merge 10 commits into from

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.

@bocchris-aws bocchris-aws changed the title Fix recomp greedy Fix recompilation in greedy sampling Jul 14, 2023
@bocchris-aws
Copy link
Contributor Author

Closing as accidentally other changes got included.

@HuggingFaceDocBuilderDev

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

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