Skip to content
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

Symbolic Factorization Reuse in the standard LUFactorization #493

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

ChrisRackauckas
Copy link
Member

This should be sufficient for CUDSS.jl to be optimally used as well

This should be sufficient for CUDSS.jl to be optimally used as well
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 51.85185% with 39 lines in your changes are missing coverage. Please review.

Project coverage is 62.61%. Comparing base (d050e01) to head (084d0d6).

Files Patch % Lines
ext/LinearSolveCUDAExt.jl 0.00% 27 Missing ⚠️
src/LinearSolve.jl 78.43% 11 Missing ⚠️
ext/LinearSolveCUDSSExt.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #493       +/-   ##
===========================================
+ Coverage   25.10%   62.61%   +37.50%     
===========================================
  Files          28       29        +1     
  Lines        2167     2212       +45     
===========================================
+ Hits          544     1385      +841     
+ Misses       1623      827      -796     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrisRackauckas
Copy link
Member Author

This is hard to test, but it is now working with CUDSS and I can check the symbolic factorizations are reused! MWE:

using CUDA, CUDA.CUSPARSE
using CUDSS
using SparseArrays, LinearAlgebra
using LinearSolve

T = Float64
n = 100
A_cpu = sprand(T, n, n, 0.05) + I
x_cpu = zeros(T, n)
b_cpu = rand(T, n)

A_gpu = CuSparseMatrixCSR(A_cpu)
x_gpu = CuVector(x_cpu)
b_gpu = CuVector(b_cpu)
prob = LinearProblem(A_gpu, b_gpu)
sol = solve(prob, LUFactorization())

cache = init(prob, LUFactorization())
solve!(cache)
cache.b = CuVector(rand(T, n))
solve!(cache)
cache.A = CuSparseMatrixCSR(A_cpu + 3I)
solve!(cache)
cache.b = CuVector(rand(T, n))
solve!(cache)

This is with JuliaArrays/ArrayInterface.jl#433 and exanauts/CUDSS.jl#33

@ChrisRackauckas ChrisRackauckas merged commit c3f4c4f into main Apr 19, 2024
14 of 18 checks passed
@ChrisRackauckas ChrisRackauckas deleted the symbolic_lu branch April 19, 2024 19:01
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.

1 participant