Pyomo.DoE: add advanced run_doe debug config and fix trace/Cholesky initialization consistency#3867
Open
adowling2 wants to merge 11 commits intoPyomo:mainfrom
Open
Pyomo.DoE: add advanced run_doe debug config and fix trace/Cholesky initialization consistency#3867adowling2 wants to merge 11 commits intoPyomo:mainfrom
adowling2 wants to merge 11 commits intoPyomo:mainfrom
Conversation
Member
Author
|
@smondal13 @sscini @slilonfe5 @snarasi2 @djlaky I found a small bug in how we initialize the Cholesky factorization when the FIM at the initial point needs "inertia correction". This PR fixes the initialization inconsistency. This PR also proposes an interface to allow for more advanced solver options when diagnosing initialization issues for the Pyomo.DoE (dynamic) optimization formulation. Edit: This is a work in progress right now. I am not 100% happy with the proposed changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes # .
Summary/Motivation:
This PR adds advanced debugging/inspection controls for
pyomo.contrib.doe.DesignOfExperiments.run_doe()while preserving default behavior for typical users. It also fixes a trace-objective initialization inconsistency that can produce large residuals in Cholesky-related constraints at the start of the final NLP solve.The motivating workflow showed:
max_iter=0for final-model probing because scenario solves reused the same solver options,fim,L,fim_inv,L_inv, andcov_trace.Changes proposed in this PR:
run_config(ConfigBlock/dict) argument torun_doe(model=None, results_file=None, run_config=None):scenario_solver_optionsfinal_solver_optionsfinal_solveinspection.enabledinspection.top_constraintsconstraint_namebodylower_boundupper_boundviolationconstraint_typefinal_solve=False) to inspect assembled NLP state without running final optimization._initialize_cholesky_from_fim()to re-synchronizeL,L_inv,fim_inv, andcov_tracefrom current FIM immediately before final solve / inspection.reactor_example.py.Backward compatibility:
run_doe()with norun_config) remains unchanged.run_configis provided.Testing:
I ran:
pytest -q pyomo/contrib/doe/tests/test_doe_debug.py8 passedpytest -q pyomo/contrib/doe/tests/test_doe_solve.py -k "rooney_biegler_fd_central_solve"1 passed, 17 deselectedNew/updated tests cover:
max_iter=0-style final probing with separate scenario options,Outstanding Tasks (before removing WIP):
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: