-
-
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
Base.two_mul
is constant folding incorrectly on 1.10 (but not 1.9 or 1.11)
#52079
Comments
What CPU is that? I see timings of around 20ns on my laptop (11th gen Intel). I think there's probably a few ns that could be shaved (roughly 1-2 on my laptop), primarily in our It's also possibly worth noting that |
There is another working example related to this to consider which higlights this issue:
Thir runs in ~220 ms on Julia 1.7.3, ~900 ms on Julia 1.9.x and ~2000 ms on Julia 1.10.x so there is a factor of few slow-down compared to the older version. |
damn am I using fake Intel?
|
What Julia version are you testing on? |
|
Ok something is actually very wrong here. 1.10 is 2x slower than 1.9 or nightly and I have no idea why. |
well, at least 1.7 was equally slow (do we have benchmark tests we can add to?) |
On my computer (Apple M1 Max), I find that 1.9 is faster than 1.8 or nightly. Note also that there is a special-case optimization for On Julia 1.8: julia> @btime x^y setup=begin x=rand(); y=rand(); end;
15.698 ns (0 allocations: 0 bytes)
julia> @btime $(Ref(1.2))[]^$(Ref(3.4))[];
15.782 ns (0 allocations: 0 bytes)
julia> @btime $(Ref(1.2))[]^$(Ref(3.0))[];
3.958 ns (0 allocations: 0 bytes) On Julia 1.9 (fastest): julia> @btime $(Ref(1.2))[]^$(Ref(3.4))[];
11.637 ns (0 allocations: 0 bytes)
julia> @btime $(Ref(1.2))[]^$(Ref(3.0))[];
3.916 ns (0 allocations: 0 bytes) On nightly (1.11.0-DEV.860): julia> @btime $(Ref(1.2))[]^$(Ref(3.4))[];
14.863 ns (0 allocations: 0 bytes)
julia> @btime $(Ref(1.2))[]^$(Ref(3.0))[];
5.167 ns (0 allocations: 0 bytes) |
Some discussion here as well https://discourse.julialang.org/t/exponentiation-of-floats/105951/22, seems to be some sort of weird bug. |
Base.two_mul
is constant folding incorrectly on 1.10 (but not 1.9 or 1.11)
The MWE is (on 1.10)
|
The big regression happened in 0f5f62c @vchuravy @pchintalapudi |
So it's some kind of race condition associated with parallel image generation? That would explain why simply recompiling |
I'm not sure if it's a race condition or just a plain bug. |
What kind of bug though, like it seems to be fixed by recompile the exact same function? |
A bug in our multiversioning code. |
If this is also fixed on 1.11 can we bisect forward to find the fix? |
So this got bisected to 0f5f62c @pchintalapudi and @vchuravy |
So after struggling with this for a long while it seems there were two different issues. The first one we lacked coverage over, but the other was a very subtle issue when we sorted the fptrs. ~I still need to add test that does multiversioning where we call between multiversioned functions~ Fixes #52079
So after struggling with this for a long while it seems there were two different issues. The first one we lacked coverage over, but the other was a very subtle issue when we sorted the fptrs. ~I still need to add test that does multiversioning where we call between multiversioned functions~ Fixes #52079 (cherry picked from commit a386cd1)
So after struggling with this for a long while it seems there were two different issues. The first one we lacked coverage over, but the other was a very subtle issue when we sorted the fptrs. ~I still need to add test that does multiversioning where we call between multiversioned functions~ Fixes #52079 (cherry picked from commit a386cd1)
…g#52194) So after struggling with this for a long while it seems there were two different issues. The first one we lacked coverage over, but the other was a very subtle issue when we sorted the fptrs. ~I still need to add test that does multiversioning where we call between multiversioned functions~ Fixes JuliaLang#52079
It's useful for something: https://cds.cern.ch/record/2866130/files/ANA-EXOT-2022-18-PAPER.pdf#page=9
(this is a fitting, so you want this exponential to be very fast)
Maybe we're hitting the physical limit of how fast this can go?
The text was updated successfully, but these errors were encountered: