[BUG]: cuopt_json_to_cvxpy.py ignores --solver unless it is CUOPT
Maintainers usually reply within 16 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
Research direction
Start in benchmark_apis/cuopt_json_to_cvxpy.py at the -s/--solver handling; the CUOPT branch passes the requested solver, while the other branch calls prob.solve without a solver= argument. Add the requested solver to that non-CUOPT call, then rerun the issue's loop with -s SCIPY, -s OSQP, and -s SCS and confirm the log prints the matching Invoking solver ... line for each. Done means the requested solver is actually used for every named solver, not just CUOPT.
Written by the indexing model from the issue text.
Description
Version
cuopt-examples main (8c00164); cvxpy 1.7.5
Which installation method(s) does this occur on?
Pip
Describe the bug.
benchmark_apis/cuopt_json_to_cvxpy.py has a -s/--solver option ("solver to use (default: CUOPT)"), but the value is only used when it is CUOPT. For any other solver the script calls
result = prob.solve(verbose=verbose,
solver_verbose=verbose or solver_verbose)
with no solver= argument, so CVXPY falls back to its own default solver. -s SCIPY, -s OSQP, -s SCS all end up running CLARABEL here, and the printed objective and timing belong to that solver, not the one requested.
Expected: -s NAME runs the problem with solver NAME, as it already does for CUOPT.
Minimum reproducible example
cat > lp.json <<'JSON'
{"csr_constraint_matrix":{"offsets":[0,2,4],"indices":[0,1,0,1],"values":[1.0,1.0,1.0,3.0]},
"constraint_bounds":{"lower_bounds":["ninf","ninf"],"upper_bounds":[4.0,6.0]},
"objective_data":{"coefficients":[3.0,5.0],"scaling_factor":1.0,"offset":0.0},
"variable_bounds":{"lower_bounds":[0.0,0.0],"upper_bounds":["inf","inf"]},
"maximize":true,"variable_types":["C","C"]}
JSON
pip install cvxpy
for s in SCIPY OSQP SCS; do
python cuopt_json_to_cvxpy.py -s $s --verbose lp.json 2>&1 | grep "Invoking solver"
done
Relevant log output
(CVXPY) ...: Invoking solver CLARABEL to obtain a solution.
(CVXPY) ...: Invoking solver CLARABEL to obtain a solution.
(CVXPY) ...: Invoking solver CLARABEL to obtain a solution.
Environment details
macOS, CPU only, Python 3.9, cvxpy 1.7.5 (installed solvers: CLARABEL, OSQP, SCIPY, SCS)
Other/Misc.
Passing solver=solver in the non-CUOPT branch fixes it; with that change the same loop prints Invoking solver SCIPY, OSQP and SCS. I can open a PR.
- Dominant language
- Jupyter Notebook
- Stars
- 473
- Forks
- 90
- Avg merge
- 14d 10h
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuopt-examples
-
Add High-Frequency Trading Market-Making ExampleMay be free again @Iroy30 claimed this 170 days ago, and no pull request is open. Open
NVIDIA/cuopt-examples#150 · 2 assignees ·
Maintainers usually reply within 16 days
-
[BUG]: cuopt-agent outputs nothing after more than 10 minutes running and leaves with a "Regenerate response" buttonMay be free again @ramakrishnap-nv claimed this 199 days ago, and no pull request is open. Openbug
NVIDIA/cuopt-examples#135 · 1 comment · 1 assignee ·
Maintainers usually reply within 16 days
All issues in NVIDIA/cuopt-examples
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ehmpathy/rhachet-roles-ehmpathy#1443 ·
Maintainers usually reply within 1 day
-
CLI: stale build hint, non-gofmt autocomplete output and a leftover `--revit=<year>` in the docsOpenCommand Line Utility (CLI)
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4217 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nolabs-ai/deepfabric#688 ·