Skip to content

Conversation

@entrpn
Copy link
Contributor

@entrpn entrpn commented Jan 10, 2025

What does this PR do?

Flux inference using PyTorch XLA.

I still need to validate that the readme works on a new machine and I didn't miss any steps then run the linter. Will do it tomorrow.

@pcuenca @sayakpaul I have a question regarding the AttentionProcessors. In a previous PR it was recommended to create a new AttentionProcessor for ptxla. Unfortunately that one doesn't work for Flux and I feel its a lot of duplication of code if I do the same for Flux as it would almost be a copy/paste of FluxAttentionProcessors. Please advice.

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@sayakpaul
Copy link
Member

it was recommended to create a new AttentionProcessor for ptxla. Unfortunately that one doesn't work for Flux and I feel its a lot of duplication of code if I do the same for Flux as it would almost be a copy/paste of FluxAttentionProcessors. Please advice.

Okay for me to create a new class even if that means duplication. Once we start to more formally support PyTorch XLA (i.e., through inclusion in our CI), we can start revisiting them to refactor but for now, new classes are completely fine by me. Cc: @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.

@entrpn
Copy link
Contributor Author

entrpn commented Jan 13, 2025

@hlky @sayakpaul created new class and addressed the comments + ran make style/quality. Please take another look.

@sayakpaul
Copy link
Member

@entrpn could you run make style && make quality?

@entrpn
Copy link
Contributor Author

entrpn commented Jan 15, 2025

make style && make quality

done

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!

@yiyixuxu yiyixuxu merged commit aeac0a0 into huggingface:main Jan 16, 2025
12 checks passed
@sayakpaul
Copy link
Member

Thanks for contributing this!

@josephrocca
Copy link
Contributor

josephrocca commented Mar 6, 2025

Sorry if I've misunderstood, as I don't understand this very well, but was this change in FluxAttnProcessor2_0 accidental?

image

https://github.com/huggingface/diffusers/pull/10515/files#diff-96aeb208ac8e69bdb368e0a481a0cd50173b3f4bf19e5da500c251614820c8cdR2327

I think it reverts this change?

@entrpn
Copy link
Contributor Author

entrpn commented Mar 7, 2025

@josephrocca yes this should not have changed. I'll need to make a PR to revert this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants