You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #297 I mentioned that GMRES was failing silently from stagnation. Turns out BiCGStab is also failing silently from (some form of) breakdown.
Not so surprising that this fails given how I'm (mis)using the algorithm, but the failure should not be silent. Indeed, in Krylov.jl it is not silent, as Krylov.jl returns extra information which indicates the algorithm did not converge. But when called from LinearSolve.jl this information is lost and the failure becomes silent. This is also an issue in IterativeSolvers.jl where the failure is silent (see: JuliaLinearAlgebra/IterativeSolvers.jl#338).
Reproducing code for Krylov:
import LinearSolve: KrylovJL_BICGSTAB, LinearProblem, solve
import LinearAlgebra: cond, norm
for problem_dim in [25, 100]
succeeded =0for i =1:100
condition_number =Inf
matrix =nothingwhile condition_number >1000
matrix =randn(Float64, (problem_dim, problem_dim))
condition_number =cond(matrix)
end
true_vec =randn(Float64, (problem_dim,))
b = matrix * true_vec
prob =LinearProblem(matrix, b)
julia_soln =solve(prob, KrylovJL_BICGSTAB())
residual_norm =norm(julia_soln - true_vec)
succeeded += (residual_norm <1) # very loose tolerance!endprintln("problem dim: $problem_dim. succeeded: $succeeded")
end
The text was updated successfully, but these errors were encountered:
This solves #297. KrylovKit.jl already throws `ReturnCode.Failure` if it doesn't converge, IterativeSolvers.jl doesn't have it possible, and now Krylov.jl is using retcodes. So now nothing is silent on non-convergence when it's possible to be known from the solver. This also fixes#298
In #297 I mentioned that GMRES was failing silently from stagnation. Turns out BiCGStab is also failing silently from (some form of) breakdown.
Not so surprising that this fails given how I'm (mis)using the algorithm, but the failure should not be silent. Indeed, in
Krylov.jl
it is not silent, asKrylov.jl
returns extra information which indicates the algorithm did not converge. But when called fromLinearSolve.jl
this information is lost and the failure becomes silent. This is also an issue inIterativeSolvers.jl
where the failure is silent (see: JuliaLinearAlgebra/IterativeSolvers.jl#338).Reproducing code for Krylov:
The text was updated successfully, but these errors were encountered: