-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add torch.compile support to flash attention 3 #1769
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
v0i0
merged 18 commits into
Dao-AILab:main
from
guilhermeleobas:guilhermeleobas/fa3-compile
Dec 4, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c7697bb
Add torch.compile support to flash attention 3
guilhermeleobas e1944ba
Don't return mutated variables in mha_bwd
guilhermeleobas a760ca3
Change fake_check flag to be opt-in; Remove build.sh and remove if-el…
guilhermeleobas 24cc2b2
Remove print statements and update exception message
guilhermeleobas 5e114d5
Fix flash_attn_backward_fake
guilhermeleobas 734bc43
Add `safe_aot_autograd_check`
guilhermeleobas fde4bc0
Update namespace to flash_attn_3
guilhermeleobas ab79ae2
Add `flash_attn_forward.register_autograd`
guilhermeleobas 6250fbe
Fix bug in `flash_attn_backward_fake`
guilhermeleobas 1e3539e
Add support and tests for torch.export and aoti_compile_and_package
guilhermeleobas f174bd6
format code
guilhermeleobas 6fe1c8c
update flash_api_stable.cpp
guilhermeleobas b555ac7
Fix flash_api_stable.cpp build
guilhermeleobas 0aa4fa1
Only run schema_check if dtype is not float8_e4m3fn
guilhermeleobas 47d7137
Correctly compute kBlockM for sm88/86/80
guilhermeleobas 49fb775
Fix bug in boxed_mha_bwd
guilhermeleobas 65dd580
don't run autograd_check when num_splits > 0
guilhermeleobas 3fcde4b
Raise TypeError if out is specified when compiling _flash_attn_forward
guilhermeleobas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,10 @@ var/ | |
|
|
||
| # IDE-related | ||
| .idea/ | ||
| .vscode/ | ||
|
|
||
| # Dev | ||
| venv | ||
|
|
||
| # compile-time generated file | ||
| flash_attn_config.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Now that #1791 is landed can you also update the stable file to keep them in sync?
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.
done!