-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add support of CuSparseMatrix
-type matrices for QRFactorization()
#410
Comments
Is this the behavior of |
I'm using Therefore, if I want to solve large sparse problems using GPU (CUDA), the |
By the way, I also want to report that there might be a small issue in the Krylov algorithms. When the sparse matrix is given as the type of using LinearSolve
using CUDA
using CUDA.CUSPARSE
A::CuSparseMatrixCSC{ComplexF32, Int32}
b::CuArray{ComplexF32}
cache = init(LinearProblem(A, b, solver=KrylovJL_GMRES())
sol = solve!(cache)
Of course we can provide the LinearProblem(A, b,
solver=KrylovJL_GMRES(rtol=1f-6, atol=1f-8)
) Otherwise we will still get an error LinearProblem(A, b,
solver=KrylovJL_GMRES(rtol=1e-6, atol=1e-8)
)
|
I'm asking about something requires no LinearSolve at all. If you run |
Yeah, I think so. using SparseArrays
using LinearAlgebra
using CUDA
using CUDA.CUSPARSE
A = sprand(100, 100, 0.1)
colptr = CuArray{Int32}(A.colptr)
rowval = CuArray{Int32}(A.rowval)
nzval = CuArray{ComplexF32}(A.nzval)
A_gpu = CuSparseMatrixCSC{ComplexF32, Int32}(colptr, rowval, nzval, size(A))
qr(A_gpu)
the output is something in the type of |
Okay yeah so it's an upstream issue with CUDA.jl. File an issue about getting that handled and it should automatically fix the LinearSolve interface here. |
I think this also relates to this issue JuliaGPU/CUDA.jl#1396 |
Maybe this issue is solved in here JuliaGPU/CUDA.jl#2121 |
For the issue with Krylov.jl, it was solved with #397. |
Yeah that piece was fixed earlier last week so I'm not worried there. The CUDA part is the bigger issue though. |
I tried to solve some sparse matrix with the type of
CuSparseMatrixCSC
.When I switch to the algorithm
QRFactorization()
, it seems to automatically convert the sparse matrix to dense matrixCuArray
.I'm using
LinearSolve v2.12.1
The text was updated successfully, but these errors were encountered: