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 low cpu mem usage tests #30808

Merged
merged 5 commits into from
May 22, 2024
Merged

Fix low cpu mem usage tests #30808

merged 5 commits into from
May 22, 2024

Conversation

SunMarc
Copy link
Member

@SunMarc SunMarc commented May 14, 2024

What does this PR do ?

This PR fixes the common tests about low_cpu_mem_usage (covered in accelerate_tests). The issue that we had was that we moved one of the model to cuda while the other was on cpu. Hence, we get an error while trying to compare those two models. After fixing the issue on the tests, the only failing model is UdopModel that I fixed (we need to tie the weights in _tie_weights. Otherwise, it won't work with low_cpu_mem_usage)

See the run here with most of the tests passing

Furthermore, I'm running accelerate tests on every model to see if we still have failing tests + check if there are any failing tests for model parallelism, cpu_offload, disk_offload.
The other failing tests are fixed here. @ydshieh for viz

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@SunMarc SunMarc force-pushed the fix_low_cpu_mem_usage_tests branch from 9c7725a to 2fac6e3 Compare May 17, 2024 12:19
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks for fixing ! 🤗

Copy link
Contributor

@NielsRogge NielsRogge left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thanks!

Would be nice if an explanation about what happens. Like, if it's a change in accelerate caused this test starting to fail, and if this is the case, a link to a commit in accelerate could be provided.

@SunMarc
Copy link
Member Author

SunMarc commented May 21, 2024

Would be nice if an explanation about what happens. Like, if it's a change in accelerate caused this test starting to fail, and if this is the case, a link to a commit in accelerate could be provided.

In this PR, I fixed the common tests. The issue was that the tests were not designed correctly ( device placement issue ). As for the failing test on UdopModel, this is an issue on the modeling code. With my fix, we can load UdopModel with low_cpu_mem_usage=True. So it's more an issue on transformers.

@SunMarc SunMarc merged commit 5c18600 into main May 22, 2024
21 checks passed
@SunMarc SunMarc deleted the fix_low_cpu_mem_usage_tests branch May 22, 2024 12:09
itazap pushed a commit that referenced this pull request May 24, 2024
* Fix tests

* fix udop failing test

* remove skip

* style
itazap pushed a commit that referenced this pull request May 30, 2024
* Fix tests

* fix udop failing test

* remove skip

* style
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

5 participants