Skip to content

Fix gradient checkpointing issue for Stable Diffusion 3 #8542

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

Merged
merged 4 commits into from
Jun 18, 2024

Conversation

RefractAI
Copy link
Contributor

When gradient checkpointing is enabled for SD3, in the example dreambooth script with default arguments, various modules fail with "expected Tensor, not tuple". This is because the gradient checkpointing codepath doesn't deconstruct the hidden states tuple. This fixes that issue.

@sayakpaul

@darknoon
Copy link

Thank you! Ran into the same issue.

@s9anus98a
Copy link

can this fix my issue? #8545

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 so much!

@sayakpaul sayakpaul requested a review from yiyixuxu June 14, 2024 21:49
@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.

thank you!

@yiyixuxu
Copy link
Collaborator

can you run make style?

@RefractAI
Copy link
Contributor Author

can you run make style?

All checks passed!

There were no changes from that command to the one file that this modifies.

@asomoza
Copy link
Member

asomoza commented Jun 15, 2024

The failed test is the same that I have, so need to wait for #8563 to be able to continue with the tests.

yiyixuxu added 2 commits June 16, 2024 08:37
@yiyixuxu yiyixuxu merged commit 3376252 into huggingface:main Jun 18, 2024
14 of 15 checks passed
yiyixuxu added a commit that referenced this pull request Jun 20, 2024
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
sayakpaul added a commit that referenced this pull request Dec 23, 2024
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
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.

None yet

7 participants