-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[CUDA][cuBLASLt] addmm -- extend bias fusions to cases with (1 by n) shapes #166307
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/166307
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 2e05c55 with merge base 030de07 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
is it worth parametrizing the test(s) to try both 1xm and n-shaped bias or is that excessive?
aten/src/ATen/native/cuda/Blas.cpp
Outdated
| && ( | ||
| self.is_contiguous() && | ||
| // NOTE: fine to have 1-len dims to the left from the leading one | ||
| self.dim() <= result.dim() && self.squeeze().dim() == 1 && |
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.
cool use of squeeze here
| self._test_addmm_addmv(func, M, m1, m2, activation=activation) | ||
|
|
||
| # vector-shaped bias and beta=1 result in epilogue fusion in CUDA | ||
| # vector-shaped bias (or with 1-len dims on the left from the leading dim) |
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.
is this an "or" or have we changed the case from vector-shaped bias to 1 x n one?
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.
It is an or. Motivated by the "expected fusions" tests from Inductor -- and we can fuse these broadcast biases safely.
|
@eqy, thanks for the review! Do you mean in |
|
@eqy, the testing is expanded. Let me know if there is anything else we'd rather do before I merge. |
|
@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 |
…shapes (#166307) Pull Request resolved: #166307 Approved by: https://github.com/eqy
Stack from ghstack (oldest at bottom):
cc @ptrblck @msaroufim @eqy @jerryzh168