Skip to content

Commit b6163c9

Browse files
Add docs and example tests to barrier (#449)
This PR is a follow-up for PR #272 to add documentation and additional tests Authors: - Ramakrishnap (https://github.com/rgsl888prabhu) - Hugo Linsenmaier (https://github.com/hlinsen) - Chris Maes (https://github.com/chris-maes) Approvers: - Ishika Roy (https://github.com/Iroy30) - Trevor McKay (https://github.com/tmckayus) - Chris Maes (https://github.com/chris-maes) URL: #449
1 parent 182e8da commit b6163c9

File tree

15 files changed

+599
-82
lines changed

15 files changed

+599
-82
lines changed

ci/test_wheel_cuopt.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ cd -
6666
RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
6767
export RAPIDS_DATASET_ROOT_DIR
6868

69-
# Please enable this once ISSUE https://github.com/NVIDIA/cuopt/issues/94 is fixed
7069
# Run CLI tests
7170
timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh
7271

7372
# Run Python tests
73+
74+
# Due to race condition in certain cases UCX might not be able to cleanup properly, so we set the number of threads to 1
75+
export OMP_NUM_THREADS=1
76+
7477
RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest --verbose --capture=no ./python/cuopt/cuopt/tests/
7578

7679
# run jump tests and cvxpy integration tests for only nightly builds

docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ You may use the following functions to determine the number of bytes used to rep
1616
.. doxygenfunction:: cuOptGetIntSize
1717
.. doxygenfunction:: cuOptGetFloatSize
1818

19+
Version Information
20+
-------------------
21+
22+
You may use the following function to get the version of the cuOpt library
23+
24+
.. doxygenfunction:: cuOptGetVersion
25+
1926
Status Codes
2027
------------
2128

@@ -25,6 +32,9 @@ Every function in the C API returns a status code that indicates success or fail
2532
.. doxygendefine:: CUOPT_INVALID_ARGUMENT
2633
.. doxygendefine:: CUOPT_MPS_FILE_ERROR
2734
.. doxygendefine:: CUOPT_MPS_PARSE_ERROR
35+
.. doxygendefine:: CUOPT_VALIDATION_ERROR
36+
.. doxygendefine:: CUOPT_OUT_OF_MEMORY
37+
.. doxygendefine:: CUOPT_RUNTIME_ERROR
2838

2939
Optimization Problem
3040
--------------------
@@ -156,9 +166,22 @@ These constants are used as parameter names in the :c:func:`cuOptSetParameter`,
156166
.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE
157167
.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE
158168
.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE
169+
.. doxygendefine:: CUOPT_MIP_ABSOLUTE_GAP
170+
.. doxygendefine:: CUOPT_MIP_RELATIVE_GAP
159171
.. doxygendefine:: CUOPT_MIP_SCALING
160172
.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY
173+
.. doxygendefine:: CUOPT_MIP_PRESOLVE
161174
.. doxygendefine:: CUOPT_PRESOLVE
175+
.. doxygendefine:: CUOPT_LOG_TO_CONSOLE
176+
.. doxygendefine:: CUOPT_CROSSOVER
177+
.. doxygendefine:: CUOPT_FOLDING
178+
.. doxygendefine:: CUOPT_AUGMENTED
179+
.. doxygendefine:: CUOPT_DUALIZE
180+
.. doxygendefine:: CUOPT_ORDERING
181+
.. doxygendefine:: CUOPT_ELIMINATE_DENSE_COLUMNS
182+
.. doxygendefine:: CUOPT_CUDSS_DETERMINISTIC
183+
.. doxygendefine:: CUOPT_BARRIER_DUAL_INITIAL_POINT
184+
.. doxygendefine:: CUOPT_DUAL_POSTSOLVE
162185
.. doxygendefine:: CUOPT_SOLUTION_FILE
163186
.. doxygendefine:: CUOPT_NUM_CPU_THREADS
164187
.. doxygendefine:: CUOPT_USER_PROBLEM_FILE
@@ -186,6 +209,7 @@ These constants are used to configure `CUOPT_METHOD` via :c:func:`cuOptSetIntege
186209
.. doxygendefine:: CUOPT_METHOD_CONCURRENT
187210
.. doxygendefine:: CUOPT_METHOD_PDLP
188211
.. doxygendefine:: CUOPT_METHOD_DUAL_SIMPLEX
212+
.. doxygendefine:: CUOPT_METHOD_BARRIER
189213

190214

191215
Solving an LP or MIP
@@ -206,12 +230,15 @@ The output of a solve is a `cuOptSolution` object.
206230
The following functions may be used to access information from a `cuOptSolution`
207231

208232
.. doxygenfunction:: cuOptGetTerminationStatus
233+
.. doxygenfunction:: cuOptGetErrorStatus
234+
.. doxygenfunction:: cuOptGetErrorString
209235
.. doxygenfunction:: cuOptGetPrimalSolution
210236
.. doxygenfunction:: cuOptGetObjectiveValue
211237
.. doxygenfunction:: cuOptGetSolveTime
212238
.. doxygenfunction:: cuOptGetMIPGap
213239
.. doxygenfunction:: cuOptGetSolutionBound
214240
.. doxygenfunction:: cuOptGetDualSolution
241+
.. doxygenfunction:: cuOptGetDualObjectiveValue
215242
.. doxygenfunction:: cuOptGetReducedCosts
216243

217244
When you are finished with a `cuOptSolution` object you should destory it with

docs/cuopt/source/cuopt-python/routing/routing-example.ipynb

Lines changed: 110 additions & 30 deletions
Large diffs are not rendered by default.

docs/cuopt/source/introduction.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ This is a linear program.
6666

6767
How cuOpt Solves the Linear Programming Problem
6868
------------------------------------------------
69-
cuOpt includes an LP solver based on `PDLP <https://arxiv.org/abs/2106.04756>`__, 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.
69+
cuOpt includes three LP solving methods:
7070

71-
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.
71+
* **PDLP**: Based on `PDLP <https://arxiv.org/abs/2106.04756>`__, a First-Order Method (FOM) for solving large-scale LPs. This solver implements primal-dual hybrid gradient enhanced by heuristics. Sparse matrix-vector products are perfomed efficiently on NVIDIA GPUs.
72+
73+
* **Barrier (Interior-Point)**: A primal-dual interior-point method that uses GPU-accelerated sparse Cholesky and LDLT solves via cuDSS, and sparse matrix operations via cuSparse.
74+
75+
* **Dual Simplex**: A CPU-based dual simplex solver for small to medium-sized problems.
76+
77+
All three algorithms can be run concurrently on both GPU and CPU, with the fastest solution returned automatically.
7278

7379
Mixed Integer Linear Programming (MILP)
7480
=========================================
@@ -121,6 +127,7 @@ cuOpt supports the following APIs:
121127
- `AMPL <https://www.ampl.com/>`_
122128
- `GAMS <https://www.gams.com/>`_
123129
- `PuLP <https://pypi.org/project/PuLP/>`_
130+
- `JuMP <https://github.com/jump-dev/cuOpt.jl>`_
124131

125132

126133
==================================

docs/cuopt/source/lp-features.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The LP solver can be accessed in the following ways:
1313
- AMPL
1414
- GAMS
1515
- PuLP
16+
- JuMP
1617

1718
- **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.
1819

@@ -65,17 +66,19 @@ Users can control how the solver will operate by specifying the PDLP solver mode
6566
Method
6667
------
6768

68-
**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.
69+
**Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs three algorithms in parallel: PDLP on the GPU, barrier (interior-point) on the GPU, and dual simplex on the CPU. A solution is returned from the algorithm that finishes first.
6970

70-
**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.
71+
**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 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.
72+
73+
**Barrier**: The barrier method (also known as interior-point method) solves linear programs using a primal-dual predictor-corrector algorithm. This method uses GPU-accelerated sparse Cholesky and sparse LDLT solves via cuDSS, and GPU-accelerated sparse matrix-vector and matrix-matrix operations via cuSparse. Barrier is particularly effective for large-scale problems and can automatically apply techniques like folding, dualization, and dense column elimination to improve performance. This method solves the linear systems at each iteration using the augmented system or the normal equations (ADAT). Enable crossover to obtain a highly accurate basic solution from a barrier solution.
7174

7275
**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.
7376

7477

7578
Crossover
7679
---------
7780

78-
Crossover allows you to obtain a high-quality basic solution from the results of a PDLP solve. More details can be found :ref:`here <crossover>`.
81+
Crossover allows you to obtain a high-quality basic solution from the results of a PDLP or barrier solve. When enabled, crossover converts these solutions to a vertex solution (basic solution) with high accuracy. More details can be found :ref:`here <crossover>`.
7982

8083

8184
Presolve

0 commit comments

Comments
 (0)