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

[Wav2Vec2] Make sure that gradient checkpointing is only run if needed #14407

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Nov 15, 2021

What does this PR do?

Further fixes: #14388 - thanks @MarktHart for noticing the degradation.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@patrickvonplaten
Copy link
Contributor Author

This PR further reduces the required memory by 20%

@patrickvonplaten
Copy link
Contributor Author

cc @anton-l FYI

@patrickvonplaten patrickvonplaten merged commit 76d0d41 into huggingface:master Nov 15, 2021
@patrickvonplaten patrickvonplaten deleted the correct_wav2vec2_gradient_checkpoint_feat_extractor branch November 15, 2021 20:03
LysandreJik pushed a commit that referenced this pull request Nov 16, 2021
#14407)

* [Wav2Vec2] Make sure that gradient checkpointing is only run if needed

* make fix-copies
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.

Wav2Vec2 CUDA memory usage doubled in v4.11.3 compared to v4.10.3 with the same batch size
1 participant