Solver ecosystem revamp/refactor #19
Replies: 4 comments 14 replies
-
I think I also suggest defining structs of the form solver = TronSolver(model) # only the problem dimensions are useful here
params = TronParams(...)
tron!(solver, model, params) # stats are inside solver |
Beta Was this translation helpful? Give feedback.
-
I've been testing the refactor/revamp, and it looks like that we can separate into a refactor and later into a revamp:
Should we try this, or try to do the revamp at the same time? |
Beta Was this translation helpful? Give feedback.
-
Hi all! First, I would like to thank you for this revamp. I like the new shape of Currently, MadNLP is shipped with its own interfaces to HLS and MUMPS. We are wondering whether we could reuse the interfaces from abstract type AbstractLinearSolver end
mutable struct EmptyLinearSolver <: AbstractLinearSolver end
# dummy functions
introduce(::EmptyLinearSolver) = ""
factorize!(M::EmptyLinearSolver) = M
solve!(::EmptyLinearSolver,x) = x
is_inertia(::EmptyLinearSolver) = false
inertia(::EmptyLinearSolver) = (0,0,0)
improve!(::EmptyLinearSolver) = false
rescale!(::AbstractLinearSystemScaler) = nothing
solve_refine!(y,::AbstractIterator,x) = nothing
A first idea would be to implement something inheriting from Julia's linear algebra structures, but we won't have any proper interface to compute the inertia or to proceed to iterative refinement. That's why I like your idea of defining a new package In a nutshell, my question is: is a development of a package LinearSolver.jl in JSO still planned ? If so, I would be interested to integrate this package in MadNLP. And of course, I would be happy to bring some help in developing the package :-) cc @sshin23 |
Beta Was this translation helpful? Give feedback.
-
Now that the NLPModels ecosystem has been refactored, it's time to think about the other half of the JSO-compliant solver.
Currently we have
SolverTools.jl
housing stats, logging, line search, trust region, and some other auxiliary tools for blas and bounds.NLPModels + SolverTools define a JSO-compliant solver by the input (
AbstractNLPModel
) and output (GenericExecutionStats
). We have following packages with JSO-compliant solvers (incomplete list):NLPModelsIpopt
andNLPModelsKnitro
: Just need stats.JSOSolvers
: Uses everything in SolverTools.Percival
: Uses stats, logging and bounds.CaNNOLeS
: Use stats and logging. Could use line search if it were more generalDCI
andRipQP
: Haven't looked at, but suspect only stats and loggingThis suggests having stats and logging in a more basic package. Something like
SolverCore
orSolverBase
. Then, the other tools could remain onSolverTools
.Furthermore, the tests can be factored out of
JSOSolvers
and generalized to other situations beyond "unconstrained" and "bound-constrained". There are 3 types of tests:T
and keep the type?max_time
andmax_eval
? (We don't have guidance on what should these keyword arguments be)Opinions? This will all be breaking, so it's a good moment to add other things.
Beta Was this translation helpful? Give feedback.
All reactions