Add BLISLUFactorization, CudaOffloadLUFactorization, and MetalLUFactorization to default solver choices #733
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the default solver algorithm selection in LinearSolve.jl by adding support for three additional factorization methods as conditionally available choices:
BLISLUFactorization
- BLIS-based LU factorizationCudaOffloadLUFactorization
- CUDA GPU-accelerated LU factorizationMetalLUFactorization
- Metal GPU-accelerated LU factorization for Apple SiliconThese solvers can now be selected by the default algorithm when they are:
Implementation Details
The implementation follows the same conditional availability pattern as
RFLUFactorization
:Key Changes:
DefaultAlgorithmChoice
enum to include the three new solver typesuseblis()
,usecuda()
,usemetal()
that check if the respective extensions are loadedthrowerror
parameter (defaults totrue
) to allow graceful instantiation in the default solver systemDefaultLinearSolverInit
struct to include fields for the new algorithmssolve!
with extension availability checksinit_cacheval
implementations that returnnothing
when extensions aren't loadedConditional Availability
The algorithms are only used when:
using CUDA
,using Metal
, or when BLIS is available)This ensures backward compatibility and graceful degradation when extensions aren't available.
Testing
Added comprehensive tests to verify:
throwerror=false
throwerror=true
when extensions aren't loadedAll tests pass successfully.
Motivation
This change allows LinearSolve.jl to automatically leverage specialized high-performance solvers when they are available, improving performance for users who have these extensions installed, while maintaining compatibility for those who don't.
🤖 Generated with Claude Code