From fe33807d28ba6c0f68dc308de770399bcef7d919 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 28 Jul 2024 16:02:38 -0400 Subject: [PATCH 01/16] Don't default to MKL on EPYC --- Project.toml | 1 + src/LinearSolve.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6fcabb6a5..66af337d2 100644 --- a/Project.toml +++ b/Project.toml @@ -7,6 +7,7 @@ version = "2.30.2" ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471" +CpuId = "adafc99b-e345-5852-983c-f28acb93d879" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56" FastLapackInterface = "29a986be-02c6-4525-aec4-84b980013641" diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index 894c6e0d8..053eb8c1f 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -44,7 +44,7 @@ import PrecompileTools const CRC = ChainRulesCore -if Preferences.@load_preference("LoadMKL_JLL", true) +if Preferences.@load_preference("LoadMKL_JLL", !occursin("EPYC", cpubrand())) using MKL_jll const usemkl = MKL_jll.is_available() else From 13c79966489e4a7c72bfdfb68fec8e69da574f8a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 28 Jul 2024 16:21:23 -0400 Subject: [PATCH 02/16] import correctly --- src/LinearSolve.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index 053eb8c1f..f166f6b45 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -41,10 +41,11 @@ import PrecompileTools import Krylov using SciMLBase import Preferences + import CpuId const CRC = ChainRulesCore -if Preferences.@load_preference("LoadMKL_JLL", !occursin("EPYC", cpubrand())) +if Preferences.@load_preference("LoadMKL_JLL", !occursin("EPYC", CpuId.cpubrand())) using MKL_jll const usemkl = MKL_jll.is_available() else From c2e4532350b67148132935daa0ce8d376270dcec Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 28 Jul 2024 18:08:55 -0400 Subject: [PATCH 03/16] Update Project.toml --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 66af337d2..9a41909e9 100644 --- a/Project.toml +++ b/Project.toml @@ -73,6 +73,7 @@ CUDA = "5" CUDSS = "0.1, 0.2, 0.3" ChainRulesCore = "1.22" ConcreteStructs = "0.2.3" +CpuId = "0.3.2" DocStringExtensions = "0.9.3" EnumX = "1.0.4" Enzyme = "0.11.15, 0.12" From 7175a9a3bed527f663792b5cabaaeaa3cfd36b18 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 28 Jul 2024 20:09:01 -0400 Subject: [PATCH 04/16] Update Project.toml Co-authored-by: Chris Elrod --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 9a41909e9..2b23a13ab 100644 --- a/Project.toml +++ b/Project.toml @@ -73,7 +73,7 @@ CUDA = "5" CUDSS = "0.1, 0.2, 0.3" ChainRulesCore = "1.22" ConcreteStructs = "0.2.3" -CpuId = "0.3.2" +CpuId = "0.3.1" DocStringExtensions = "0.9.3" EnumX = "1.0.4" Enzyme = "0.11.15, 0.12" From 0877d2c7abc1e931572220c2b4cd41cd5c1dab08 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 28 Jul 2024 20:23:50 -0400 Subject: [PATCH 05/16] Update qa.jl --- test/qa.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/qa.jl b/test/qa.jl index 5c4f3e061..9b4045063 100644 --- a/test/qa.jl +++ b/test/qa.jl @@ -6,7 +6,7 @@ using LinearSolve, Aqua Aqua.test_piracies(LinearSolve, treat_as_own = [LinearProblem]) Aqua.test_project_extras(LinearSolve) - Aqua.test_stale_deps(LinearSolve) + Aqua.test_stale_deps(LinearSolve, ignore = [:MKL_jll]) Aqua.test_unbound_args(LinearSolve) Aqua.test_undefined_exports(LinearSolve) end From 8210447a304a9ffd80bc8330c1c51b8d696e9c7d Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 08:13:28 -0400 Subject: [PATCH 06/16] Update static_arrays.jl --- 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 300c86c25..fc7993978 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -19,9 +19,9 @@ for alg in (nothing, LUFactorization(), SVDFactorization(), CholeskyFactorizatio @test norm(A * sol .- b) < 1e-10 if __non_native_static_array_alg(alg) - @test_broken __solve_no_alloc(A, b, alg) + @test_broken __solve_no_alloc(A, b, alg) isa LinearSolution else - @test_nowarn __solve_no_alloc(A, b, alg) + @test_nowarn __solve_no_alloc(A, b, alg) isa LinearSolution end cache = init(LinearProblem(A, b), alg) From a8a6dbcf60cc8fe9cd1aa70983a57c97792f5a6b Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 10:05:38 -0400 Subject: [PATCH 07/16] Update test/static_arrays.jl --- 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 fc7993978..4e8de4e13 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -19,7 +19,7 @@ for alg in (nothing, LUFactorization(), SVDFactorization(), CholeskyFactorizatio @test norm(A * sol .- b) < 1e-10 if __non_native_static_array_alg(alg) - @test_broken __solve_no_alloc(A, b, alg) isa LinearSolution + @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution else @test_nowarn __solve_no_alloc(A, b, alg) isa LinearSolution end From 0ca72d7dcce2772e216aa1d6aafc7fdd0aa174eb Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 10:05:48 -0400 Subject: [PATCH 08/16] Update test/static_arrays.jl --- 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 4e8de4e13..01e33c840 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -21,7 +21,7 @@ for alg in (nothing, LUFactorization(), SVDFactorization(), CholeskyFactorizatio if __non_native_static_array_alg(alg) @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution else - @test_nowarn __solve_no_alloc(A, b, alg) isa LinearSolution + @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution end cache = init(LinearProblem(A, b), alg) From fe5e57febb9fc697e840ec3e6771bf1900fc2ebd Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 10:21:35 -0400 Subject: [PATCH 09/16] Update adjoint.jl --- test/adjoint.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/adjoint.jl b/test/adjoint.jl index 7c8b8f4b9..abfd84c2f 100644 --- a/test/adjoint.jl +++ b/test/adjoint.jl @@ -62,7 +62,7 @@ db12 = FiniteDiff.finite_difference_gradient( db22 = FiniteDiff.finite_difference_gradient( x -> f3(eltype(x).(A), eltype(x).(b1), x), copy(b1)) -@test dA≈dA2 atol=1e-4 +@test dA≈dA2 atol=1e-3 @test db1 ≈ db12 @test db2 ≈ db22 From 36342554e43b8a9259b6bb3f14b1b6a099dbbc8a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 11:45:26 -0400 Subject: [PATCH 10/16] Update test/adjoint.jl --- test/adjoint.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/adjoint.jl b/test/adjoint.jl index abfd84c2f..809feba8a 100644 --- a/test/adjoint.jl +++ b/test/adjoint.jl @@ -62,7 +62,7 @@ db12 = FiniteDiff.finite_difference_gradient( db22 = FiniteDiff.finite_difference_gradient( x -> f3(eltype(x).(A), eltype(x).(b1), x), copy(b1)) -@test dA≈dA2 atol=1e-3 +@test dA≈dA2 rtol=1e-3 @test db1 ≈ db12 @test db2 ≈ db22 From 4cdf9fcd751fc4c011f5c62f8c9c2926b0b924aa Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 14:32:17 -0400 Subject: [PATCH 11/16] Update static_arrays.jl --- test/static_arrays.jl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/static_arrays.jl b/test/static_arrays.jl index 01e33c840..5c93f3f7b 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -18,12 +18,8 @@ for alg in (nothing, LUFactorization(), SVDFactorization(), CholeskyFactorizatio @inferred solve(LinearProblem(A, b), alg) @test norm(A * sol .- b) < 1e-10 - if __non_native_static_array_alg(alg) - @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution - else - @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution - end - + @show alg + @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution cache = init(LinearProblem(A, b), alg) sol = solve!(cache) @test norm(A * sol .- b) < 1e-10 From 26574e6e155bf7da8033a60338c7f13ac6546787 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 17:42:51 -0400 Subject: [PATCH 12/16] Update static_arrays.jl --- test/static_arrays.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/static_arrays.jl b/test/static_arrays.jl index 5c93f3f7b..090d08c24 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -17,9 +17,11 @@ 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 - - @show alg - @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution + if alg isa KrylovJL_GMRES + @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution + else + @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution + end cache = init(LinearProblem(A, b), alg) sol = solve!(cache) @test norm(A * sol .- b) < 1e-10 From db50dd40f70389f5e978e1b4fd7c6e4ac4906b21 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 19:53:43 -0400 Subject: [PATCH 13/16] Update test/static_arrays.jl --- 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 090d08c24..f3b3cd139 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -17,7 +17,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_GMRES + if alg <: KrylovJL_GMRES @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution else @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution From 14f838f1e0a1924d10fa36a622e598199a584c10 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 20:15:33 -0400 Subject: [PATCH 14/16] Update static_arrays.jl --- 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 f3b3cd139..109a4c532 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -17,7 +17,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 <: KrylovJL_GMRES + if typeof(alg) <: KrylovJL_GMRES @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution else @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution From 96b7ead1687dd272e3a48f72cc5cb740441b5130 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 29 Jul 2024 22:46:47 -0400 Subject: [PATCH 15/16] Update test/static_arrays.jl --- 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 109a4c532..5be6b6a28 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -17,7 +17,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 typeof(alg) <: KrylovJL_GMRES + if alg isa Function && alg === KrylovJL_GMRES @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution else @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution From 067c31b39a2f5dae779ded0ef129e967c42efd4c Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 30 Jul 2024 01:17:24 -0400 Subject: [PATCH 16/16] Update test/static_arrays.jl Co-authored-by: Chris Elrod --- 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 5be6b6a28..0e78d8b69 100644 --- a/test/static_arrays.jl +++ b/test/static_arrays.jl @@ -17,7 +17,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 Function && alg === KrylovJL_GMRES + if alg isa KrylovJL{typeof(LinearSolve.Krylov.gmres!)} @test_broken __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution else @test_nowarn __solve_no_alloc(A, b, alg) isa SciMLBase.LinearSolution