Enzyme.jl
Enzyme.jl copied to clipboard
LAPACK Support (dtrtrs_64_)
I'm running this on julia 1.7.1, with a MacOS 12.2.1, it crashes
using Enzyme
function mybackslash!(x, A, b)
x .= A \ b
nothing
end
A = rand(5, 5)
b = rand(5, 1)
x = zeros(5, 1)
∂z_∂x = rand(size(x)...)
∂z_∂A = zero(A)
∂z_∂b = zero(b)
Enzyme.autodiff(mybackslash!, Const, Duplicated(x, ∂z_∂x), Duplicated(A, ∂z_∂A), Duplicated(b, ∂z_∂b))
I think support for BLAS is not yet there. So, for instance, matvec, matmul and algorithms for solving linear systems need to be explicitely coded, just as in the example here.
This is now an absence of lapack support.
However, julia no longer crashes.
If anyone here has cycles to add an EnzymeRule for this or other lapack functions, I'm sure it would be greatly appreciated. (one can look at existing chainrules and the enzyme.jl custom rules docs for inspiration)