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

implementing flux on TPUs with ptxla #10515

Merged
merged 13 commits into from
Jan 16, 2025

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!

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.

6 participants