-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix bug for torch.uint1-7 not support in torch<2.6 #10368
Conversation
torch.uint7, | ||
) | ||
|
||
if version.parse(torch.__version__) >= version.parse('2.6'): |
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.
oh thanks so much!
can we use is_torch_version
?
diffusers/src/diffusers/utils/import_utils.py
Line 727 in c1e7fd5
def is_torch_version(operation: str, version: str): |
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.
Thank you! Apologies that I missed this 😅
I think this should be something like:
if version <= 2.5:
# do not use any of the uintx
else:
# use the uintx types as well
I believe the uintx data types were added in 2.5 and not 2.6
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.
Also maybe good to have another branch that adds float8_e4m3fn
and float8_e5m2
only if torch version is >= 2.2
. int8
came in 2.0
I believe but since minimum diffusers requirement is torch>=1.4
, another branch for it might be needed. LMK if I can help with any changes
are you able to run |
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. |
hi @baymax591 closing this one since it is merged |
…ersion 0.32.1 Aryan (2): Fix TorchAO related bugs; revert device_map changes (#10371) Release: v0.32.1 Sayak Paul (1): fix test pypi installation in the release workflow (#10360) YiYi Xu (1): make style for huggingface/diffusers#10368 (#10370)
What does this PR do?
fix bug for torch.uint1-7 not support in torch<2.6
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
before this PR
When I execute the following command
python -c "from diffusers import AutoPipelineForText2Image"
get the following error:
The reason is that lower versions of torch do not support torch.uint1.
I added judgment on the torch version in the PR to avoid errors,and deleted redundant code.