-
Notifications
You must be signed in to change notification settings - Fork 518
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
Various bug fixes in gdp.mbigm transformation #3073
Conversation
…traint containers on Disjuncts
…uffixes" This reverts commit 7fe251e.
… we don't yet if they are on the model
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3073 +/- ##
==========================================
- Coverage 88.34% 88.33% -0.01%
==========================================
Files 833 833
Lines 92567 92582 +15
==========================================
+ Hits 81776 81786 +10
- Misses 10791 10796 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
A couple general questions
pyomo/gdp/plugins/multiple_bigm.py
Outdated
if ( | ||
results.solver.termination_condition | ||
is TerminationCondition.infeasible | ||
): |
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.
Are we sure that we want to check against "infeasible"? For the "old" (current) solver interfaces, I am not sure if this is always a guarantee of infeasibility. (In particular, I don't think that Ipopt will ever guarantee infeasibility)
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.
I changed this so that we maintain a list of solvers we trust that 'infeasible' means 'proven infeasible' and we do this for those. For others (looking at you, ipopt), we just revert to the old behavior and scream about an unsuccessful solve.
pyomo/gdp/plugins/multiple_bigm.py
Outdated
if ( | ||
results.solver.termination_condition | ||
is TerminationCondition.infeasible | ||
): |
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.
Same question on infeasible
here...
@@ -201,7 +200,6 @@ class MultipleBigMTransformation(GDP_to_MIP_Transformation, _BigM_MixIn): | |||
|
|||
def __init__(self): | |||
super().__init__(logger) | |||
self.handlers[Suffix] = self._warn_for_active_suffix |
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.
Are we sure we want to silently ignore Suffixes?
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.
I changed this to ignore LocalVars
, warn about ignoring BigM
, and yell for everything else.
… suffix, and logging a message at the debug level about ignoring BigM Suffixes
OK, @jsiirola, this is ready for another look. |
pyomo/gdp/plugins/multiple_bigm.py
Outdated
self, other_disjunct, scratch_block, unsuccessful_solve_msg | ||
): | ||
solver = self._config.solver | ||
solver_trusted = solver.name in _trusted_solvers |
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.
I don't think we can rely on solver.name
here:
>>> SolverFactory('gurobi_direct').name
'gurobi_direct'
>>> SolverFactory('gurobi_persistent').name
'gurobi_persistent'
>>> SolverFactory('gurobi', solver_io='lp').name
'gurobi'
>>> SolverFactory('gurobi', solver_io='nl').name
'asl'
>>> SolverFactory('appsi_gurobi').name
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'LegacySolver' object has no attribute 'name'
If we are going to do this, maybe the solution is that the solvers advertise two new attributes: .algorithm
and .interface
? @mrmundt, @michaelbynum?
…ted solver name for now, and adding a TODO about how the future will be better.
Fixes # .
Summary/Motivation:
Fixes three bugs in the multiple bigm transformation:
Changes proposed in this PR:
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: