-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Dispatch to generic matrix product rather than gemm for reshaped transposed arrays #30988
Comments
It's generally best to avoid |
I think it would be justified to specialise In case anyone else wonders why Julia has a lazy |
This is a problem all over the place and I'm not sure reshaping a transposed array necessarily is the common place where this causes problems. Consider e.g. things like julia> @time sum(spzeros(10000,10000))
0.000014 seconds (12 allocations: 78.672 KiB)
0.0
julia> @time sum(vec(spzeros(10000,10000)))
0.230635 seconds (17 allocations: 78.797 KiB)
0.0 and similar things happen for most array types.
That was indeed the conclusion in #4211. However, I think it's worth reconsidering for Julia 2, see #4211 (comment) |
I'm not sure I understand. Are you suggesting not to materialise |
No. I'm saying that the problems with |
Profiling indicates that the difference in runtimes comes about because the first call dispatches to
_generic_matmul
while the second dispatches togemm!
.Related issues:
The text was updated successfully, but these errors were encountered: