From 9158744ff39779d0e8c93ad889790d62d375dc41 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 2 Sep 2024 09:16:16 -0400 Subject: [PATCH 1/2] Test master See if it recreates the Enzyme issue in https://github.com/SciML/SciMLBase.jl/actions/runs/10665292019/job/29558360634?pr=779 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2e8298fff..14bd70984 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ For information on using the package, [in-development documentation](https://docs.sciml.ai/LinearSolve/dev/) for the version of the documentation which contains the unreleased features. + ## High Level Examples ```julia From 210f6562214a106ef3823adb61c35647a23d6a9b Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 12 Sep 2024 06:19:59 +0200 Subject: [PATCH 2/2] Set const to avoid type instability issues --- test/enzyme.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/enzyme.jl b/test/enzyme.jl index ac552a45a..fda6a395f 100644 --- a/test/enzyme.jl +++ b/test/enzyme.jl @@ -176,15 +176,16 @@ Enzyme.autodiff(Reverse, f3, Duplicated(copy(A), dA), Duplicated(copy(b1), db1), =# A = rand(n, n); +const _A = rand(n, n); dA = zeros(n, n); -b1 = rand(n); +const _b1 = rand(n); for alg in ( LUFactorization(), RFLUFactorization() # KrylovJL_GMRES(), fails ) @show alg function fb(b) - prob = LinearProblem(A, b) + prob = LinearProblem(_A, b) sol1 = solve(prob, alg) @@ -192,11 +193,11 @@ for alg in ( end fb(b1) - fd_jac = FiniteDiff.finite_difference_jacobian(fb, b1) |> vec + fd_jac = FiniteDiff.finite_difference_jacobian(fb, _b1) |> vec @show fd_jac en_jac = map(onehot(b1)) do db1 - eres = Enzyme.autodiff(Forward, fb, Duplicated(copy(b1), db1)) + eres = Enzyme.autodiff(Forward, fb, Duplicated(copy(_b1), db1)) eres[1] end |> collect @show en_jac