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

[FA-2] Revert suggestion that broke FA2 fine-tuning with quantized models #26916

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented Oct 18, 2023

What does this PR do?

Reverts: #26846 (comment)

This leads to an error because getattr will try to evaluate the third argument. for quantized models weight attribute do not exist leading to an error making the fine-tuning not possible

To repro on a more local scope:

>>> import torch
>>> t = torch.randn(1)
>>> getattr(t, 'device', t.non_existent_attribute)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Tensor' object has no attribute 'non_existent_attribute'

cc @ArthurZucker

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Ah, nice catch! Thanks @younesbelkada

@younesbelkada younesbelkada merged commit 574a538 into huggingface:main Oct 18, 2023
3 checks passed
@younesbelkada younesbelkada deleted the fix-fa-2-issue branch October 18, 2023 22:36
staghado pushed a commit to staghado/transformers that referenced this pull request Oct 24, 2023
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
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.

2 participants