Understanding an Enzyme Warning Message

When training a UDE with many parameters (>100) I get an Enzyme warning if I do not select the AD algorithm a-priori. This warning appears not once, but several times during the optimization process. While I can obviously set verbose to false to make everything look nice, it would be great to first understand what is going on. Can someone give me an intuition of what this warning means and why it appears n times where n is larger than the number of epochs?

I am working with julia 1.9.2 and Enzyme 0.11.7

β”Œ Warning: EnzymeVJP tried and failed in the automated AD choice algorithm with the following error. (To turn off this printing, add `verbose = false` to the `solve` call)
β”” @ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/zGhCS/src/concrete_solve.jl:23
Enzyme execution failed.
Enzyme: Not yet implemented, mixed activity for jl_new_struct constants=Bool[1]   %6 = call noalias nonnull {} addrspace(10)* ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32)*, {} addrspace(10)*, ...) @julia.call({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32)* noundef nonnull @jl_f_tuple, {} addrspace(10)* noundef null, {} addrspace(10)* %5) #12, !dbg !9
 [1] dynamics!
   @ ./REPL[39]:2

That error indicates that you have a type unstable construction of an object, which contains both type unstable non-differentiated data and type unstable differentiated data.

We specifically do not support that yet, so we throw an error rather than risking an incorrect answer.

On 1.10+ you should get a nicer backtrace showing fully the context of where it’s happening.

Perhaps update that area of the code to be type stable (which regardless would be good for performance too)?

1 Like