Skip to content

[Core] add QKV fusion to AuraFlow and PixArt Sigma - #8952

Merged
yiyixuxu merged 17 commits into
mainfrom
qkv-rest
Aug 6, 2024
Merged

[Core] add QKV fusion to AuraFlow and PixArt Sigma#8952
yiyixuxu merged 17 commits into
mainfrom
qkv-rest

Conversation

@sayakpaul

Copy link
Copy Markdown
Member

What does this PR do?

As a follow-up of #8829, I decided to give QKV fusion a try for AuraFlow and PixArt-Sigma when doing int8 quantization. Some nice gains on an H100:

PixArt

  • Without fusion: 1.499 seconds
  • With fusion: 1.455 seconds

AuraFlow

  • Without fusion: 13.850 seconds
  • With fusion: 13.707 seconds

@sayakpaul
sayakpaul requested a review from yiyixuxuJuly 24, 2024 04:44
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@yiyixuxuyiyixuxu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

very nice! thank you

Comment threadsrc/diffusers/models/attention_processor.py Outdated
Comment on lines +1282 to +1283
*args,
**kwargs,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we do not need them, no?

Suggested change
*args,
**kwargs,

@sayakpaul

Copy link
Copy Markdown
MemberAuthor

@yiyixuxu because we have

attention_mask=attention_mask,

I had to do:
33310ef

LMK if you have other ideas to counter it. Without it, we will have:
https://github.com/huggingface/diffusers/actions/runs/10104445763/job/27943457611?pr=8952#step:7:17774

@sayakpaul

Copy link
Copy Markdown
MemberAuthor

@yiyixuxu a friendly ping.

@sayakpaulsayakpaul mentioned this pull request Jul 30, 2024
6 tasks
@yiyixuxu
yiyixuxu merged commit 52f1378 into mainAug 6, 2024
@yiyixuxu
yiyixuxu deleted the qkv-rest branch August 6, 2024 00:09
@yiyixuxu

Copy link
Copy Markdown
Collaborator

@sayakpaul you're right thank you!

sayakpaul added a commit that referenced this pull request Dec 23, 2024
* add fusion support to pixart
* add to auraflow.
* add tests
* apply review feedback.
* add back args and kwargs
* style
Sign up for freeto 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.

3 participants

@sayakpaul@HuggingFaceDocBuilderDev@yiyixuxu