Open kmp5VT opened 6 days ago
GPUArrays.jl does not support factorizations. It's interesting that qr(A)
doesn't error straight away.
This may be easy to fix, since it seems like the factorization was computed correctly, but I'm not familiar enough to be sure. In any case, CUDA.jl carries quite a bit of code for QR factorizations: https://github.com/JuliaGPU/CUDA.jl/blob/14de0097ff7c26932cc4a175840961cc7d3f396e/lib/cusolver/linalg.jl#L141-L237. Quite a bit of those rely on CUSOLVER APIs, so I'm not sure it's possible to add this here.
Yeah it actually has no issue running the QR and gets the right answer
julia> A = JLArray(randn(5,5))
5×5 JLArray{Float64, 2}:
-1.72275 -1.71712 -0.633798 0.177743 -1.08403
0.478877 0.395843 -1.02957 0.645991 -1.37382
-0.410473 0.871103 0.245303 0.538019 -1.31581
-0.190147 -1.46851 -0.183525 -0.216322 0.793294
-0.626786 -2.15311 0.591278 0.0816701 1.23045
julia> Q,R = qr(A)
LinearAlgebra.QRCompactWY{Float64, JLArray{Float64, 2}, JLArray{Float64, 2}}
Q factor: 5×5 LinearAlgebra.QRCompactWYQ{Float64, JLArray{Float64, 2}, JLArray{Float64, 2}}
R factor:
5×5 JLArray{Float64, 2}:
1.948 2.26845 0.0833889 -0.116918 0.42488
0.0 2.34746 -0.127072 0.351965 -1.96242
0.0 0.0 1.37189 -0.366869 1.51315
0.0 0.0 0.0 0.720891 -0.781938
0.0 0.0 0.0 0.0 -0.067345
julia> Q * R ≈ A
true
I can look into this issue though. Thanks!
Hello,
I am trying to convert the output packed Q output of the QR decomposition of a JLArray back into a JLArray but there is a constructor error being thrown.