-
Notifications
You must be signed in to change notification settings - Fork 546
add cuopt direct solver #3620
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
base: main
Are you sure you want to change the base?
add cuopt direct solver #3620
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3620 +/- ##
==========================================
- Coverage 89.00% 85.66% -3.35%
==========================================
Files 889 890 +1
Lines 102519 102704 +185
==========================================
- Hits 91252 87981 -3271
- Misses 11267 14723 +3456
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:
|
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.
We are working on making cuopt available in our testing infrastructure; can you please add tests to this PR?
@Iroy30 - We've been able to make cuopt available on our internal testing machines. Can you please add tests to this PR? |
5dbf9dd
to
6f64094
Compare
@mrmundt Thanks! We have added tests by enabling testing cuopt with LP and MILP capabilities in tests/solvers.py. Let us know if:
The following is the testing output I get relevant to cuOpt
|
self._solver_model.set_constraint_upper_bounds(np.array(c_ub)) | ||
|
||
def _add_var(self, variables): | ||
# Map vriable to index and get var bounds |
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.
Missed typo - reported upstream to crate-ci
# Map vriable to index and get var bounds | |
# Map variable to index and get var bounds |
"""for v, c in zip(con.body.linear_vars, con.body.linear_coefs): | ||
matrix_data.append(value(c)) | ||
matrix_indices.append(self.var_name_dict[str(v)])""" |
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.
Leftover debugging? Or intended to be included?
t0 = time.time() | ||
self.solution = cuopt.linear_programming.solver.Solve(self._solver_model) | ||
t1 = time.time() |
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 is fine, but just so you're aware, we have this lovely little utility called TicTocTimer
that you may want to consider using: https://pyomo.readthedocs.io/en/latest/api/pyomo.common.timing.TicTocTimer.html
Fixes #3626
Summary/Motivation:
Add cuOpt math optimization (includes LP and MILP) solver backend to Pyomo so users can solve pyomo models with cuOpt
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: