Use Hessian approximation in CyIpopt when grey-box without Hessian is present#3892
Use Hessian approximation in CyIpopt when grey-box without Hessian is present#3892Robbybp wants to merge 10 commits intoPyomo:mainfrom
Conversation
…ssian_approximation=limited-memory if not available
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3892 +/- ##
==========================================
- Coverage 89.93% 89.93% -0.01%
==========================================
Files 902 902
Lines 106393 106399 +6
==========================================
+ Hits 95683 95685 +2
- Misses 10710 10714 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jsiirola
left a comment
There was a problem hiding this comment.
Looks good.
One design question, though: should we promote has_hessian_support up to PyomoNLP? (Maybe this should be added to a future "Let's revisit the design of Pynumero and ExternalGreyBox"?)
| # Note that `config` is a copy of the instance-level self.config so | ||
| # we don't have to reset the option after the solve. | ||
| if config.options.get("hessian_approximation", None) == "exact": | ||
| logger.warning( |
There was a problem hiding this comment.
Can you add a test exercising / verifying this warning?
For now, no. PyomoNLP always has Hessian support. However, if we eventually merge grey box support into PyomoNLP (to eliminate the need for PyomoNLPWithGreyBoxBlocks), then we will need to do this. |
I was mostly thinking about an implementation like def has_hessian_support(self):
return Trueand including it so that we had a "standard" interface API. |
|
I see. I still would rather not add this before we need it. |
Fixes #3891
Changes proposed in this PR:
hessian_approximation=limited-memoryin CyIpopt solver when the model contains a grey-box that doesn't support Hessianshessian_approximation=exacthas_hessian_supportmethod toPyomoNLPWithGreyBoxBlocks(previously only existed on_ExternalGreyBoxAsNLP, although the former has a private_has_hessian_supportattribute)Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: