-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Regression: mul!
of views allocates in v1.9+ for arrays of 4 or higher dimension, not in v1.8.5
#998
Comments
I haven't benchmarked this but one difference is the following: julia> A = rand(ComplexF64,4,4,1000,1000);
julia> B = similar(A);
julia> a,b = (view(B,:,:,1,1),view(A,:,:,1,1));
julia> f(A,B,C) = Base.require_one_based_indexing(A,B,C)
f (generic function with 1 method)
julia> @code_warntype optimize=true f(a, a, b) This used to constant fold in 1.8 to 1 ─ %1 = invoke Base._any_tuple(Base.has_offset_axes::typeof(Base.has_offset_axes), false::Bool, A::SubArray{ComplexF64, 2, Array{ComplexF64, 4}, ... |
Seems to be f718238af297f5179fe113ff76236 cc @vtjnash
Seems to indeed be where the regression comes from: Before:
After:
|
Is it clear to anyone what would be the good strategy to fix this? |
Friendly bump, in case anyone with some available time knows what could be done here. This is a fairly severe regression that has our simulation code stuck on 1.8.5 because we need views of 5-dimensional arrays, and the runtime penalty is too large. With current nightly it's become even worse: julia> @btime mul!($b,$a,$a);
493.124 ns (10 allocations: 608 bytes) |
It seems the root cause of this is the following
This should be 1. So |
…ews (#53091) Closes #49332 --------- Co-authored-by: Denis Barucic <barucic.d@gmail.com>
…ews (JuliaLang#53091) Closes #49332 --------- Co-authored-by: Denis Barucic <barucic.d@gmail.com> (cherry picked from commit 9edf1dd)
This seems like a regression: in Julia v1.9-rc2 and master
This is on an M1 Max
But in v1.8.5 we don't allocate
Note that if A has dimensions 3 or less, this issue does not arise.
The text was updated successfully, but these errors were encountered: