-
-
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
Regression in broadcast assignment to a SlowSubArray
on nightly
#53158
Labels
domain:arrays
[a, r, r, a, y, s]
kind:regression
Regression in behavior compared to a previous version
performance
Must go faster
regression 1.11
Comments
jishnub
added
performance
Must go faster
kind:regression
Regression in behavior compared to a previous version
domain:arrays
[a, r, r, a, y, s]
labels
Feb 2, 2024
Bisected to 9aa7980:
On this commit, julia> a = zeros(4000,4000); b = rand(size(a)...);
julia> @btime $a[1:end,1:end] .= $b;
61.351 ms (0 allocations: 0 bytes) vs on 045b6f9: julia> @btime $a[1:end,1:end] .= $b;
20.189 ms (0 allocations: 0 bytes) |
vtjnash
pushed a commit
that referenced
this issue
Feb 20, 2024
…3383) With this, the following (and equivalent calls) work: ```julia julia> copyto!(view(zeros(BigInt, 2), 1:2), Vector{BigInt}(undef,2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef julia> copyto!(view(zeros(BigInt, 2), 1:2), view(Vector{BigInt}(undef,2), 1:2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef ``` Close #53098. With this, all the `_unsetindex!` branches in `copyto_unaliased!` work for `Array`-views, and this makes certain indexing operations vectorize and speed-up: ```julia julia> using BenchmarkTools julia> a = view(rand(100,100), 1:100, 1:100); b = view(similar(a), axes(a)...); julia> @Btime copyto!($b, $a); 16.427 μs (0 allocations: 0 bytes) # master 2.308 μs (0 allocations: 0 bytes) # PR ``` Improves (but doesn't resolve) #40962 and #53158 ```julia julia> a = rand(40,40); b = rand(40,40); julia> @Btime $a[1:end,1:end] .= $b; 5.383 μs (0 allocations: 0 bytes) # v"1.12.0-DEV.16" 3.194 μs (0 allocations: 0 bytes) # PR ``` ƒ Co-authored-by: Jameson Nash <vtjnash@gmail.com>
tecosaur
pushed a commit
to tecosaur/julia
that referenced
this issue
Mar 4, 2024
…liaLang#53383) With this, the following (and equivalent calls) work: ```julia julia> copyto!(view(zeros(BigInt, 2), 1:2), Vector{BigInt}(undef,2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef julia> copyto!(view(zeros(BigInt, 2), 1:2), view(Vector{BigInt}(undef,2), 1:2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef ``` Close JuliaLang#53098. With this, all the `_unsetindex!` branches in `copyto_unaliased!` work for `Array`-views, and this makes certain indexing operations vectorize and speed-up: ```julia julia> using BenchmarkTools julia> a = view(rand(100,100), 1:100, 1:100); b = view(similar(a), axes(a)...); julia> @Btime copyto!($b, $a); 16.427 μs (0 allocations: 0 bytes) # master 2.308 μs (0 allocations: 0 bytes) # PR ``` Improves (but doesn't resolve) JuliaLang#40962 and JuliaLang#53158 ```julia julia> a = rand(40,40); b = rand(40,40); julia> @Btime $a[1:end,1:end] .= $b; 5.383 μs (0 allocations: 0 bytes) # v"1.12.0-DEV.16" 3.194 μs (0 allocations: 0 bytes) # PR ``` ƒ Co-authored-by: Jameson Nash <vtjnash@gmail.com>
mkitti
pushed a commit
to mkitti/julia
that referenced
this issue
Mar 7, 2024
…liaLang#53383) With this, the following (and equivalent calls) work: ```julia julia> copyto!(view(zeros(BigInt, 2), 1:2), Vector{BigInt}(undef,2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef julia> copyto!(view(zeros(BigInt, 2), 1:2), view(Vector{BigInt}(undef,2), 1:2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef ``` Close JuliaLang#53098. With this, all the `_unsetindex!` branches in `copyto_unaliased!` work for `Array`-views, and this makes certain indexing operations vectorize and speed-up: ```julia julia> using BenchmarkTools julia> a = view(rand(100,100), 1:100, 1:100); b = view(similar(a), axes(a)...); julia> @Btime copyto!($b, $a); 16.427 μs (0 allocations: 0 bytes) # master 2.308 μs (0 allocations: 0 bytes) # PR ``` Improves (but doesn't resolve) JuliaLang#40962 and JuliaLang#53158 ```julia julia> a = rand(40,40); b = rand(40,40); julia> @Btime $a[1:end,1:end] .= $b; 5.383 μs (0 allocations: 0 bytes) # v"1.12.0-DEV.16" 3.194 μs (0 allocations: 0 bytes) # PR ``` ƒ Co-authored-by: Jameson Nash <vtjnash@gmail.com>
KristofferC
pushed a commit
that referenced
this issue
Mar 27, 2024
…3383) With this, the following (and equivalent calls) work: ```julia julia> copyto!(view(zeros(BigInt, 2), 1:2), Vector{BigInt}(undef,2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef julia> copyto!(view(zeros(BigInt, 2), 1:2), view(Vector{BigInt}(undef,2), 1:2)) 2-element view(::Vector{BigInt}, 1:2) with eltype BigInt: #undef #undef ``` Close #53098. With this, all the `_unsetindex!` branches in `copyto_unaliased!` work for `Array`-views, and this makes certain indexing operations vectorize and speed-up: ```julia julia> using BenchmarkTools julia> a = view(rand(100,100), 1:100, 1:100); b = view(similar(a), axes(a)...); julia> @Btime copyto!($b, $a); 16.427 μs (0 allocations: 0 bytes) # master 2.308 μs (0 allocations: 0 bytes) # PR ``` Improves (but doesn't resolve) #40962 and #53158 ```julia julia> a = rand(40,40); b = rand(40,40); julia> @Btime $a[1:end,1:end] .= $b; 5.383 μs (0 allocations: 0 bytes) # v"1.12.0-DEV.16" 3.194 μs (0 allocations: 0 bytes) # PR ``` ƒ Co-authored-by: Jameson Nash <vtjnash@gmail.com> (cherry picked from commit 1a90409)
This seems to have regressed on the current nightly ( julia> a = zeros(40000,4000); b = rand(size(a)...);
julia> @benchmark $a[1:end, 1:end] .= $b
BenchmarkTools.Trial: 16 samples with 1 evaluation.
Range (min … max): 311.599 ms … 332.538 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 313.798 ms ┊ GC (median): 0.00%
Time (mean ± σ): 315.770 ms ± 5.354 ms ┊ GC (mean ± σ): 0.00% ± 0.00%
▁▁█▁▁▁██ ▁ ▁ ▁ ▁ ▁
████████▁▁▁█▁▁▁▁▁▁▁▁▁█▁█▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
312 ms Histogram: frequency by time 333 ms <
Memory estimate: 0 bytes, allocs estimate: 0. vs on nightly: julia> @benchmark $a[1:end, 1:end] .= $b
BenchmarkTools.Trial: 12 samples with 1 evaluation.
Range (min … max): 448.373 ms … 452.969 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 450.255 ms ┊ GC (median): 0.00%
Time (mean ± σ): 450.305 ms ± 1.671 ms ┊ GC (mean ± σ): 0.00% ± 0.00%
█ ██ ██ █ █ █ █ █ █ █
█▁██▁██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁█▁▁▁▁▁▁█▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁█▁▁▁█▁▁▁▁▁█ ▁
448 ms Histogram: frequency by time 453 ms <
Memory estimate: 0 bytes, allocs estimate: 0.
julia> VERSION
v"1.12.0-DEV.528" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
domain:arrays
[a, r, r, a, y, s]
kind:regression
Regression in behavior compared to a previous version
performance
Must go faster
regression 1.11
On v1.10.0
vs on v"1.11.0-DEV.1442" as well as the current master (d54a455)
versioninfo:
Curiously, profiling points to integer comparison checks while iterating over
CartesianIndices
to be the most expensive step:The text was updated successfully, but these errors were encountered: