EnzymeAD / Enzyme.jl

Julia bindings for the Enzyme automatic differentiator
https://enzyme.mit.edu
MIT License
461 stars 66 forks source link

Failure for autojacvec=EnzymeVJP() for ODEProblem #1617

Closed m-bossart closed 2 months ago

m-bossart commented 5 months ago

I'm getting the following error when using EnzymeVJP() option for the sensitivity of an ODEProblem. I've isolated the error to an Enzyme autodiff call per the instructions here: https://docs.sciml.ai/SciMLSensitivity/stable/faq/

ERROR: MethodError: no method matching asprogress(::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64)

Closest candidates are:
  asprogress(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any; progress, kwargs...) (method too new to be called from this world context.)
   @ ProgressLogging C:\Users\Matt Bossart\.julia\packages\ProgressLogging\6KXlp\src\ProgressLogging.jl:156
  asprogress(::Any, ::ProgressLogging.ProgressString, ::Any...; _...) (method too new to be called from this world context.)
   @ ProgressLogging C:\Users\Matt Bossart\.julia\packages\ProgressLogging\6KXlp\src\ProgressLogging.jl:200
  asprogress(::Any, ::ProgressLogging.Progress, ::Any...; _...) (method too new to be called from this world context.)
   @ ProgressLogging C:\Users\Matt Bossart\.julia\packages\ProgressLogging\6KXlp\src\ProgressLogging.jl:155

Stacktrace:
  [1] (::VSCodeServer.var"#62#63"{@Kwargs{}, VSCodeServer.var"#57#58", Tuple{…}, Module})()
    @ VSCodeServer c:\Users\Matt Bossart\.vscode\extensions\julialang.language-julia-1.83.2\scripts\packages\VSCodeServer\src\progress.jl:73
  [2] #invokelatest#2
    @ .\essentials.jl:892 [inlined]
  [3] invokelatest
    @ .\essentials.jl:889 [inlined]
  [4] #try_process_progress#61
    @ c:\Users\Matt Bossart\.vscode\extensions\julialang.language-julia-1.83.2\scripts\packages\VSCodeServer\src\progress.jl:72 [inlined]
  [5] try_process_progress
    @ c:\Users\Matt Bossart\.vscode\extensions\julialang.language-julia-1.83.2\scripts\packages\VSCodeServer\src\progress.jl:68 [inlined]
  [6] handle_message(j::VSCodeServer.VSCodeLogger, level::Base.CoreLogging.LogLevel, message::String, _module::Module, group::Symbol,
 id::Symbol, file::String, line::Int64; kwargs::@Kwargs{})
    @ VSCodeServer c:\Users\Matt Bossart\.vscode\extensions\julialang.language-julia-1.83.2\scripts\packages\VSCodeServer\src\progress.jl:9
  [7]
    @ VSCodeServer c:\Users\Matt Bossart\.vscode\extensions\julialang.language-julia-1.83.2\scripts\packages\VSCodeServer\src\progress.jl:7
  [8] #invokelatest#2
    @ .\essentials.jl:892 [inlined]
  [9] invokelatest
    @ .\essentials.jl:889 [inlined]
 [10] macro expansion
    @ .\logging.jl:377 [inlined]
 [11] macro expansion
    @ C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\utils.jl:67 [inlined]
 [12] codegen(output::Symbol, job::GPUCompiler.CompilerJob{…}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, toplevel::Bool, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
    @ Enzyme.Compiler C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:5249
 [13] codegen
    @ C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:5132 [inlined]
 [14] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, postopt::Bool)        
    @ Enzyme.Compiler C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6661
 [15] _thunk
    @ C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6661 [inlined]
 [16] cached_compilation
    @ C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6699 [inlined]
 [17] (::Enzyme.Compiler.var"#28593#28594"{…})(ctx::LLVM.Context)
    @ Enzyme.Compiler C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6768
 [18] JuliaContext(f::Enzyme.Compiler.var"#28593#28594"{…}; kwargs::@Kwargs{})
    @ GPUCompiler C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:52
 [19] JuliaContext(f::Function)
    @ GPUCompiler C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:42
 [20] #s2010#28592
    @ C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6719 [inlined]
 [21]
    @ Enzyme.Compiler .\none:0
 [22] (::Core.GeneratedFunctionStub)(::UInt64, ::LineNumberNode, ::Any, ::Vararg{Any})
    @ Core .\boot.jl:602
 [23] runtime_generic_augfwd(activity::Type{…}, width::Val{…}, ModifiedBetween::Val{…}, RT::Val{…}, f::typeof(*), df::Nothing, primal_1::Matrix{…}, shadow_1_1::Matrix{…}, primal_2::Vector{…}, shadow_2_1::Vector{…})
    @ Enzyme.Compiler C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\rules\jitrules.jl:307
Some type information was truncated. Use `show(err)` to see complete types.

The example below should reproduce the error. I only get the error when using the ODEProblem that comes from the application specific code. I can work to minimize further if needed.

using Pkg
Pkg.activate(".")
Pkg.add(url="https://github.com/EnzymeAD/Enzyme.jl", rev="isdefabs")   
Pkg.add(url="https://github.com/NREL-Sienna/PowerSimulationsDynamics.jl", rev="mb/differentiable") 
Pkg.add("OrdinaryDiffEq")
Pkg.add("PowerSystemCaseBuilder")
Pkg.add("PowerSystems")
Pkg.add("SciMLSensitivity")

using Enzyme
using Zygote
using OrdinaryDiffEq, PowerSimulationsDynamics, PowerSystemCaseBuilder, PowerSystems, SciMLSensitivity, SciMLBase

#VERY SIMPLE ODEProblem 
odef(du, u, p, t) = du .= u .* p
prob = ODEProblem(odef, [2.0], (0.0, 1.0), [3.0])

#ISOLATE TO ENZYME INTERNAL CALL (works)
u0 = prob.u0
p = prob.p
tmp2 = Enzyme.make_zero(p)
t = prob.tspan[1]
du = zero(u0)
_f = prob.f
_tmp6 = Enzyme.make_zero(_f)
tmp3 = zero(u0)
tmp4 = zero(u0)
ytmp = zero(u0)
tmp1 = zero(u0)

Enzyme.autodiff(Enzyme.Reverse, Enzyme.Duplicated(_f, _tmp6),
    Enzyme.Const, Enzyme.Duplicated(tmp3, tmp4),
    Enzyme.Duplicated(ytmp, tmp1),
    Enzyme.Duplicated(p, tmp2),
    Enzyme.Const(t))

#Get application specific ODEProblem 
sys = build_system(PSIDTestSystems, "psid_test_omib")
sim = Simulation!(
    MassMatrixModel,
    sys,
    pwd(),
    (0.0, 0.4), 
)
prob_old = sim.problem
f_old = prob_old.f
f_new = SciMLBase.ODEFunction{true}(
    f_old.f;
    mass_matrix = f_old.mass_matrix,
)
prob = ODEProblem{true}(f_new, prob_old.u0, (0.0,0.2), prob_old.p)

#ISOLATE TO ENZYME INTERNAL CALL (fails)
u0 = prob.u0
p = prob.p
tmp2 = Enzyme.make_zero(p)
t = prob.tspan[1]
du = zero(u0)
_f = prob.f
_tmp6 = Enzyme.make_zero(_f)
tmp3 = zero(u0)
tmp4 = zero(u0)
ytmp = zero(u0)
tmp1 = zero(u0)

#Fails
Enzyme.autodiff(Enzyme.Reverse, Enzyme.Duplicated(_f, _tmp6),
    Enzyme.Const, Enzyme.Duplicated(tmp3, tmp4),
    Enzyme.Duplicated(ytmp, tmp1),
    Enzyme.Duplicated(p, tmp2),
    Enzyme.Const(t))

Environment details:

  [bcd4f6db] DelayDiffEq v5.47.3
  [7da242da] Enzyme v0.12.21 `https://github.com/EnzymeAD/Enzyme.jl#isdefabs`
  [1dea7af3] OrdinaryDiffEq v6.85.0
  [398b2ede] PowerSimulationsDynamics v0.14.2 `https://github.com/NREL-Sienna/PowerSimulationsDynamics.jl#mb/differentiable`
⌃ [f00506e0] PowerSystemCaseBuilder v1.2.5
⌅ [bcd98974] PowerSystems v3.3.0
  [37e2e3b7] ReverseDiff v1.15.3
  [0bca4576] SciMLBase v2.42.0
⌃ [1ed8b502] SciMLSensitivity v7.62.0
  [9f7883ad] Tracker v0.2.34
  [e88e6eb3] Zygote v0.6.70
wsmoses commented 5 months ago

Can you narrow this down further to a simpler MWE?

m-bossart commented 4 months ago

Ok I've narrowed it to remove the application specific packages built on top of the differential equation ecosystem. The problem is related to the order in which ProgressLoggingand Enzymeare loaded (the failure only happens when ProgressLoggingis loaded after Enzyme).

#This order works:
using ProgressLogging
using Enzyme
#This order fails:
#using Enzyme
#using ProgressLogging

using OrdinaryDiffEq
using ComponentArrays
using LinearAlgebra
function dq_ri(δ::T) where {T <: Number}
    return T[
        sin(δ) cos(δ)
        -cos(δ) sin(δ)
    ]
end
function ri_dq(δ::T) where {T <: Number}
    return T[
        sin(δ) -cos(δ)
        cos(δ) sin(δ)
    ]
end
function f!(dx, x, p, t)
    vr_1, vr_2, vi_1, vi_2, ir_1_2, ii_1_2,  δ, ω = x
    L = p[:BUS1BUS2][:params][:L]
    R = p[:BUS1BUS2][:params][:R]
    c_1 = p[:BUS1BUS2][:params][:c_1]
    c_2 = p[:BUS1BUS2][:params][:c_2]
    R_th = p[:InfBus][:params][:R_th]
    X_th = p[:InfBus][:params][:X_th]
    vm_internal = p[:InfBus][:refs][:V_ref]
    θ_internal = p[:InfBus][:refs][:θ_ref]
    R_gen = p[:generator_102_1][:params][:Machine][:R]
    Xd_p = p[:generator_102_1][:params][:Machine][:Xd_p]
    eq_p = p[:generator_102_1][:params][:Machine][:eq_p]
    Sbase = p[:generator_102_1][:params][:Sbase]
    H = p[:generator_102_1][:params][:Shaft][:H]
    D = p[:generator_102_1][:params][:Shaft][:D]
    τm = p[:generator_102_1][:refs][:P_ref]
    ω_sys = 1.0 
    ω_b = 60 * 2 * pi
    basepower = 100.0

    V_R_internal = vm_internal * cos(θ_internal)
    V_I_internal = vm_internal * sin(θ_internal)
    Zmag = R_th^2 + X_th^2
    i_r_source = R_th * (V_R_internal - vr_1) / Zmag + X_th * (V_I_internal - vi_1) / Zmag
    i_i_source = R_th * (V_I_internal - vi_1) / Zmag - X_th * (V_R_internal - vr_1) / Zmag
    i_ri_source = [i_r_source; i_i_source]

    #Generator Model
    V_dq = ri_dq(δ) * [vr_2; vi_2]
    i_d = (1.0 / (R_gen^2 + Xd_p^2)) * (Xd_p * (eq_p - V_dq[2]) - R_gen * V_dq[1])  #15.36
    i_q = (1.0 / (R_gen^2 + Xd_p^2)) * (Xd_p * V_dq[1] + R_gen * (eq_p - V_dq[2]))  #15.36
    Pe = (V_dq[1] + R_gen * i_d) * i_d + (V_dq[2] + R_gen * i_q) * i_q
    τe = Pe
    i_ri_gen = (basepower / Sbase) * dq_ri(δ) * [i_d; i_q]

    #Bus models (voltages); time constants in Mass Matrix; for bus currents, positive is going into bus.  
    ir_1 = -ir_1_2 + i_ri_source[1]  
    ii_1 = -ii_1_2 + i_ri_source[2]  
    ir_2 =  ir_1_2 + i_ri_gen[1]  
    ii_2 =  ii_1_2 + i_ri_gen[2] 

    dx[1] = (ir_1 + vi_1 * c_1)
    dx[3] = (ii_1 - vr_1 * c_1)
    dx[2] = (ir_2 + vi_2 * c_2)
    dx[4] = (ii_2 - vr_2 * c_2)
    dx[5] = (ω_b / L) * ((vr_1 - vr_2) - (R * ir_1_2 - L * ii_1_2))
    dx[6] = (ω_b / L) * ((vi_1 - vi_2) - (R * ii_1_2 + L * ir_1_2))
    dx[7] = 2 * π * 60 * (ω - ω_sys)     #15.5        
    dx[8] = (1 / (2 * H)) * (τm - τe - D * (ω - 1.0) / ω)    #15.5
    return
end
p = ComponentVector{Float64}(
    BUS1BUS2 = (
        params = (L = 0.1, R = 0.0, c_1 = 0.0, c_2 = 0.0), 
        refs = Float64[]
    ), 
    InfBus = (
        params = (R_th = 0.0, X_th = 5.0e-6),
        refs = (V_ref = 1.0500005545402755, θ_ref = -2.267572498565851e-6)
    ),
    generator_102_1 = (
        params = (Machine = (R = 0.0, Xd_p = 0.5, eq_p = 1.0241178412217837), Shaft = (H = 2.0, D = 2.0), Sbase = 100.0), 
        refs = (;P_ref = 1.0)
    )
)
M = Diagonal(vcat(zeros(4), ones(4)))
x0 = [
    1.0499999999999878
    1.0389092482347253
    2.690377732797622e-20
    0.047619047619048165
    -0.47619047619048166
    -0.11090751765262562
    0.28273776304747733
    1.0
] 
f_ode = ODEFunction{true}(f!; mass_matrix = M)   
prob = ODEProblem{true}(f_ode, x0, (0.0, 5.0), p)

u0 = prob.u0
p = prob.p
tmp2 = Enzyme.make_zero(p)
t = prob.tspan[1]
du = zero(u0)
_f = prob.f
_tmp6 = Enzyme.make_zero(_f)
tmp3 = zero(u0)
tmp4 = zero(u0)
ytmp = zero(u0)
tmp1 = zero(u0)

Enzyme.autodiff(Enzyme.Reverse, Enzyme.Duplicated(_f, _tmp6),
    Enzyme.Const, Enzyme.Duplicated(tmp3, tmp4),
    Enzyme.Duplicated(ytmp, tmp1),
    Enzyme.Duplicated(p, tmp2),
    Enzyme.Const(t))
m-bossart commented 4 months ago

Unfortunately when I load Enzyme last in the original MWE, Julia crashes with the following:

GC error (probable corruption)
Allocations: 247118948 (Pool: 246816324; Big: 302624); GC: 160

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ff8c5ad04c8 -- jl_static_is_function_ at C:/workdir/src\rtutils.c:696 [inlined]
jl_static_show_x_ at C:/workdir/src\rtutils.c:1113
in expression starting at c:\Users\Matt Bossart\OneDrive - UCB-O365\Desktop\temp_for_mwe\mwe_aug_forward\mwe_enzymevjp.jl:69
jl_static_is_function_ at C:/workdir/src\rtutils.c:696 [inlined]
jl_static_show_x_ at C:/workdir/src\rtutils.c:1113
jl_static_show_next_ at C:/workdir/src\rtutils.c:1262
jl_static_show_x at C:/workdir/src\rtutils.c:1207 [inlined]
ijl_static_show at C:/workdir/src\rtutils.c:1268 [inlined]
jl_ at C:/workdir/src\rtutils.c:1358
gc_dump_queue_and_abort at C:/workdir/src\gc.c:1808
gc_mark_outrefs at C:/workdir/src\gc.c:2528 [inlined]
gc_mark_loop_serial_ at C:/workdir/src\gc.c:2697
gc_mark_loop_serial at C:/workdir/src\gc.c:2720
gc_mark_loop at C:/workdir/src\gc.c:2901 [inlined]
_jl_gc_collect at C:/workdir/src\gc.c:3234
ijl_gc_collect at C:/workdir/src\gc.c:3531
maybe_collect at C:/workdir/src\gc.c:937 [inlined]
jl_gc_pool_alloc_inner at C:/workdir/src\gc.c:1300
jl_gc_pool_alloc_noinline at C:/workdir/src\gc.c:1357 [inlined]
jl_gc_alloc_ at C:/workdir/src\julia_internal.h:476 [inlined]
jl_gc_alloc at C:/workdir/src\gc.c:3583
_new_array_ at C:/workdir/src\array.c:134
_new_array at C:/workdir/src\array.c:198 [inlined]
ijl_alloc_array_1d at C:/workdir/src\array.c:436
Array at .\boot.jl:477 [inlined]
Array at .\boot.jl:486 [inlined]
similar at .\abstractarray.jl:877 [inlined]
similar at .\abstractarray.jl:876 [inlined]
_array_for at .\array.jl:723 [inlined]
_array_for at .\array.jl:726 [inlined]
InferenceState at .\compiler\inferencestate.jl:270
InferenceState at .\compiler\inferencestate.jl:433
const_prop_call at .\compiler\abstractinterpretation.jl:1201
abstract_call_method_with_const_args at .\compiler\abstractinterpretation.jl:818
abstract_call_method_with_const_args at .\compiler\abstractinterpretation.jl:788
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:103
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
unknown function (ip: 000001e50bed2fb3)
unknown function (ip: 000001e527908d4d)
unknown function (ip: 000001e527908cc2)
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2889
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:219
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
unknown function (ip: 000001e50bed2fb3)
unknown function (ip: 000001e527908d4d)
unknown function (ip: 000001e527908cc2)
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:219
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
unknown function (ip: 000001e50bed2fb3)
unknown function (ip: 000001e527908d4d)
unknown function (ip: 000001e527908cc2)
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:219
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
unknown function (ip: 000001e50bed2fb3)
unknown function (ip: 000001e527908d4d)
unknown function (ip: 000001e527908cc2)
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:219
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
unknown function (ip: 000001e50bed2fb3)
unknown function (ip: 000001e527908d4d)
unknown function (ip: 000001e527908cc2)
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:219
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
unknown function (ip: 000001e50bed2fb3)
unknown function (ip: 000001e527908d4d)
unknown function (ip: 000001e527908cc2)
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:219
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
unknown function (ip: 000001e50bed2fb3)
unknown function (ip: 000001e527908d4d)
unknown function (ip: 000001e527908cc2)
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:219 [inlined]
typeinf_ext at .\compiler\typeinfer.jl:1051
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1082
ci_cache_populate at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\jlgen.jl:523
compile_method_instance at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\jlgen.jl:599
macro expansion at C:\Users\Matt Bossart\.julia\packages\TimerOutputs\Lw5SP\src\TimerOutput.jl:253 [inlined]
irgen at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\irgen.jl:4
macro expansion at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:208 [inlined]
macro expansion at C:\Users\Matt Bossart\.julia\packages\TimerOutputs\Lw5SP\src\TimerOutput.jl:253 [inlined]
macro expansion at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:207 [inlined]
#emit_llvm#158 at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\utils.jl:103
emit_llvm at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\utils.jl:97 [inlined]
#codegen#156 at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:136
codegen at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:115 [inlined]
#codegen#28546 at C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:5164
codegen at C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:5132 [inlined]
_thunk at C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6661
_thunk at C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6661 [inlined]
cached_compilation at C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6699 [inlined]
#28593 at C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6768
#JuliaContext#154 at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:52
unknown function (ip: 000001e51a8fff6c)
JuliaContext at C:\Users\Matt Bossart\.julia\packages\GPUCompiler\05oYT\src\driver.jl:42
#s2010#28592 at C:\Users\Matt Bossart\.julia\packages\Enzyme\x1vcV\src\compiler.jl:6719 [inlined]
#s2010#28592 at .\none:0
GeneratedFunctionStub at .\boot.jl:602
jl_call_staged at C:/workdir/src\method.c:540
ijl_code_for_staged at C:/workdir/src\method.c:593
get_staged at .\compiler\utilities.jl:123
retrieve_code_info at .\compiler\utilities.jl:135 [inlined]
InferenceState at .\compiler\inferencestate.jl:430
typeinf_edge at .\compiler\typeinfer.jl:920
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:216
typeinf_ext at .\compiler\typeinfer.jl:1051
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1082
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1078
jfptr_typeinf_ext_toplevel_38981.1 at C:\Users\Matt Bossart\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
_jl_invoke at C:/workdir/src\gf.c:2895 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:3077 [inlined]
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_type_infer at C:/workdir/src\gf.c:394
jl_generate_fptr_impl at C:/workdir/src\jitlayers.cpp:504
jl_compile_method_internal at C:/workdir/src\gf.c:2481
jl_compile_method_internal at C:/workdir/src\gf.c:2372 [inlined]
_jl_invoke at C:/workdir/src\gf.c:2887 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:3077
unknown function (ip: 000001e5138637ad)
Allocations: 247118948 (Pool: 246816324; Big: 302624); GC: 160
wsmoses commented 2 months ago

@m-bossart on latest Enzyme and julia 1.10.5, this doesn't err for me. Reopen if it persists?