-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Fix regression loading dtype #34409
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 regression loading dtype #34409
Conversation
BenjaminBossan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough background to judge if the fix is good, but the test should cover it, as the generate call itself would raise an error without the fix.
|
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. |
ArthurZucker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, noting as it will be in a patch
| # We shouldn't hit the default value unless for quant methods like hqq that modifies expected_keys. | ||
| old_param = getattr(old_param, split, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 I knew it!
It was a bit too specific
* fix regression * add test for torchao * expected output * better fix
* fix regression * add test for torchao * expected output * better fix
What does this PR do?
This PR fixes the regression that @BenjaminBossan found out. It was caused by this PR. Basically,
old_paramwas always going to beNonewith the current logic. Hence, we don't set the correct dtype to the parameterparam = param.to(old_param.dtype). This caused a dtype mismatch with torchao.To reproduce
I tested that hqq serialization and the new test that I added both passed