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: Adalora ranknum loaded on wrong device #1852

Merged

Conversation

BenjaminBossan
Copy link
Member

Locally, multiple AdaLoRA-related tests are failing. We did not catch this in the nightly run because the tests were missing the necessary pytest marker.

The issue is related to the change in #1742, which made it possible to load different adapters on different devices. Although that PR itself was sound, the problem is that for AdaLoRA, one of its parameters, ranknum, was not listed in the other_param_names and was thus not moved to the correct device. This oversight is now fixed and the GPU tests are now passing locally for me.

Note that this bug only occurred in the tests when loading a 2nd AdaLoRA adapter. At first I was confused because I thought that this is not supported (there is a check for that), but actually it's supported as long as the additional adapters are not trainable, so the check is fine.

This PR also adds the missing pytest marker to the test class that was missing it, so that these errors should be caught by our nightly CI in the future.

Locally, multiple AdaLoRA-related tests are failing. We did not catch
this in the nightly run because the tests were missing the necessary
pytest marker.

The issue is related to the change in huggingface#1742, which made it possible to
load different adapters on different devices.

Although that PR itself was sound, the issue is that for AdaLoRA, one of
its parameters, ranknum, was not listed in the other_param_names and was
thus not moved to the correct device. This oversight is now fixed and
the GPU tests are now passing locally for me.

This PR also adds the missing pytest marker to the test class that was
missing it, so that these errors should be caught by our nightly CI in
the future.
@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.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks a lot for fixing !

@BenjaminBossan BenjaminBossan merged commit 3831e06 into huggingface:main Jun 13, 2024
14 checks passed
@BenjaminBossan BenjaminBossan deleted the fix-adalora-ranknum-device branch June 13, 2024 08:47
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.

3 participants