Skip to content

Use Hessian approximation in CyIpopt when grey-box without Hessian is present#3892

Open
Robbybp wants to merge 10 commits intoPyomo:mainfrom
Robbybp:cyipopt-hessian
Open

Use Hessian approximation in CyIpopt when grey-box without Hessian is present#3892
Robbybp wants to merge 10 commits intoPyomo:mainfrom
Robbybp:cyipopt-hessian

Conversation

@Robbybp
Copy link
Copy Markdown
Contributor

@Robbybp Robbybp commented Mar 26, 2026

Fixes #3891

Changes proposed in this PR:

  • Set (potentially override) hessian_approximation=limited-memory in CyIpopt solver when the model contains a grey-box that doesn't support Hessians
  • Log a warning if this happens and the user had set hessian_approximation=exact
  • Add a has_hessian_support method to PyomoNLPWithGreyBoxBlocks (previously only existed on _ExternalGreyBoxAsNLP, although the former has a private _has_hessian_support attribute)

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:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@Robbybp Robbybp changed the title Cyipopt hessian Use Hessian approximation in CyIpopt when grey-box without Hessian is present Mar 26, 2026
@michaelbynum michaelbynum self-requested a review March 26, 2026 12:34
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.93%. Comparing base (6baac63) to head (5ac3a48).

Files with missing lines Patch % Lines
...trib/pynumero/algorithms/solvers/cyipopt_solver.py 75.00% 1 Missing ⚠️
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     
Flag Coverage Δ
builders 29.21% <50.00%> (+0.01%) ⬆️
default 86.23% <83.33%> (?)
expensive 35.65% <50.00%> (?)
linux 87.38% <83.33%> (-2.04%) ⬇️
linux_other 87.38% <83.33%> (-0.01%) ⬇️
oldsolvers 28.12% <16.66%> (+0.01%) ⬆️
osx 82.73% <33.33%> (+0.01%) ⬆️
win 85.80% <83.33%> (-0.01%) ⬇️
win_other 85.80% <83.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CyIpopt] Automatically use Hessian approximation when grey-box exact Hessian isn't available

3 participants