-
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
Enabled warm-start flag for MOSEK10 and moved var initialization to _add_vars #2647
Conversation
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.
Looks good!
# Initialize variables | ||
for m_v, p_v in zip(var_ids, var_seq): | ||
if p_v.value is not None: | ||
for sol_type in mosek.soltype.values: | ||
self._solver_model.putxxslice( | ||
sol_type, m_v, m_v + 1, [(p_v.value)]) |
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.
Question: by moving this to _add_vars()
, does this prevent the variable values from being updated between subsequent solves in the case of the persistent solver?
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.
The same task
object instance will be used over subsequent solves (when using mosek_persistent). So, the variable values from the previous solve will already be in that particular task. Pyomo would not have to pass them again. We only need to tell mosek if it should use those values or ignore them. (@jsiirola )
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.
@Utkarsh-Detha: Correct, but if the user changed the Pyomo variable value between calls to solve()
(e.g., in the context of a multistart procedure), those new values will no longer be sent to to MOSEK. I think that the correct thing to do is to leave this in _warm_start
, but if you do move it, then the logic also needs to be added to update_vars()
in mosek_persistent.py
.
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.
@Utkarsh-Detha, reminder that this PR is waiting on a response from you to the above comment from @jsiirola.
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.
@jsiirola then I suppose we just leave it as is. I will undo the changes concerning this.
(Sorry about the slow response, I have been on holiday)
(Need an answer about the effect of moving the variable warmstart on the persistent solver interface before morging)
Codecov ReportBase: 87.06% // Head: 87.06% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2647 +/- ##
=======================================
Coverage 87.06% 87.06%
=======================================
Files 757 757
Lines 84448 84455 +7
=======================================
+ Hits 73521 73529 +8
+ Misses 10927 10926 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
This looks good!
Summary/Motivation:
Issue #2613 was caused by a rare assert failure within MOSEK 10. That has since been fixed (please upgrade to MOSEK 10.0.30).
But, while looking at the warmstart function in mosek_direct.py, I noticed that a parameter required to turn on initial solution utilization (only for v10 onwards) was missing.
Changes proposed in this PR:
mosek.iparam.mio_construct_sol
in warm_start function in mosek_direct.py_warm_start
function to the_add_vars
function.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: