-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Grouped Query Attention #128898
Grouped Query Attention #128898
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/128898
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 95e724e with merge base e6cddc9 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorch-bot rebase |
@pytorchbot rebase |
d6a4752
to
697d565
Compare
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.
Overall looks really good, left a few comments
I think it would be helpful to run this script: and get some micro benchmark data: https://github.com/pytorch/pytorch/blob/main/benchmarks/transformer/sdpa.py
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
aa0d3f0
to
98f856b
Compare
@pytorchbot merge |
This PR updates submodules third_party/fmt If those updates are intentional, please add "submodule" keyword to PR title/description. |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Approach: Using the current function declaration
Constraint: Q_Heads % KV_Heads == 0
Major change:
Sample use cases this would enable:
LLama3
Design Choice:
Benchmarks:
For different batch sizes enable_gqa=True shows a substansial improvement in the run_time of sdpa
cc @XilunWu @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames