Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[core] TorchAO Quantizer #10009
[core] TorchAO Quantizer #10009
Changes from all commits
64cbf11
b78a36c
355509e
cbb0da4
ee084a5
748a002
bc006f2
956f3bf
2c6beef
cfdb94f
8e214e2
1d9f832
01b2b42
b17cf35
250ccf4
50946a9
edae34b
8f09bdf
7c79b8e
820ac88
f9f1535
747bd7d
25d3cf8
10deb16
f3771a8
55d6155
de97a51
101d10c
edd98db
2677e0c
cc70887
5f75db2
9704daa
b227189
7d9d1dc
e9fccb6
bc874fc
29ec905
7ca64fd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Indeed it seems Pytorch 2.5+ is required because in
diffusers/src/diffusers/quantizers/torchao/torchao_quantizer.py
Line 45 in 92933ec
torch.uint1
(and others) which are not available in earlier torch versions. However,diffusers
seem to requiretorch>=1.4
(ref), so this seem inconsistent. Am I missing something?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.
TorchAO will not be imported or usable unless the pytorch version of 2.5 or above is available. Some Diffusers models can run with the 1.4 version as well, which is why that's the minimum required version.
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'm running into the same issue with the
torch.unit1
import. It seems the TorchAO import is not guarded according to the backtrace. The following backtrace stems from this import line:Here is the trace, and the pip list:
And the pip list:
pip list -v
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 a lot for reporting @fjeremic! We were able to replicate for torch <= 2.2. It seems to not cause the import errors for >= 2.3. We will be doing a patch release soon to fix this behaviour. Sorry for the inconvenience!
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 for providing a quick fix!
For completeness, I was running into the import error with
torch 2.2.2
when importingAutoencoderKL
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.
@BeckerFelix @fjeremic The patch release is out! Hope it fixes any problems you were facing in torch < 2.3
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.
Probably not necessary to have this since it's already in the API docs