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
copyto!
does not vectorize for views with UnitRange
indices
#53430
Labels
domain:arrays
[a, r, r, a, y, s]
kind:regression
Regression in behavior compared to a previous version
performance
Must go faster
Comments
This also appears to be a regression from v1.10.1, where both the operations are equally performant: julia> a = rand(100,100); b = similar(a); av = view(a, axes(a)...); bv = view(b, axes(b)...); bv2 = view(b, UnitRange.(axes(b))...);
julia> @btime copyto!($bv, $av);
9.646 μs (0 allocations: 0 bytes)
julia> @btime copyto!($bv2, $av);
9.560 μs (0 allocations: 0 bytes)
julia> versioninfo()
Julia Version 1.10.1
Commit 7790d6f0641 (2024-02-13 20:41 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
LD_LIBRARY_PATH = :/usr/lib/x86_64-linux-gnu/gtk-3.0/modules
JULIA_EDITOR = subl |
jishnub
added
the
kind:regression
Regression in behavior compared to a previous version
label
Feb 22, 2024
Bisected the regression to #51760
On df39cee, julia> a = rand(100,100); b = similar(a); av = view(a, axes(a)...); bv2 = view(b, UnitRange.(axes(b))...);
julia> @btime copyto!($bv2, $av);
2.428 μs (0 allocations: 0 bytes) whereas on f0a28e9: julia> @btime copyto!($bv2, $av);
20.690 μs (0 allocations: 0 bytes) |
jishnub
changed the title
Feb 26, 2024
setindex!
does not vectorize for views with UnitRange
indicescopyto!
does not vectorize for views with UnitRange
indices
KristofferC
added a commit
that referenced
this issue
May 13, 2024
This reverts commit f0a28e9. This introduced in general a try catch inside the inner loop for `copyto!` and it also has performance regression in other cases #53430. Since this was added without any tests and "is not-quite-public API" it seems easiest to just revert it. This was added for Memory-to-Array and vice versa but dedicated methods could be added for that if it is desirable Fixes #53430, #52070
Even with the revert of #51760 there still seem to be some slowdown: 1.10:
1.11:
But I am not sure it is bad enough to require a milestone... |
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
This performance difference appears to arise from a lack of vectorization in indexing. In the first case, the output of
contains
whereas
contains
In particular, if I add a
@simd
declaration, this appears to improve performance considerably:Versioninfo:
The text was updated successfully, but these errors were encountered: