Skip to content

F/flax split head dim#5181

Merged
pcuenca merged 7 commits into
huggingface:mainfrom
entrpn:f/flax-split-head-dim
Sep 26, 2023
Merged

F/flax split head dim#5181
pcuenca merged 7 commits into
huggingface:mainfrom
entrpn:f/flax-split-head-dim

Conversation

@entrpn
Copy link
Copy Markdown
Contributor

@entrpn entrpn commented Sep 25, 2023

What does this PR do?

@patrickvonplaten Adds optional flag to split_head_dim in flax attention which speeds up the diffusion process for Stable Diffusion 2.1 and SDXL.

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.

Comment thread src/diffusers/models/attention_flax.py Outdated
Copy link
Copy Markdown
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! @pcuenca what do you think?

Copy link
Copy Markdown
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks a lot!

Running tests to see if anything important comes up :)

@pcuenca
Copy link
Copy Markdown
Member

pcuenca commented Sep 26, 2023

@entrpn could you please run make style in your branch? Otherwise I can do it later.

@entrpn
Copy link
Copy Markdown
Contributor Author

entrpn commented Sep 26, 2023

@pcuenca I ran it already. I just re-ran it after Patrick's changes and there were no changes.

@pcuenca
Copy link
Copy Markdown
Member

pcuenca commented Sep 26, 2023

Ok, I'll merge then and we can verify later.

@pcuenca pcuenca merged commit 16d56c4 into huggingface:main Sep 26, 2023
@entrpn entrpn deleted the f/flax-split-head-dim branch September 27, 2023 17:53
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* split_head_dim flax attn

* Make split_head_dim non default

* make style and make quality

* add description for split_head_dim flag

* Update src/diffusers/models/attention_flax.py

Co-authored-by: Patrick von Platen <[email protected]>

---------

Co-authored-by: Juan Acevedo <[email protected]>
Co-authored-by: Patrick von Platen <[email protected]>
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* split_head_dim flax attn

* Make split_head_dim non default

* make style and make quality

* add description for split_head_dim flag

* Update src/diffusers/models/attention_flax.py

Co-authored-by: Patrick von Platen <[email protected]>

---------

Co-authored-by: Juan Acevedo <[email protected]>
Co-authored-by: Patrick von Platen <[email protected]>
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.

4 participants