From 3161e370b9f5ca065effbd57bf8089910c257a7d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 19 Aug 2025 14:58:45 -0400 Subject: [PATCH 1/6] Fix missing imports in CUDA extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing imports for LU, CuVector, CuMatrix, and LinearVerbosity to fix compilation errors in LinearSolveCUDAExt. Fixes the issue reported at: https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/2 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- ext/LinearSolveCUDAExt.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/LinearSolveCUDAExt.jl b/ext/LinearSolveCUDAExt.jl index 5bae5040d..eab6ee401 100644 --- a/ext/LinearSolveCUDAExt.jl +++ b/ext/LinearSolveCUDAExt.jl @@ -1,13 +1,16 @@ module LinearSolveCUDAExt using CUDA +using CUDA: CuVector, CuMatrix using LinearSolve: LinearSolve, is_cusparse, defaultalg, cudss_loaded, DefaultLinearSolver, DefaultAlgorithmChoice, ALREADY_WARNED_CUDSS, LinearCache, needs_concrete_A, error_no_cudss_lu, init_cacheval, OperatorAssumptions, CudaOffloadFactorization, CudaOffloadLUFactorization, CudaOffloadQRFactorization, - SparspakFactorization, KLUFactorization, UMFPACKFactorization + SparspakFactorization, KLUFactorization, UMFPACKFactorization, + LinearVerbosity using LinearSolve.LinearAlgebra, LinearSolve.SciMLBase, LinearSolve.ArrayInterface +using LinearAlgebra: LU using SciMLBase: AbstractSciMLOperator function LinearSolve.is_cusparse(A::Union{ From f66b516ad6fb64ac778437bb38be81f7f81fae9c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 19 Aug 2025 15:30:33 -0400 Subject: [PATCH 2/6] Add sources section to LinearSolveAutotune Project.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add [sources] section with paths to LinearSolveAutotune and LinearSolve packages for proper local development setup. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- lib/LinearSolveAutotune/Project.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/LinearSolveAutotune/Project.toml b/lib/LinearSolveAutotune/Project.toml index 1b0e60bcf..013f0d168 100644 --- a/lib/LinearSolveAutotune/Project.toml +++ b/lib/LinearSolveAutotune/Project.toml @@ -3,6 +3,10 @@ uuid = "67398393-80e8-4254-b7e4-1b9a36a3c5b6" authors = ["SciML"] version = "1.8.0" +[sources] +LinearSolveAutotune = {path = "."} +LinearSolve = {path = "../.."} + [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" From a60e259ceb6d059b11845c8f362f569b2efd2fab Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 19 Aug 2025 15:35:14 -0400 Subject: [PATCH 3/6] Move sources section to main Project.toml following OrdinaryDiffEq pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove sources section from lib/LinearSolveAutotune/Project.toml - Add sources section to main LinearSolve.jl Project.toml - This follows the same pattern used in OrdinaryDiffEq.jl where sources are defined in the main package Project.toml, not in individual lib packages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Project.toml | 7 +++++-- lib/LinearSolveAutotune/Project.toml | 4 ---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 803538c05..b176df597 100644 --- a/Project.toml +++ b/Project.toml @@ -5,6 +5,7 @@ version = "3.33.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" @@ -28,11 +29,13 @@ Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +[sources] +LinearSolveAutotune = {path = "lib/LinearSolveAutotune"} + [weakdeps] AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" BandedMatrices = "aae01518-5342-5314-be14-df237901396f" BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0" -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" CUSOLVERRF = "a8cc9031-bad2-4722-94f5-40deabb4245c" CliqueTrees = "60701a23-6482-424a-84db-faee86b9b1f8" @@ -122,8 +125,8 @@ RecursiveFactorization = "0.2.23" Reexport = "1.2.2" SafeTestsets = "0.1" SciMLBase = "2.70" -SciMLOperators = "1" SciMLLogging = "1" +SciMLOperators = "1" Setfield = "1.1.1" SparseArrays = "1.10" Sparspak = "0.3.9" diff --git a/lib/LinearSolveAutotune/Project.toml b/lib/LinearSolveAutotune/Project.toml index 013f0d168..1b0e60bcf 100644 --- a/lib/LinearSolveAutotune/Project.toml +++ b/lib/LinearSolveAutotune/Project.toml @@ -3,10 +3,6 @@ uuid = "67398393-80e8-4254-b7e4-1b9a36a3c5b6" authors = ["SciML"] version = "1.8.0" -[sources] -LinearSolveAutotune = {path = "."} -LinearSolve = {path = "../.."} - [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" From 11ed2bec72370768d43456d4bbaee877951f42b4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 19 Aug 2025 15:37:08 -0400 Subject: [PATCH 4/6] Fix sources section: LinearSolveAutotune should source LinearSolve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove incorrectly added sources from main Project.toml - Add sources section to LinearSolveAutotune/Project.toml pointing to LinearSolve - This allows LinearSolveAutotune to use the local LinearSolve package during development 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Project.toml | 3 --- lib/LinearSolveAutotune/Project.toml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index b176df597..3a85ba500 100644 --- a/Project.toml +++ b/Project.toml @@ -29,9 +29,6 @@ Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -[sources] -LinearSolveAutotune = {path = "lib/LinearSolveAutotune"} - [weakdeps] AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" BandedMatrices = "aae01518-5342-5314-be14-df237901396f" diff --git a/lib/LinearSolveAutotune/Project.toml b/lib/LinearSolveAutotune/Project.toml index 1b0e60bcf..df593f72a 100644 --- a/lib/LinearSolveAutotune/Project.toml +++ b/lib/LinearSolveAutotune/Project.toml @@ -3,6 +3,9 @@ uuid = "67398393-80e8-4254-b7e4-1b9a36a3c5b6" authors = ["SciML"] version = "1.8.0" +[sources] +LinearSolve = {path = "../.."} + [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" From 4331d747a343d8946714f23129018b65220b5eea Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 19 Aug 2025 15:58:47 -0400 Subject: [PATCH 5/6] Fix CUDA extension issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove stub init_cacheval for CudaOffloadLUFactorization from base package to avoid method overwriting error during precompilation - Move CUDA from deps to weakdeps since it's only needed for the extension These changes fix: 1. Method overwriting error during module precompilation 2. Aqua.jl stale deps test failure for CUDA 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Project.toml | 2 +- src/factorization.jl | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 3a85ba500..b218f4908 100644 --- a/Project.toml +++ b/Project.toml @@ -5,7 +5,6 @@ version = "3.33.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" @@ -33,6 +32,7 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" BandedMatrices = "aae01518-5342-5314-be14-df237901396f" BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0" +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" CUSOLVERRF = "a8cc9031-bad2-4722-94f5-40deabb4245c" CliqueTrees = "60701a23-6482-424a-84db-faee86b9b1f8" diff --git a/src/factorization.jl b/src/factorization.jl index ca335d0ed..e4e35b49e 100644 --- a/src/factorization.jl +++ b/src/factorization.jl @@ -1210,10 +1210,6 @@ function init_cacheval(::BLISLUFactorization, A, b, u, Pl, Pr, nothing end -function init_cacheval(::CudaOffloadLUFactorization, A, b, u, Pl, Pr, - maxiters::Int, abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions) - nothing -end function init_cacheval(::MetalLUFactorization, A, b, u, Pl, Pr, maxiters::Int, abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions) From b2e1c3fedc0a9740c8054e0b684d17ef72963205 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 19 Aug 2025 16:07:07 -0400 Subject: [PATCH 6/6] Update src/factorization.jl --- src/factorization.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/factorization.jl b/src/factorization.jl index e4e35b49e..ca335d0ed 100644 --- a/src/factorization.jl +++ b/src/factorization.jl @@ -1210,6 +1210,10 @@ function init_cacheval(::BLISLUFactorization, A, b, u, Pl, Pr, nothing end +function init_cacheval(::CudaOffloadLUFactorization, A, b, u, Pl, Pr, + maxiters::Int, abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions) + nothing +end function init_cacheval(::MetalLUFactorization, A, b, u, Pl, Pr, maxiters::Int, abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions)