JuliaDiff / ForwardDiff.jl

Forward Mode Automatic Differentiation for Julia
Other
891 stars 144 forks source link

Error with bunchkaufman factorization #602

Open juliohm opened 2 years ago

juliohm commented 2 years ago

Is there anything that I can do to help fix https://discourse.julialang.org/t/error-with-bunchkaufman-factorization-in-turing-jl/88174 ?

I don't have experience with the forward-diff functionality. I am a Turing.jl user who encountered this error about the missing method basically.

KristofferC commented 2 years ago

ForwardDiff requires that code is written generically. The Bunchkaufman code only works for normal floating point numbers so that's why it errors.

juliohm commented 2 years ago

Thank you @KristofferC , so the fix should go in LinearAlgebra? Is there any workaround?

KristofferC commented 2 years ago

If you can compute the derivative analytically you can add an overload for baunchkaufman(v::Vector{<:ForwardDiff.Dual}) that returns the correct Dual values but that might require reading a bit of the source code of ForwardDiff.

juliohm commented 2 years ago

Thank you, I will see what I can do. Most likely I will need to work on a short-term alternative with Turing.jl due to some internal deadlines. Perhaps if I change the autodiff backend to Zygote.jl things will work? I will give it a try.