-
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
block_gmres
fails with LinearOperator
#854
Comments
It probably slipped through the cracks because |
@gdalle We never defined linear operator * matrix products in LinearOperators.jl. |
Thanks! Indeed I had traced it back to JuliaSmoothOptimizers/LinearOperators.jl#322 but I didn't know if this was a design decision or an oversight |
Hey @amontoison, gentle ping cause I was curious to see if you had been able to investigate? |
Hi @gdalle! Sorry, I didn't find time to investigate. I have an example here: https://github.com/JuliaSmoothOptimizers/KrylovPreconditioners.jl/blob/main/ext/CUDA/operators.jl#L1 |
We did define mul!(res::AbstractVector, op::AbstractLinearOperator{T}, v::AbstractVector, α, β) to matrices. |
In Krylov.jl, we only rely on mul!(res::AbstractMatrix, op::AbstractLinearOperator{T}, v::AbstractMatrix, α, β) An issue is that, unlike vectors, matrices can have a different number of columns, and the operators can be dedicated to only certain sizes of matrices. Guillaume, can you give more details on your linear operator? |
Sorry for not answering, and thank you for taking an interest |
I opened a PR in LinearOperators.jl to start working on a fix, would love to get some help @amontoison @dpo! |
Now that the LinearOperators PR has been merged, this seems to work: julia> using Krylov, LinearOperators
julia> A, B = rand(2, 2), rand(2, 2);
julia> block_gmres(A, B)
([0.1341553080088699 0.48826584325663686; 0.9880393854740158 0.3756128570051308], SimpleStats
niter: 1
solved: true
inconsistent: false
residuals: []
Aresiduals: []
κ₂(A): []
timer: 12.10ms
status: solution good enough given atol and rtol
)
julia> block_gmres(LinearOperator(A), B)
([0.1341553080088699 0.48826584325663686; 0.9880393854740158 0.3756128570051308], SimpleStats
niter: 1
solved: true
inconsistent: false
residuals: []
Aresiduals: []
κ₂(A): []
timer: 498.99ms
status: solution good enough given atol and rtol
) Closing in favor of more specific issues in the future |
Did you tested with a Krylov method that requires A' like |
I thought |
Oh, you're right 🥴 |
well, get cracking! |
I think this is a LinearOperators.jl issue, right?
The text was updated successfully, but these errors were encountered: