-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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 CUDA memory usage doubled in v4.11.3 compared to v4.10.3 with the same batch size #14388
Comments
Looking into it now |
Benchmarking your script on current master gives me a peak GPU mem usage of |
And with |
Will investigate now |
No problem at all! If there is anything I can do to assist I would be happy to help. |
Ok I think I already found one problem. It seems like the @MarktHart - could you add model.gradient_checkpointing_enable() before this line:
this should more or less solve the problem |
That does solve the issue. Thanks a bunch! |
@patrickvonplaten do you decide whether to close the issue or that backward compatibility should be restored? |
@sgugger - this is a weird issue. For some reason Will open a hacky PR to fix it |
I have this issue in 4.14.1 when i set group_by_length=True. Adding model.gradient_checkpointing_enable() can't solve this problem. |
@voidful - can you provide a reproducible script here? :-) Thanks a lot! |
It turn out to be length issue on my custom dataset, simplify apply .filter can solve this problem~~~~ |
Environment info
transformers
version: 4.11.3Who can help
@patrickvonplaten, @anton-l
Information
When using Wav2vec2 the memory usage roughly doubles when going from Huggingface v4.10.3 to v4.11.3
Whereas my 3090 (24GB memory) in v4.10.3 could handle a batchsize of ~32, in 4.11.3 this is reduced to ~10.
The problem arises when using:
The tasks I am working on is:
To reproduce
Steps to reproduce the behavior:
Reproduce script (relatively minimal):
Expected behavior
Upgrading Huggingface Transformers from 4.10 to a later version should keep the memory usage in the same ballpark
The text was updated successfully, but these errors were encountered: