-
-
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
Compiler error #34232
Comments
Narrowed down the trigger a bit more: const AbstractScalarOrVec{T} = Union{T,AbstractVector{T}} where {T<:AbstractFloat}
function mh1(
rng::Union{AbstractRNG,AbstractVector{<:AbstractRNG}},
Horiginal::AbstractScalarOrVec{<:T},
Hproposal::AbstractScalarOrVec{<:T},
) where {T<:AbstractFloat}
α = min.(1.0, exp.(Horiginal .- Hproposal))
accept = rand(rng) .< α
return accept, α
end
function mh2(
rng::Union{AbstractRNG,AbstractVector{<:AbstractRNG}},
Horiginal::AbstractScalarOrVec{<:T},
Hproposal::AbstractScalarOrVec{<:T},
) where {T<:AbstractFloat}
α = min(1.0, exp(Horiginal - Hproposal))
accept = rand(rng) < α
return accept, α
end
function mh3(
rng,
Horiginal,
Hproposal,
)
α = min.(1.0, exp.(Horiginal .- Hproposal))
accept = rand(rng) .< α
return accept, α
end
function g(spl)
h = spl.state.h
rng = Random.GLOBAL_RNG
θ = spl.state.z.θ
value, gradient = h.∂ℓπ∂θ(θ)
e1, e2 = value, value
# Doesn't work
is_accept, α = mh1(rng, e1, e2)
# Work
#is_accept, α = mh2(rng, e1, e2)
#is_accept, α = mh3(rng, e1, e2)
is_accept, α
end
g(spl) Using |
What is the result on julia 1.3 (and if you can check, master). |
Seems to be fixed on 1.3 https://travis-ci.com/TuringLang/DynamicPPL.jl/jobs/271769735. |
Actually even 1.2. |
Okay so not sure what is left to do here, we are not making any more 1.1 releases. |
What about 1.0? |
But it seems to pass on 1.0 as well? |
No, it doesn't pass https://travis-ci.com/TuringLang/DynamicPPL.jl/jobs/271780848. |
Ah, I just looked at the build pass status. If the commit that fixed it can be found and backported then it could be included in a new 1.0.x release, yes. |
Restored backport-pending-1.0 label to #31405. This time, we'll just drop the new tests from the backport (#30954 (comment)). |
FYI, this is redundant. |
Cool, thanks! |
Fixed on master (actually on v1.2) |
Hi!
The following code triggers what looks like a compiler bug.
Here is the stacktrace:
and my
versioninfo()
:What seems to be a similar error also happens on other platforms (https://travis-ci.com/TuringLang/DynamicPPL.jl). The error doesn't affect the result of the function though, it just happens once when the function is compiled.
The text was updated successfully, but these errors were encountered: