From 68f26a5c51e08e0508272235e5fc448b2c698783 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 13:05:23 +0000 Subject: [PATCH 01/10] Fix test setup --- Project.toml | 2 -- src/common.jl | 28 ++++++++++------------------ test/enzyme/Project.toml | 9 +++++++++ test/{ => enzyme}/enzyme.jl | 0 test/runtests.jl | 8 ++++++-- 5 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 test/enzyme/Project.toml rename test/{ => enzyme}/enzyme.jl (100%) diff --git a/Project.toml b/Project.toml index 11ccd0213..3f1d9e352 100644 --- a/Project.toml +++ b/Project.toml @@ -75,7 +75,6 @@ ChainRulesCore = "1.22" ConcreteStructs = "0.2.3" DocStringExtensions = "0.9.3" EnumX = "1.0.4" -Enzyme = "0.13" EnzymeCore = "0.8.1" FastAlmostBandedMatrices = "0.1" FastLapackInterface = "2" @@ -124,7 +123,6 @@ AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a" Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" BandedMatrices = "aae01518-5342-5314-be14-df237901396f" BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0" -Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e" FastLapackInterface = "29a986be-02c6-4525-aec4-84b980013641" FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" diff --git a/src/common.jl b/src/common.jl index 6c64d7d24..1be103f16 100644 --- a/src/common.jl +++ b/src/common.jl @@ -255,7 +255,6 @@ function SciMLBase.reinit!(cache::LinearCache; b = cache.b, u = cache.u, p = nothing, - reinit_cache = false, reuse_precs = false) (; alg, cacheval, abstol, reltol, maxiters, verbose, assumptions, sensealg) = cache @@ -270,23 +269,16 @@ function SciMLBase.reinit!(cache::LinearCache; p = isnothing(p) ? cache.p : p Pl = cache.Pl Pr = cache.Pr - if reinit_cache - return LinearCache{ - typeof(A), typeof(b), typeof(u), typeof(p), typeof(alg), typeof(cacheval), - typeof(Pl), typeof(Pr), typeof(reltol), typeof(assumptions.issq), - typeof(sensealg)}( - A, b, u, p, alg, cacheval, precsisfresh, isfresh, Pl, Pr, abstol, reltol, - maxiters, verbose, assumptions, sensealg) - else - cache.A = A - cache.b = b - cache.u = u - cache.p = p - cache.Pl = Pl - cache.Pr = Pr - cache.isfresh = true - cache.precsisfresh = precsisfresh - end + + cache.A = A + cache.b = b + cache.u = u + cache.p = p + cache.Pl = Pl + cache.Pr = Pr + cache.isfresh = true + cache.precsisfresh = precsisfresh + nothing end function SciMLBase.solve(prob::LinearProblem, args...; kwargs...) diff --git a/test/enzyme/Project.toml b/test/enzyme/Project.toml new file mode 100644 index 000000000..a8b471e01 --- /dev/null +++ b/test/enzyme/Project.toml @@ -0,0 +1,9 @@ +[deps] +FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" +ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" +Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" +RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" +SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" diff --git a/test/enzyme.jl b/test/enzyme/enzyme.jl similarity index 100% rename from test/enzyme.jl rename to test/enzyme/enzyme.jl diff --git a/test/runtests.jl b/test/runtests.jl index 063090bb3..9275a7174 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,12 +21,16 @@ if GROUP == "All" || GROUP == "Core" @time @safetestset "Static Arrays" include("static_arrays.jl") end -if GROUP == "All" || GROUP == "Enzyme" +# Don't run Enzyme tests on prerelease +if GROUP == "All" || GROUP == "Enzyme" && isempty(VERSION.prerelease) + Pkg.activate("enzyme") + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + Pkg.instantiate() @time @safetestset "Enzyme Derivative Rules" include("enzyme.jl") end if GROUP == "DefaultsLoading" - @time @safetestset "Enzyme Derivative Rules" include("defaults_loading.jl") + @time @safetestset "Defaults Loading Tests" include("defaults_loading.jl") end if GROUP == "LinearSolveCUDA" From 13001c0a3f9271cec50b19c95506c35ddcd43c37 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 13:22:42 +0000 Subject: [PATCH 02/10] a few more fixes --- Project.toml | 2 +- test/default_algs.jl | 33 +++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Project.toml b/Project.toml index 3f1d9e352..d32534f08 100644 --- a/Project.toml +++ b/Project.toml @@ -150,4 +150,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [targets] -test = ["Aqua", "Test", "IterativeSolvers", "InteractiveUtils", "JET", "KrylovKit", "KrylovPreconditioners", "Pkg", "Random", "SafeTestsets", "MultiFloats", "ForwardDiff", "HYPRE", "MPI", "BlockDiagonals", "Enzyme", "FiniteDiff", "BandedMatrices", "FastAlmostBandedMatrices", "StaticArrays", "AllocCheck", "StableRNGs", "Zygote", "RecursiveFactorization", "Sparspak", "FastLapackInterface", "SparseArrays"] +test = ["Aqua", "Test", "IterativeSolvers", "InteractiveUtils", "JET", "KrylovKit", "KrylovPreconditioners", "Pkg", "Random", "SafeTestsets", "MultiFloats", "ForwardDiff", "HYPRE", "MPI", "BlockDiagonals", "FiniteDiff", "BandedMatrices", "FastAlmostBandedMatrices", "StaticArrays", "AllocCheck", "StableRNGs", "Zygote", "RecursiveFactorization", "Sparspak", "FastLapackInterface", "SparseArrays"] diff --git a/test/default_algs.jl b/test/default_algs.jl index 3a3b0ad12..677809160 100644 --- a/test/default_algs.jl +++ b/test/default_algs.jl @@ -1,4 +1,9 @@ -using LinearSolve, RecursiveFactorization, LinearAlgebra, SparseArrays, Test, JET +using LinearSolve, RecursiveFactorization, LinearAlgebra, SparseArrays, Test + +if isempty(VERSION.prerelease) + using JET +end + @test LinearSolve.defaultalg(nothing, zeros(3)).alg === LinearSolve.DefaultAlgorithmChoice.GenericLUFactorization prob = LinearProblem(rand(3, 3), rand(3)) @@ -55,19 +60,23 @@ solve(prob) A = rand(4, 4) b = rand(4) prob = LinearProblem(A, b) -VERSION ≥ v"1.10-" && JET.@test_opt init(prob, nothing) -JET.@test_opt solve(prob, LUFactorization()) -JET.@test_opt solve(prob, GenericLUFactorization()) -@test_skip JET.@test_opt solve(prob, QRFactorization()) -JET.@test_opt solve(prob, DiagonalFactorization()) -#JET.@test_opt solve(prob, SVDFactorization()) -#JET.@test_opt solve(prob, KrylovJL_GMRES()) +if if isempty(VERSION.prerelease) + JET.@test_opt init(prob, nothing) + JET.@test_opt solve(prob, LUFactorization()) + JET.@test_opt solve(prob, GenericLUFactorization()) + @test_skip JET.@test_opt solve(prob, QRFactorization()) + JET.@test_opt solve(prob, DiagonalFactorization()) + #JET.@test_opt solve(prob, SVDFactorization()) + #JET.@test_opt solve(prob, KrylovJL_GMRES()) + + prob = LinearProblem(sparse(A), b) + #JET.@test_opt solve(prob, UMFPACKFactorization()) + #JET.@test_opt solve(prob, KLUFactorization()) + #JET.@test_opt solve(prob, SparspakFactorization()) + #JET.@test_opt solve(prob) +end prob = LinearProblem(sparse(A), b) -#JET.@test_opt solve(prob, UMFPACKFactorization()) -#JET.@test_opt solve(prob, KLUFactorization()) -#JET.@test_opt solve(prob, SparspakFactorization()) -#JET.@test_opt solve(prob) @inferred solve(prob) @inferred init(prob, nothing) From f7f90539cc48fe28576d8b1514521fb112882974 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 14:19:04 +0000 Subject: [PATCH 03/10] Remove JET from prereleases as well --- .github/workflows/Tests.yml | 2 +- Project.toml | 4 +--- test/default_algs.jl | 16 ---------------- test/{enzyme => nopre}/Project.toml | 1 + test/{enzyme => nopre}/enzyme.jl | 0 test/nopre/jet.jl | 16 ++++++++++++++++ test/runtests.jl | 7 ++++--- test/static_arrays.jl | 8 ++++++-- 8 files changed, 29 insertions(+), 25 deletions(-) rename test/{enzyme => nopre}/Project.toml (90%) rename test/{enzyme => nopre}/enzyme.jl (100%) create mode 100644 test/nopre/jet.jl diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 4f13a499e..f8b5b66cf 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -33,7 +33,7 @@ jobs: - "LinearSolveHYPRE" - "LinearSolvePardiso" - "LinearSolveBandedMatrices" - - "Enzyme" + - "NoPre" uses: "SciML/.github/.github/workflows/tests.yml@v1" with: group: "${{ matrix.group }}" diff --git a/Project.toml b/Project.toml index d32534f08..d6ad77a91 100644 --- a/Project.toml +++ b/Project.toml @@ -84,7 +84,6 @@ GPUArraysCore = "0.1.6, 0.2" HYPRE = "1.4.0" InteractiveUtils = "1.10" IterativeSolvers = "0.9.3" -JET = "0.8.28, 0.9" KernelAbstractions = "0.9.27" Krylov = "0.10" KrylovKit = "0.8, 0.9" @@ -130,7 +129,6 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" -JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" KrylovPreconditioners = "45d422c2-293f-44ce-8315-2cb988662dec" @@ -150,4 +148,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [targets] -test = ["Aqua", "Test", "IterativeSolvers", "InteractiveUtils", "JET", "KrylovKit", "KrylovPreconditioners", "Pkg", "Random", "SafeTestsets", "MultiFloats", "ForwardDiff", "HYPRE", "MPI", "BlockDiagonals", "FiniteDiff", "BandedMatrices", "FastAlmostBandedMatrices", "StaticArrays", "AllocCheck", "StableRNGs", "Zygote", "RecursiveFactorization", "Sparspak", "FastLapackInterface", "SparseArrays"] +test = ["Aqua", "Test", "IterativeSolvers", "InteractiveUtils", "KrylovKit", "KrylovPreconditioners", "Pkg", "Random", "SafeTestsets", "MultiFloats", "ForwardDiff", "HYPRE", "MPI", "BlockDiagonals", "FiniteDiff", "BandedMatrices", "FastAlmostBandedMatrices", "StaticArrays", "AllocCheck", "StableRNGs", "Zygote", "RecursiveFactorization", "Sparspak", "FastLapackInterface", "SparseArrays"] diff --git a/test/default_algs.jl b/test/default_algs.jl index 677809160..bf779cc13 100644 --- a/test/default_algs.jl +++ b/test/default_algs.jl @@ -60,22 +60,6 @@ solve(prob) A = rand(4, 4) b = rand(4) prob = LinearProblem(A, b) -if if isempty(VERSION.prerelease) - JET.@test_opt init(prob, nothing) - JET.@test_opt solve(prob, LUFactorization()) - JET.@test_opt solve(prob, GenericLUFactorization()) - @test_skip JET.@test_opt solve(prob, QRFactorization()) - JET.@test_opt solve(prob, DiagonalFactorization()) - #JET.@test_opt solve(prob, SVDFactorization()) - #JET.@test_opt solve(prob, KrylovJL_GMRES()) - - prob = LinearProblem(sparse(A), b) - #JET.@test_opt solve(prob, UMFPACKFactorization()) - #JET.@test_opt solve(prob, KLUFactorization()) - #JET.@test_opt solve(prob, SparspakFactorization()) - #JET.@test_opt solve(prob) -end - prob = LinearProblem(sparse(A), b) @inferred solve(prob) @inferred init(prob, nothing) diff --git a/test/enzyme/Project.toml b/test/nopre/Project.toml similarity index 90% rename from test/enzyme/Project.toml rename to test/nopre/Project.toml index a8b471e01..3273e3188 100644 --- a/test/enzyme/Project.toml +++ b/test/nopre/Project.toml @@ -2,6 +2,7 @@ FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" diff --git a/test/enzyme/enzyme.jl b/test/nopre/enzyme.jl similarity index 100% rename from test/enzyme/enzyme.jl rename to test/nopre/enzyme.jl diff --git a/test/nopre/jet.jl b/test/nopre/jet.jl new file mode 100644 index 000000000..52d3b6a2c --- /dev/null +++ b/test/nopre/jet.jl @@ -0,0 +1,16 @@ +using LinearSolve, RecursiveFactorization, LinearAlgebra, SparseArrays, Test +using JET + +JET.@test_opt init(prob, nothing) +JET.@test_opt solve(prob, LUFactorization()) +JET.@test_opt solve(prob, GenericLUFactorization()) +@test_skip JET.@test_opt solve(prob, QRFactorization()) +JET.@test_opt solve(prob, DiagonalFactorization()) +#JET.@test_opt solve(prob, SVDFactorization()) +#JET.@test_opt solve(prob, KrylovJL_GMRES()) + +prob = LinearProblem(sparse(A), b) +#JET.@test_opt solve(prob, UMFPACKFactorization()) +#JET.@test_opt solve(prob, KLUFactorization()) +#JET.@test_opt solve(prob, SparspakFactorization()) +#JET.@test_opt solve(prob) \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 9275a7174..b4af286d5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -22,11 +22,12 @@ if GROUP == "All" || GROUP == "Core" end # Don't run Enzyme tests on prerelease -if GROUP == "All" || GROUP == "Enzyme" && isempty(VERSION.prerelease) - Pkg.activate("enzyme") +if GROUP == "All" || GROUP == "NoPre" && isempty(VERSION.prerelease) + Pkg.activate("nopre") Pkg.develop(PackageSpec(path = dirname(@__DIR__))) Pkg.instantiate() - @time @safetestset "Enzyme Derivative Rules" include("enzyme.jl") + @time @safetestset "Enzyme Derivative Rules" include("nopre/enzyme.jl") + @time @safetestset "JET Tests" include("nopre/jet.jl") end if GROUP == "DefaultsLoading" diff --git a/test/static_arrays.jl b/test/static_arrays.jl index 0e78d8b69..0fbd5a4ba 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -1,12 +1,16 @@ using LinearSolve, StaticArrays, LinearAlgebra, Test, StableRNGs -using AllocCheck rng = StableRNG(0) A = SMatrix{5, 5}(Hermitian(rand(rng, 5, 5) + I)) b = SVector{5}(rand(rng, 5)) -@check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) +if isempty(VERSION.prerelease) + using AllocCheck + @check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) +else + __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) +end function __non_native_static_array_alg(alg) return alg isa SVDFactorization || alg isa KrylovJL From f310b7ff523e6d715d66c011f0ac07cd384aaff7 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 16:10:19 +0000 Subject: [PATCH 04/10] fix nopre tests --- test/default_algs.jl | 4 ---- test/nopre/jet.jl | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/default_algs.jl b/test/default_algs.jl index bf779cc13..666e3f34b 100644 --- a/test/default_algs.jl +++ b/test/default_algs.jl @@ -1,9 +1,5 @@ using LinearSolve, RecursiveFactorization, LinearAlgebra, SparseArrays, Test -if isempty(VERSION.prerelease) - using JET -end - @test LinearSolve.defaultalg(nothing, zeros(3)).alg === LinearSolve.DefaultAlgorithmChoice.GenericLUFactorization prob = LinearProblem(rand(3, 3), rand(3)) diff --git a/test/nopre/jet.jl b/test/nopre/jet.jl index 52d3b6a2c..5ed384c7c 100644 --- a/test/nopre/jet.jl +++ b/test/nopre/jet.jl @@ -1,6 +1,9 @@ using LinearSolve, RecursiveFactorization, LinearAlgebra, SparseArrays, Test using JET +A = rand(4, 4) +b = rand(4) +prob = LinearProblem(A, b) JET.@test_opt init(prob, nothing) JET.@test_opt solve(prob, LUFactorization()) JET.@test_opt solve(prob, GenericLUFactorization()) From 688d4bcb6502cefb7209c35bfa39cf8180ce96d9 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 16:41:33 +0000 Subject: [PATCH 05/10] fix core --- test/static_arrays.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/static_arrays.jl b/test/static_arrays.jl index 0fbd5a4ba..447ad6e35 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -5,7 +5,7 @@ rng = StableRNG(0) A = SMatrix{5, 5}(Hermitian(rand(rng, 5, 5) + I)) b = SVector{5}(rand(rng, 5)) -if isempty(VERSION.prerelease) +@static if isempty(VERSION.prerelease) using AllocCheck @check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) else @@ -21,7 +21,7 @@ for alg in (nothing, LUFactorization(), SVDFactorization(), CholeskyFactorizatio sol = solve(LinearProblem(A, b), alg) @inferred solve(LinearProblem(A, b), alg) @test norm(A * sol .- b) < 1e-10 - if alg isa KrylovJL{typeof(LinearSolve.Krylov.gmres!)} + if alg isa KrylovJL{typeof(LinearSolve.Krylov.gmres!)} && isempty(VERSION.prerelease) @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution else @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution From b279c7649d84ad2e9660a7294987252c192aedac Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 17:40:40 +0000 Subject: [PATCH 06/10] fix functionoperator definition --- test/default_algs.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/default_algs.jl b/test/default_algs.jl index 666e3f34b..58f30db50 100644 --- a/test/default_algs.jl +++ b/test/default_algs.jl @@ -70,8 +70,8 @@ m, n = 2, 2 A = rand(m, n) b = rand(m) x = rand(n) -f = (du, u, p, t) -> mul!(du, A, u) -fadj = (du, u, p, t) -> mul!(du, A', u) +f = (w, v, u, p, t) -> mul!(w, A, v) +fadj = (w, v, u, p, t) -> mul!(w, A', v) funcop = FunctionOperator(f, x, b; op_adjoint = fadj) prob = LinearProblem(funcop, b) sol1 = solve(prob) @@ -82,8 +82,8 @@ m, n = 3, 2 A = rand(m, n) b = rand(m) x = rand(n) -f = (du, u, p, t) -> mul!(du, A, u) -fadj = (du, u, p, t) -> mul!(du, A', u) +f = (w, v, u, p, t) -> mul!(w, A, v) +fadj = (w, v, u, p, t) -> mul!(w, A', v) funcop = FunctionOperator(f, x, b; op_adjoint = fadj) prob = LinearProblem(funcop, b) sol1 = solve(prob) @@ -94,8 +94,8 @@ m, n = 2, 3 A = rand(m, n) b = rand(m) x = rand(n) -f = (du, u, p, t) -> mul!(du, A, u) -fadj = (du, u, p, t) -> mul!(du, A', u) +f = (w, v, u, p, t) -> mul!(w, A, v) +fadj = (w, v, u, p, t) -> mul!(w, A', v) funcop = FunctionOperator(f, x, b; op_adjoint = fadj) prob = LinearProblem(funcop, b) sol1 = solve(prob) From 688b10122ae44055d44e020da499ee5aef056d55 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 17:52:52 +0000 Subject: [PATCH 07/10] fix doc links --- docs/src/basics/FAQ.md | 2 +- docs/src/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/basics/FAQ.md b/docs/src/basics/FAQ.md index 293468c6b..5027b22e2 100644 --- a/docs/src/basics/FAQ.md +++ b/docs/src/basics/FAQ.md @@ -26,7 +26,7 @@ the performance to the expected state, please open an issue and we will improve This is addressed in the [JuliaCon 2022 video](https://www.youtube.com/watch?v=JWI34_w-yYw&t=182s). This happens in a few ways: - 1. The Fortran/C code that NumPy/SciPy uses is actually slow. It's [OpenBLAS](https://github.com/xianyi/OpenBLAS), + 1. The Fortran/C code that NumPy/SciPy uses is actually slow. It's [OpenBLAS](https://github.com/OpenMathLib/OpenBLAS), a library developed in part by the Julia Lab back in 2012 as a fast open source BLAS implementation. Many open source environments now use this build, including many R distributions. However, the Julia Lab has greatly improved its ability to generate optimized SIMD in platform-specific ways. This, and improved multithreading support diff --git a/docs/src/index.md b/docs/src/index.md index c2f9c9dfa..696632c9c 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -23,7 +23,7 @@ Pkg.add("LinearSolve") ## Contributing - Please refer to the - [SciML ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://github.com/SciML/ColPrac/blob/master/README.md) + [SciML ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://github.com/SciML/ColPrac) for guidance on PRs, issues, and other matters relating to contributing to SciML. - See the [SciML Style Guide](https://github.com/SciML/SciMLStyle) for common coding practices and other style decisions. From bb38e2bed1b7a4095fcfff21173d4b03a3562ef8 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 20:45:16 +0000 Subject: [PATCH 08/10] fix check allocs call? --- test/static_arrays.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/static_arrays.jl b/test/static_arrays.jl index 447ad6e35..02b531412 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -7,7 +7,7 @@ b = SVector{5}(rand(rng, 5)) @static if isempty(VERSION.prerelease) using AllocCheck - @check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) + AllocCheck.@check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) else __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) end From 22d6ea9d2bc8d508939062ee0c95196ed5d96bc9 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 21:05:27 +0000 Subject: [PATCH 09/10] see if this is required --- test/static_arrays.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/static_arrays.jl b/test/static_arrays.jl index 02b531412..8a5581806 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -6,7 +6,10 @@ A = SMatrix{5, 5}(Hermitian(rand(rng, 5, 5) + I)) b = SVector{5}(rand(rng, 5)) @static if isempty(VERSION.prerelease) - using AllocCheck + using AllocCheck +end + +@static if isempty(VERSION.prerelease) AllocCheck.@check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) else __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) From 69a6d70eda573d81a7917d61b2e624a3f337d11d Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 18 May 2025 21:49:37 +0000 Subject: [PATCH 10/10] Move static arrays to nopre --- test/nopre/Project.toml | 1 + test/{ => nopre}/static_arrays.jl | 11 ++--------- test/runtests.jl | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) rename test/{ => nopre}/static_arrays.jl (83%) diff --git a/test/nopre/Project.toml b/test/nopre/Project.toml index 3273e3188..88d22fd55 100644 --- a/test/nopre/Project.toml +++ b/test/nopre/Project.toml @@ -8,3 +8,4 @@ LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" \ No newline at end of file diff --git a/test/static_arrays.jl b/test/nopre/static_arrays.jl similarity index 83% rename from test/static_arrays.jl rename to test/nopre/static_arrays.jl index 8a5581806..f917d2e48 100644 --- a/test/static_arrays.jl +++ b/test/nopre/static_arrays.jl @@ -1,19 +1,12 @@ using LinearSolve, StaticArrays, LinearAlgebra, Test, StableRNGs +using AllocCheck rng = StableRNG(0) A = SMatrix{5, 5}(Hermitian(rand(rng, 5, 5) + I)) b = SVector{5}(rand(rng, 5)) -@static if isempty(VERSION.prerelease) - using AllocCheck -end - -@static if isempty(VERSION.prerelease) - AllocCheck.@check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) -else - __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) -end +@check_allocs __solve_no_alloc(A, b, alg) = solve(LinearProblem(A, b), alg) function __non_native_static_array_alg(alg) return alg isa SVDFactorization || alg isa KrylovJL diff --git a/test/runtests.jl b/test/runtests.jl index b4af286d5..0d994f787 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,7 +18,6 @@ if GROUP == "All" || GROUP == "Core" @time @safetestset "Adjoint Sensitivity" include("adjoint.jl") @time @safetestset "Traits" include("traits.jl") @time @safetestset "BandedMatrices" include("banded.jl") - @time @safetestset "Static Arrays" include("static_arrays.jl") end # Don't run Enzyme tests on prerelease @@ -28,6 +27,7 @@ if GROUP == "All" || GROUP == "NoPre" && isempty(VERSION.prerelease) Pkg.instantiate() @time @safetestset "Enzyme Derivative Rules" include("nopre/enzyme.jl") @time @safetestset "JET Tests" include("nopre/jet.jl") + @time @safetestset "Static Arrays" include("nopre/static_arrays.jl") end if GROUP == "DefaultsLoading"