Split CUDA extension into cuSPARSE/cuBLAS for CUDA.jl 6.x#84
Split CUDA extension into cuSPARSE/cuBLAS for CUDA.jl 6.x#84albertomercurio wants to merge 1 commit into
Conversation
CUDA.jl 6.0 split the monolithic package into a `CUDA` meta-package plus standalone `CUDACore`, `cuSPARSE`, `cuBLAS`, ... The single extension keyed only on `CUDA` never activated when a package loaded just the split libraries (e.g. `using cuSPARSE`), and it went through the deprecated `CUDA.CUSPARSE` / `CUDA.CUBLAS` bindings. Replace `KrylovPreconditionersCUDAExt` with two granular extensions: - `KrylovPreconditionersCuSPARSEExt` (triggers: CUDACore, cuSPARSE) — ic0, ilu0, operators, scaling - `KrylovPreconditionersCuBLASExt` (triggers: CUDACore, cuSPARSE, cuBLAS) — block Jacobi, which additionally needs batched LU/inverse from cuBLAS `using CUDA` still activates both extensions since it loads the split libraries. This requires CUDA.jl 6.2 and drops the 5.x code path, so the package version is bumped to 0.4.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates KrylovPreconditioners’ NVIDIA/CUDA integration to work with CUDA.jl 6.x’s split packages by replacing the old single CUDA-keyed extension with separate cuSPARSE- and cuBLAS-keyed extensions, and bumps the package version accordingly.
Changes:
- Split the CUDA extension into
KrylovPreconditionersCuSPARSEExtandKrylovPreconditionersCuBLASExtkeyed onCUDACore/cuSPARSE/cuBLAS. - Update CUDA-related weakdeps/compat entries for the split packages and bump version to
0.4.0. - Adjust GPU test imports and migrate block-Jacobi synchronization away from deprecated
CUDA.@sync.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/gpu/nvidia.jl | Updates NVIDIA GPU test imports to use the CUDA.jl 6.x cuSPARSE submodule. |
| Project.toml | Bumps version and replaces the old CUDA weakdep/extension with CUDACore/cuSPARSE/cuBLAS weakdeps and granular extensions. |
| ext/KrylovPreconditionersCuSPARSEExt.jl | Defines the cuSPARSE-triggered extension and includes IC0/ILU0/operators/scaling CUDA implementations. |
| ext/KrylovPreconditionersCuBLASExt.jl | Introduces the cuBLAS-triggered extension and includes the CUDA block-Jacobi implementation. |
| ext/CUDA/block_jacobi.jl | Switches synchronization usage for batched LU/inversion calls in the CUDA block-Jacobi update path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @sync pivot, info = CUBLAS.getrf_batched!(p.blocklist, true) | ||
| @sync pivot, info, p.blocklist = CUBLAS.getri_batched(p.blocklist, pivot) |
| @@ -1,4 +1,4 @@ | |||
| using CUDA, CUDA.CUSPARSE, CUDA.CUSOLVER | |||
| using CUDA, CUDA.cuSPARSE | |||
|
Please only do one extension |
|
Yes but I was wondering what if people only load CUDACore and cuSPARSE? The extension won't load, so people are forced to load CUDA.jl entirely |
|
99.9% of the users will just install CUDA.jl. |
CUDA.jl 6.0 split the monolithic package into a
CUDAmeta-package plus standaloneCUDACore,cuSPARSE,cuBLAS, ... The single extension keyed only onCUDAnever activated when a package loaded just the split libraries (e.g.using cuSPARSE), and it went through the deprecatedCUDA.CUSPARSE/CUDA.CUBLASbindings.Replace
KrylovPreconditionersCUDAExtwith two granular extensions:KrylovPreconditionersCuSPARSEExt(triggers: CUDACore, cuSPARSE) — ic0, ilu0, operators, scalingKrylovPreconditionersCuBLASExt(triggers: CUDACore, cuSPARSE, cuBLAS) — block Jacobi, which additionally needs batched LU/inverse from cuBLASusing CUDAstill activates both extensions since it loads the split libraries. This requires CUDA.jl 6.2 and drops the 5.x code path, so the package version is bumped to 0.4.0.