dfdx / Yota.jl

Reverse-mode automatic differentiation in Julia
MIT License
158 stars 12 forks source link

Error "could not load symbol jl_typeinf_begin" when differentiating simple function in Julia 1.9.0 #136

Closed ngiann closed 1 year ago

ngiann commented 1 year ago

Sorry to bother, it looks like it could be a configuration issue on my own machine, but I am so buffled that I decided to post it here just in case it is something more general.

In a clean environment, under Julia 1.9.0, I install Yota via the package manager. I then type:

using Yota
f = x -> sum(x.^2)
grad(f,[1.0;1.0])

and get the following error:

ERROR: could not load symbol "jl_typeinf_begin":
/home/nikos/julia-1.9.0/bin/julia: undefined symbol: jl_typeinf_begin
Stacktrace:
  [1] typeinf_lock
    @ ~/.julia/packages/CompilerPluginTools/JC03S/src/typeinf.jl:15 [inlined]
  [2] #code_ircode_by_mi#141
    @ ~/.julia/packages/CompilerPluginTools/JC03S/src/ircode.jl:49 [inlined]
  [3] code_ircode_by_mi
    @ ~/.julia/packages/CompilerPluginTools/JC03S/src/ircode.jl:48 [inlined]
  [4] (::CompilerPluginTools.var"#134#135"{UInt64, Core.Compiler.NativeInterpreter, typeof(CompilerPluginTools.no_pass)})(data::Core.MethodMatch)
    @ CompilerPluginTools ~/.julia/packages/CompilerPluginTools/JC03S/src/ircode.jl:11
  [5] iterate
    @ ./generator.jl:47 [inlined]
  [6] _collect(c::Vector{Any}, itr::Base.Generator{Vector{Any}, CompilerPluginTools.var"#134#135"{UInt64, Core.Compiler.NativeInterpreter, typeof(CompilerPluginTools.no_pass)}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:802
  [7] collect_similar(cont::Vector{Any}, itr::Base.Generator{Vector{Any}, CompilerPluginTools.var"#134#135"{UInt64, Core.Compiler.NativeInterpreter, typeof(CompilerPluginTools.no_pass)}})
    @ Base ./array.jl:711
  [8] map(f::Function, A::Vector{Any})
    @ Base ./abstractarray.jl:3261
  [9] code_ircode_by_signature(pass::Function, sig::Any; world::UInt64, interp::Core.Compiler.NativeInterpreter)
    @ CompilerPluginTools ~/.julia/packages/CompilerPluginTools/JC03S/src/ircode.jl:9
 [10] code_ircode_by_signature(pass::Function, sig::Any)
    @ CompilerPluginTools ~/.julia/packages/CompilerPluginTools/JC03S/src/ircode.jl:8
 [11] getcode(f::Any, argtypes::Any)
    @ Umlaut ~/.julia/packages/Umlaut/e2gNd/src/trace.jl:240
 [12] trace!(t::Umlaut.Tracer, v_fargs::Any)
    @ Umlaut ~/.julia/packages/Umlaut/e2gNd/src/trace.jl:446
 [13] trace(f::Any, args::Any; ctx::Any, deprecated_kws::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
    @ Umlaut ~/.julia/packages/Umlaut/e2gNd/src/trace.jl:575
 [14] gradtape(f::Function, args::Vector{Float64}; ctx::Yota.GradCtx, seed::Int64)
    @ Yota ~/.julia/packages/Yota/G3nBA/src/grad.jl:260
 [15] grad(f::Function, args::Vector{Float64}; seed::Int64)
    @ Yota ~/.julia/packages/Yota/G3nBA/src/grad.jl:356
 [16] grad(f::Function, args::Vector{Float64})
    @ Yota ~/.julia/packages/Yota/G3nBA/src/grad.jl:348
 [17] top-level scope
    @ REPL[6]:1

Thanks in advance.

dfdx commented 1 year ago

Can you manually update Umlaut.jl to the latest version and try again?

dfdx commented 1 year ago

Ok, I see more errors on Julia 1.9. Let me take a closer look at it and come back to you.

dfdx commented 1 year ago

Fixed in version 0.8.3.

ngiann commented 1 year ago

Much appreciated!