-
-
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
maximum! allocates #28928
Comments
…ty edge-cases Alleviates #28928 but does not completely remove allocations due to the allocation of the view that gets passed to `map!`.
…ty edge-cases Alleviates #28928 but does not completely remove allocations due to the allocation of the view that gets passed to `map!`.
…ty edge-cases Alleviates #28928 but does not completely remove allocations due to the allocation of the view that gets passed to `map!`.
* Detangle Slice between whole dimensions and axes We use axes in many downstream computations that may not re-index directly into the original array, so we add a second type parameter to `Slice` that is turned on when converting `:` in indexing expressions -- and really only `SubArray` cares about. * Reduce allocations for in-place reductions and fix mixed-dimensionality edge-cases Alleviates #28928 but does not completely remove allocations due to the allocation of the view that gets passed to `map!`. * Introduce a whole new IdentityUnitRange that we will encourage offset array implementations to use instead of Base.Slice * Test that maximum! allocates less
@mbauman Your recent commits are beyond my understanding, so I'm not sure if they fixed the allocations? If so please close this issue. |
No, unfortunately I just helped the issue a little bit. As I mentioned in the commit message itself:
Your example is down to just one allocation (for that view). You're on a faster machine than me — my previous was ~670ns. julia> X = rand(10,3,4); x= rand(1,3,4);
julia> @btime maximum!($x,$X)
546.149 ns (1 allocation: 64 bytes) |
Don't think this needs to be kept open since it is unlikely that this single allocation is a performance issue. |
See https://discourse.julialang.org/t/maximum-allocates/14191.
The text was updated successfully, but these errors were encountered: