Skip to content

Use flash_attention for SD2 #7

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

Merged
merged 3 commits into from
Oct 4, 2024
Merged

Use flash_attention for SD2 #7

merged 3 commits into from
Oct 4, 2024

Conversation

zpcore
Copy link
Collaborator

@zpcore zpcore commented Sep 26, 2024

What does this PR do?

Use flash attention for SD2 base.

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.

@zpcore zpcore force-pushed the piz/ft branch 3 times, most recently from c8a18c3 to c805f6b Compare September 27, 2024 03:36
@zpcore zpcore requested review from JackCaoG and entrpn September 30, 2024 23:18
Copy link
Collaborator

@entrpn entrpn left a comment

Choose a reason for hiding this comment

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

@zpcore sd 2 base doesn't require attention masks. What is the reasoning for adding it?

@zpcore
Copy link
Collaborator Author

zpcore commented Oct 1, 2024

@zpcore sd 2 base doesn't require attention masks. What is the reasoning for adding it?

You are right, the attention mask is always None. I don't know why the original code pass None mask to the attention. To be safe I just keep it there.

@entrpn
Copy link
Collaborator

entrpn commented Oct 1, 2024

@zpcore sd 2 base doesn't require attention masks. What is the reasoning for adding it?

You are right, the attention mask is always None. I don't know why the original code pass None mask to the attention. To be safe I just keep it there.

I believe it was added because there is a method to use masking for diffusion models, but this particular model and implementation we're targeting doesn't use it. LGTM.

@zpcore zpcore merged commit 0003397 into main Oct 4, 2024
10 of 12 checks passed
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.

2 participants