From c358dd8012d10d2cb42730ebb3cb99734cead36d Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 19 May 2025 10:47:35 -0500 Subject: [PATCH 01/49] Address review comments --- docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst index 133f76c65a..30e010e97f 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst @@ -208,7 +208,7 @@ Copy the code below into a file called ``lp_example.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. @@ -423,7 +423,7 @@ Copy the code below into a file called ``lp_example_mps.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. From 7efb11456bb41ddb32d80a81082f2fef8ab4010c Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 19 May 2025 10:55:31 -0500 Subject: [PATCH 02/49] Add cli.rst --- docs/cuopt/source/cuopt-c/lp-milp/cli.rst | 8 ++++++++ docs/cuopt/source/cuopt-c/lp-milp/index.rst | 1 + 2 files changed, 9 insertions(+) create mode 100644 docs/cuopt/source/cuopt-c/lp-milp/cli.rst diff --git a/docs/cuopt/source/cuopt-c/lp-milp/cli.rst b/docs/cuopt/source/cuopt-c/lp-milp/cli.rst new file mode 100644 index 0000000000..51bf2a4c4b --- /dev/null +++ b/docs/cuopt/source/cuopt-c/lp-milp/cli.rst @@ -0,0 +1,8 @@ +CLI for LP and MILP +=================== + +The cuOpt CLI is a command-line interface for the cuOpt LP/MILP API. It is a simple interface that allows you to solve LP/MILP problems from the command line. This CLI is based on C/C++ API. + +.. literalinclude:: cuopt-cli-help.txt + :language: shell + :linenos: \ No newline at end of file diff --git a/docs/cuopt/source/cuopt-c/lp-milp/index.rst b/docs/cuopt/source/cuopt-c/lp-milp/index.rst index 683459aa95..c408831bcb 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/index.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/index.rst @@ -11,5 +11,6 @@ This section contains details on the cuOpt LP/MILP C API. lp-milp-c-api.rst ../../lp-milp-settings.rst + cli.rst lp-example.rst milp-examples.rst \ No newline at end of file From fd62f8318e9a7c573a65675d5c67cc219213e14c Mon Sep 17 00:00:00 2001 From: Rajesh Gandham Date: Mon, 19 May 2025 11:26:19 -0700 Subject: [PATCH 03/49] Cleanup CLI docs --- docs/cuopt/source/cuopt-c/lp-milp/cli.rst | 161 +++++++++++++++++- .../source/cuopt-c/lp-milp/lp-example.rst | 52 +----- .../source/cuopt-c/lp-milp/lp-milp-c-api.rst | 12 +- .../source/cuopt-c/lp-milp/milp-examples.rst | 77 +-------- 4 files changed, 161 insertions(+), 141 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/lp-milp/cli.rst b/docs/cuopt/source/cuopt-c/lp-milp/cli.rst index 51bf2a4c4b..8463a6d412 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/cli.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/cli.rst @@ -1,8 +1,163 @@ CLI for LP and MILP =================== -The cuOpt CLI is a command-line interface for the cuOpt LP/MILP API. It is a simple interface that allows you to solve LP/MILP problems from the command line. This CLI is based on C/C++ API. +The cuopt_cli is a command-line interface for LP/MILP solvers that accepts MPS format files as input models. It provides command-line arguments to control all solver settings and parameters when solving linear and mixed-integer programming problems. + + +To see all available options and their descriptions: + +.. code-block:: bash + + cuopt_cli --help + +This will display the complete list of command-line arguments and their usage: .. literalinclude:: cuopt-cli-help.txt - :language: shell - :linenos: \ No newline at end of file + :language: shell + :linenos: + + +Basic Usage +########## + +To solve a simple LP problem using cuopt_cli: + +.. code-block:: bash + + # Create a sample MPS file + echo "* optimize + * cost = -0.2 * VAR1 + 0.1 * VAR2 + * subject to + * 3 * VAR1 + 4 * VAR2 <= 5.4 + * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 + NAME SAMPLE + ROWS + N COST + L ROW1 + L ROW2 + COLUMNS + VAR1 COST -0.2 + VAR1 ROW1 3.0 + VAR1 ROW2 2.7 + VAR2 COST 0.1 + VAR2 ROW1 4.0 + VAR2 ROW2 10.1 + RHS + RHS1 ROW1 5.4 + RHS1 ROW2 4.9 + ENDATA" > sample.mps + + # Solve using default settings + cuopt_cli sample.mps + +This should give you the following output: + +.. code-block:: bash + :caption: Output + + [2025-05-19 10:09:28:353715] [CUOPT] [info ] Running file sample.mps + Solving a problem with 2 constraints 2 variables (0 integers) and 4 nonzeros + Objective offset 0.000000 scaling_factor 1.000000 + Running concurrent + + Dual simplex finished in 0.00 seconds + Iter Primal Obj. Dual Obj. Gap Primal Res. Dual Res. Time + 0 +0.00000000e+00 +0.00000000e+00 0.00e+00 0.00e+00 2.00e-01 0.033s + PDLP finished + Concurrent time: 0.036s + Solved with dual simplex + Status: Optimal Objective: -3.60000000e-01 Iterations: 1 Time: 0.036s + + +Mixed Integer Programming Example +############################### + +Here's an example of solving a Mixed Integer Programming (MIP) problem using the CLI: + +.. code-block:: bash + + echo "* Optimal solution -28 + * Has 5 nodes + NAME MIP_SAMPLE + ROWS + N OBJ + L C1 + L C2 + L C3 + COLUMNS + MARK0001 'MARKER' 'INTORG' + X1 OBJ -7 + X1 C1 -1 + X1 C2 5 + X1 C3 -2 + X2 OBJ -2 + X2 C1 2 + X2 C2 1 + X2 C3 -2 + MARK0001 'MARKER' 'INTEND' + RHS + RHS C1 4 + RHS C2 20 + RHS C3 -7 + BOUNDS + UP BOUND X1 10 + UP BOUND X2 10 + ENDATA" > mip_sample.mps + + # Solve the MIP problem with custom parameters + cuopt_cli mip_sample.mps --mip-gap 0.01 --time-limit 10 + +This should produce output similar to: + +.. code-block:: bash + :caption: Output + + [2025-05-19 11:18:19:229055] [CUOPT] [info ] Running file mip_sample.mps + Solving a problem with 3 constraints 2 variables (2 integers) and 6 nonzeros + Objective offset 0.000000 scaling_factor 1.000000 + After trivial presolve updated 3 constraints 2 variables + Running presolve! + After trivial presolve updated 3 constraints 2 variables + Solving LP root relaxation + Scaling matrix. Maximum column norm 1.225464e+00 + Dual Simplex Phase 1 + Dual feasible solution found. + Dual Simplex Phase 2 + Iter Objective Primal Infeas Perturb Time + 1 -3.04000000e+01 7.57868205e+00 0.00e+00 0.00 + + Root relaxation solution found in 3 iterations and 0.00s + Root relaxation objective -3.01818182e+01 + + Strong branching on 2 fractional variables + | Explored | Unexplored | Objective | Bound | Depth | Iter/Node | Gap | Time + 0 1 +inf -3.018182e+01 1 0.0e+00 - 0.00 + B 3 1 -2.700000e+01 -2.980000e+01 2 6.7e-01 10.4% 0.00 + B&B added a solution to population, solution queue size 0 with objective -27 + B 4 0 -2.800000e+01 -2.980000e+01 2 7.5e-01 6.4% 0.00 + B&B added a solution to population, solution queue size 1 with objective -28 + Explored 4 nodes in 0.00s. + Absolute Gap 0.000000e+00 Objective -2.8000000000000004e+01 Lower Bound -2.8000000000000004e+01 + Optimal solution found. + Consuming B&B solutions, solution queue size 2 + Solution objective: -28.000000 , relative_mip_gap 0.000000 solution_bound -28.000000 presolve_time 0.227418 total_solve_time 0.000000 max constraint violation 0.000000 max int violation 0.000000 max var bounds violation 0.000000 nodes 4 simplex_iterations 3 + + +Using Solver Parameters +###################### + +You can customize the solver behavior using various command line parameters. Some examples are shown below: + +.. code-block:: bash + + # Set absolute primal tolerance and PDLP solver mode + cuopt_cli sample.mps --absolute-primal-tolerance 0.0001 --pdlp-solver-mode 1 + + # Set time limit and use specific solver method + cuopt_cli sample.mps --time-limit 5 --method pdlp + + # Control output verbosity + cuopt_cli sample.mps --verbose 2 + + # Output the logs to a .log file and solution to a .sol file + cuopt_cli mip_sample.mps --log-file mip_sample.log --solution-file mip_sample.sol diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst index 30e010e97f..976e433e79 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst @@ -493,54 +493,4 @@ You should see the following output: x1 = 1.800000 x2 = 0.000000 - Solver completed successfully! - - -Example for CLI with MPS file ------------------------------- - -This example demonstrates how to use the cuOpt CLI to solve an MPS file and how to set the parameters for the solver. - -.. code-block:: bash - - echo "* optimize - * cost = -0.2 * VAR1 + 0.1 * VAR2 - * subject to - * 3 * VAR1 + 4 * VAR2 <= 5.4 - * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 - NAME good-1 - ROWS - N COST - L ROW1 - L ROW2 - COLUMNS - VAR1 COST -0.2 - VAR1 ROW1 3 ROW2 2.7 - VAR2 COST 0.1 - VAR2 ROW1 4 ROW2 10.1 - RHS - RHS1 ROW1 5.4 ROW2 4.9 - ENDATA" > sample.mps - - # Solve the MPS file with the additional parameter settings - cuopt_cli sample.mps --absolute-primal-tolerance 0.0001 --pdlp-solver-mode 1 --time-limit 5 - - -This should give you the following output: - -.. code-block:: bash - :caption: Output - - [2025-05-17 15:22:16:143587] [CUOPT] [info ] Running file sample.mps - Solving a problem with 2 constraints 2 variables (0 integers) and 4 nonzeros - Objective offset 0.000000 scaling_factor 1.000000 - Running concurrent - - Dual simplex finished in 0.00 seconds - Iter Primal Obj. Dual Obj. Gap Primal Res. Dual Res. Time - 0 +0.00000000e+00 +0.00000000e+00 0.00e+00 0.00e+00 2.00e-01 0.011s - PDLP finished - Concurrent time: 0.012s - Solved with dual simplex - Status: Optimal Objective: -3.60000000e-01 Iterations: 1 Time: 0.012s - + Solver completed successfully! \ No newline at end of file diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst index 199b3f691f..2065003b6f 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst @@ -165,14 +165,4 @@ More details on the parameters can be found in the `LP/MILP settings <../../lp-m .. doxygenfunction:: cuOptGetMIPGap .. doxygenfunction:: cuOptGetSolutionBound .. doxygenfunction:: cuOptGetDualSolution -.. doxygenfunction:: cuOptGetReducedCosts - -CLI for LP and MILP -=================== - -The cuOpt CLI is a command-line interface for the cuOpt LP/MILP API. It is a simple interface that allows you to solve LP/MILP problems from the command line. This CLI is based on C/C++ API. - -.. literalinclude:: cuopt-cli-help.txt - :language: shell - :linenos: - +.. doxygenfunction:: cuOptGetReducedCosts \ No newline at end of file diff --git a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst index 042a291e5f..02dd825cb6 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst @@ -529,79 +529,4 @@ You should see the following output: x1 = 4.000000 x2 = 0.000000 - Solver completed successfully! - -Example for CLI with MPS file ------------------------------- - -This example demonstrates how to use the cuOpt CLI to solve an MPS file and how to set the parameters for the solver. - -.. code-block:: bash - - # Create a MPS file in the current directory - echo "* Example 2.1 from N & W - * Optimal solution -28 - * Has 5 nodes - NAME EXAMPLE21 - ROWS - N OBJ - L C1 - L C2 - L C3 - COLUMNS - MARK0001 'MARKER' 'INTORG' - X1 OBJ -7 - X1 C1 -1 - X1 C2 5 - X1 C3 -2 - X2 OBJ -2 - X2 C1 2 - X2 C2 1 - X2 C3 -2 - MARK0001 'MARKER' 'INTEND' - RHS - RHS C1 4 - RHS C2 20 - RHS C3 -7 - BOUNDS - UP BOUND X1 10 - UP BOUND X2 10 - ENDATA" > sample.mps - - # Solve the MPS file with the additional parameter settings - cuopt_cli sample.mps --mip-absolute-tolerance 0.0001 --method 0 --time-limit 5 - -This should give you the following output: - -.. code-block:: bash - :caption: Output - - [2025-05-17 15:29:35:484327] [CUOPT] [info ] Running file sample.mps - Solving a problem with 3 constraints 2 variables (2 integers) and 6 nonzeros - Objective offset 0.000000 scaling_factor 1.000000 - After trivial presolve updated 3 constraints 2 variables - Running presolve! - After trivial presolve updated 3 constraints 2 variables - Solving LP root relaxation - Scaling matrix. Maximum column norm 1.225464e+00 - Dual Simplex Phase 1 - Dual feasible solution found. - Dual Simplex Phase 2 - Iter Objective Primal Infeas Perturb Time - 1 -3.04000000e+01 7.57868205e+00 0.00e+00 0.00 - - Root relaxation solution found in 3 iterations and 0.00s - Root relaxation objective -3.01818182e+01 - - Strong branching on 2 fractional variables - | Explored | Unexplored | Objective | Bound | Depth | Iter/Node | Gap | Time - 0 1 +inf -3.018182e+01 1 0.0e+00 - 0.00 - B 3 1 -2.700000e+01 -2.980000e+01 2 6.7e-01 10.4% 0.00 - B&B added a solution to population, solution queue size 0 with objective -27 - B 4 0 -2.800000e+01 -2.980000e+01 2 7.5e-01 6.4% 0.00 - B&B added a solution to population, solution queue size 1 with objective -28 - Explored 4 nodes in 0.00s. - Absolute Gap 0.000000e+00 Objective -2.8000000000000004e+01 Lower Bound -2.8000000000000004e+01 - Optimal solution found. - Consuming B&B solutions, solution queue size 2 - Solution objective: -28.000000 , relative_mip_gap 0.000000 solution_bound -28.000000 presolve_time 0.026420 total_solve_time 0.000000 max constraint violation 0.000000 max int violation 0.000000 max var bounds violation 0.000000 nodes 4 simplex_iterations + Solver completed successfully! \ No newline at end of file From aae447ff03d76718c8c2801aeb14193cd0baf73e Mon Sep 17 00:00:00 2001 From: Rajesh Gandham Date: Mon, 19 May 2025 11:48:53 -0700 Subject: [PATCH 04/49] Fix warnings and errors --- docs/cuopt/source/cuopt-c/lp-milp/cli.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/lp-milp/cli.rst b/docs/cuopt/source/cuopt-c/lp-milp/cli.rst index 8463a6d412..856b378543 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/cli.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/cli.rst @@ -18,7 +18,7 @@ This will display the complete list of command-line arguments and their usage: Basic Usage -########## +########### To solve a simple LP problem using cuopt_cli: @@ -70,7 +70,7 @@ This should give you the following output: Mixed Integer Programming Example -############################### +################################# Here's an example of solving a Mixed Integer Programming (MIP) problem using the CLI: @@ -112,7 +112,7 @@ This should produce output similar to: .. code-block:: bash :caption: Output - [2025-05-19 11:18:19:229055] [CUOPT] [info ] Running file mip_sample.mps + [2025-05-19 11:18:19:229055] [CUOPT] [info ] Running file mip_sample.mps Solving a problem with 3 constraints 2 variables (2 integers) and 6 nonzeros Objective offset 0.000000 scaling_factor 1.000000 After trivial presolve updated 3 constraints 2 variables @@ -144,7 +144,7 @@ This should produce output similar to: Using Solver Parameters -###################### +####################### You can customize the solver behavior using various command line parameters. Some examples are shown below: From a1a21eeb035f5c0ed0a107ee4f0f62854ef534b3 Mon Sep 17 00:00:00 2001 From: Rajesh Gandham Date: Mon, 19 May 2025 13:12:58 -0700 Subject: [PATCH 05/49] Move commandline interface two levels up --- docs/cuopt/source/conf.py | 2 +- docs/cuopt/source/cuopt-c/lp-milp/index.rst | 1 - docs/cuopt/source/cuopt-c/quick-start.rst | 63 +------------------ .../{cuopt-c/lp-milp => cuopt-cli}/cli.rst | 31 ++------- docs/cuopt/source/cuopt-cli/index.rst | 21 +++++++ docs/cuopt/source/cuopt-cli/quick-start.rst | 15 +++++ docs/cuopt/source/index.rst | 10 +++ 7 files changed, 54 insertions(+), 89 deletions(-) rename docs/cuopt/source/{cuopt-c/lp-milp => cuopt-cli}/cli.rst (84%) create mode 100644 docs/cuopt/source/cuopt-cli/index.rst create mode 100644 docs/cuopt/source/cuopt-cli/quick-start.rst diff --git a/docs/cuopt/source/conf.py b/docs/cuopt/source/conf.py index 4dc52f90dc..2d10b369f2 100644 --- a/docs/cuopt/source/conf.py +++ b/docs/cuopt/source/conf.py @@ -30,7 +30,7 @@ subprocess.run(["cuopt_sh", "--help"], stdout=open("cuopt-server/client-api/sh-cli-help.txt", "w")) # Run cuopt_cli help command and save output -subprocess.run(["cuopt_cli", "--help"], stdout=open("cuopt-c/lp-milp/cuopt-cli-help.txt", "w")) +subprocess.run(["cuopt_cli", "--help"], stdout=open("cuopt-cli/cuopt-cli-help.txt", "w")) with open('cuopt_spec.yaml', 'w') as f: yaml.dump(get_openapi( diff --git a/docs/cuopt/source/cuopt-c/lp-milp/index.rst b/docs/cuopt/source/cuopt-c/lp-milp/index.rst index c408831bcb..683459aa95 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/index.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/index.rst @@ -11,6 +11,5 @@ This section contains details on the cuOpt LP/MILP C API. lp-milp-c-api.rst ../../lp-milp-settings.rst - cli.rst lp-example.rst milp-examples.rst \ No newline at end of file diff --git a/docs/cuopt/source/cuopt-c/quick-start.rst b/docs/cuopt/source/cuopt-c/quick-start.rst index 8388b47f08..73767264b1 100644 --- a/docs/cuopt/source/cuopt-c/quick-start.rst +++ b/docs/cuopt/source/cuopt-c/quick-start.rst @@ -52,65 +52,4 @@ For CUDA 12.x: libcuopt=25.5.* python=3.12 cuda-version=12.8 -Please visit examples under each section to learn how to use the cuOpt C API. - - -Smoke Test -========== - -To test the installation, you can run the following command: - -.. code-block:: bash - - cuopt_cli --help - -This will print the help message for the cuOpt CLI. If the installation is successful, you should see the help message. - -Lets try to solve a simple LP problem: - -.. code-block:: bash - - echo "* optimize - * cost = 0.2 * VAR1 + 0.1 * VAR2 - * subject to - * 3 * VAR1 + 4 * VAR2 <= 5.4 - * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 - NAME good-1 - ROWS - N COST - L ROW1 - L ROW2 - COLUMNS - VAR1 COST 0.2 - VAR1 ROW1 3 ROW2 2.7 - VAR2 COST 0.1 - VAR2 ROW1 4 ROW2 10.1 - RHS - RHS1 ROW1 5.4 ROW2 4.9 - ENDATA" > sample.mps - - cuopt_cli sample.mps - -This will print the solution to the console. - -.. code-block:: text - - [2025-05-17 12:33:16:228750] [CUOPT] [info ] Running file sample.mps - Solving a problem with 2 constraints 2 variables (0 integers) and 4 nonzeros - Objective offset 0.000000 scaling_factor 1.000000 - Running concurrent - - Dual simplex finished in 0.00 seconds - Iter Primal Obj. Dual Obj. Gap Primal Res. Dual Res. Time - 0 +0.00000000e+00 +0.00000000e+00 0.00e+00 0.00e+00 2.00e-01 0.024s - PDLP finished - Concurrent time: 0.026s - Solved with dual simplex - Status: Optimal Objective: -3.60000000e-01 Iterations: 1 Time: 0.026s - - - - - - - +Please visit examples under each section to learn how to use the cuOpt C API. \ No newline at end of file diff --git a/docs/cuopt/source/cuopt-c/lp-milp/cli.rst b/docs/cuopt/source/cuopt-cli/cli.rst similarity index 84% rename from docs/cuopt/source/cuopt-c/lp-milp/cli.rst rename to docs/cuopt/source/cuopt-cli/cli.rst index 856b378543..936ce42567 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/cli.rst +++ b/docs/cuopt/source/cuopt-cli/cli.rst @@ -1,21 +1,5 @@ -CLI for LP and MILP -=================== - -The cuopt_cli is a command-line interface for LP/MILP solvers that accepts MPS format files as input models. It provides command-line arguments to control all solver settings and parameters when solving linear and mixed-integer programming problems. - - -To see all available options and their descriptions: - -.. code-block:: bash - - cuopt_cli --help - -This will display the complete list of command-line arguments and their usage: - -.. literalinclude:: cuopt-cli-help.txt - :language: shell - :linenos: - +Examples +======== Basic Usage ########### @@ -105,7 +89,7 @@ Here's an example of solving a Mixed Integer Programming (MIP) problem using the ENDATA" > mip_sample.mps # Solve the MIP problem with custom parameters - cuopt_cli mip_sample.mps --mip-gap 0.01 --time-limit 10 + cuopt_cli mip_sample.mps --mip-absolute-gap 0.01 --time-limit 10 This should produce output similar to: @@ -154,10 +138,7 @@ You can customize the solver behavior using various command line parameters. Som cuopt_cli sample.mps --absolute-primal-tolerance 0.0001 --pdlp-solver-mode 1 # Set time limit and use specific solver method - cuopt_cli sample.mps --time-limit 5 --method pdlp - - # Control output verbosity - cuopt_cli sample.mps --verbose 2 + cuopt_cli sample.mps --time-limit 5 --method pdlp - # Output the logs to a .log file and solution to a .sol file - cuopt_cli mip_sample.mps --log-file mip_sample.log --solution-file mip_sample.sol + # Turn off output to console and output the logs to a .log file and solution to a .sol file + cuopt_cli mip_sample.mps --log-to-console false --log-file mip_sample.log --solution-file mip_sample.sol diff --git a/docs/cuopt/source/cuopt-cli/index.rst b/docs/cuopt/source/cuopt-cli/index.rst new file mode 100644 index 0000000000..2aa2296e37 --- /dev/null +++ b/docs/cuopt/source/cuopt-cli/index.rst @@ -0,0 +1,21 @@ +Command Line Interface +====================== + +The cuopt_cli is a command-line interface for LP/MILP solvers that accepts MPS format files as input models. It provides command-line arguments to control all solver settings and parameters when solving linear and mixed-integer programming problems. + +.. toctree:: + :maxdepth: 3 + :caption: Command Line Interface Overview + :name: Command Line Interface Overview + :titlesonly: + + quick-start.rst + +.. toctree:: + :maxdepth: 3 + :caption: Usage + :name: Usage + :titlesonly: + + cli.rst + diff --git a/docs/cuopt/source/cuopt-cli/quick-start.rst b/docs/cuopt/source/cuopt-cli/quick-start.rst new file mode 100644 index 0000000000..727793d821 --- /dev/null +++ b/docs/cuopt/source/cuopt-cli/quick-start.rst @@ -0,0 +1,15 @@ +================= +Quickstart Guide +================= + +cuopt_cli is built as part of the libcuopt package. To see all available options and their descriptions: + +.. code-block:: bash + + cuopt_cli --help + +This will display the complete list of command-line arguments and their usage: + +.. literalinclude:: cuopt-cli-help.txt + :language: shell + :linenos: \ No newline at end of file diff --git a/docs/cuopt/source/index.rst b/docs/cuopt/source/index.rst index 73fa971ed3..60f5c97de5 100644 --- a/docs/cuopt/source/index.rst +++ b/docs/cuopt/source/index.rst @@ -50,6 +50,16 @@ Server (cuopt-server) Server Overview +================================== +Command Line Interface (cuopt-cli) +================================== +.. toctree:: + :maxdepth: 1 + :caption: Command Line Interface + :name: Command Line Interface + + Command Line Interface Overview + =============================== Third Party Modeling Languages From f4de673a6955d88c1dad6b855fc3fb25e27c3f9b Mon Sep 17 00:00:00 2001 From: Rajesh Gandham Date: Tue, 20 May 2025 06:03:28 -0700 Subject: [PATCH 06/49] Fix review comments --- docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst | 1 - docs/cuopt/source/cuopt-cli/cli.rst | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst index 02dd825cb6..5dcde4b079 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst @@ -451,7 +451,6 @@ Build and run the example # Create a MPS file in the current directory echo "* Example 2.1 from N & W * Optimal solution -28 - * Has 5 nodes NAME EXAMPLE21 ROWS N OBJ diff --git a/docs/cuopt/source/cuopt-cli/cli.rst b/docs/cuopt/source/cuopt-cli/cli.rst index 936ce42567..2144ce28ac 100644 --- a/docs/cuopt/source/cuopt-cli/cli.rst +++ b/docs/cuopt/source/cuopt-cli/cli.rst @@ -61,7 +61,6 @@ Here's an example of solving a Mixed Integer Programming (MIP) problem using the .. code-block:: bash echo "* Optimal solution -28 - * Has 5 nodes NAME MIP_SAMPLE ROWS N OBJ @@ -80,7 +79,7 @@ Here's an example of solving a Mixed Integer Programming (MIP) problem using the X2 C3 -2 MARK0001 'MARKER' 'INTEND' RHS - RHS C1 4 + RHS C1 4 RHS C2 20 RHS C3 -7 BOUNDS From 2e62582ef1245593b9eebbf0dc115e412f0521da Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 21 May 2025 15:01:39 -0500 Subject: [PATCH 07/49] Adding changes from Andrew to add versions and adding link to cli --- .gitignore | 1 + docs/cuopt/source/conf.py | 8 ++++++++ .../cuopt/source/cuopt-cli/{cli.rst => cli-examples.rst} | 0 docs/cuopt/source/cuopt-cli/index.rst | 2 +- docs/cuopt/source/cuopt-cli/quick-start.rst | 9 +++++++-- 5 files changed, 17 insertions(+), 3 deletions(-) rename docs/cuopt/source/cuopt-cli/{cli.rst => cli-examples.rst} (100%) diff --git a/.gitignore b/.gitignore index 603ee4b05c..9755d86dce 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ error_log.txt docs/cuopt/source/cuopt-c/lp-milp/cuopt-cli-help.txt docs/cuopt/source/cuopt-server/client-api/sh-cli-help.txt docs/cuopt/source/cuopt-server/server-api/server-cli-help.txt +docs/cuopt/source/cuopt-cli/cuopt-cli-help.txt docs/cuopt/source/cuopt_spec.yaml python/cuopt_self_hosted/cuopt_sh_client/tests/utils/certs/*.key docs/cuopt/build diff --git a/docs/cuopt/source/conf.py b/docs/cuopt/source/conf.py index 2d10b369f2..ed3f559fe1 100644 --- a/docs/cuopt/source/conf.py +++ b/docs/cuopt/source/conf.py @@ -146,6 +146,10 @@ html_theme_options = { 'collapse_navigation': False, 'navigation_depth': 6, + "switcher": { + "json_url": "../versions1.json", + "version_match": release, + }, 'extra_head': [ # Adding Adobe Analytics ''' @@ -159,11 +163,15 @@ "show_nav_level": 2 } + + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_css_files = ["swagger-nvidia.css"] +html_extra_path = ["versions1.json"] + # -- Options for Breathe (Doxygen) ---------------------------------------- breathe_projects = { diff --git a/docs/cuopt/source/cuopt-cli/cli.rst b/docs/cuopt/source/cuopt-cli/cli-examples.rst similarity index 100% rename from docs/cuopt/source/cuopt-cli/cli.rst rename to docs/cuopt/source/cuopt-cli/cli-examples.rst diff --git a/docs/cuopt/source/cuopt-cli/index.rst b/docs/cuopt/source/cuopt-cli/index.rst index 2aa2296e37..fd0eae5295 100644 --- a/docs/cuopt/source/cuopt-cli/index.rst +++ b/docs/cuopt/source/cuopt-cli/index.rst @@ -17,5 +17,5 @@ The cuopt_cli is a command-line interface for LP/MILP solvers that accepts MPS f :name: Usage :titlesonly: - cli.rst + cli-examples.rst diff --git a/docs/cuopt/source/cuopt-cli/quick-start.rst b/docs/cuopt/source/cuopt-cli/quick-start.rst index 727793d821..d59d568368 100644 --- a/docs/cuopt/source/cuopt-cli/quick-start.rst +++ b/docs/cuopt/source/cuopt-cli/quick-start.rst @@ -2,7 +2,10 @@ Quickstart Guide ================= -cuopt_cli is built as part of the libcuopt package. To see all available options and their descriptions: +cuopt_cli is built as part of the libcuopt package and you can follow these `instructions <../cuopt-c/quick-start.html>`_ to install it. + +To see all available options and their descriptions: + .. code-block:: bash @@ -12,4 +15,6 @@ This will display the complete list of command-line arguments and their usage: .. literalinclude:: cuopt-cli-help.txt :language: shell - :linenos: \ No newline at end of file + :linenos: + +Please refer to `parameter settings <../lp-milp-settings.html>`_ for more details on default values and other options. \ No newline at end of file From f80798c43ab25459242f830565e406284048f392 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Wed, 21 May 2025 14:45:10 -0700 Subject: [PATCH 08/49] Update lp-milp-c-api.rst --- .../source/cuopt-c/lp-milp/lp-milp-c-api.rst | 231 +++++++++++------- 1 file changed, 145 insertions(+), 86 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst index 2065003b6f..fbd312430e 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst @@ -3,76 +3,52 @@ cuOpt LP/MILP C API Reference This section contains the cuOpt LP/MILP C API reference. -Types ------ +Integer and Floating-Point Types +--------------------------------- + +cuOpt may be built with 32 or 64 bit integer and floating-point types. The C API uses a `typedef` for floating point and integer types to abstract the size of these types. -.. doxygentypedef:: cuOptOptimizationProblem -.. doxygentypedef:: cuOptSolverSettings -.. doxygentypedef:: cuOptSolution -.. doxygentypedef:: cuopt_float_t .. doxygentypedef:: cuopt_int_t +.. doxygentypedef:: cuopt_float_t -Status Constants ----------------- +You may use the following functions to determine the number of bytes used to represent these types in your build + +.. doxygenfunction:: cuOptGetIntSize +.. doxygenfunction:: cuOptGetFloatSize + +Status Codes +------------ + +Every function in the C API returns a status code that indicates success or failure. The following status codes are defined -.. Status code constants .. doxygendefine:: CUOPT_SUCCESS .. doxygendefine:: CUOPT_INVALID_ARGUMENT .. doxygendefine:: CUOPT_MPS_FILE_ERROR .. doxygendefine:: CUOPT_MPS_PARSE_ERROR -Parameter Constants -------------------- +Optimization Problem +-------------------- -These constants would be used as the parameter name in the `cuOptSetParameter `_ and `cuOptGetParameter `_ functions. More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. +An optimization problem is represented via a `cuOptOptimizationProblem` -.. LP/MIP parameter string constants -.. doxygendefine:: CUOPT_ABSOLUTE_DUAL_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_DUAL_TOLERANCE -.. doxygendefine:: CUOPT_ABSOLUTE_PRIMAL_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_PRIMAL_TOLERANCE -.. doxygendefine:: CUOPT_ABSOLUTE_GAP_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_GAP_TOLERANCE -.. doxygendefine:: CUOPT_INFEASIBILITY_DETECTION -.. doxygendefine:: CUOPT_STRICT_INFEASIBILITY -.. doxygendefine:: CUOPT_PRIMAL_INFEASIBLE_TOLERANCE -.. doxygendefine:: CUOPT_DUAL_INFEASIBLE_TOLERANCE -.. doxygendefine:: CUOPT_ITERATION_LIMIT -.. doxygendefine:: CUOPT_TIME_LIMIT -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE -.. doxygendefine:: CUOPT_METHOD -.. doxygendefine:: CUOPT_PER_CONSTRAINT_RESIDUAL -.. doxygendefine:: CUOPT_SAVE_BEST_PRIMAL_SO_FAR -.. doxygendefine:: CUOPT_FIRST_PRIMAL_FEASIBLE -.. doxygendefine:: CUOPT_LOG_FILE -.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE -.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE -.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE -.. doxygendefine:: CUOPT_MIP_SCALING -.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY -.. doxygendefine:: CUOPT_NUM_CPU_THREADS +.. doxygentypedef:: cuOptOptimizationProblem -Termination Status Constants ----------------------------- +Optimization problems can be created via three different functions -These constants would be used as the termination status in the `cuOptGetTerminationStatus `_ function. +.. doxygenfunction:: cuOptReadProblem +.. doxygenfunction:: cuOptCreateProblem +.. doxygenfunction:: cuOptCreateRangedProblem -.. LP/MIP termination status constants -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NO_TERMINATION -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_OPTIMAL -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_INFEASIBLE -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_UNBOUNDED -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_ITERATION_LIMIT -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_TIME_LIMIT -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NUMERICAL_ERROR -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_PRIMAL_FEASIBLE -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_FEASIBLE_FOUND -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_CONCURRENT_LIMIT +A optimization problem must be destroyed with the following function + +.. doxygenfunction:: cuOptDestroyProblem + +Certain constants are needed to define an optimization problem. These constants are described below. Objective Sense Constants ------------------------- -These would be used as the objective sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +These constants are used to define the objective sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_MINIMIZE .. doxygendefine:: CUOPT_MAXIMIZE @@ -80,7 +56,7 @@ These would be used as the objective sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +These constants are used to define the constraint sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_LESS_THAN .. doxygendefine:: CUOPT_GREATER_THAN @@ -89,7 +65,7 @@ These would be used as the constraint sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +These constants are used to define the the variable type in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_CONTINUOUS .. doxygendefine:: CUOPT_INTEGER @@ -97,39 +73,15 @@ These would be used as the variable type in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +This constant may be used to represent infinity in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_INFINITY -PDLP Solver Mode Constants --------------------------- +Querying an optimization problem +-------------------------------- -These would be used as the PDLP solver mode while setting solver parameters using `cuOptSetParameter `_. - -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE1 -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE2 -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_METHODICAL1 -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_FAST1 +The following functions may be used to get information about an `cuOptimizationProblem` -Method Constants ----------------- - -These would be used as the method while setting solver parameters using `cuOptSetParameter `_. - -.. doxygendefine:: CUOPT_METHOD_CONCURRENT -.. doxygendefine:: CUOPT_METHOD_PDLP -.. doxygendefine:: CUOPT_METHOD_DUAL_SIMPLEX - -Functions ---------- - -.. cuopt_c.h functions -.. doxygenfunction:: cuOptGetFloatSize -.. doxygenfunction:: cuOptGetIntSize -.. doxygenfunction:: cuOptReadProblem -.. doxygenfunction:: cuOptCreateProblem -.. doxygenfunction:: cuOptCreateRangedProblem -.. doxygenfunction:: cuOptDestroyProblem .. doxygenfunction:: cuOptGetNumConstraints .. doxygenfunction:: cuOptGetNumVariables .. doxygenfunction:: cuOptGetObjectiveSense @@ -144,10 +96,29 @@ Functions .. doxygenfunction:: cuOptGetVariableLowerBounds .. doxygenfunction:: cuOptGetVariableUpperBounds .. doxygenfunction:: cuOptGetVariableTypes +.. doxygenfunction:: cuOptIsMIP + + +Solver Settings +--------------- + +Settings are used to configure the LP/MIP solvers. All settings are stored in a `cuOptSolverSettings` object. + + +.. doxygentypedef:: cuOptSolverSettings + +A `cuOptSolverSettings` object is created with `cuOptCreateSolverSettings` + .. doxygenfunction:: cuOptCreateSolverSettings + +When you are done with a solve you should destroy a `cuOptSolverSettings` object with + .. doxygenfunction:: cuOptDestroySolverSettings -More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. + +Setting Parameters +------------------ +The following functions are used to set and get parameters. You can find more details on the available parameters in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. .. doxygenfunction:: cuOptSetParameter .. doxygenfunction:: cuOptGetParameter @@ -155,9 +126,76 @@ More details on the parameters can be found in the `LP/MILP settings <../../lp-m .. doxygenfunction:: cuOptGetIntegerParameter .. doxygenfunction:: cuOptSetFloatParameter .. doxygenfunction:: cuOptGetFloatParameter -.. doxygenfunction:: cuOptIsMIP + + +Parameter Constants +------------------- + +These constants are used as the parameter name in the `cuOptSetParameter `_ , `cuOptGetParameter `_ and similar functions. More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. + +.. LP/MIP parameter string constants +.. doxygendefine:: CUOPT_ABSOLUTE_DUAL_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_DUAL_TOLERANCE +.. doxygendefine:: CUOPT_ABSOLUTE_PRIMAL_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_PRIMAL_TOLERANCE +.. doxygendefine:: CUOPT_ABSOLUTE_GAP_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_GAP_TOLERANCE +.. doxygendefine:: CUOPT_INFEASIBILITY_DETECTION +.. doxygendefine:: CUOPT_STRICT_INFEASIBILITY +.. doxygendefine:: CUOPT_PRIMAL_INFEASIBLE_TOLERANCE +.. doxygendefine:: CUOPT_DUAL_INFEASIBLE_TOLERANCE +.. doxygendefine:: CUOPT_ITERATION_LIMIT +.. doxygendefine:: CUOPT_TIME_LIMIT +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE +.. doxygendefine:: CUOPT_METHOD +.. doxygendefine:: CUOPT_PER_CONSTRAINT_RESIDUAL +.. doxygendefine:: CUOPT_SAVE_BEST_PRIMAL_SO_FAR +.. doxygendefine:: CUOPT_FIRST_PRIMAL_FEASIBLE +.. doxygendefine:: CUOPT_LOG_FILE +.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE +.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE +.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE +.. doxygendefine:: CUOPT_MIP_SCALING +.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY +.. doxygendefine:: CUOPT_NUM_CPU_THREADS + +PDLP Solver Mode Constants +-------------------------- + +These constants are used to configure `CUOPT_PDLP_SOLVER_MODE` via `cuOptSetIntegerParameter `_. + +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE1 +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE2 +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_METHODICAL1 +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_FAST1 + +Method Constants +---------------- + +These constants are used to configure `CUOPT_METHOD` via `cuOptSetIntegerParameter `_. + +.. doxygendefine:: CUOPT_METHOD_CONCURRENT +.. doxygendefine:: CUOPT_METHOD_PDLP +.. doxygendefine:: CUOPT_METHOD_DUAL_SIMPLEX + + +Solving an LP or MIP +-------------------- + +LP and MIP solves are performed by calling the `cuOptSolve` function + .. doxygenfunction:: cuOptSolve -.. doxygenfunction:: cuOptDestroySolution + + +Solution +-------- + +The output of a solve is a `cuOptSolution` object. + +.. doxygentypedef:: cuOptSolution + +The following functions may be used to access information from a `cuOptSolution` + .. doxygenfunction:: cuOptGetTerminationStatus .. doxygenfunction:: cuOptGetPrimalSolution .. doxygenfunction:: cuOptGetObjectiveValue @@ -165,4 +203,25 @@ More details on the parameters can be found in the `LP/MILP settings <../../lp-m .. doxygenfunction:: cuOptGetMIPGap .. doxygenfunction:: cuOptGetSolutionBound .. doxygenfunction:: cuOptGetDualSolution -.. doxygenfunction:: cuOptGetReducedCosts \ No newline at end of file +.. doxygenfunction:: cuOptGetReducedCosts + +When you are finished with a `cuOptSolution` object you should destory it with + +.. doxygenfunction:: cuOptDestroySolution + +Termination Status Constants +---------------------------- + +These constants define the termination status received from the `cuOptGetTerminationStatus `_ function. + +.. LP/MIP termination status constants +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NO_TERMINATION +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_OPTIMAL +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_INFEASIBLE +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_UNBOUNDED +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_ITERATION_LIMIT +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_TIME_LIMIT +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NUMERICAL_ERROR +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_PRIMAL_FEASIBLE +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_FEASIBLE_FOUND +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_CONCURRENT_LIMIT From da987bcb18ce5bb5c7cd5b55c98502cf422c7db0 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 21 May 2025 16:53:03 -0500 Subject: [PATCH 09/49] changes for project.json and typedef header fix --- .../cuopt/linear_programming/cuopt_c.h | 27 ++++++--- docs/cuopt/source/conf.py | 2 +- .../source/cuopt-c/lp-milp/lp-milp-c-api.rst | 60 ++++++++++--------- .../source/cuopt-c/lp-milp/milp-examples.rst | 4 +- docs/cuopt/source/introduction.rst | 2 +- docs/cuopt/source/release-notes.rst | 6 +- 6 files changed, 56 insertions(+), 45 deletions(-) diff --git a/cpp/include/cuopt/linear_programming/cuopt_c.h b/cpp/include/cuopt/linear_programming/cuopt_c.h index 30e5d2f835..700ba2c4f0 100644 --- a/cpp/include/cuopt/linear_programming/cuopt_c.h +++ b/cpp/include/cuopt/linear_programming/cuopt_c.h @@ -27,26 +27,30 @@ extern "C" { #endif -/* @brief A ``cuOptOptimizationProblem`` object contains a representation of +/** + * @brief A ``cuOptOptimizationProblem`` object contains a representation of * an LP or MIP. It is created by ``cuOptCreateProblem`` or ``cuOptCreateRangedProblem``. * It is passed to ``cuOptSolve``. It should be destroyed using ``cuOptDestroyProblem``. */ typedef void* cuOptOptimizationProblem; -/* @brief A ``cuOptSolverSettings`` object contains parameter settings and other information +/** + * @brief A ``cuOptSolverSettings`` object contains parameter settings and other information * for an LP or MIP solve. It is created by ``cuOptCreateSolverSettings``. It is passed to * ``cuOptSolve``. It should be destroyed using ``cuOptDestroySolverSettings``. */ typedef void* cuOptSolverSettings; -/* @brief A ``cuOptSolution`` object contains the solution to an LP or MIP. It is created by +/** + * @brief A ``cuOptSolution`` object contains the solution to an LP or MIP. It is created by * ``cuOptSolve``. It should be destroyed using ``cuOptDestroySolution``. */ typedef void* cuOptSolution; #if CUOPT_INSTANTIATE_FLOAT -/* @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` +/** + * @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` * to get the number of bytes in the floating point type. */ typedef float cuopt_float_t; @@ -54,27 +58,31 @@ typedef float cuopt_float_t; #endif #if CUOPT_INSTANTIATE_DOUBLE -/* @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` +/** + * @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` * to get the size of the floating point type. */ typedef double cuopt_float_t; #endif #if CUOPT_INSTANTIATE_INT32 -/* @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` +/** + * @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` * to get the size of the integer type. */ typedef int32_t cuopt_int_t; #endif #if CUOPT_INSTANTIATE_INT64 -/* @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` +/** + * @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` * to get the size of the integer type. */ typedef int64_t cuopt_int_t; #endif -/* @brief Get the size of the float type. +/** + * @brief Get the size of the float type. * * @return The size in bytes of the float type. */ @@ -85,7 +93,8 @@ int8_t cuOptGetFloatSize(); */ int8_t cuOptGetIntSize(); -/* @brief Read an optimization problem from an MPS file. +/** + * @brief Read an optimization problem from an MPS file. * * @param[in] filename - The path to the MPS file. * diff --git a/docs/cuopt/source/conf.py b/docs/cuopt/source/conf.py index ed3f559fe1..f8f634b960 100644 --- a/docs/cuopt/source/conf.py +++ b/docs/cuopt/source/conf.py @@ -170,7 +170,7 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_css_files = ["swagger-nvidia.css"] -html_extra_path = ["versions1.json"] +html_extra_path = ["project.json", "versions1.json"] # -- Options for Breathe (Doxygen) ---------------------------------------- diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst index 2065003b6f..dfc69ffbcf 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst @@ -21,36 +21,7 @@ Status Constants .. doxygendefine:: CUOPT_MPS_FILE_ERROR .. doxygendefine:: CUOPT_MPS_PARSE_ERROR -Parameter Constants -------------------- - -These constants would be used as the parameter name in the `cuOptSetParameter `_ and `cuOptGetParameter `_ functions. More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. -.. LP/MIP parameter string constants -.. doxygendefine:: CUOPT_ABSOLUTE_DUAL_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_DUAL_TOLERANCE -.. doxygendefine:: CUOPT_ABSOLUTE_PRIMAL_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_PRIMAL_TOLERANCE -.. doxygendefine:: CUOPT_ABSOLUTE_GAP_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_GAP_TOLERANCE -.. doxygendefine:: CUOPT_INFEASIBILITY_DETECTION -.. doxygendefine:: CUOPT_STRICT_INFEASIBILITY -.. doxygendefine:: CUOPT_PRIMAL_INFEASIBLE_TOLERANCE -.. doxygendefine:: CUOPT_DUAL_INFEASIBLE_TOLERANCE -.. doxygendefine:: CUOPT_ITERATION_LIMIT -.. doxygendefine:: CUOPT_TIME_LIMIT -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE -.. doxygendefine:: CUOPT_METHOD -.. doxygendefine:: CUOPT_PER_CONSTRAINT_RESIDUAL -.. doxygendefine:: CUOPT_SAVE_BEST_PRIMAL_SO_FAR -.. doxygendefine:: CUOPT_FIRST_PRIMAL_FEASIBLE -.. doxygendefine:: CUOPT_LOG_FILE -.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE -.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE -.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE -.. doxygendefine:: CUOPT_MIP_SCALING -.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY -.. doxygendefine:: CUOPT_NUM_CPU_THREADS Termination Status Constants ---------------------------- @@ -120,6 +91,37 @@ These would be used as the method while setting solver parameters using `cuOptSe .. doxygendefine:: CUOPT_METHOD_PDLP .. doxygendefine:: CUOPT_METHOD_DUAL_SIMPLEX +Parameter Constants +------------------- + +These constants would be used as the parameter name in the `cuOptSetParameter `_ and `cuOptGetParameter `_ functions. More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. + +.. LP/MIP parameter string constants +.. doxygendefine:: CUOPT_ABSOLUTE_DUAL_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_DUAL_TOLERANCE +.. doxygendefine:: CUOPT_ABSOLUTE_PRIMAL_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_PRIMAL_TOLERANCE +.. doxygendefine:: CUOPT_ABSOLUTE_GAP_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_GAP_TOLERANCE +.. doxygendefine:: CUOPT_INFEASIBILITY_DETECTION +.. doxygendefine:: CUOPT_STRICT_INFEASIBILITY +.. doxygendefine:: CUOPT_PRIMAL_INFEASIBLE_TOLERANCE +.. doxygendefine:: CUOPT_DUAL_INFEASIBLE_TOLERANCE +.. doxygendefine:: CUOPT_ITERATION_LIMIT +.. doxygendefine:: CUOPT_TIME_LIMIT +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE +.. doxygendefine:: CUOPT_METHOD +.. doxygendefine:: CUOPT_PER_CONSTRAINT_RESIDUAL +.. doxygendefine:: CUOPT_SAVE_BEST_PRIMAL_SO_FAR +.. doxygendefine:: CUOPT_FIRST_PRIMAL_FEASIBLE +.. doxygendefine:: CUOPT_LOG_FILE +.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE +.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE +.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE +.. doxygendefine:: CUOPT_MIP_SCALING +.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY +.. doxygendefine:: CUOPT_NUM_CPU_THREADS + Functions --------- diff --git a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst index 5dcde4b079..3069c55095 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst @@ -212,7 +212,7 @@ Copy the code below into a file called ``milp_example.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. @@ -432,7 +432,7 @@ Copy the code below into a file called ``milp_example_mps.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 9002595752..3c13affc45 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -64,7 +64,7 @@ Maximize objective function: How cuOpt Solves LP Problem ------------------------------ -cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve LPs at large scale. This implements a gradient descent, enhanced by heuristics, performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. +cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve LPs at large scale. This implements a gradient descent, enhanced by heuristics, performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms are run concurrently on the GPU and CPU. Mixed Integer Linear Programming (MILP) ========================================= diff --git a/docs/cuopt/source/release-notes.rst b/docs/cuopt/source/release-notes.rst index 7ddb438c8a..4156da3929 100644 --- a/docs/cuopt/source/release-notes.rst +++ b/docs/cuopt/source/release-notes.rst @@ -12,20 +12,20 @@ New Features - Added crossover from PDLP to Dual Simplex - Added concurrent mode that runs PDLP and Dual Simplex together - Added a LP and MILP C API for cuOpt -- PDLP enhancements +- PDLP: Faster iterations and new more robust default PDLPSolverMode Stable2 - Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError Breaking Changes ---------------- -- FIx concurrent LP crashes and limit minimal absolute tolerance are not breaking changes. +- Fix concurrent LP crashes. - Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError - Split cuOpt as libcuopt and cuopt wheel Improvements ------------ -- FIx concurrent LP crashes and limit minimal absolute tolerance are not breaking changes. +- Fix concurrent LP crashes. - Hook up MILP Gap parameters and add info about number of nodes explored and simplex iterations, other fixes - FJ bug fixes, tests and improvements - Cleanup solver settings From 3fe8048a89f988b8c7118889a53225872cad7b67 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Wed, 21 May 2025 15:16:38 -0700 Subject: [PATCH 10/49] Update cli-examples.rst --- docs/cuopt/source/cuopt-cli/cli-examples.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/cuopt/source/cuopt-cli/cli-examples.rst b/docs/cuopt/source/cuopt-cli/cli-examples.rst index 2144ce28ac..f6b3b524f5 100644 --- a/docs/cuopt/source/cuopt-cli/cli-examples.rst +++ b/docs/cuopt/source/cuopt-cli/cli-examples.rst @@ -39,7 +39,7 @@ This should give you the following output: .. code-block:: bash :caption: Output - [2025-05-19 10:09:28:353715] [CUOPT] [info ] Running file sample.mps + Running file sample.mps Solving a problem with 2 constraints 2 variables (0 integers) and 4 nonzeros Objective offset 0.000000 scaling_factor 1.000000 Running concurrent @@ -95,7 +95,7 @@ This should produce output similar to: .. code-block:: bash :caption: Output - [2025-05-19 11:18:19:229055] [CUOPT] [info ] Running file mip_sample.mps + Running file mip_sample.mps Solving a problem with 3 constraints 2 variables (2 integers) and 6 nonzeros Objective offset 0.000000 scaling_factor 1.000000 After trivial presolve updated 3 constraints 2 variables @@ -134,10 +134,10 @@ You can customize the solver behavior using various command line parameters. Som .. code-block:: bash # Set absolute primal tolerance and PDLP solver mode - cuopt_cli sample.mps --absolute-primal-tolerance 0.0001 --pdlp-solver-mode 1 + cuopt_cli --absolute-primal-tolerance 0.0001 --pdlp-solver-mode 1 sample.mps # Set time limit and use specific solver method - cuopt_cli sample.mps --time-limit 5 --method pdlp + cuopt_cli --time-limit 5 --method pdlp sample.mps # Turn off output to console and output the logs to a .log file and solution to a .sol file - cuopt_cli mip_sample.mps --log-to-console false --log-file mip_sample.log --solution-file mip_sample.sol + cuopt_cli --log-to-console false --log-file mip_sample.log --solution-file mip_sample.sol mip_sample.mps From 19f95d078462e62d178bc32035b32e287e180c7c Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Wed, 21 May 2025 23:32:03 +0000 Subject: [PATCH 11/49] Update introduction.rst --- docs/cuopt/source/introduction.rst | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 9002595752..68674ae570 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -2,7 +2,7 @@ Introduction ========================== -**NVIDIA® cuOpt™** is a GPU-accelerated optimization library that excels in `Mixed Integer Linear Programming (MILP) `_, `Linear Programming (LP) `_, and `Vehicle Routing Problems (VRP) `_. It enables solutions for large-scale problems with millions of variables and constraints, offering seamless deployment across hybrid and multi-cloud environments. +**NVIDIA® cuOpt™** is a GPU-accelerated optimization library that solves `Mixed Integer Linear Programming (MILP) `_, `Linear Programming (LP) `_, and `Vehicle Routing Problems (VRP) `_. It enables solutions for large-scale problems with millions of variables and constraints, offering seamless deployment across hybrid and multi-cloud environments. Using accelerated computing, NVIDIA® cuOpt optimizes operations research and logistics by enabling better, faster decisions. @@ -45,9 +45,7 @@ Given the time and computational resources required for brute-force enumeration, Linear Programming (LP) ======================= -**Linear Programming** is a technique for optimizing a linear objective function over a feasible region defined by a set of linear inequality and equality constraints. For example, please consider the following. - -Given system constraints: +**Linear Programming** is a technique for optimizing a linear objective function over a feasible region defined by a set of linear inequality and equality constraints. For example, consider the following system constraints 2x + 4 y >= 230 @@ -57,21 +55,23 @@ Given system constraints: y >= 0, -Maximize objective function: +and suppose we want to maximize the objective function + + f(x,y) = 5x + 3y. - f(x,y) = 5x + 3y +This is a linear program. How cuOpt Solves LP Problem ------------------------------ -cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve LPs at large scale. This implements a gradient descent, enhanced by heuristics, performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. +cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve large-scale LPs. This solver implements gradient descent, enhanced by heuristics, and performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. Mixed Integer Linear Programming (MILP) ========================================= A **Mixed Integer Linear Program** is a variant of a Linear Program, where some of the variables are restricted to take on only integer values, while other variables can vary continuously. NVIDIA cuOpt uses a hybrid GPU/CPU method: running primal heuristics on the GPU and improving the dual bound on the CPU. -Given system constraints: +For example, consider the following system of constraints: 2x + 4y >= 230 @@ -81,23 +81,22 @@ Given system constraints: y >= 0 and y is continuous, +and suppose we wish to maximize the objective function + f(x,y) = 5x + 3y. -Maximize objective function: - - f(x,y) = 5x + 3y - +This is a mixed integer linear program. -Although this problem seems similar to a Linear Program, it is actually much more difficult. +Although MILPs seems similar to a LPs, they are actually much more difficult. How cuOpt Solves MILP Problem ------------------------------ -MILP solver is a hybrid GPU/CPU algorithm. Primal heuristics including local search, feasibility pump, and feasibility jump are performed on the GPU to improve the primal bound. Branch and bound is performed on the CPU to improve the dual bound. Integer feasible solutions are shared between both algorithms. +The MILP solver is a hybrid GPU/CPU algorithm. Primal heuristics including local search, feasibility pump, and feasibility jump are performed on the GPU to improve the primal bound. Branch and bound is performed on the CPU to improve the dual bound. Integer feasible solutions are shared between both algorithms. ============================= -API Supports +Supported APIs ============================= cuOpt supports the following APIs: From 7f6442017582964f4041c3f3c524f1731dd3ca4d Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Thu, 22 May 2025 00:00:43 +0000 Subject: [PATCH 12/49] Updates to faq.rst, introduction.rst, lp-features.rst, lp-milp-settings.rst, milp-features.rst, release-notes.rst, routing-features.rst --- docs/cuopt/source/faq.rst | 19 +++++---- docs/cuopt/source/introduction.rst | 2 +- docs/cuopt/source/lp-features.rst | 55 ++++++++++++-------------- docs/cuopt/source/lp-milp-settings.rst | 4 +- docs/cuopt/source/milp-features.rst | 35 ++++++++-------- docs/cuopt/source/release-notes.rst | 13 ++---- docs/cuopt/source/routing-features.rst | 2 +- 7 files changed, 59 insertions(+), 71 deletions(-) diff --git a/docs/cuopt/source/faq.rst b/docs/cuopt/source/faq.rst index 1f6134aafd..ba1c48d391 100644 --- a/docs/cuopt/source/faq.rst +++ b/docs/cuopt/source/faq.rst @@ -8,8 +8,8 @@ General FAQ .. dropdown:: Where can I find cuOpt container images? There are two options: - - Nvidia docker hub (https://hub.docker.com/r/nvidia/) - - Nvidia NGC registry (https://catalog.ngc.nvidia.com/orgs/nvidia/teams/cuopt/containers/cuopt/tags) with NVAIE license. + - NVIDIA docker hub (https://hub.docker.com/r/nvidia/) + - NVIDIA NGC registry (https://catalog.ngc.nvidia.com/orgs/nvidia/teams/cuopt/containers/cuopt/tags) with NVAIE license. .. dropdown:: How to get a NVAIE license? @@ -79,7 +79,7 @@ General FAQ .. dropdown:: Why is NVIDIA cuOpt running longer than the supplied time limit? - #. The time limit supplied governs the run time of the solver only, but there are other overheads such as ``network delay``, ``etl``, ``validation`` or ``solver being busy with other requests``. + #. The time limit supplied governs the run time of the solver only, but there are other overheads such as network delay, ETL, validation or the solver being busy with other requests. #. The complete round-trip solve time might be more than what was set. @@ -337,25 +337,24 @@ Linear Programming FAQs - Hardware: If using self-hosted, you should use a recent server-grade GPU. We recommend H100 SXM (not the PCIE version). - Tolerance: The set tolerance usually has a massive impact on performance. Try the lowest possible value using ``set_optimality_tolerance`` until you have reached your lowest possible acceptable accuracy. - - PDLP Solver mode: PDLP solver mode will change the way PDLP internally optimizes the problem. The mode choice made using ``set_pdlp_solver_mode`` can drastically impact how fast a specific problem will be solved. You should test the different modes to see which one fits your problem best. - - Infeasibility detection: By default, the solver will try to detect infeasible problems which takes time. If you know your problem is feasible, use ``set_infeasibility_detection`` to make solving faster. + - PDLP Solver mode: PDLP solver mode will change the way PDLP internally optimizes the problem. The mode choice can drastically impact how fast a specific problem will be solved. You should test the different modes to see which one fits your problem best. - Batch mode: In case you know upfront that you need to solve multiple LP problems, instead of solving them sequentially, you should use the batch mode which can solve multiple LPs in parallel. .. dropdown:: What solver mode should I choose? We cannot predict up-front which solver mode will work best for a particular problem. The only way to know is to test. Once you know a solver mode is good on a class of problems, it should also be good on other similar problems. -.. dropdown:: What threshold should I use? +.. dropdown:: What tolerance should I use? - The choice entirely depends on the level of accuracy you need for your problem. A higher threshold will always result in a faster result. In general, 1e-2 is low accuracy, 1e-4 regular, 1e-6 high, 1e-8 very high. + The choice entirely depends on the level of accuracy you need for your problem. A looser tolerance will always result in a faster result. For PDLP, 1e-2 relative tolerance is low accuracy, 1e-4 is regular, 1e-6 is high, and 1e-8 is very high. .. dropdown:: What are the limitations of the LP solver? - #. There is no inherit limit imposed on the number of variables, number of constraints, or number of non-zeros you can have in a MILP or LP, except the restrictions due to the number of bits in integer and the amount of memory in the CPU and GPU. + #. There is no inherit limit imposed on the number of variables, number of constraints, or number of non-zeros you can have in a MILP or LP, except the restrictions due to the number of bits in an integer and the amount of memory in the CPU and GPU. Depending on these factors, the problems that can be solved can vary, for example: - - On a H100 SXM with 80GB memory, these are few examples of the problems that can be solved: + - On a H100 SXM with 80GB memory, here are few examples of the problems that can be solved: - 10M rows/constraints, 10M columns/variables, and 2B non-zeros in the constraint matrix. - 74.5M rows/constraints, 74.5M columns/variables, and 1.49B non-zeros in the constraint matrix. @@ -369,7 +368,7 @@ Mixed Integer Linear Programming FAQs Depending on these factors, the problems that can be solved can vary, for example: - On a H100 SXM with 80GB memory, this is the biggest dataset that was tested: - - Number of non-zeros/coefficient matrix size supported - 27 million (dataset: miplib2017). + - 27 million non-zeros coefficients on a problem from MIPLIB2017. Container FAQs ------------------------------ diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 68674ae570..a05ef18477 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -109,7 +109,7 @@ cuOpt supports the following APIs: - Python support - Routing (TSP, VRP, and PDP) - Linear Programming (LP) and Mixed Integer Linear Programming (MILP) - - cuOpt includes a Python API that is used as the backend of the cuOpt server. However, we do not provide documentation for the Python API at this time. We suggest users use a third-party modeling language or the cuOpt server to access cuOpt via Python. We anticipate that the Python API will change significantly in the future. Use it at your own risk. + - cuOpt includes a Python API that is used as the backend of the cuOpt server. However, we do not provide documentation for the Python API at this time. We suggest using a third-party modeling language or cuOpt server to access cuOpt via Python. We anticipate that the Python API will change significantly in the future. Use it at your own risk. - Server support - Linear Programming (LP) - Mixed Integer Linear Programming (MILP) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 046a8e2f3c..6e39db9a30 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -3,31 +3,36 @@ LP Features ================== Availability ------------------------------- +------------- -NVIDIA cuOpt LP is available in 3 different ways: +The LP solver can be accessed in three different ways: -- **Third-Party Modeling Languages**: cuOpt's LP and MILP solver can be called directly from the following third-party modeling languages. This allows you to leverage GPU acceleration while maintaining your existing optimization workflow in these modeling languages. - - Supported modeling languages: +- **Third-Party Modeling Languages**: cuOpt's LP and MILP solver can be called directly from the following third-party modeling languages. - SciPy - PuLP - CVXPY - Pyomo - AMPL +This allows you to leverage GPU acceleration while maintaining your existing optimization workflow in these modeling languages. + - **C API**: A native C API that provides direct low-level access to cuOpt's LP capabilities, enabling integration into any application or system that can interface with C. -- **As a Self-Hosted Service**: cuOpt LP can be deployed as a in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. +- **As a Self-Hosted Service**: cuOpt's LP solver can be deployed as a in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. + +All three options provide the same powerful linear optimization capabilities while offering flexibility in deployment and integration approaches. + +Variable Bounds +--------------- -All three options provide the same powerful linear programming optimization capabilities while offering flexibility in deployment and integration approaches. +Lower and upper bounds can be applied to each variable. If no variable bounds are specified, the default bounds are ``[-inf,+inf]``. Constraints ----------- The constraint matrix is specified in `Compressed Sparse Row (CSR) format `_. -There are two ways to specify constraints in cuOpt LP: +There are two ways to specify constraints to cuOpt LP solver: 1. Using row_type and right-hand side: @@ -35,33 +40,25 @@ There are two ways to specify constraints in cuOpt LP: A*x {<=, =, >=} b - where A is the constraint matrix in CSR format, x is the variable vector, and b is the right-hand side vector. The relationship {<=, =, >=} is specified through the ``row_type`` parameter. + where A is the constraint matrix in CSR format, x is the variable vector, and b is the right-hand side vector. The relationship {<=, =, >=} is specified via the ``row_type`` parameter. 2. Using constraint bounds: - Alternatively, constraints can be specified as double-sided inequalities: + Alternatively, constraints can be specified as two-sided inequalities: lb <= A*x <= ub - where lb and ub are vectors of lower and upper bounds respectively. This form allows specifying both bounds in a single constraint. + where lb and ub are vectors of lower and upper bounds respectively. This form allows specifying both bounds on a single constraint. Warm Start ----------- .. note:: - Warm start is not supported C API and third-party modeling languages. + Warm start is not currently supported C API and third-party modeling languages. -Warm starts allow a user to provide an initial solution to help PDLP converge faster - -For warm start, the initial ``primal`` and ``dual`` solution can be provided to the solver in data. - -Alternatively, previously run solutions can be used to warm start a new request to boost the speed to the solution. `Examples `_ are shared on the self-hosted page. - -Variable Bounds ---------------- - -Lower and upper bounds can be applied to each variable. If no variable bounds are specified, the default bounds will be ``[-inf,+inf]``. +A warm starts allow a user to provide an initial solution to help PDLP converge faster. The initial ``primal`` and ``dual`` solutions can be specified by the user. +Alternatively, previously run solutions can be used to warm start a new request to decrease solve time. `Examples `_ are shared on the self-hosted page. PDLP Solver Mode ---------------- @@ -73,7 +70,7 @@ Method **Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs two solves at the same time: PDLP on the GPU and dual simplex on the CPU. A solution is returned from the solve that finishes first. -**PDLP**: Primal-Dual Hybrid Gradient for Linear Program is an algorithm for solving large-scale linear programming problems on the GPU. PDLP does not attempt to any matrix factorizations during the course of the solve. Select this method if your LP is so large that factorization will not fit into memory. By default PDLP solves to low relative tolerance and the solutions it returns do not lie at a vertex of the feasible region. Enable crossover if you need a highly accurate basic solution. +**PDLP**: Primal-Dual Hybrid Gradient for Linear Program is an algorithm for solving large-scale linear programming problems on the GPU. PDLP does not attempt to any matrix factorizations during the course of the solve. Select this method if your LP is so large that factorization will not fit into memory. By default PDLP solves to low relative tolerance and the solutions it returns do not lie at a vertex of the feasible region. Enable crossover to obtain a highly accurate basic solution from a PDLP solution. **Dual Simplex**: The simplex method applied to the dual of the linear program. Dual simplex requires the basis factorization of linear program fit into memory. Select this method if your LP is small to medium sized, or if you require a highly accurate basic solution. @@ -88,8 +85,8 @@ Infeasibility Detection An option under ``solver config`` in API. The PDLP solver includes the option to detect infeasible problems. If the infeasibilty detection is enabled in solver settings, PDLP will abort as soon as it concludes the problem is infeasible. -Infeasibility detection is always enabled for dual simplex. - +.. note:: + Infeasibility detection is always enabled for dual simplex. Time Limit ---------- @@ -98,15 +95,13 @@ The user may specify a time limit to the solver. By default the solver runs unti .. note:: - Note that ``time_limit`` applies only to solve time inside the LP solver. This does not include time for ``network transfer``, ``validation of input``, and other operations that occur outside the solver. The overhead associated with these operations are usually quite small compared to the solve time + Note that ``time_limit`` applies only to solve time inside the LP solver. This does not include time for network transfer, validation of input, and other operations that occur outside the solver. The overhead associated with these operations are usually small compared to the solve time. Batch Mode ---------- .. note:: - Batch mode is not supported C API and third-party modeling languages. It is only available via cuOpt server. - -Users can submit a set of problems which will be solved in a batch. Problems will be solved at the same time in parallel to fully utilize the GPU. Checkout `self-hosted client `_ example in thin client. + Batch mode is not currently supported in the C API and third-party modeling languages. It is only available via cuOpt server. -And batch mode is supported only in server. \ No newline at end of file +Users can submit a set of problems which will be solved in a batch. Problems will be solved at the same time in parallel to fully utilize the GPU. Checkout `self-hosted client `_ example in thin client. \ No newline at end of file diff --git a/docs/cuopt/source/lp-milp-settings.rst b/docs/cuopt/source/lp-milp-settings.rst index e5dc6e65f7..361f4865b6 100644 --- a/docs/cuopt/source/lp-milp-settings.rst +++ b/docs/cuopt/source/lp-milp-settings.rst @@ -9,8 +9,8 @@ Please refer to examples in `C `_ and `Server Thin client `_ is shared on the self-hosted page. Logging Callback ---------------- .. note:: - Logging callback is not supported C API and third-party modeling languages. + The logging callback is not currently supported in the C API and third-party modeling languages. A logging callback allows users to get additional information about how the solve is progressing. `Logging Callback Example `_ is shared on the self-hosted page. @@ -70,9 +74,4 @@ The user may specify a time limit to the solver. By default the solver runs unti .. note:: - Note that time_limit applies only to solve time inside the LP solver. This does not include time for ``network transfer``, ``validation of input``, and other operations that occur outside the solver. The overhead associated with these operations are usually quite small compared to the solve time - -Variable Bounds ---------------- - -Lower and upper bounds can be applied to each variable. If no variable bounds are specified, the default bounds will be ``[-inf,+inf]``. \ No newline at end of file + Note that time_limit applies only to solve time inside the LP solver. This does not include time for network transfer, validation of input, and other operations that occur outside the solver. The overhead associated with these operations are usually small compared to the solve time. diff --git a/docs/cuopt/source/release-notes.rst b/docs/cuopt/source/release-notes.rst index 7ddb438c8a..f7f9342810 100644 --- a/docs/cuopt/source/release-notes.rst +++ b/docs/cuopt/source/release-notes.rst @@ -9,30 +9,25 @@ Release Notes 25.05 New Features ------------ -- Added crossover from PDLP to Dual Simplex - Added concurrent mode that runs PDLP and Dual Simplex together +- Added crossover from PDLP to Dual Simplex - Added a LP and MILP C API for cuOpt - PDLP enhancements -- Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError Breaking Changes ---------------- -- FIx concurrent LP crashes and limit minimal absolute tolerance are not breaking changes. -- Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError +- NoTermination is now a NumericalError - Split cuOpt as libcuopt and cuopt wheel Improvements ------------ -- FIx concurrent LP crashes and limit minimal absolute tolerance are not breaking changes. -- Hook up MILP Gap parameters and add info about number of nodes explored and simplex iterations, other fixes +- Hook up MILP Gap parameters and add info about number of nodes explored and simplex iterations - FJ bug fixes, tests and improvements -- Cleanup solver settings -- Allow no time limit on MILP +- Allow no time limit in MILP - Refactor routing - Probing cache optimization -- Split cuOpt as libcuopt and cuopt wheel - Diversity improvements for routing - Enable more compile warnings and faster compile by bypassing rapids fetch - Constraint prop based on load balanced bounds update diff --git a/docs/cuopt/source/routing-features.rst b/docs/cuopt/source/routing-features.rst index 5bbbdb43f4..2cd5047ea9 100644 --- a/docs/cuopt/source/routing-features.rst +++ b/docs/cuopt/source/routing-features.rst @@ -5,7 +5,7 @@ Routing Features Availability ------------------------------ -NVIDIA cuOpt Routing is available in two forms: +The Routing solver is available in two forms: - **As a Self-Hosted Service**: cuOpt Routing can be deployed as a service in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. For more information, see :doc:`cuopt-server/quick-start`. From b40fdbad683fdecde1546e4a85d76ae78f8758b2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 21 May 2025 20:53:24 -0500 Subject: [PATCH 13/49] features and release notes --- docs/cuopt/source/lp-features.rst | 6 ++++++ docs/cuopt/source/release-notes.rst | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 046a8e2f3c..875daa1c57 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -78,6 +78,12 @@ Method **Dual Simplex**: The simplex method applied to the dual of the linear program. Dual simplex requires the basis factorization of linear program fit into memory. Select this method if your LP is small to medium sized, or if you require a highly accurate basic solution. +Crossover +--------- + +Crossover allows you to obtain a high-quality basic solution. More details can be found `here `__. + + Logging Callback ---------------- With logging callback, users can fetch server-side logs for additional debugs and to get details on solver process details. `Examples `__ are shared on the self-hosted page. diff --git a/docs/cuopt/source/release-notes.rst b/docs/cuopt/source/release-notes.rst index 4156da3929..532d8fe54a 100644 --- a/docs/cuopt/source/release-notes.rst +++ b/docs/cuopt/source/release-notes.rst @@ -13,19 +13,17 @@ New Features - Added concurrent mode that runs PDLP and Dual Simplex together - Added a LP and MILP C API for cuOpt - PDLP: Faster iterations and new more robust default PDLPSolverMode Stable2 -- Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError +- Limit minimal absolute tolerance and NoTermination is now NumericalError Breaking Changes ---------------- -- Fix concurrent LP crashes. -- Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError +- Limit minimal absolute tolerance and NoTermination is now NumericalError - Split cuOpt as libcuopt and cuopt wheel Improvements ------------ -- Fix concurrent LP crashes. - Hook up MILP Gap parameters and add info about number of nodes explored and simplex iterations, other fixes - FJ bug fixes, tests and improvements - Cleanup solver settings @@ -45,6 +43,7 @@ Bug Fixes - In the solution, ``termination_status`` should be cast to correct enum. - Fixed a bug using vehicle IDs in construct feasible solution algorithm. - FP recombiner probing bug fix. +- Fix concurrent LP crashes. - Fix print relative dual residual. - Handle empty problems gracefully. - Improve breaks to allow dimensions at arbitrary places in the route. From 2ed89e6b43255a47dd598273d6927414c2947ab2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 21 May 2025 20:58:42 -0500 Subject: [PATCH 14/49] update --- docs/cuopt/source/lp-features.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index f09b389251..3c8e2d68eb 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -78,7 +78,7 @@ Method Crossover --------- -Crossover allows you to obtain a high-quality basic solution. More details can be found `here `__. +Crossover allows you to obtain a high-quality basic solution. More details can be found `here `__. Logging Callback @@ -110,4 +110,4 @@ Batch Mode .. note:: Batch mode is not currently supported in the C API and third-party modeling languages. It is only available via cuOpt server. -Users can submit a set of problems which will be solved in a batch. Problems will be solved at the same time in parallel to fully utilize the GPU. Checkout `self-hosted client `_ example in thin client. \ No newline at end of file +Users can submit a set of problems which will be solved in a batch. Problems will be solved at the same time in parallel to fully utilize the GPU. Checkout `self-hosted client `_ example in thin client. From eaabf33ae592cc9744ca5618eb242de3f31da9ac Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 22 May 2025 10:16:14 -0500 Subject: [PATCH 15/49] fix container path --- docs/cuopt/source/cuopt-server/quick-start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cuopt/source/cuopt-server/quick-start.rst b/docs/cuopt/source/cuopt-server/quick-start.rst index f0910b57e1..2a91dcabda 100644 --- a/docs/cuopt/source/cuopt-server/quick-start.rst +++ b/docs/cuopt/source/cuopt-server/quick-start.rst @@ -86,7 +86,7 @@ Step 4: Pull the container: .. code-block:: bash - docker pull nvcr.io/nvidia/cuopt:25.5.0 + docker pull nvcr.io/nvidia/cuopt/cuopt:25.5.0 The container includes both the Python API and self-hosted server components. To run the container: From 400e8560954b50ccd8405ed384fe50445ef2a207 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 22 May 2025 10:17:26 -0500 Subject: [PATCH 16/49] fix container path --- docs/cuopt/source/cuopt-server/quick-start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/cuopt-server/quick-start.rst b/docs/cuopt/source/cuopt-server/quick-start.rst index 2a91dcabda..40ec403989 100644 --- a/docs/cuopt/source/cuopt-server/quick-start.rst +++ b/docs/cuopt/source/cuopt-server/quick-start.rst @@ -86,14 +86,14 @@ Step 4: Pull the container: .. code-block:: bash - docker pull nvcr.io/nvidia/cuopt/cuopt:25.5.0 + docker pull CONTAINER_IMAGE_PATH The container includes both the Python API and self-hosted server components. To run the container: .. code-block:: bash - docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 nvcr.io/nvidia/cuopt/cuopt:25.5.0 /bin/bash -c "python3 -m cuopt_server.cuopt_service" + docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 /bin/bash -c "python3 -m cuopt_server.cuopt_service" Smoke Test From b6c048eab41d15c4d8a5a8db3a63813d78138711 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 22 May 2025 14:37:56 -0500 Subject: [PATCH 17/49] Move thirdparty files to directory and clean it --- THIRD_PARTY_LICENSES | 791 -------------------------------- thirdparty/THIRD_PARTY_LICENSES | 3 + 2 files changed, 3 insertions(+), 791 deletions(-) delete mode 100644 THIRD_PARTY_LICENSES create mode 100644 thirdparty/THIRD_PARTY_LICENSES diff --git a/THIRD_PARTY_LICENSES b/THIRD_PARTY_LICENSES deleted file mode 100644 index ca53fd9c41..0000000000 --- a/THIRD_PARTY_LICENSES +++ /dev/null @@ -1,791 +0,0 @@ -================================================== -Third Party Licenses -================================================== - -h5py License ---------------------- - - Copyright Notice and Statement for the h5py Project - - Copyright (c) 2008 Andrew Collette and contributors - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -FastAPI License ---------------------- - - Copyright (c) 2023 Frederick Jansen - Copyright (c) 2014 Bruno M. Custódio - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - -uvicorn License ---------------------- - - Copyright (c) 2017-present, Encode OSS Ltd. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -pandas License ---------------------- - - BSD 3-Clause License - - Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team - All rights reserved. - - Copyright (c) 2011-2024, Open source contributors. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -cupy License ---------------------- - - - Copyright (c) 2015 Preferred Infrastructure, Inc. - Copyright (c) 2015 Preferred Networks, Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - -numpy License ---------------------- - - - Copyright (c) 2005-2021, NumPy Developers. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - * Neither the name of the NumPy Developers nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -numpydoc License ---------------------- - - - Copyright (C) 2008 Stefan van der Walt , Pauli Virtanen - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - -Scipy License ---------------------- - - - Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -pybase64 License ---------------------- - - - BSD 2-Clause License - - Copyright (c) 2017-2019, Matthieu Darbois - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -ZipFile License ---------------------- - - PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 - -------------------------------------------- - - 1. This LICENSE AGREEMENT is between the Python Software Foundation - ("PSF"), and the Individual or Organization ("Licensee") accessing and - otherwise using this software ("Python") in source or binary form and - its associated documentation. - - 2. Subject to the terms and conditions of this License Agreement, PSF hereby - grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, - analyze, test, perform and/or display publicly, prepare derivative works, - distribute, and otherwise use Python alone or in any derivative version, - provided, however, that PSF's License Agreement and PSF's notice of copyright, - i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; - All Rights Reserved" are retained in Python alone or in any derivative version - prepared by Licensee. - - 3. In the event Licensee prepares a derivative work that is based on - or incorporates Python or any part thereof, and wants to make - the derivative work available to others as provided herein, then - Licensee hereby agrees to include in any such work a brief summary of - the changes made to Python. - - 4. PSF is making Python available to Licensee on an "AS IS" - basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND - DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT - INFRINGE ANY THIRD PARTY RIGHTS. - - 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON - FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS - A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, - OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 6. This License Agreement will automatically terminate upon a material - breach of its terms and conditions. - - 7. Nothing in this License Agreement shall be deemed to create any - relationship of agency, partnership, or joint venture between PSF and - Licensee. This License Agreement does not grant permission to use PSF - trademarks or trade name in a trademark sense to endorse or promote - products or services of Licensee, or any third party. - - 8. By copying, installing or otherwise using Python, Licensee - agrees to be bound by the terms and conditions of this License - Agreement. - - - BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 - ------------------------------------------- - - BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 - - 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an - office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the - Individual or Organization ("Licensee") accessing and otherwise using - this software in source or binary form and its associated - documentation ("the Software"). - - 2. Subject to the terms and conditions of this BeOpen Python License - Agreement, BeOpen hereby grants Licensee a non-exclusive, - royalty-free, world-wide license to reproduce, analyze, test, perform - and/or display publicly, prepare derivative works, distribute, and - otherwise use the Software alone or in any derivative version, - provided, however, that the BeOpen Python License is retained in the - Software, alone or in any derivative version prepared by Licensee. - - 3. BeOpen is making the Software available to Licensee on an "AS IS" - basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND - DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT - INFRINGE ANY THIRD PARTY RIGHTS. - - 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE - SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS - AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY - DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 5. This License Agreement will automatically terminate upon a material - breach of its terms and conditions. - - 6. This License Agreement shall be governed by and interpreted in all - respects by the law of the State of California, excluding conflict of - law provisions. Nothing in this License Agreement shall be deemed to - create any relationship of agency, partnership, or joint venture - between BeOpen and Licensee. This License Agreement does not grant - permission to use BeOpen trademarks or trade names in a trademark - sense to endorse or promote products or services of Licensee, or any - third party. As an exception, the "BeOpen Python" logos available at - http://www.pythonlabs.com/logos.html may be used according to the - permissions granted on that web page. - - 7. By copying, installing or otherwise using the software, Licensee - agrees to be bound by the terms and conditions of this License - Agreement. - - - CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 - --------------------------------------- - - 1. This LICENSE AGREEMENT is between the Corporation for National - Research Initiatives, having an office at 1895 Preston White Drive, - Reston, VA 20191 ("CNRI"), and the Individual or Organization - ("Licensee") accessing and otherwise using Python 1.6.1 software in - source or binary form and its associated documentation. - - 2. Subject to the terms and conditions of this License Agreement, CNRI - hereby grants Licensee a nonexclusive, royalty-free, world-wide - license to reproduce, analyze, test, perform and/or display publicly, - prepare derivative works, distribute, and otherwise use Python 1.6.1 - alone or in any derivative version, provided, however, that CNRI's - License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) - 1995-2001 Corporation for National Research Initiatives; All Rights - Reserved" are retained in Python 1.6.1 alone or in any derivative - version prepared by Licensee. Alternately, in lieu of CNRI's License - Agreement, Licensee may substitute the following text (omitting the - quotes): "Python 1.6.1 is made available subject to the terms and - conditions in CNRI's License Agreement. This Agreement together with - Python 1.6.1 may be located on the Internet using the following - unique, persistent identifier (known as a handle): 1895.22/1013. This - Agreement may also be obtained from a proxy server on the Internet - using the following URL: http://hdl.handle.net/1895.22/1013";. - - 3. In the event Licensee prepares a derivative work that is based on - or incorporates Python 1.6.1 or any part thereof, and wants to make - the derivative work available to others as provided herein, then - Licensee hereby agrees to include in any such work a brief summary of - the changes made to Python 1.6.1. - - 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" - basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND - DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT - INFRINGE ANY THIRD PARTY RIGHTS. - - 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON - 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS - A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, - OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 6. This License Agreement will automatically terminate upon a material - breach of its terms and conditions. - - 7. This License Agreement shall be governed by the federal - intellectual property law of the United States, including without - limitation the federal copyright law, and, to the extent such - U.S. federal law does not apply, by the law of the Commonwealth of - Virginia, excluding Virginia's conflict of law provisions. - Notwithstanding the foregoing, with regard to derivative works based - on Python 1.6.1 that incorporate non-separable material that was - previously distributed under the GNU General Public License (GPL), the - law of the Commonwealth of Virginia shall govern this License - Agreement only as to issues arising under or with respect to - Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this - License Agreement shall be deemed to create any relationship of - agency, partnership, or joint venture between CNRI and Licensee. This - License Agreement does not grant permission to use CNRI trademarks or - trade name in a trademark sense to endorse or promote products or - services of Licensee, or any third party. - - 8. By clicking on the "ACCEPT" button where indicated, or by copying, - installing or otherwise using Python 1.6.1, Licensee agrees to be - bound by the terms and conditions of this License Agreement. - - ACCEPT - - - CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 - -------------------------------------------------- - - Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, - The Netherlands. All rights reserved. - - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, - provided that the above copyright notice appear in all copies and that - both that copyright notice and this permission notice appear in - supporting documentation, and that the name of Stichting Mathematisch - Centrum or CWI not be used in advertising or publicity pertaining to - distribution of the software without specific, written prior - permission. - - STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO - THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE - FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION - ---------------------------------------------------------------------- - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - - -uuid License ---------------------- - - This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and - the Individual or Organization ("Licensee") accessing and otherwise using Python - 3.9.16 software in source or binary form and its associated documentation. - - 2. Subject to the terms and conditions of this License Agreement, PSF hereby - grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, - analyze, test, perform and/or display publicly, prepare derivative works, - distribute, and otherwise use Python 3.9.16 alone or in any derivative - version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright (c) 2001-2023 Python Software Foundation; All Rights - Reserved" are retained in Python 3.9.16 alone or in any derivative version - prepared by Licensee. - - 3. In the event Licensee prepares a derivative work that is based on or - incorporates Python 3.9.16 or any part thereof, and wants to make the - derivative work available to others as provided herein, then Licensee hereby - agrees to include in any such work a brief summary of the changes made to Python - 3.9.16. - - 4. PSF is making Python 3.9.16 available to Licensee on an "AS IS" basis. - PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF - EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR - WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE - USE OF PYTHON 3.9.16 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. - - 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 3.9.16 - FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF - MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 3.9.16, OR ANY DERIVATIVE - THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 6. This License Agreement will automatically terminate upon a material breach of - its terms and conditions. - - 7. Nothing in this License Agreement shall be deemed to create any relationship - of agency, partnership, or joint venture between PSF and Licensee. This License - Agreement does not grant permission to use PSF trademarks or trade name in a - trademark sense to endorse or promote products or services of Licensee, or any - third party. - - 8. By copying, installing or otherwise using Python 3.9.16, Licensee agrees - to be bound by the terms and conditions of this License Agreement. - - -boto3 License ---------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -psutil License ---------------------- - - BSD 3-Clause License - - Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of the psutil authors nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -Apache 2.0 License ---------------------- - - All contributions after December 1, 2017 released under dual license - either Apache 2.0 License or the BSD 3-Clause License. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License. - - - Self-Checkout Guidance for Use of Unmodified Permissively-licensed Software - 1) The initial commit of this software to revision control should be "as-received" from the source listed above. If not feasible to submit to revision control, you can attach the unmodified sources to a tracking bug for this library/feature; in either case, indicate the location and date from which the source code was received in the change log or bug comment. - - If you submit the source to source control, please cite this OSRB bug number in the perforce changelist description or git commit message, so that it is easier to correlate the imported source with this request. - - 2) Product documentation must indicate this software is present, and the specific copyright and license terms that apply. The technical publications team for your project can provide you guidance with this - if you require further information please contact us again. - - -msgpack-numpy License ------------------------- - - Copyright (c) 2013-2022, Lev E. Givon. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Lev E. Givon nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -jsonref License ---------------------- - - The MIT License - - Copyright (C) 2013 Chase Sterling - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. diff --git a/thirdparty/THIRD_PARTY_LICENSES b/thirdparty/THIRD_PARTY_LICENSES new file mode 100644 index 0000000000..290f9c35cb --- /dev/null +++ b/thirdparty/THIRD_PARTY_LICENSES @@ -0,0 +1,3 @@ +================================================== +Third Party Licenses +================================================== From c31dfe6876d89f3a4697ac82aba7510c2f9ae56d Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Thu, 22 May 2025 12:58:15 -0700 Subject: [PATCH 18/49] Update introduction.rst --- docs/cuopt/source/introduction.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 8349cfee63..af9201826c 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -47,9 +47,9 @@ Linear Programming (LP) **Linear Programming** is a technique for optimizing a linear objective function over a feasible region defined by a set of linear inequality and equality constraints. For example, consider the following system constraints - 2x + 4 y >= 230 + 2x + 4y >= 230 - 3x + 2y < 190 + 3x + 2y <= 190 x >= 0 @@ -75,7 +75,7 @@ For example, consider the following system of constraints: 2x + 4y >= 230 - 3x + 2y < 190 + 3x + 2y <= 190 x >= 0 and x is integer From a4a7d6a2c828b04815552e897fc31207e27f38c3 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 22 May 2025 16:24:44 -0500 Subject: [PATCH 19/49] Update brev details and add project.json --- README.md | 1 + docs/cuopt/source/cuopt-python/quick-start.rst | 5 +++++ docs/cuopt/source/cuopt-server/quick-start.rst | 4 ++++ docs/cuopt/source/project.json | 1 + docs/cuopt/source/resources.rst | 3 +++ 5 files changed, 14 insertions(+) create mode 100644 docs/cuopt/source/project.json diff --git a/README.md b/README.md index 122c10afc5..69f163498b 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Review the [CONTRIBUTING.md](CONTRIBUTING.md) file for information on how to con - [cuopt (Python) documentation](https://docs.nvidia.com/cuopt/user-guide/latest/introduction.html) - [libcuopt (C++/CUDA) documentation](https://docs.nvidia.com/cuopt/user-guide/latest/introduction.html) - [Examples and Notebooks](https://github.com/NVIDIA/cuopt-examples) +- [Test cuopt with Brev](https://brev.nvidia.com/launchable/deploy?launchableID=env-2qIG6yjGKDtdMSjXHcuZX12mDNJ): Examples notebooks are pulled and hosted on [Brev](https://docs.nvidia.com/brev/latest/). ## Installation diff --git a/docs/cuopt/source/cuopt-python/quick-start.rst b/docs/cuopt/source/cuopt-python/quick-start.rst index 1e43d7cd50..cbbc20d3fb 100644 --- a/docs/cuopt/source/cuopt-python/quick-start.rst +++ b/docs/cuopt/source/cuopt-python/quick-start.rst @@ -64,6 +64,11 @@ This will start an interactive session with cuOpt pre-installed and ready to use Make sure you have the NVIDIA Container Toolkit installed on your system to enable GPU support in containers. See the `installation guide `_ for details. +Brev +---- + +NVIDIA cuOpt can be tested with `Brev Launchable `_ with `example notebooks `_. For more details, please refer to the `Brev documentation `_. + Smoke Test ---------- diff --git a/docs/cuopt/source/cuopt-server/quick-start.rst b/docs/cuopt/source/cuopt-server/quick-start.rst index 40ec403989..54cbee1045 100644 --- a/docs/cuopt/source/cuopt-server/quick-start.rst +++ b/docs/cuopt/source/cuopt-server/quick-start.rst @@ -95,6 +95,10 @@ The container includes both the Python API and self-hosted server components. To docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 /bin/bash -c "python3 -m cuopt_server.cuopt_service" +Brev +---- + +NVIDIA cuOpt can be tested with `Brev Launchable `_ with `example notebooks `_. For more details, please refer to the `Brev documentation `_. Smoke Test ---------- diff --git a/docs/cuopt/source/project.json b/docs/cuopt/source/project.json new file mode 100644 index 0000000000..ea33b83412 --- /dev/null +++ b/docs/cuopt/source/project.json @@ -0,0 +1 @@ +{"name": "cuopt", "version": "25.05.00", "url": "https://github.com/nvidia/cuopt", "description": "Nvidia cuOpt is a optimization engine"} \ No newline at end of file diff --git a/docs/cuopt/source/resources.rst b/docs/cuopt/source/resources.rst index a74a517ed4..978778ef72 100644 --- a/docs/cuopt/source/resources.rst +++ b/docs/cuopt/source/resources.rst @@ -6,6 +6,9 @@ Resources `Sample Notebooks `_ ---------------------------------------------------------------------------------- +`Test cuopt with Brev `_ +------------------------------------------------------------------------------------------------------------------------ + `File a Bug `_ ----------------------------------------------------------------- From 3649ba23423a3abc244d2602dfd13d08a5c05e8c Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 03:20:55 +0000 Subject: [PATCH 20/49] Changes to make cuOptCreateProblem consistent with cuOptCreateRangedProblem --- cpp/include/cuopt/linear_programming/cuopt_c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/cuopt/linear_programming/cuopt_c.h b/cpp/include/cuopt/linear_programming/cuopt_c.h index 30e5d2f835..97880f7b9f 100644 --- a/cpp/include/cuopt/linear_programming/cuopt_c.h +++ b/cpp/include/cuopt/linear_programming/cuopt_c.h @@ -102,7 +102,7 @@ cuopt_int_t cuOptReadProblem(const char* filename, cuOptOptimizationProblem* pro * minimize/maximize cᵀx + offset * subject to A x {=, ≤, ≥} b * l ≤ x ≤ u - * xᵢ ∈ ℤ for some i + * x_i integer for some i * @endverbatim * * @param[in] num_constraints The number of constraints From b0504fa0e139328ff42b837d244e19f6b0b578b6 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 07:50:40 -0500 Subject: [PATCH 21/49] deprecate cuda 11 support --- docs/cuopt/source/cuopt-c/quick-start.rst | 17 ----------------- docs/cuopt/source/cuopt-python/quick-start.rst | 13 ------------- docs/cuopt/source/cuopt-server/quick-start.rst | 13 ------------- docs/cuopt/source/system-requirements.rst | 10 +++------- 4 files changed, 3 insertions(+), 50 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/quick-start.rst b/docs/cuopt/source/cuopt-c/quick-start.rst index 73767264b1..18a18334af 100644 --- a/docs/cuopt/source/cuopt-c/quick-start.rst +++ b/docs/cuopt/source/cuopt-c/quick-start.rst @@ -11,14 +11,6 @@ Installation pip --- -For CUDA 11.x: - -.. code-block:: bash - - # This is deprecated module and not longer used, but share same name for the CLI, so we need to uninstall it first if it exists. - pip uninstall cuopt-thin-client - pip install --extra-index-url=https://pypi.nvidia.com libcuopt-cu11==25.5.* - For CUDA 12.x: .. code-block:: bash @@ -33,15 +25,6 @@ Conda NVIDIA cuOpt can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: -For CUDA 11.x: - -.. code-block:: bash - - # This is deprecated module and not longer used, but share same name for the CLI, so we need to uninstall it first if it exists. - conda remove cuopt-thin-client - conda install -c rapidsai -c conda-forge -c nvidia \ - libcuopt=25.5.* python=3.12 cuda-version=11.8 - For CUDA 12.x: .. code-block:: bash diff --git a/docs/cuopt/source/cuopt-python/quick-start.rst b/docs/cuopt/source/cuopt-python/quick-start.rst index cbbc20d3fb..27d46b8f7a 100644 --- a/docs/cuopt/source/cuopt-python/quick-start.rst +++ b/docs/cuopt/source/cuopt-python/quick-start.rst @@ -10,12 +10,6 @@ Installation pip --- -For CUDA 11.x: - -.. code-block:: bash - - pip install --extra-index-url=https://pypi.nvidia.com cuopt-cu11==25.5.* - For CUDA 12.x: .. code-block:: bash @@ -28,13 +22,6 @@ Conda NVIDIA cuOpt can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: -For CUDA 11.x: - -.. code-block:: bash - - conda install -c rapidsai -c conda-forge -c nvidia \ - cuopt=25.5.* python=3.12 cuda-version=11.8 - For CUDA 12.x: .. code-block:: bash diff --git a/docs/cuopt/source/cuopt-server/quick-start.rst b/docs/cuopt/source/cuopt-server/quick-start.rst index 54cbee1045..4aba1e6aad 100644 --- a/docs/cuopt/source/cuopt-server/quick-start.rst +++ b/docs/cuopt/source/cuopt-server/quick-start.rst @@ -8,12 +8,6 @@ Installation pip --- -For CUDA 11.x: - -.. code-block:: bash - - pip install --extra-index-url=https://pypi.nvidia.com cuopt-server-cu11==25.5.* cuopt-sh==25.5.* - For CUDA 12.x: .. code-block:: bash @@ -26,13 +20,6 @@ Conda cuOpt Server can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: -For CUDA 11.x: - -.. code-block:: bash - - conda install -c rapidsai -c conda-forge -c nvidia \ - cuopt-server=25.5.* cuopt-sh=25.5.* python=3.12 cuda-version=11.8 - For CUDA 12.x: .. code-block:: bash diff --git a/docs/cuopt/source/system-requirements.rst b/docs/cuopt/source/system-requirements.rst index 3642a0586f..7313ff0edc 100644 --- a/docs/cuopt/source/system-requirements.rst +++ b/docs/cuopt/source/system-requirements.rst @@ -21,11 +21,11 @@ System Requirements - 100+ GB free space * CUDA: - - 11.2+ + - 12.0+ * NVIDIA drivers: - - 450.80.02+ - + - 525.60.13+ (linux) + - 527.41+ (windows) * OS: - Linux distributions with glibc>=2.28 (released in August 2018): * Arch Linux (minimum version 2018-08-02) @@ -37,10 +37,6 @@ System Requirements * Windows 11 with WSL2 * CUDA & NVIDIA Driver combinations: - - CUDA 11.2 with Driver 470.42.01+ - - CUDA 11.4 with Driver 470.42.01+ - - CUDA 11.5 with Driver 495.29.05+ - - CUDA 11.8 with Driver 520.61.05+ - CUDA 12.0 with Driver 525.60.13+ - CUDA 12.2 with Driver 535.86.10+ - CUDA 12.5 with Driver 555.42.06+ From c75fdd9348799b17233365354131e0e9ce981112 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 08:00:33 -0500 Subject: [PATCH 22/49] Add rapids logger to rpath --- python/cuopt/cuopt/linear_programming/CMakeLists.txt | 5 +++++ python/libcuopt/CMakeLists.txt | 1 + 2 files changed, 6 insertions(+) diff --git a/python/cuopt/cuopt/linear_programming/CMakeLists.txt b/python/cuopt/cuopt/linear_programming/CMakeLists.txt index 5fd133ba7e..85ef760826 100644 --- a/python/cuopt/cuopt/linear_programming/CMakeLists.txt +++ b/python/cuopt/cuopt/linear_programming/CMakeLists.txt @@ -73,3 +73,8 @@ add_subdirectory(data_model) if(DEFINED cython_lib_dir) rapids_cython_add_rpath_entries(TARGET mps_parser PATHS "${cython_lib_dir}") endif() +set(rpaths + "$ORIGIN/../lib64" + "$ORIGIN/../../rapids_logger/lib64" +) +set_property(TARGET mps_parser PROPERTY INSTALL_RPATH ${rpaths} APPEND) diff --git a/python/libcuopt/CMakeLists.txt b/python/libcuopt/CMakeLists.txt index 7b85f2275c..1212ff02b7 100644 --- a/python/libcuopt/CMakeLists.txt +++ b/python/libcuopt/CMakeLists.txt @@ -58,6 +58,7 @@ target_link_libraries(cuopt_cli PRIVATE argparse) set(rpaths "$ORIGIN/../lib64" + "$ORIGIN/../../rapids_logger/lib64" "$ORIGIN/../../nvidia/cublas/lib" "$ORIGIN/../../nvidia/curand/lib" "$ORIGIN/../../nvidia/cusolver/lib" From c81ae2b8e7b24a03b1a719afcf9827019162c3dd Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 09:44:41 -0500 Subject: [PATCH 23/49] Add cli test --- ci/test_wheel_cuopt.sh | 6 ++++ python/libcuopt/libcuopt/tests/test_cli.sh | 33 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 python/libcuopt/libcuopt/tests/test_cli.sh diff --git a/ci/test_wheel_cuopt.sh b/ci/test_wheel_cuopt.sh index e601073ad6..96f32941fd 100755 --- a/ci/test_wheel_cuopt.sh +++ b/ci/test_wheel_cuopt.sh @@ -49,4 +49,10 @@ cd ./datasets ./get_test_data.sh --solomon ./get_test_data.sh --tsp cd - + +# Run CLI tests +RAPIDS_DATASET_ROOT_DIR=./datasets timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh + +# Run Python tests RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest --verbose --capture=no ./python/cuopt/cuopt/tests/ + diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh new file mode 100644 index 0000000000..04630e249d --- /dev/null +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +# Test the CLI + + +# Add a test for the help command +cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1) + +# Add a test with a simple linear programming problem + +# Run solver and check for optimal status - fail if not found +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/linear_programming/good-mps-1.mps | grep -q "Status: Optimal" || (echo "Expected optimal solution not found" && exit 1) + +# Add a for mixed integer programming test with options + +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) \ No newline at end of file From 8ff9acfc9f8642feb685240697e852d66d6023dd Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 10:01:49 -0500 Subject: [PATCH 24/49] fix issues --- docs/cuopt/source/cuopt-cli/cli-examples.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/cuopt/source/cuopt-cli/cli-examples.rst b/docs/cuopt/source/cuopt-cli/cli-examples.rst index f6b3b524f5..f920e12f4c 100644 --- a/docs/cuopt/source/cuopt-cli/cli-examples.rst +++ b/docs/cuopt/source/cuopt-cli/cli-examples.rst @@ -10,11 +10,11 @@ To solve a simple LP problem using cuopt_cli: # Create a sample MPS file echo "* optimize - * cost = -0.2 * VAR1 + 0.1 * VAR2 - * subject to - * 3 * VAR1 + 4 * VAR2 <= 5.4 - * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 - NAME SAMPLE + * cost = -0.2 * VAR1 + 0.1 * VAR2 + * subject to + * 3 * VAR1 + 4 * VAR2 <= 5.4 + * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 + NAME SAMPLE ROWS N COST L ROW1 @@ -63,10 +63,10 @@ Here's an example of solving a Mixed Integer Programming (MIP) problem using the echo "* Optimal solution -28 NAME MIP_SAMPLE ROWS - N OBJ - L C1 - L C2 - L C3 + N OBJ + L C1 + L C2 + L C3 COLUMNS MARK0001 'MARKER' 'INTORG' X1 OBJ -7 @@ -85,7 +85,7 @@ Here's an example of solving a Mixed Integer Programming (MIP) problem using the BOUNDS UP BOUND X1 10 UP BOUND X2 10 - ENDATA" > mip_sample.mps + ENDATA" > mip_sample.mps # Solve the MIP problem with custom parameters cuopt_cli mip_sample.mps --mip-absolute-gap 0.01 --time-limit 10 From e6d772a413fd576cac7022eab25d3faf8b70fa8f Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 10:02:15 -0500 Subject: [PATCH 25/49] add a sample mps file for test --- datasets/mip/sample.mps | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 datasets/mip/sample.mps diff --git a/datasets/mip/sample.mps b/datasets/mip/sample.mps new file mode 100644 index 0000000000..3bcc1e446f --- /dev/null +++ b/datasets/mip/sample.mps @@ -0,0 +1,26 @@ +* Optimal solution -28 +NAME MIP_SAMPLE +ROWS + N OBJ + L C1 + L C2 + L C3 +COLUMNS + MARK0001 'MARKER' 'INTORG' + X1 OBJ -7 + X1 C1 -1 + X1 C2 5 + X1 C3 -2 + X2 OBJ -2 + X2 C1 2 + X2 C2 1 + X2 C3 -2 + MARK0001 'MARKER' 'INTEND' +RHS + RHS C1 4 + RHS C2 20 + RHS C3 -7 +BOUNDS + UP BOUND X1 10 + UP BOUND X2 10 +ENDATA From e260b796c1f7c15965fc2f01afad972dbeca9dfd Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 10:09:32 -0500 Subject: [PATCH 26/49] fix tests in docs --- docs/cuopt/source/cuopt-cli/cli-examples.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/cuopt-cli/cli-examples.rst b/docs/cuopt/source/cuopt-cli/cli-examples.rst index f920e12f4c..9fdd693cc5 100644 --- a/docs/cuopt/source/cuopt-cli/cli-examples.rst +++ b/docs/cuopt/source/cuopt-cli/cli-examples.rst @@ -29,7 +29,7 @@ To solve a simple LP problem using cuopt_cli: RHS RHS1 ROW1 5.4 RHS1 ROW2 4.9 - ENDATA" > sample.mps + ENDATA" > sample.mps # Solve using default settings cuopt_cli sample.mps @@ -85,7 +85,7 @@ Here's an example of solving a Mixed Integer Programming (MIP) problem using the BOUNDS UP BOUND X1 10 UP BOUND X2 10 - ENDATA" > mip_sample.mps + ENDATA" > mip_sample.mps # Solve the MIP problem with custom parameters cuopt_cli mip_sample.mps --mip-absolute-gap 0.01 --time-limit 10 From f61efb7963c65e77dcc72960682b6ec1d63bc700 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 10:17:54 -0500 Subject: [PATCH 27/49] pre-commit changes --- ci/test_wheel_cuopt.sh | 5 ++++- python/libcuopt/libcuopt/tests/test_cli.sh | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ci/test_wheel_cuopt.sh b/ci/test_wheel_cuopt.sh index 96f32941fd..da3ebec1ee 100755 --- a/ci/test_wheel_cuopt.sh +++ b/ci/test_wheel_cuopt.sh @@ -50,8 +50,11 @@ cd ./datasets ./get_test_data.sh --tsp cd - +RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" +export RAPIDS_DATASET_ROOT_DIR + # Run CLI tests -RAPIDS_DATASET_ROOT_DIR=./datasets timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh +timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh # Run Python tests RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest --verbose --capture=no ./python/cuopt/cuopt/tests/ diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh index 04630e249d..cec8e9e16f 100644 --- a/python/libcuopt/libcuopt/tests/test_cli.sh +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -26,8 +26,8 @@ cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage informati # Add a test with a simple linear programming problem # Run solver and check for optimal status - fail if not found -cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/linear_programming/good-mps-1.mps | grep -q "Status: Optimal" || (echo "Expected optimal solution not found" && exit 1) +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) # Add a for mixed integer programming test with options -cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) \ No newline at end of file +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) From f3b414bbc986f6cdc326cb4a58fa0d19ead81752 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 11:20:19 -0500 Subject: [PATCH 28/49] remove third party modeling languges for now from docs --- docs/cuopt/source/introduction.rst | 6 +-- docs/cuopt/source/lp-features.rst | 6 +-- docs/cuopt/source/milp-features.rst | 8 +--- .../third_party_modeling_languages/index.rst | 37 +------------------ 4 files changed, 5 insertions(+), 52 deletions(-) diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index af9201826c..f49089a29b 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -115,8 +115,4 @@ cuOpt supports the following APIs: - Mixed Integer Linear Programming (MILP) - Routing (TSP, VRP, and PDP) - cuOpt Third-Party Modeling Languages support (LP and MILP) - - SciPy - - PuLP - - CVXPY - - Pyomo - - AMPL + This is still under development, and will be available soon. diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 3c8e2d68eb..ddc99d8548 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -8,11 +8,7 @@ Availability The LP solver can be accessed in three different ways: - **Third-Party Modeling Languages**: cuOpt's LP and MILP solver can be called directly from the following third-party modeling languages. - - SciPy - - PuLP - - CVXPY - - Pyomo - - AMPL + - This is still under development, and will be available soon. This allows you to leverage GPU acceleration while maintaining your existing optimization workflow in these modeling languages. diff --git a/docs/cuopt/source/milp-features.rst b/docs/cuopt/source/milp-features.rst index 3966b37ebc..884b4105ae 100644 --- a/docs/cuopt/source/milp-features.rst +++ b/docs/cuopt/source/milp-features.rst @@ -5,14 +5,10 @@ MILP Features Availability ------------ -The MILP solver can be accessed in three different ways: +The MILP solver can be accessed in the following ways: - **Third-Party Modeling Languages**: cuOpt's MILP solver can be called directly from the following third-party modeling languages: - - SciPy - - PuLP - - CVXPY - - Pyomo - - AMPL + - This is still under development, and will be available soon. This allows you to leverage GPU acceleration while maintaining your existing optimization workflow in these modeling languages. diff --git a/docs/cuopt/source/third_party_modeling_languages/index.rst b/docs/cuopt/source/third_party_modeling_languages/index.rst index c6d8f84578..2371fb9034 100644 --- a/docs/cuopt/source/third_party_modeling_languages/index.rst +++ b/docs/cuopt/source/third_party_modeling_languages/index.rst @@ -2,39 +2,4 @@ Third Party Modeling Languages =============================== - --------------------------- -CVXPY Support --------------------------- - -CVXPY may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver to use it to solve linear and mixed integer programming problems. - - --------------------------- -SciPy Support --------------------------- - -SciPy users may call cuOpt to solve linear and mixed integer programming problems using linprog and milp. You must specify cuOpt as the method to solve these problems. - - --------------------------- -PuLP Support --------------------------- - -PuLP may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver within PuLP to use it to solve LPs and MIPs. - - --------------------------- -Pyomo Support --------------------------- - -Pyomo may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver within Pyomo to use it to solve LPs and MIPs. - - --------------------------- -AMPL Support --------------------------- - -AMPL may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver within AMPL to use it to solve LPs and MIPs. - - +This is still under development, and will be available soon. From e95d8b551b5b7536ea93661ac6ccf89044ea1e0e Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 12:12:13 -0500 Subject: [PATCH 29/49] Remove modeling language details --- docs/cuopt/source/index.rst | 11 ----------- docs/cuopt/source/introduction.rst | 4 +--- docs/cuopt/source/lp-features.rst | 11 ----------- docs/cuopt/source/milp-features.rst | 10 ---------- .../source/third_party_modeling_languages/index.rst | 5 ----- 5 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 docs/cuopt/source/third_party_modeling_languages/index.rst diff --git a/docs/cuopt/source/index.rst b/docs/cuopt/source/index.rst index 60f5c97de5..44f50db163 100644 --- a/docs/cuopt/source/index.rst +++ b/docs/cuopt/source/index.rst @@ -60,17 +60,6 @@ Command Line Interface (cuopt-cli) Command Line Interface Overview - -=============================== -Third Party Modeling Languages -=============================== -.. toctree:: - :maxdepth: 4 - :caption: Third Party Modeling Languages - :name: Third Party Modeling Languages - - Third Party Modeling Languages - ============= Resources ============= diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index f49089a29b..5d15737d6e 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -109,10 +109,8 @@ cuOpt supports the following APIs: - Python support - Routing (TSP, VRP, and PDP) - Linear Programming (LP) and Mixed Integer Linear Programming (MILP) - - cuOpt includes a Python API that is used as the backend of the cuOpt server. However, we do not provide documentation for the Python API at this time. We suggest using a third-party modeling language or cuOpt server to access cuOpt via Python. We anticipate that the Python API will change significantly in the future. Use it at your own risk. + - cuOpt includes a Python API that is used as the backend of the cuOpt server. However, we do not provide documentation for the Python API at this time. We suggest using cuOpt server to access cuOpt via Python. We anticipate that the Python API will change significantly in the future. Use it at your own risk. - Server support - Linear Programming (LP) - Mixed Integer Linear Programming (MILP) - Routing (TSP, VRP, and PDP) -- cuOpt Third-Party Modeling Languages support (LP and MILP) - This is still under development, and will be available soon. diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index ddc99d8548..963d21dc7e 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -7,11 +7,6 @@ Availability The LP solver can be accessed in three different ways: -- **Third-Party Modeling Languages**: cuOpt's LP and MILP solver can be called directly from the following third-party modeling languages. - - This is still under development, and will be available soon. - -This allows you to leverage GPU acceleration while maintaining your existing optimization workflow in these modeling languages. - - **C API**: A native C API that provides direct low-level access to cuOpt's LP capabilities, enabling integration into any application or system that can interface with C. - **As a Self-Hosted Service**: cuOpt's LP solver can be deployed as a in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. @@ -49,9 +44,6 @@ There are two ways to specify constraints to cuOpt LP solver: Warm Start ----------- -.. note:: - Warm start is not currently supported C API and third-party modeling languages. - A warm starts allow a user to provide an initial solution to help PDLP converge faster. The initial ``primal`` and ``dual`` solutions can be specified by the user. Alternatively, previously run solutions can be used to warm start a new request to decrease solve time. `Examples `_ are shared on the self-hosted page. @@ -103,7 +95,4 @@ The user may specify a time limit to the solver. By default the solver runs unti Batch Mode ---------- -.. note:: - Batch mode is not currently supported in the C API and third-party modeling languages. It is only available via cuOpt server. - Users can submit a set of problems which will be solved in a batch. Problems will be solved at the same time in parallel to fully utilize the GPU. Checkout `self-hosted client `_ example in thin client. diff --git a/docs/cuopt/source/milp-features.rst b/docs/cuopt/source/milp-features.rst index 884b4105ae..a7501b73da 100644 --- a/docs/cuopt/source/milp-features.rst +++ b/docs/cuopt/source/milp-features.rst @@ -7,11 +7,6 @@ Availability The MILP solver can be accessed in the following ways: -- **Third-Party Modeling Languages**: cuOpt's MILP solver can be called directly from the following third-party modeling languages: - - This is still under development, and will be available soon. - -This allows you to leverage GPU acceleration while maintaining your existing optimization workflow in these modeling languages. - - **C API**: A native C API that provides direct low-level access to cuOpt's MILP solver, enabling integration into any application or system that can interface with C. - **As a Self-Hosted Service**: cuOpt's MILP solver can be deployed in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. @@ -50,16 +45,11 @@ Both forms are mathematically equivalent. The choice between them is a matter of Incumbent Solution Callback --------------------------- -.. note:: - The incumbent solution callback is not currently supported in the C API and third-party modeling languages. User can provide a callback to receive new integer feasible solutions that improve the objective (called incumbents) while the solver is running. `Incumbent Example `_ is shared on the self-hosted page. Logging Callback ---------------- -.. note:: - The logging callback is not currently supported in the C API and third-party modeling languages. - A logging callback allows users to get additional information about how the solve is progressing. `Logging Callback Example `_ is shared on the self-hosted page. diff --git a/docs/cuopt/source/third_party_modeling_languages/index.rst b/docs/cuopt/source/third_party_modeling_languages/index.rst deleted file mode 100644 index 2371fb9034..0000000000 --- a/docs/cuopt/source/third_party_modeling_languages/index.rst +++ /dev/null @@ -1,5 +0,0 @@ -=============================== -Third Party Modeling Languages -=============================== - -This is still under development, and will be available soon. From d2a37a93d36f6ad5a43cb4deb7319ea319127397 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 13:39:53 -0500 Subject: [PATCH 30/49] fix doc --- docs/cuopt/source/lp-features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 963d21dc7e..73f46b50cc 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -5,7 +5,7 @@ LP Features Availability ------------- -The LP solver can be accessed in three different ways: +The LP solver can be accessed in the following ways: - **C API**: A native C API that provides direct low-level access to cuOpt's LP capabilities, enabling integration into any application or system that can interface with C. From 33000a8fdd42112890344d32dac6c16a798b5a6c Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 13:47:36 -0500 Subject: [PATCH 31/49] update doc --- docs/cuopt/source/lp-features.rst | 2 +- docs/cuopt/source/milp-features.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 73f46b50cc..5c83abd341 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -11,7 +11,7 @@ The LP solver can be accessed in the following ways: - **As a Self-Hosted Service**: cuOpt's LP solver can be deployed as a in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. -All three options provide the same powerful linear optimization capabilities while offering flexibility in deployment and integration approaches. +All the above options provide the same powerful linear optimization capabilities while offering flexibility in deployment and integration approaches. Variable Bounds --------------- diff --git a/docs/cuopt/source/milp-features.rst b/docs/cuopt/source/milp-features.rst index a7501b73da..f52fb771f4 100644 --- a/docs/cuopt/source/milp-features.rst +++ b/docs/cuopt/source/milp-features.rst @@ -11,7 +11,7 @@ The MILP solver can be accessed in the following ways: - **As a Self-Hosted Service**: cuOpt's MILP solver can be deployed in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. -All three options provide the same powerful mixed-integer linear optimization capabilities while offering flexibility in deployment and integration approaches. +All the above options provide the same powerful mixed-integer linear optimization capabilities while offering flexibility in deployment and integration approaches. Variable Bounds --------------- From 45d4a3a76035a854cafbe875b9507ec25c5fdd37 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 11:57:10 -0700 Subject: [PATCH 32/49] Update introduction.rst --- docs/cuopt/source/introduction.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 5d15737d6e..437f264f26 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -29,7 +29,7 @@ For example, the TSP has several applications in planning and logistics, where a The VRP generalizes the TSP to solve for the optimal set of routes for a fleet of vehicles in order to deliver to a given set of customers. The PDP adds the possibility of two different types of services, namely pickup or delivery, whereas in VRP all customers require the same service be performed at a customer location. -How cuOpt Solves Routing Problem +How cuOpt Solves the Routing Problem ----------------------------------- cuOpt first generates an initial population of solutions, then iteratively improves the population until the time limit is reached, and picks the best solution from the population. @@ -38,7 +38,7 @@ cuOpt first generates an initial population of solutions, then iteratively impro The Necessity for Heuristics ------------------------------ -Given the time and computational resources required for brute-force enumeration, obtaining the exact optimal solution is not realistic at all. However, there are well-studied heuristics that yield near-optimal solutions for very large problems within a reasonable time, and NVIDIA cuOpt focuses on using these heuristics. +Given the time and computational resources required for brute-force enumeration, obtaining the exact optimal solution is not realistic. However, there are well-studied heuristics that yield near-optimal solutions for very large problems within a reasonable time, and NVIDIA cuOpt focuses on using these heuristics. @@ -64,12 +64,14 @@ This is a linear program. How cuOpt Solves LP Problem ------------------------------ -cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve large-scale LPs. This solver implements gradient descent, enhanced by heuristics, and performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. +cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve large-scale LPs. This solver implements gradient descent, enhanced by heuristics, and performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. + +In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. Mixed Integer Linear Programming (MILP) ========================================= -A **Mixed Integer Linear Program** is a variant of a Linear Program, where some of the variables are restricted to take on only integer values, while other variables can vary continuously. NVIDIA cuOpt uses a hybrid GPU/CPU method: running primal heuristics on the GPU and improving the dual bound on the CPU. +A **Mixed Integer Linear Program** is a variant of a Linear Program where some of the variables are restricted to take on only integer values, while other variables can vary continuously. NVIDIA cuOpt uses a hybrid GPU/CPU method: running primal heuristics on the GPU and improving the dual bound on the CPU. For example, consider the following system of constraints: From b203574ae3e7a22e559125d2c2994895e6cbab8f Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 11:59:29 -0700 Subject: [PATCH 33/49] Update release-notes.rst --- docs/cuopt/source/release-notes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/release-notes.rst b/docs/cuopt/source/release-notes.rst index 2f7678de2d..9505e20552 100644 --- a/docs/cuopt/source/release-notes.rst +++ b/docs/cuopt/source/release-notes.rst @@ -11,7 +11,7 @@ New Features - Added concurrent mode that runs PDLP and Dual Simplex together - Added crossover from PDLP to Dual Simplex -- Added a LP and MILP C API for cuOpt +- Added a C API for LP and MILP - PDLP: Faster iterations and new more robust default PDLPSolverMode Stable2 Breaking Changes @@ -46,7 +46,7 @@ Bug Fixes - Improve breaks to allow dimensions at arbitrary places in the route. - Free var elimination with a substitute variable for each free variable. - Fixed race condition when resetting vehicle IDs in heterogenous mode. -- cuOpt self-hosted client, some MILPs will not have all fields in ``lp_stats``. +- cuOpt self-hosted client, some MILPs do not have all fields in ``lp_stats``. - Fixed RAPIDS logger usage. - Handle LP state more cleanly, per solution. - Fixed routing solver intermittent failures. From 9b538b1135bd2716d05c7ff6c2ed519136c6bb8f Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:04:02 -0700 Subject: [PATCH 34/49] Update lp-features.rst --- docs/cuopt/source/lp-features.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 5c83abd341..70080c6f88 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -23,7 +23,7 @@ Constraints The constraint matrix is specified in `Compressed Sparse Row (CSR) format `_. -There are two ways to specify constraints to cuOpt LP solver: +There are two ways to specify constraints to the LP solver: 1. Using row_type and right-hand side: @@ -50,23 +50,23 @@ Alternatively, previously run solutions can be used to warm start a new request PDLP Solver Mode ---------------- -Users can control how the solver will operate by using ``solver mode`` under ``solver config``. The mode choice can drastically impact how fast a specific problem will be solved. Users are encouraged to test different modes to see which one fits the best their problem. +Users can control how the solver will operate by specifying the PDLP solver mode. The mode choice can drastically impact how fast a specific problem will be solved. Users are encouraged to test different modes to see which one fits the best their problem. Method ------ -**Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs two solves at the same time: PDLP on the GPU and dual simplex on the CPU. A solution is returned from the solve that finishes first. +**Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs two algorithms at the same time: PDLP on the GPU and dual simplex on the CPU. A solution is returned from the algorithm that finishes first. **PDLP**: Primal-Dual Hybrid Gradient for Linear Program is an algorithm for solving large-scale linear programming problems on the GPU. PDLP does not attempt to any matrix factorizations during the course of the solve. Select this method if your LP is so large that factorization will not fit into memory. By default PDLP solves to low relative tolerance and the solutions it returns do not lie at a vertex of the feasible region. Enable crossover to obtain a highly accurate basic solution from a PDLP solution. -**Dual Simplex**: The simplex method applied to the dual of the linear program. Dual simplex requires the basis factorization of linear program fit into memory. Select this method if your LP is small to medium sized, or if you require a highly accurate basic solution. +**Dual Simplex**: Dual simplex is the simplex method applied to the dual of the linear program. Dual simplex requires the basis factorization of linear program fit into memory. Select this method if your LP is small to medium sized, or if you require a high-quality basic solution. Crossover --------- -Crossover allows you to obtain a high-quality basic solution. More details can be found `here `__. +Crossover allows you to obtain a high-quality basic solution from the results of a PDLP solve. More details can be found `here `__. Logging Callback @@ -77,7 +77,7 @@ With logging callback, users can fetch server-side logs for additional debugs an Infeasibility Detection ----------------------- -An option under ``solver config`` in API. The PDLP solver includes the option to detect infeasible problems. If the infeasibilty detection is enabled in solver settings, PDLP will abort as soon as it concludes the problem is infeasible. +The PDLP solver includes the option to detect infeasible problems. If the infeasibilty detection is enabled in solver settings, PDLP will abort as soon as it concludes the problem is infeasible. .. note:: Infeasibility detection is always enabled for dual simplex. From 81953ffab5cbf70bf42a4dc0bd91384eda12874f Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:05:58 -0700 Subject: [PATCH 35/49] Update lp-example.rst --- docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst index 976e433e79..4bbe629225 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst @@ -5,7 +5,7 @@ LP C API Examples Example With Data ----------------- -This example demonstrates how to use the cuOpt linear programming solver in C. More details on the API can be found in `C API `_. +This example demonstrates how to use the LP solver in C. More details on the API can be found in `C API `_. Copy the code below into a file called ``lp_example.c``: @@ -493,4 +493,4 @@ You should see the following output: x1 = 1.800000 x2 = 0.000000 - Solver completed successfully! \ No newline at end of file + Solver completed successfully! From 7fbd6a49d1bfa56327ff9fbc95009765ab3076b3 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:08:25 -0700 Subject: [PATCH 36/49] Update milp-examples.rst --- docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst index 3069c55095..da08c05095 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst @@ -5,7 +5,7 @@ MILP C API Examples Example With Data ----------------- -This example demonstrates how to use the cuOpt solver in C to solve a MILP problem. More details on the API can be found in `C API `_. +This example demonstrates how to use the MILP solver in C. More details on the API can be found in `C API `_. Copy the code below into a file called ``milp_example.c``: @@ -528,4 +528,4 @@ You should see the following output: x1 = 4.000000 x2 = 0.000000 - Solver completed successfully! \ No newline at end of file + Solver completed successfully! From 98d0570eb6cb9dab96da5903cf005348ba3e0a00 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:10:12 -0700 Subject: [PATCH 37/49] Update cli-examples.rst --- docs/cuopt/source/cuopt-cli/cli-examples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cuopt/source/cuopt-cli/cli-examples.rst b/docs/cuopt/source/cuopt-cli/cli-examples.rst index 9fdd693cc5..43cc147906 100644 --- a/docs/cuopt/source/cuopt-cli/cli-examples.rst +++ b/docs/cuopt/source/cuopt-cli/cli-examples.rst @@ -88,7 +88,7 @@ Here's an example of solving a Mixed Integer Programming (MIP) problem using the ENDATA" > mip_sample.mps # Solve the MIP problem with custom parameters - cuopt_cli mip_sample.mps --mip-absolute-gap 0.01 --time-limit 10 + cuopt_cli --mip-absolute-gap 0.01 --time-limit 10 mip_sample.mps This should produce output similar to: From c36bed9204f8f60a85c2c8062f23ddc2e043fb99 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:13:00 -0700 Subject: [PATCH 38/49] Update lp-features.rst --- docs/cuopt/source/lp-features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 70080c6f88..6fa62834ca 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -46,7 +46,7 @@ Warm Start A warm starts allow a user to provide an initial solution to help PDLP converge faster. The initial ``primal`` and ``dual`` solutions can be specified by the user. -Alternatively, previously run solutions can be used to warm start a new request to decrease solve time. `Examples `_ are shared on the self-hosted page. +Alternatively, previously run solutions can be used to warm start a new solve to decrease solve time. `Examples `_ are shared on the self-hosted page. PDLP Solver Mode ---------------- From 2cf08a622600913923d5cb8b14d8828ee96b491b Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:17:00 -0700 Subject: [PATCH 39/49] Update milp-features.rst --- docs/cuopt/source/milp-features.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/milp-features.rst b/docs/cuopt/source/milp-features.rst index f52fb771f4..9ca31e9371 100644 --- a/docs/cuopt/source/milp-features.rst +++ b/docs/cuopt/source/milp-features.rst @@ -46,12 +46,12 @@ Both forms are mathematically equivalent. The choice between them is a matter of Incumbent Solution Callback --------------------------- -User can provide a callback to receive new integer feasible solutions that improve the objective (called incumbents) while the solver is running. `Incumbent Example `_ is shared on the self-hosted page. +User can provide a callback to receive new integer feasible solutions that improve the objective (called incumbents) while the solver is running. An `Incumbent Example `_ is shared on the self-hosted page. Logging Callback ---------------- -A logging callback allows users to get additional information about how the solve is progressing. `Logging Callback Example `_ is shared on the self-hosted page. +A logging callback allows users to get additional information about how the solve is progressing. A `Logging Callback Example `_ is shared on the self-hosted page. Time Limit -------------- From 6cc25867fba5eb9b0b9a2041e1397d8e2e51f0de Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:18:08 -0700 Subject: [PATCH 40/49] Update lp-features.rst --- docs/cuopt/source/lp-features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 6fa62834ca..7d0adab21c 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -11,7 +11,7 @@ The LP solver can be accessed in the following ways: - **As a Self-Hosted Service**: cuOpt's LP solver can be deployed as a in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. -All the above options provide the same powerful linear optimization capabilities while offering flexibility in deployment and integration approaches. +Each option provide the same powerful linear optimization capabilities while offering flexibility in deployment and integration. Variable Bounds --------------- From 3fc576b7b8bc51d0e4d37745cf333d7893a858a9 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:18:48 -0700 Subject: [PATCH 41/49] Update milp-features.rst --- docs/cuopt/source/milp-features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cuopt/source/milp-features.rst b/docs/cuopt/source/milp-features.rst index 9ca31e9371..97a5729ac4 100644 --- a/docs/cuopt/source/milp-features.rst +++ b/docs/cuopt/source/milp-features.rst @@ -11,7 +11,7 @@ The MILP solver can be accessed in the following ways: - **As a Self-Hosted Service**: cuOpt's MILP solver can be deployed in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. -All the above options provide the same powerful mixed-integer linear optimization capabilities while offering flexibility in deployment and integration approaches. +Each option provide the same powerful mixed-integer linear optimization capabilities while offering flexibility in deployment and integration. Variable Bounds --------------- From 546c6297161e8187758f8f3e70aee3166a84a5da Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:24:00 -0700 Subject: [PATCH 42/49] Update introduction.rst --- docs/cuopt/source/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 437f264f26..45d4de9efa 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -89,7 +89,7 @@ and suppose we wish to maximize the objective function This is a mixed integer linear program. -Although MILPs seems similar to a LPs, they are actually much more difficult. +Although MILPs seems similar to a LPs, they require much more computation to solve. How cuOpt Solves MILP Problem ------------------------------ From 9b0b29753c0972dfc3bcb012081d0a3d3e071601 Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 23 May 2025 12:25:37 -0700 Subject: [PATCH 43/49] Update introduction.rst --- docs/cuopt/source/introduction.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 45d4de9efa..e047c6e3fc 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -62,7 +62,7 @@ and suppose we want to maximize the objective function This is a linear program. -How cuOpt Solves LP Problem +How cuOpt Solves the Linear Programming Problem ------------------------------ cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve large-scale LPs. This solver implements gradient descent, enhanced by heuristics, and performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. @@ -91,8 +91,8 @@ This is a mixed integer linear program. Although MILPs seems similar to a LPs, they require much more computation to solve. -How cuOpt Solves MILP Problem ------------------------------- +How cuOpt Solves the Mixed-Integer Linear Programming Problem +------------------------------------------------------------- The MILP solver is a hybrid GPU/CPU algorithm. Primal heuristics including local search, feasibility pump, and feasibility jump are performed on the GPU to improve the primal bound. Branch and bound is performed on the CPU to improve the dual bound. Integer feasible solutions are shared between both algorithms. From ca877bc4593083e9690bc49711afdf8b4cf43972 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 15:33:25 -0500 Subject: [PATCH 44/49] add cli to bin --- python/libcuopt/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/libcuopt/CMakeLists.txt b/python/libcuopt/CMakeLists.txt index 1212ff02b7..0f60e211d8 100644 --- a/python/libcuopt/CMakeLists.txt +++ b/python/libcuopt/CMakeLists.txt @@ -67,3 +67,5 @@ set(rpaths set_property(TARGET cuopt PROPERTY INSTALL_RPATH ${rpaths} APPEND) set_property(TARGET cuopt_cli PROPERTY INSTALL_RPATH ${rpaths} APPEND) + +install(TARGETS cuopt_cli RUNTIME DESTINATION bin) From 8e02ff80f692e4c643cb88aaa92ec6d7bbec2293 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 15:39:58 -0500 Subject: [PATCH 45/49] update intro --- docs/cuopt/source/introduction.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index e047c6e3fc..85949293c2 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -30,7 +30,7 @@ The VRP generalizes the TSP to solve for the optimal set of routes for a fleet o How cuOpt Solves the Routing Problem ------------------------------------ +------------------------------------- cuOpt first generates an initial population of solutions, then iteratively improves the population until the time limit is reached, and picks the best solution from the population. @@ -63,7 +63,7 @@ This is a linear program. How cuOpt Solves the Linear Programming Problem ------------------------------- +------------------------------------------------ cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve large-scale LPs. This solver implements gradient descent, enhanced by heuristics, and performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. From 79e1bb0f2a11e4449e8c89212180c0bc2b6b0355 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 17:33:52 -0500 Subject: [PATCH 46/49] APTH --- python/libcuopt/CMakeLists.txt | 2 -- python/libcuopt/libcuopt/tests/test_cli.sh | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/python/libcuopt/CMakeLists.txt b/python/libcuopt/CMakeLists.txt index 0f60e211d8..1212ff02b7 100644 --- a/python/libcuopt/CMakeLists.txt +++ b/python/libcuopt/CMakeLists.txt @@ -67,5 +67,3 @@ set(rpaths set_property(TARGET cuopt PROPERTY INSTALL_RPATH ${rpaths} APPEND) set_property(TARGET cuopt_cli PROPERTY INSTALL_RPATH ${rpaths} APPEND) - -install(TARGETS cuopt_cli RUNTIME DESTINATION bin) diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh index cec8e9e16f..836f8c32b1 100644 --- a/python/libcuopt/libcuopt/tests/test_cli.sh +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -20,6 +20,25 @@ set -euo pipefail # Test the CLI +# Find the directory containing cuopt_cli, starting from root +cuopt_dir=$(find / -type f -name cuopt_cli -exec dirname {} \; 2>/dev/null | head -n 1) + +if [ -z "$cuopt_dir" ]; then + echo "cuopt_cli not found." + exit 1 +else + # Add the directory to PATH if not already present + case ":$PATH:" in + *":$cuopt_dir:"*) + echo "cuopt_cli directory already in PATH." + ;; + *) + export PATH="$cuopt_dir:$PATH" + echo "Added $cuopt_dir to PATH." + ;; + esac +fi + # Add a test for the help command cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1) From 09f7ad863abdeca8f8f5067cf7b67237ce72e499 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 23 May 2025 22:55:43 -0500 Subject: [PATCH 47/49] disable cli test inwheels --- python/libcuopt/libcuopt/tests/test_cli.sh | 25 +++------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh index 836f8c32b1..146bb30fd9 100644 --- a/python/libcuopt/libcuopt/tests/test_cli.sh +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -20,33 +20,14 @@ set -euo pipefail # Test the CLI -# Find the directory containing cuopt_cli, starting from root -cuopt_dir=$(find / -type f -name cuopt_cli -exec dirname {} \; 2>/dev/null | head -n 1) - -if [ -z "$cuopt_dir" ]; then - echo "cuopt_cli not found." - exit 1 -else - # Add the directory to PATH if not already present - case ":$PATH:" in - *":$cuopt_dir:"*) - echo "cuopt_cli directory already in PATH." - ;; - *) - export PATH="$cuopt_dir:$PATH" - echo "Added $cuopt_dir to PATH." - ;; - esac -fi - # Add a test for the help command -cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1) +#cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1) # Add a test with a simple linear programming problem # Run solver and check for optimal status - fail if not found -cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) +#cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) # Add a for mixed integer programming test with options -cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) +#cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) From 8755199931812e285861102d48beb6a94dd2a8ce Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 26 May 2025 23:36:04 -0500 Subject: [PATCH 48/49] Add cli support --- python/libcuopt/libcuopt/_cli_wrapper.py | 27 ++++++++++++++++++++++ python/libcuopt/libcuopt/tests/test_cli.sh | 7 +++--- python/libcuopt/pyproject.toml | 5 +++- 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 python/libcuopt/libcuopt/_cli_wrapper.py diff --git a/python/libcuopt/libcuopt/_cli_wrapper.py b/python/libcuopt/libcuopt/_cli_wrapper.py new file mode 100644 index 0000000000..6f3a745574 --- /dev/null +++ b/python/libcuopt/libcuopt/_cli_wrapper.py @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. +# All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import subprocess +import sys + + +def main(): + """ + This connects to cli binary which situated under libcuopt/bin folder + """ + cli_path = os.path.join(os.path.dirname(__file__), "bin", "cuopt_cli") + sys.exit(subprocess.call([cli_path] + sys.argv[1:])) diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh index 146bb30fd9..6f98e01d03 100644 --- a/python/libcuopt/libcuopt/tests/test_cli.sh +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -21,13 +21,14 @@ set -euo pipefail # Add a test for the help command -#cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1) +cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1) # Add a test with a simple linear programming problem # Run solver and check for optimal status - fail if not found -#cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) + +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) # Add a for mixed integer programming test with options -#cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) diff --git a/python/libcuopt/pyproject.toml b/python/libcuopt/pyproject.toml index 8dfdb48378..0e180e1fe9 100644 --- a/python/libcuopt/pyproject.toml +++ b/python/libcuopt/pyproject.toml @@ -60,11 +60,14 @@ libcuopt = "libcuopt" select = [ "distro-too-large-compressed", ] - # PyPI limit is 700 MiB, fail CI before we get too close to that # 11.X size is 300M compressed and 12.x size is 600M compressed max_allowed_size_compressed = '700M' +[project.scripts] +cuopt_cli = "libcuopt._cli_wrapper:main" + + [tool.scikit-build] build-dir = "build/{wheel_tag}" cmake.build-type = "Release" From fa6ee53cfa403a2aeaff066bbd17ac566fce23bd Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 27 May 2025 08:16:24 -0500 Subject: [PATCH 49/49] Add path for testing --- python/libcuopt/libcuopt/tests/test_cli.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh index 6f98e01d03..6b217e123a 100644 --- a/python/libcuopt/libcuopt/tests/test_cli.sh +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -17,8 +17,11 @@ set -euo pipefail -# Test the CLI +# Add cuopt_cli path to PATh variable +export PATH="$(pyenv root)/versions/$(pyenv version-name)/bin:$PATH" + +# Test the CLI # Add a test for the help command cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1)