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

Support bfloat16 for Upsample2D #9480

Merged
merged 7 commits into from
Oct 2, 2024
Merged

Support bfloat16 for Upsample2D #9480

merged 7 commits into from
Oct 2, 2024

Conversation

darhsu
Copy link
Contributor

@darhsu darhsu commented Sep 20, 2024

What does this PR do?

Support bfloat16 for Upsample2D. This change is backwards compatible.

Resolves the TODO comment as PyTorch 2.1+ supports bloat16. Referencing the original PyTorch issue:
pytorch/pytorch#86679 (comment)

Before submitting

Who can review?

CC: @sayakpaul @yiyixuxu

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Is it possible to add a small test for this? Our CI already has the latest PyTorch.

src/diffusers/models/upsampling.py Outdated Show resolved Hide resolved
@darhsu
Copy link
Contributor Author

darhsu commented Sep 20, 2024

@sayakpaul For sure, just added a test for bfloat16 by copying over test_upsample_default and resolved your comment

@darhsu darhsu requested a review from sayakpaul September 20, 2024 04:10
@darhsu darhsu requested a review from sayakpaul September 20, 2024 08:48
Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thanks a lot! @yiyixuxu WDYT?

@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.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!

src/diffusers/utils/testing_utils.py Outdated Show resolved Hide resolved
@darhsu darhsu requested a review from yiyixuxu September 20, 2024 21:48
@darhsu
Copy link
Contributor Author

darhsu commented Sep 24, 2024

@yiyixuxu is this good to merge?

@yiyixuxu
Copy link
Collaborator

can we run make style?

@darhsu
Copy link
Contributor Author

darhsu commented Sep 26, 2024

@yiyixuxu Fixed the style in the latest commit!

@darhsu
Copy link
Contributor Author

darhsu commented Oct 1, 2024

@yiyixuxu @sayakpaul Is there anything else I can do here to help?

@yiyixuxu yiyixuxu merged commit 61d3764 into huggingface:main Oct 2, 2024
15 checks passed
leisuzz pushed a commit to leisuzz/diffusers that referenced this pull request Oct 11, 2024
* Support bfloat16 for Upsample2D

* Add test and use is_torch_version

* Resolve comments and add decorator

* Simplify require_torch_version_greater_equal decorator

* Run make style

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: YiYi Xu <[email protected]>
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* Support bfloat16 for Upsample2D

* Add test and use is_torch_version

* Resolve comments and add decorator

* Simplify require_torch_version_greater_equal decorator

* Run make style

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: YiYi Xu <[email protected]>
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