Valentin Churavy
Valentin Churavy
Can you post the full log as a Gist?
``` julia> jac = Enzyme.jacobian(Forward, F, z, Val(1)) ([0.0, 0.0, 0.9309410649689392, 0.19161192949503747, 1.395478078742109, 0.0, 0.0, 0.14002672400024546, 0.14227937225880918, 0.18290817583778968, 0.3712755068969665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.08431178356516157, 0.40517985161797276, 0.4412912824781923], [0.0, 0.0,...
Note that what You might want to make your code type-stable. ``` julia> const S = sprand(N, N, 0.1) 10×10 SparseMatrixCSC{Float64, Int64} with 10 stored entries: ⋅ 0.864191 ⋅ ⋅...
In particular the type-stable variant: ``` julia> @btime Enzyme.jacobian(Forward, F, z) 2.236 μs (59 allocations: 8.86 KiB) ``` Versus your variant: ``` julia> @btime Enzyme.jacobian(Forward, F, z, Val(1)) 115.640 μs...
``` julia> @btime Enzyme.jacobian(Forward, F, z, Val(1)) 3.336 μs (105 allocations: 14.78 KiB) julia> @btime Enzyme.jacobian(Forward, F, z) 2.212 μs (59 allocations: 8.86 KiB) ```
That might be cc: @wsmoses
> I'm not as well versed in how Julia implements indirect function calls, but differentiating the call to cl.fn may require special care to ensure the bitcode is available There...
> If I have an enum is this accessible to you, or should just have them be ints. Enum is fine, we just have to keep the defs in sync....
Yeah which would also allow us to get rid of the custom handling of Julia's tbaa.
> custom Type Analysis rule Not sure what form that would take, but keep in mind that you can call Julia from C and as such Enzyme.jl could provide arbitrary...