-
Notifications
You must be signed in to change notification settings - Fork 14
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
[MOI] Add support for nonlinear problems without Hessian #322
Conversation
Thanks for this PR! |
Only for univariate functions. We don't compute it for multivariate user-defined operators. |
Oops, my bad. My interpretation of the doc was incorrect. This is indeed the best solution in this case. |
I think we kept the docs intentionally ambiguous, because it's a level of detail that shouldn't concern most people. The issue here is just a straight-up bug. You should check whether the AD backend supports |
@odow I'm curious, why JuMP chose to skip the Hessian for multivariate registered functions ? For the user using the legacy syntax, would you recommend to call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This reminds me of the possibility of piggybacking on Ipopt.jl/Knitro.jl...
Mainly because they can have many arguments, and computing the Hessian with ForwardDiff is expensive (because we'd need to compute the dense Hessian). It would be breaking to enable this argument now. The documentation has a tutorial on adding it manually if you're interested though: |
Solve #318
This PR adds support for MOI nonlinear problems without Hessian. This is needed to support problems with user-defined functions (whose support has been improved in the latest MOI releases). Now MadNLP switches automatically to the LBFGS algorithm if the Hessian is not available, as it is done in Ipopt.jl.
Currently, we specify to NLPModels that the problem does not have Hessian by setting
nnzh=0
inNLPModelMeta
, so the following code works if the Hessian callback is not defined:https://github.com/MadNLP/MadNLP.jl/blob/fp/moi_nohessian/src/nlpmodels.jl#L360-L362
I am not sure this is the correct approach.