-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Specialize Diagonal * Matrix * Diagonal #46400
Conversation
Co-authored-by: N5N3 <[email protected]>
@N5N3 what kinds of test do we need? Is |
That's enough. The correctness is intuitive here. The tag was added only for coverage. |
Co-authored-by: Michael Abbott <[email protected]>
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.
I'd like to suggest two more tests to specifically target the size checks. Otherwise this LGTM. I don't think Number
-transpose
-like optimizations are needed.
Co-authored-by: Daniel Karrasch <[email protected]>
This is a fast path for a 3 argument matrix multiplication where the first and third matrix is a
Diagonal
. This 3 arg matmul is commonly used in graph theory (e.g. computing graph laplacian, cc @yuehhua). With this fast path we get a performance boost that is about 2 times faster.