-
Notifications
You must be signed in to change notification settings - Fork 87
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
Simplify handling of linear and quadratic derivatives for nonlinear solvers #1397
Comments
I think this is out-of-scope for MathOptInterface 1.0. There are only a handful of solvers that need this, and they are already implemented. The Ipopt.jl wrapper could do with a large refactoring, but that could happen post MOI 1.0. Let's focus on finishing what we have, rather than adding yet more complexity. |
I think doing this would in fact decrease complexity quite a lot. Maintaining this MOI layer and simpler NL solver is much easier than maintaining MOI wrappers that are so complicated. I don't think a refactoring of Ipopt.jl would help, the wrapper is written quite well it's just doing too many things. Also, this is currently a big blocker for adding support for more NL solvers since writing the MOI wrapper go so much more complicated with MOI compared to MPB where you didn't have to support affine and quadratic. I don't think it's blocking the release of MOI v0.10 or MOI v1.0 though as it's non-breaking but I might do this to ease the addition for new MOI wrappers for NL solvers I need. |
This could be a separate package first. It's really one of these "model transformers" we have been talking about.
|
jump-dev/Ipopt.jl#320 adds a |
We now have bridges from ScalarAffine and ScalarQuadratic to ScalarNonlinearFunction, so solvers who don't exploit linear/quadratic functions are much simpler. If solvers do exploit, then they'll need specialized support anyway. One option is to copy the code from Ipopt. I don't know if we need to add yet-another-utility to MOI for this. I propose to close this issue unless anyone objects. |
The wrappers of nonlinear solvers like Ipopt and NLopt are quite complicated because the solvers only expect gradient, jacobian, hessian callbacks and they also support linear and quadratic objective and constraints.
We cannot rewrite them with bridges since bridges do not play well with the NLPBlock.
This will be resolved by #846 but in the short term, it would be good to have a solution as well.
We could create an MOI layer (that would be a copy-paste of part of the Ipopt wrapper basically) that would do the transformation.
Now how do we add this MOI layer in JuMP for nonlinear solvers ?
Similarly to jump-dev/JuMP.jl#2610, the MOI layer would be automatically added by JuMP if it detects that a linear/quadratic constraints is not supported even when adding bridges but the solver supports
NLPBlock
.The text was updated successfully, but these errors were encountered: