-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[BERT
] Add support for sdpa
#28802
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
[BERT
] Add support for sdpa
#28802
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ed6efd0
Adding SDPA support for BERT
hackyon 0f34d58
Using the proper input name for testing model input in inference()
hackyon c85acbd
Adding documentation for SDPA in BERT model page
hackyon 5ce07b3
Use the stable link for the documentation
hackyon 288cc1d
Adding a gate to only call .contiguous() for torch < 2.2.0
hackyon 2afd61f
Additions and fixes to the documentation
hackyon fa8b5ad
Minor updates to documentation
hackyon 05d5c4e
Adding extra requirements needed for the contiguous() bug
hackyon 95ec569
Adding "Adapted from" in plcae of the "Copied from"
hackyon a07fd89
Add benchmark speedup tables to the documentation
hackyon 64334c1
Minor fixes to the documentation
hackyon 6a7376d
Use ClapText as a replacemenet for Bert in the Copied-From
hackyon 5ddb6e1
Some more fixes for the fix-copies references
hackyon 35577eb
Overriding the test_eager_matches_sdpa_generate in bert tests to not …
hackyon 0e62fe0
Undo changes to separate test
hackyon 5c64480
Refactored SDPA self attention code for KV projections
hackyon 9a9bb9b
Change use_sdpa to attn_implementation
hackyon 1a0af20
Merge remote-tracking branch 'upstream/main' into sdpa-bert
hackyon 0965399
Merge remote-tracking branch 'upstream/main' into sdpa-bert
hackyon b4813a0
Merge remote-tracking branch 'upstream/main' into sdpa-bert
hackyon e312cd1
Merge remote-tracking branch 'upstream/main' into sdpa-bert
hackyon 66a24c1
Fix test_sdpa_can_dispatch_on_flash by preparing input (required for …
hackyon 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
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
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.
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.
very nice thanks for the detailed benchmark! 🤗