-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Add flop formulas for sdpa #95854
Add flop formulas for sdpa #95854
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/95854
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit e9e9c34: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ghstack-source-id: 771ea7fb25103fdfee0bf063b96f9b28aa2627aa Pull Request resolved: #95854
[ghstack-poisoned]
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.
cc @drisspg
[ghstack-poisoned]
[ghstack-poisoned]
# [b, h, s, d] @ [b, h, d, s2] -> [b, h, s, s2] | ||
total_flops += bmm_flop([(b * h, s, d), (b * h, d, s2)]) | ||
# [b, h, s, s2] @ [b, h, s2, d] -> [b, h, s2, d] | ||
total_flops += bmm_flop([(b * h, s, s2), (b * h, s2, d)]) |
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.
Not sure how precise flop_counting is but in essence, we only really care about the bmms right?
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.
more or less yeah.
I still need to add the backwards formulas, but I'll leave that to a future PR 🤔 |
@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 |
Pull Request resolved: pytorch/pytorch#95854 Approved by: https://github.com/drisspg
Pull Request resolved: pytorch/pytorch#95854 Approved by: https://github.com/drisspg
Pull Request resolved: pytorch#95854 Approved by: https://github.com/drisspg
Pull Request resolved: pytorch#95854 Approved by: https://github.com/drisspg
Stack from ghstack (oldest at bottom):