-
Notifications
You must be signed in to change notification settings - Fork 55
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
Update kref! for GPU support #217
Conversation
Codecov Report
@@ Coverage Diff @@
## master #217 +/- ##
=======================================
Coverage 97.42% 97.42%
=======================================
Files 30 30
Lines 3190 3190
=======================================
Hits 3108 3108
Misses 82 82 Continue to review full report at Codecov.
|
@mtanneau can you check that this PR solves the problem with MINRES-QLP? You need the |
It works on my machine, yes.
Status `~/Git/Tulip.jl/Project.toml`
[052768ef] CUDA v1.3.0 `https://github.com/JuliaGPU/CUDA.jl.git#master`
[ba0b0d4f] Krylov v0.5.2 `https://github.com/amontoison/Krylov.jl.git#gpu_kref!`
[40e66cde] LDLFactorizations v0.5.0
[b8f27783] MathOptInterface v0.9.15
[10f199a5] QPSReader v0.2.0
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[de0858da] Printf
[2f01184e] SparseArrays
[4607b0f0] SuiteSparse
[8dfed614] Test I have an Nvidia GTX1080 GPU, you may want to check on another machine just to be sure. |
@amontoison give me the green light when this is ready to go. |
using Random, LinearAlgebra, CUDA, Krylov
Random.seed!(0)
n = 2^12
A = Matrix(Symmetric(rand(n, n)))
cA = CuArray(A)
b = ones(n)
cb = CuArray(b)
minres_qlp(A, b) # warm up
CUDA.@time minres_qlp(A, b); -> 104.331374 seconds CUDA.allowscalar(false)
minres_qlp(cA, cb) #warm up
CUDA.@time minres_qlp(cA, cb); -> 3.651324 seconds 💪 |
As a side remark, the CUDA version seems to be allocated some memory on the CPU. julia> CUDA.@time minres_qlp(A, b);
68.133280 seconds (56 CPU allocations: 578.141 KiB)
julia> CUDA.@time minres_qlp(cA, cb);
5.153048 seconds (2.99 M CPU allocations: 117.499 MiB, 0.21% gc time) (6 GPU allocations: 192.000 KiB, 0.00% gc time) (these are all post warm-up runs) No idea if it's expected nor where it comes from. |
Without the modifications of this PR: CUDA.@time minres_qlp(cA, cb); -> 860.511457 seconds 🐌 For the allocations on CPU, I don't know where the problem comes from. It's difficult to profile it by ssh. |
Thanks. Let's release. |
close #215
Related PRs : JuliaGPU/CUDA.jl#419, JuliaGPU/CUDA.jl#427 and JuliaLang/julia#35124