-
Notifications
You must be signed in to change notification settings - Fork 130
Deprecate LP batch solve across Python, server, and docs #915
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -337,20 +337,29 @@ def create_solution(sol): | |||||||||||||||||||||||||||||||||||||||||||||||
| sol = None | ||||||||||||||||||||||||||||||||||||||||||||||||
| total_solve_time = None | ||||||||||||||||||||||||||||||||||||||||||||||||
| if type(LP_data) is list: | ||||||||||||||||||||||||||||||||||||||||||||||||
| if len(LP_data) == 0: | ||||||||||||||||||||||||||||||||||||||||||||||||
| raise HTTPException( | ||||||||||||||||||||||||||||||||||||||||||||||||
| status_code=400, detail="LP_data list cannot be empty" | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| is_batch = True | ||||||||||||||||||||||||||||||||||||||||||||||||
| data_model_list = [] | ||||||||||||||||||||||||||||||||||||||||||||||||
| warnings = [] | ||||||||||||||||||||||||||||||||||||||||||||||||
| for i_data in LP_data: | ||||||||||||||||||||||||||||||||||||||||||||||||
| i_warnings, data_model = create_data_model(i_data) | ||||||||||||||||||||||||||||||||||||||||||||||||
| data_model_list.append(data_model) | ||||||||||||||||||||||||||||||||||||||||||||||||
| warnings.extend(i_warnings) | ||||||||||||||||||||||||||||||||||||||||||||||||
| warnings = [ | ||||||||||||||||||||||||||||||||||||||||||||||||
| "LP batch mode is deprecated. Multiple problems are now solved " | ||||||||||||||||||||||||||||||||||||||||||||||||
| "sequentially. Implement your own parallelism if needed." | ||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||
| sol = [] | ||||||||||||||||||||||||||||||||||||||||||||||||
| total_solve_time = 0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| cswarnings, solver_settings = create_solver( | ||||||||||||||||||||||||||||||||||||||||||||||||
| LP_data[0], warmstart_data | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| warnings.extend(cswarnings) | ||||||||||||||||||||||||||||||||||||||||||||||||
| sol, total_solve_time = linear_programming.BatchSolve( | ||||||||||||||||||||||||||||||||||||||||||||||||
| data_model_list, solver_settings | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| for i_data in LP_data: | ||||||||||||||||||||||||||||||||||||||||||||||||
| i_warnings, data_model = create_data_model(i_data) | ||||||||||||||||||||||||||||||||||||||||||||||||
| warnings.extend(i_warnings) | ||||||||||||||||||||||||||||||||||||||||||||||||
| i_sol = linear_programming.Solve( | ||||||||||||||||||||||||||||||||||||||||||||||||
| data_model, solver_settings=solver_settings | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
351
to
+360
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Batch solves currently ignore per-item solver settings after index 0. At Line 351-353, 🔧 Proposed fix- cswarnings, solver_settings = create_solver(
- LP_data[0], warmstart_data
- )
- warnings.extend(cswarnings)
for i_data in LP_data:
i_warnings, data_model = create_data_model(i_data)
warnings.extend(i_warnings)
+ cswarnings, solver_settings = create_solver(
+ i_data, warmstart_data
+ )
+ warnings.extend(cswarnings)
i_sol = linear_programming.Solve(
data_model, solver_settings=solver_settings
)As per coding guidelines " 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| total_solve_time += i_sol.get_solve_time() | ||||||||||||||||||||||||||||||||||||||||||||||||
| sol.append(i_sol) | ||||||||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||||||||
| warnings, data_model = create_data_model(LP_data) | ||||||||||||||||||||||||||||||||||||||||||||||||
| cswarnings, solver_settings = create_solver( | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -382,7 +391,7 @@ def create_solution(sol): | |||||||||||||||||||||||||||||||||||||||||||||||
| if i_sol.get_error_status() != ErrorStatus.Success: | ||||||||||||||||||||||||||||||||||||||||||||||||
| res.append( | ||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||
| "status": i_sol.get_error_status(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| "status": i_sol.get_error_status().name, | ||||||||||||||||||||||||||||||||||||||||||||||||
| "solution": i_sol.get_error_message(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: NVIDIA/cuopt
Length of output: 1520
🏁 Script executed:
Repository: NVIDIA/cuopt
Length of output: 716
🏁 Script executed:
Repository: NVIDIA/cuopt
Length of output: 884
Remove or relocate deprecation notices to external documentation site.
This file has been updated with multiple deprecation notices added directly to the in-repo .rst documentation:
Per cuOpt project guidelines, deprecation notices and migration guidance for RAPIDS projects are maintained on the external docs site rather than in in-repo documentation. Remove these inline deprecation references and rely on external documentation to communicate deprecated functionality.
🤖 Prompt for AI Agents