[BUG]: cuopt_json_to_cvxpy.py ignores --solver unless it is CUOPT
メンテナーはふだん 16 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
benchmark_apis/cuopt_json_to_cvxpy.py の -s/--solver の処理から始めてください。CUOPT の分岐は要求された solver を渡しますが、もう一方の分岐は prob.solve を solver= 引数なしで呼び出します。その非 CUOPT の呼び出しに要求された solver を追加し、その後、-s SCIPY、-s OSQP、-s SCS で issue のループを再実行し、それぞれについてログが一致する Invoking solver ... の行を出力することを確認してください。完了とは、CUOPT だけでなく、名前付きの各 solver に対して要求された solver が実際に使用されることを意味します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Jupyter Notebook
- スター
- 473
- フォーク
- 90
- 平均マージ
- 14日 10時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/cuopt-examples のほかの issue
-
Add High-Frequency Trading Market-Making Example再び着手できるかも @Iroy30 が 170 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
NVIDIA/cuopt-examples#150 · 担当者 2 名 ·
メンテナーはふだん 16 日以内に返信
-
[BUG]: cuopt-agent outputs nothing after more than 10 minutes running and leaves with a "Regenerate response" button再び着手できるかも @ramakrishnap-nv が 200 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
NVIDIA/cuopt-examples#135 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 16 日以内に返信
NVIDIA/cuopt-examples の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
MUKE-coder/grit#240 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
neutralinojs/neutralinojs-cli#474 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ehmpathy/rhachet-roles-ehmpathy#1443 ·
メンテナーはふだん 1 日以内に返信
-
data only (no code) enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信