Closed bvdmitri closed 1 year ago
The relevant IRTools lines are https://github.com/FluxML/IRTools.jl/blob/v0.4.8/src/reflection/reflection.jl#L49-L50. It seems slightly concerning that _methods_by_ftype
can return nothing all of a sudden? Couldn't coax it to do so on 1.8 or 1.9 by trying to lookup non-existent methods.
Could this be related: https://github.com/JuliaLang/julia/commit/f6e911aad7eaa0e703a20f0481265d339b2a3625 ?
In particular, the commit has the following change:
function _methods_by_ftype(@nospecialize(t), mt::Union{Core.MethodTable, Nothing}, lim::Int, world::UInt, ambig::Bool, min::Ref{UInt}, max::Ref{UInt}, has_ambig::Ref{Int32})
- return ccall(:jl_matching_methods, Any, (Any, Any, Cint, Cint, UInt, Ptr{UInt}, Ptr{UInt}, Ptr{Int32}), t, mt, lim, ambig, world, min, max, has_ambig)::Union{Array{Any,1}, Bool}
+ return ccall(:jl_matching_methods, Any, (Any, Any, Cint, Cint, UInt, Ptr{UInt}, Ptr{UInt}, Ptr{Int32}), t, mt, lim, ambig, world, min, max, has_ambig)::Union{Vector{Any},Nothing}
end
The commit also changes the return result from jl_false
to jl_nothing
in some cases. But I haven't investigated further.
Nice find! Going further up the trace we get to https://github.com/biaslab/ReactiveMP.jl/blob/9d907e9a0449be815043eea3eab9946a54116576/src/approximations/cvi.jl#L125-L126. I wonder if logq
being a function defined in a loop has something to do with this. @aviatesk as the author of the linked commit, would you know why _methods_by_ftype
with limit=-1
would succeed up to 1.9 but fail on 1.10?
see #107
Thanks. I think the bigger issue though is that we're hitting the nothing
/false
case at all. Do you know of any reason why pre-nightly would be able to lookup the method while nightly would fail?
I have the same impression as @ToucheSir . As I commented on the PR length(false) === 1
, so the check length(_methods) == 0
was never receiving false
, otherwise the code would fail two lines below anyway. The bigger issue here is that all of the sudden the code actually gets nothing
/false
FYI: our tests are passing on Julia Version 1.10.0-DEV.651
and we don't have this error in our recent CI action. The fail was on Julia Version 1.10.0-DEV.650
.
I don't know if we are hitting this case. It's possible we saw this error in some nightly version due to changes in method look up.
Well, at least #106 should make meta
more robust and we can consider the immediate issue resolved. I'm going to close this issue for now, but if the behaviour comes back just comment/ping me and we can re-open.
We get consistent failures on GitHub CI with Julia nigthly in our code that uses
Zygote
, which looks like some problem inIRTools
. The error happens in three separate completely unrelated branches with different changes, so we assume our changes did not cause the issue:https://github.com/biaslab/ReactiveMP.jl/actions/runs/4244267646/jobs/7378178164 https://github.com/biaslab/ReactiveMP.jl/actions/runs/4243540900/jobs/7376449987 https://github.com/biaslab/ReactiveMP.jl/actions/runs/4243889962/jobs/7377272496
The start of the error looks like:
Zygote and IRTools versions are:
Tests are failing only on Julia nightly (1.10) and are passing on 1.6, 1.7, and 1.8