-
Notifications
You must be signed in to change notification settings - Fork 94
Description
Now that we've mostly settled on the MOI/MOIU/JuMP API structure, it's time to rename the different components to match what they do. Last time we do this before MOI is released.
Let's list the things we have:
supports-MOI-interface
describes a type that implements the MOI interface for specifying problems, i.e.,addvariable!
,addconstraint!
,copy!
. There are different levels of support, i.e., copy-only, 2-pass load, and generaladdconstraint!
.data-with-optimize!
is asupports-MOI-interface
object that lets you calloptimize!
. The data are usually stored and owned directly by the solver.data-without-optimize!
is asupports-MOI-interface
object that does not supportoptimize!
. It just stores the problem data.data-with-optimize!-plus-caching
is asupports-MOI-interface
object that lets you attach and synchronize with adata-with-optimize!
. It stores an extra copy of the data and deals with the case of thedata-with-optimize!
not supporting the full MOI interface by re-copying the data to the solver when needed. In "automatic" mode, adata-with-optimize!-plus-caching
can act exactly like adata-with-optimize!
(Supertype of InstanceManager is AbstractSolverInstance JuliaOpt/MathOptInterfaceBridges.jl#65). In "manual" mode it gives more control over when copies happen, and you can't naively use it as a drop-in fordata-with-optimize!
.optimize!-attributes
are gettable/settable attributes related to howoptimize!
works like stopping limits, solution methods, and the name of the solver (Add SolverName #201). These are dropped oncopy!
data-attributes
are essential parts of the data specification (names,VariablePrimalStart
,NLPBlock
) that cannot be dropped oncopy!
.result-attributes
are properties of the result computed byoptimize!
. I don't think we've discussed if they can be dropped oncopy
or not.
JuMP provides a frontend to any supports-MOI-instance
object depending on what its moibackend
field is set to. The default use case is for JuMP to be a frontend fordata-with-optimize!-plus-caching
.
Currently:
supports-MOI-interface
isAbstractInstance
data-with-optimize!
isAbstractSolverInstance
data-without-optimize!
isAbstractStandaloneInstance
data-with-optimize!-plus-caching
isInstanceManager
- Attributes are a mix of
AbstractSolverParameter
andAnyAttribute
(Add SolverName #201).
I'm going to throw out a couple questions to start the discussion. I don't have a full proposal yet, but hopefully this summary above will get everyone on the same page on the layout of the abstractions. I'd like to brainstorm and make a decision on this quickly so that we can make this change and move on!
Question 1: Looking at this now, the definition of data-without-optimize
is a bit strange. Usually we don't define objects by what they don't support. Should we just remove this concept in favor of supports-MOI-interface
? If we need to dispatch on data-with-optimize!
and data-without-optimize!
we can dispatch instead between data-with-optimize!
and supports-MOI-interface
.
Question 2: Do we want to call data-with-optimize!
AbstractSolver
? A documentation-level definition of a solver could be:
"A solver implements the MOI interface for loading problem data and supports
optimize!
".
This has a downside of being completely different from MPB's definition of a solver, but that's not a blocker. In the data-with-optimize!-plus-caching
I found it convenient to talk about the "solver" and the "instance":
Note that any use of "solver" in MOI should be consistent with the use of solver=
in JuMP.
Question 3: Can we make JuMP's Model
somehow consistent with the MOI naming convention? JuMP is now essentially a nice interface to any supports-MOI-interface
object. That would suggest picking a name for supports-MOI-interface
that's similar to JuMP's Model
, or renaming JuMP's Model
.
@blegat @odow @joaquimg @chriscoey @joehuchette @ccoffrin @IssamT