-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Refactor image padding logic to pervent zero tensor in transformer_z_image #12743
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
base: main
Are you sure you want to change the base?
Conversation
|
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. |
yiyixuxu
left a comment
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!
|
@bot /style |
|
Style bot fixed some files and pushed the changes. |
|
cc @JerryWu-code can you take a look too? |
Sure, I'm happy to proceed that, this error does exist on TPU with using torch_xla, and I add a minimal test case to report the problem and fix more on #12770. Ready to merge ~ |
|
Should I close the pr now? It's my first time contributing to diffusers :) |
What does this PR do?
In src/diffusers/models/transformers/transformer_z_image.py, there exists a image_padding_len for padding image to be multiple of SEQ_MULTI_OF. However, when the image shape is already multiple of SEQ_MULTI_OF, this will create a tensor with zero shape. This triggers
INVALID_ARGUMENT: Concatenate expects at least one argument.for PyTorch/XLA on TPU. It may also fail on other devices than cuda.Fixes #12742
Who can review?
@yiyixuxu @asomoza