-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Core] fuse_qkv_projection() to Flux #9185
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. |
awesome, but I think we will have to update once the refactor PR is in since I combined the attention processors there #9074 |
100 percent right. I will repurpose once your PR is in :) |
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.
PR looks good to me
Can we run a actual test to see the improvement before merge? feel free to merge once that's done
Check the PR description:
|
@sayakpaul ahh I missed it! sorry! very nice! |
@sayakpaul This feature doesn't seem to work together with
|
Please redirect the issue to https://github.com/sayakpaul/diffusers-torchao |
* start fusing flux. * test * finish fusion * fix-copues
What does this PR do?
Adds
fuse_qkv_projection()
support Flux.Will report the performance improvements soon.
Batch size 1 (see footnote):
With fusion: 8.456 seconds (memory 25.25 GB)
Without fusion: 11.492 seconds (35.455 GB)
As a reminder, refer to this comment to understand the scope of when fusion is ideal.
Footnote:
This was run on an A100. For quantization, we use "autoquant" from
torchao
. We are working on a repository to show the full-blown recipes. It will be made open in a day's time.