-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Use Preferences
to toggle precompilation of code that requires GPL dependencies
#238
Conversation
Codecov Report
@@ Coverage Diff @@
## main #238 +/- ##
==========================================
- Coverage 65.04% 64.86% -0.19%
==========================================
Files 11 12 +1
Lines 701 703 +2
==========================================
Hits 456 456
- Misses 245 247 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Ref #224 |
import LinearSolve
work on builds of Julia where Base.USE_GPL_LIBS
is falsePreferences
to toggle precompilation of code that requires GPL dependencies
What about |
In the case where Julia was built with |
Nothing in SparseArrays for sure. Only factorizations are GPLd though? |
So then what do we do with the default algorithm choice? |
We could check if |
But then how do we make that dispatch on A? |
The |
And does a generic fallback implementation exist on |
@Wimmerer weren't you going to do a pure Julia KLU sometime? |
I guess we can default it to KrylovJL_GMRES |
|
Yeah: julia> Base.USE_GPL_LIBS
false
julia> using SuiteSparse, SparseArrays, Random, LinearAlgebra
julia> A = sprand(4, 4, 0.3) + I
4×4 SparseMatrixCSC{Float64, Int64} with 6 stored entries:
1.24017 ⋅ ⋅ ⋅
⋅ 1.0 ⋅ ⋅
0.984142 ⋅ 1.0 ⋅
⋅ ⋅ 0.824643 1.0
julia> b = rand(4)
4-element Vector{Float64}:
0.9655062442597853
0.15175107617153183
0.004248022435501819
0.4659030670094594
julia> typeof(A)
SparseMatrixCSC{Float64, Int64}
julia> typeof(b)
Vector{Float64} (alias for Array{Float64, 1})
julia> A\b
4-element Vector{Float64}:
0.7785278622862858
0.15175107617153183
-0.7619340985421428
1.0942264516593845 |
It still has to be LGPL, but yeah I'll get it out the door this week @ChrisRackauckas. It just defaults to the dense case as far as I can tell. Once glue deps arrive I can add stuff like Sparspak to LinearSolve? Or I can just go ahead and do that as a direct dep. |
Alright, I just pushed b576e40 - if |
src/default.jl
Outdated
function defaultalg(A, b::GPUArraysCore.AbstractGPUArray, ::OperatorAssumptions{true}) | ||
if VERSION >= v"1.8-" | ||
LUFactorization() | ||
else | ||
QRFactorization() | ||
end | ||
KrylovJL_GMRES() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I think I've reverted that change.
I think it's fine to add it as a direct dep |
|
Fixes #224
We use
Preferences
. The user can toggle the behavior by specifying theinclude_sparse
preference. If the user does not specify the preference, we default to the value ofBase.USE_GPL_LIBS
.