Skip to content

Add CUSOLVERRF.jl integration for GPU-accelerated sparse LU factorization #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ChrisRackauckas-Claude
Copy link
Contributor

Summary

This PR adds support for NVIDIA's cusolverRF sparse LU factorization library through a package extension, providing high-performance GPU-accelerated solving for sparse linear systems.

Motivation

CUSOLVERRF.jl provides access to NVIDIA's cusolverRF library, which offers significant performance improvements for sparse LU factorization on GPUs. This integration makes it accessible through LinearSolve.jl's unified interface.

Key Features

  • New CUSOLVERRFFactorization algorithm with configurable options:
    • symbolic: Choose between :RF (default) or :KLU for symbolic factorization
    • reuse_symbolic: Reuse symbolic factorization for matrices with same sparsity pattern
  • Automatic CPU-to-GPU conversion for convenience
  • Support for multiple right-hand sides
  • Adjoint solve support
  • Comprehensive test suite

Implementation Details

The implementation follows LinearSolve.jl's extension pattern:

  • Extension module in ext/LinearSolveCUSOLVERRFExt.jl
  • Core types and exports in src/factorization.jl and src/LinearSolve.jl
  • Weak dependency configuration in Project.toml
  • Tests in test/gpu/cusolverrf.jl

Usage Example

using LinearSolve, CUSOLVERRF, SparseArrays

# Create sparse system
A = sprand(1000, 1000, 0.01) + 5I
b = rand(1000)

# Solve with default options
prob = LinearProblem(A, b)
sol = solve(prob, CUSOLVERRFFactorization())

# Use KLU for symbolic factorization
sol = solve(prob, CUSOLVERRFFactorization(symbolic = :KLU))

Limitations

  • Only supports Float64 element types with Int32 indices (CUSOLVERRF limitation)
  • Requires CUDA-capable GPU

Testing

Tests have been added to the GPU test suite and can be run with appropriate hardware.

This is a rebased version of #651.

🤖 Generated with Claude Code

claude and others added 11 commits August 5, 2025 14:34
…tion

This PR adds support for NVIDIA's cusolverRF sparse LU factorization library through a package extension. CUSOLVERRF provides high-performance GPU-accelerated factorization for sparse matrices.

Key features:
- New `CUSOLVERRFFactorization` algorithm with configurable symbolic factorization (RF or KLU)
- Automatic CPU-to-GPU conversion for convenience
- Support for multiple right-hand sides
- Reusable symbolic factorization for matrices with same sparsity pattern
- Adjoint solve support
- Comprehensive test suite

The implementation follows LinearSolve.jl's extension pattern, similar to the existing CUDSS integration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Include CUSOLVERRF tests in the GPU test suite when the package is available. The tests are conditionally included to avoid failures when CUSOLVERRF.jl is not installed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added CUSOLVERRF to recommended methods for sparse matrices
- Added CUSOLVERRF section in the full list of solvers
- Added CUSOLVERRF examples in GPU tutorial documentation
- Documented supported options and limitations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Updated sparse matrices recommendation to include both CUDSS.jl and CUSOLVERRF.jl
- Clarified that CUDSS provides interface to NVIDIA's cuDSS library
- Maintained that both offer high performance for GPU-accelerated sparse LU factorization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Clarified that CUDSS works through LUFactorization() when CUDSS.jl is loaded
- Explained that it automatically uses cuDSS for CuSparseMatrixCSR arrays
- Removed incorrect reference to a separate CUDSS factorization type

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas force-pushed the add-cusolverrf-support branch from 6fb23da to d7f1f8c Compare August 5, 2025 18:34
@ChrisRackauckas ChrisRackauckas merged commit a35ef8d into SciML:main Aug 6, 2025
95 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants