-
Notifications
You must be signed in to change notification settings - Fork 6.7k
refactor: replace fa3 wrapper with original fa3 in attention backends registry #12851
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
base: main
Are you sure you want to change the base?
refactor: replace fa3 wrapper with original fa3 in attention backends registry #12851
Conversation
|
Thanks for your PR. Since |
|
Is there any downstream callers of this function that I also need to test? |
sayakpaul
left a comment
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.
Thanks! Just a single question.
| raise | ||
|
|
||
|
|
||
| # ===== torch op registrations ===== |
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.
Do you think we should version-guard this to keep it backwards-compatible?
|
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. |
|
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
What does this PR do?
The
_wrapped_flash_attn_3function unconditionally unpacks bothoutandlsefrom the return value:However, it was not passing
return_attn_probs=Trueto request the tuple return. Since Dao-AILab/flash-attention@203b9b3,flash_attn_funcreturns onlyoutby default, causing:How does this pr fixes it
Adds
return_attn_probs=Trueto theflash_attn_3_funccall, consistent with how_flash_attention_3_hubhandles.Reproduction
and bring your own flash attention build, to repro this i built it from source @ Dao-AILab/flash-attention@ac9b5f1
Alternative
The wrapper seems to exist to support fa3 as custom op. However, fa3 now has native torch.compile support as of Dao-AILab/flash-attention@c7697bb. This might be making
_wrapped_flash_attn_3redundant, tho i dont really know if that is the only reason.Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?