-
-
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
[LateGCLowering] Fix skipped Select lifting #35387
Conversation
I checked out this PR, and still get frequent hangs. @tkf , can you try? |
There may be more than one issue. I'll take rr traces to debug ;). |
I've been running four instances of @chriselrod Thanks a lot for verifying the original problem. I guess the next step is to apply this PR to pre-#32599 code and then check if the hang or segfault happens. If not, we then know some parts of #32599 introduced the problem... I'll try it later. |
Because you seem already set up, I'm hoping it'd not be too much trouble for you to run another example. Here is some code that seems to reproduce the problem fairly reliably on my machine, without dependencies outside base or the standard library, other than using Base.Threads: @spawn, @sync, nthreads
using LinearAlgebra, BenchmarkTools
function tproduct_fm(x)
@fastmath begin
X3 = cbrt.(x)
X9 = cbrt.(X3).^2
end
lx = length(x)
H = Matrix{eltype(x)}(undef, lx, lx)
@sync for x_index_chunk in Iterators.partition(eachindex(x), lx ÷ 2nthreads())
@spawn begin
for i ∈ x_index_chunk
x3 = X3[i]
x9 = X9[i]
js = firstindex(x):i
@fastmath for j in js
A = x3 + X3[j]
B = x3 * X3[j]
C = x9 + X9[j]
f = A^2 * C
g = -(B*A)
H[j, i] = f * g
end
end
end
end
return Symmetric(H)
end
x = rand(1000);
@benchmark tproduct_fm($x) Hopefully all the issues will get fixed soon, now that the two of you seem well set up to find them. tkf, what does it take to get everything set up to create the rr traces? |
@Keno According to #35341 (comment), this bug is due to #33389 which seems to be included in 1.4 release. Does it make sense to backport this to 1.4? |
yes |
@Keno I have a few questions:
@chriselrod If the answer to the last two questions are no, I think you can just install Also, if @Keno needs |
Either is fine.
Whatever reproduces the bug is fine.
Yes, please. I'll have an updated rr jll shortly, which will simply the installation. |
Wow. I didn't know that I can install rr via jll. This is great. |
Fixes #35341. This function was skipping the lift of the select if one of the bases was null. In this situation, the caller would assign it Number -1, which means globally rooted and is obviously wrong here. I'm not entirely sure why that code was added, but perhaps @vtjnash could comment what the intention was and perhaps we can maintain whatever optimization that was intended to perform (even if in practice all it did was prevent rooting of
select
results).