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

Wrap FlauBERT integration test forward passes with torch.no_grad() #19412

Merged
merged 1 commit into from Oct 10, 2022
Merged

Wrap FlauBERT integration test forward passes with torch.no_grad() #19412

merged 1 commit into from Oct 10, 2022

Conversation

daspartho
Copy link
Contributor

What does this PR do?

This PR wraps forward passes in FlauBERT integration tests with torch.no_grad(), as proposed in issue #14642. This avoids the computation of unnecessary gradients during inference.

Before submitting

  • This PR fixes a typo or improves the docs.
  • Did you read the contributor guideline, Pull Request section?
  • Was this discussed/approved via a Github issue or the forum?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@LysandreJik could you please take a look at it?
Thanks :)

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you @daspartho!

@LysandreJik LysandreJik merged commit df2f281 into huggingface:main Oct 10, 2022
@daspartho daspartho deleted the add-no-grad-flaubert-integration-test branch October 10, 2022 19:28
ajsanjoaquin pushed a commit to ajsanjoaquin/transformers that referenced this pull request Oct 12, 2022
amyeroberts pushed a commit to amyeroberts/transformers that referenced this pull request Oct 18, 2022
kashif pushed a commit to kashif/transformers that referenced this pull request Oct 21, 2022
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.

None yet

2 participants