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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Support bfloat16 for Upsample2D #9480

wants to merge 3 commits into from

Conversation

darhsu
Copy link

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

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.

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.

3 participants