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] Fix gradient checkpointing to allow for much lower memory usage #2717

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

tomaarsen
Copy link
Collaborator

Hello!

Pull Request overview

  • Propagate the gradient checkpointing enabling to the underlying Transformer model

Details

By setting gradient_checkpointing=True, you can save a lot of memory when training at a ~10-20% speed decrease. This can allow for bigger batch sizes, which is very beneficial for in-batch negatives training.

Thanks @philschmid for reporting this.

  • Tom Aarsen

@tomaarsen tomaarsen merged commit 73fe054 into UKPLab:master Jun 5, 2024
9 checks passed
@tomaarsen tomaarsen deleted the feat/gradient_checkpointing branch June 5, 2024 11:10
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.

1 participant