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 Correctly call element_size #1635

Merged

Conversation

BenjaminBossan
Copy link
Member

Should fix the error introduced by #1630.

AFAICT, element_size should be called on the parameter, not the dtype. Unfortunately, I had issues getting older PyTorch versions to work with bnb, so I haven't tested the initial issue.

To be safe, I also re-added the previous code path using itemsize, although it might be unnecessary (we would have to check the PyTorch code to verify when the different attributes/methods were added).

Should fix the error introduced by huggingface#1630.

AFAICT, element_size should be called on the parameter, not the dtype.
Unfortunately, I had issues getting older PyTorch versions to work with
bnb, so I haven't tested the initial issue.

To be safe, I also re-added the previous code path using itemsize,
although it might be unnecessary (we would have to check the PyTorch
code to verify when the different attributes/methods were added).
@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.

@BenjaminBossan
Copy link
Member Author

Ping @winglian if you could please check if this PR still resolves your initial issue.

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 for the fix!

@winglian
Copy link
Contributor

winglian commented Apr 9, 2024

@BenjaminBossan yup, this works for me. thanks!

@BenjaminBossan BenjaminBossan merged commit 88875f1 into huggingface:main Apr 9, 2024
14 checks passed
@BenjaminBossan BenjaminBossan deleted the fix-element_size-error branch April 9, 2024 13:39
DTennant pushed a commit to DTennant/peft that referenced this pull request Apr 16, 2024
Should fix the error introduced by huggingface#1630.

AFAICT, element_size should be called on the parameter, not the dtype.
Unfortunately, I had issues getting older PyTorch versions to work with
bnb, so I haven't tested the initial issue.

To be safe, I also re-added the previous code path using itemsize,
although it might be unnecessary (we would have to check the PyTorch
code to verify when the different attributes/methods were added).
DTennant pushed a commit to DTennant/peft that referenced this pull request Apr 19, 2024
Should fix the error introduced by huggingface#1630.

AFAICT, element_size should be called on the parameter, not the dtype.
Unfortunately, I had issues getting older PyTorch versions to work with
bnb, so I haven't tested the initial issue.

To be safe, I also re-added the previous code path using itemsize,
although it might be unnecessary (we would have to check the PyTorch
code to verify when the different attributes/methods were added).
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.

4 participants