Skip to content

Conversation

@hexaeder
Copy link
Contributor

This PR attempts to fix #827 . It requires a revert of #828 (PRed in #833)

This fixes mainly cache creaction problems. Now, based on whether CUDSS is loaded and whether a CSC or CSR matrix is provided it skips the cholesky and/or lu cache build.

Also changes the default solver logic:

  • CuSparseMatrixCSR -> Krylov if CUDSS not loaded (warns once), LU otherwise
  • CuSparseMatrixCSR -> Krylov (warns once about this)

It also adds some tests for the default solver choice before and after using CUDSS and fixes some missing import in the cuda tests.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • [-] The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC. (new code does, surruding code does not)
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

@hexaeder hexaeder changed the title Hw/cusparse defaults fix default solver selection for CuSparseMatrix Nov 28, 2025
Comment on lines +348 to +350
nothing
elseif LinearSolve.is_cusparse_csr(A) && !LinearSolve.cudss_loaded(A)
nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it instead make sense to just fix cholesky instance for GPUs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have a extension (either in ArrayInterface or CUDSS) to define

ArrayInterface.cholesky_instance(::CuSparseCSR)

the Problem is that if CUDSS is not loaded, the extension would not trigger, the specialization would not load and ArrayInterface would still fallback to LinearAlgebra.cholesky for A::Any which errors out.

Or do you mean something else?

@ChrisRackauckas ChrisRackauckas merged commit aa7f12e into SciML:main Dec 7, 2025
118 of 142 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.

Default algs for CUSPARSE failing

2 participants