Enzyme.jl icon indicating copy to clipboard operation
Enzyme.jl copied to clipboard

LAPACK Support (dtrtrs_64_)

Open enigne opened this issue 3 years ago • 3 comments

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))

enigne avatar Mar 02 '22 14:03 enigne

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.

luciano-drozda avatar Mar 03 '22 21:03 luciano-drozda

This is now an absence of lapack support.

However, julia no longer crashes.

wsmoses avatar Aug 06 '22 17:08 wsmoses

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)

wsmoses avatar Aug 09 '23 00:08 wsmoses