Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c358dd8
Address review comments
rgsl888prabhu May 19, 2025
7efb114
Add cli.rst
rgsl888prabhu May 19, 2025
fd62f83
Cleanup CLI docs
rg20 May 19, 2025
aae447f
Fix warnings and errors
rg20 May 19, 2025
a1a21ee
Move commandline interface two levels up
rg20 May 19, 2025
f4de673
Fix review comments
rg20 May 20, 2025
1574827
Merge remote-tracking branch 'upstream/branch-25.05' into add_comment…
rg20 May 20, 2025
2e62582
Adding changes from Andrew to add versions and adding link to cli
rgsl888prabhu May 21, 2025
f80798c
Update lp-milp-c-api.rst
chris-maes May 21, 2025
da987bc
changes for project.json and typedef header fix
rgsl888prabhu May 21, 2025
abce36d
Merge branch 'add_comments_on_docs' of github.com:rgsl888prabhu/cuopt…
rgsl888prabhu May 21, 2025
3fe8048
Update cli-examples.rst
chris-maes May 21, 2025
19f95d0
Update introduction.rst
chris-maes May 21, 2025
7f64420
Updates to faq.rst, introduction.rst, lp-features.rst, lp-milp-settin…
chris-maes May 22, 2025
b40fdba
features and release notes
rgsl888prabhu May 22, 2025
1106244
Merge branch 'add_comments_on_docs' of github.com:rgsl888prabhu/cuopt…
rgsl888prabhu May 22, 2025
2ed89e6
update
rgsl888prabhu May 22, 2025
eaabf33
fix container path
rgsl888prabhu May 22, 2025
400e856
fix container path
rgsl888prabhu May 22, 2025
01a6224
Merge github.com:nvidia/cuopt into add_comments_on_docs
rgsl888prabhu May 22, 2025
b6c048e
Move thirdparty files to directory and clean it
rgsl888prabhu May 22, 2025
c31dfe6
Update introduction.rst
chris-maes May 22, 2025
1f36af5
Merge branch 'add_comments_on_docs' of github.com:rgsl888prabhu/cuopt…
rgsl888prabhu May 22, 2025
a4a7d6a
Update brev details and add project.json
rgsl888prabhu May 22, 2025
3649ba2
Changes to make cuOptCreateProblem consistent with cuOptCreateRangedP…
chris-maes May 23, 2025
eb63875
Merge branch 'add_comments_on_docs' of https://github.com/rgsl888prab…
chris-maes May 23, 2025
5172dab
Merge branch 'branch-25.05' into add_comments_on_docs
chris-maes May 23, 2025
3120360
Merge github.com:nvidia/cuopt into add_comments_on_docs
rgsl888prabhu May 23, 2025
d353467
Merge branch 'add_comments_on_docs' of github.com:rgsl888prabhu/cuopt…
rgsl888prabhu May 23, 2025
b0504fa
deprecate cuda 11 support
rgsl888prabhu May 23, 2025
c75fdd9
Add rapids logger to rpath
rgsl888prabhu May 23, 2025
c81ae2b
Add cli test
rgsl888prabhu May 23, 2025
8ff9acf
fix issues
rgsl888prabhu May 23, 2025
e6d772a
add a sample mps file for test
rgsl888prabhu May 23, 2025
e260b79
fix tests in docs
rgsl888prabhu May 23, 2025
f61efb7
pre-commit changes
rgsl888prabhu May 23, 2025
3e33112
Merge branch 'branch-25.05' into add_comments_on_docs
rgsl888prabhu May 23, 2025
f3b414b
remove third party modeling languges for now from docs
rgsl888prabhu May 23, 2025
ad0c23a
Merge branch 'add_comments_on_docs' of github.com:rgsl888prabhu/cuopt…
rgsl888prabhu May 23, 2025
0f6e92e
Merge github.com:nvidia/cuopt into add_comments_on_docs
rgsl888prabhu May 23, 2025
e95d8b5
Remove modeling language details
rgsl888prabhu May 23, 2025
d2a37a9
fix doc
rgsl888prabhu May 23, 2025
33000a8
update doc
rgsl888prabhu May 23, 2025
45d4a3a
Update introduction.rst
chris-maes May 23, 2025
b203574
Update release-notes.rst
chris-maes May 23, 2025
9b538b1
Update lp-features.rst
chris-maes May 23, 2025
81953ff
Update lp-example.rst
chris-maes May 23, 2025
7fbd6a4
Update milp-examples.rst
chris-maes May 23, 2025
98d0570
Update cli-examples.rst
chris-maes May 23, 2025
c36bed9
Update lp-features.rst
chris-maes May 23, 2025
2cf08a6
Update milp-features.rst
chris-maes May 23, 2025
6cc2586
Update lp-features.rst
chris-maes May 23, 2025
3fc576b
Update milp-features.rst
chris-maes May 23, 2025
546c629
Update introduction.rst
chris-maes May 23, 2025
9b0b297
Update introduction.rst
chris-maes May 23, 2025
ca877bc
add cli to bin
rgsl888prabhu May 23, 2025
8e02ff8
update intro
rgsl888prabhu May 23, 2025
79e1bb0
APTH
rgsl888prabhu May 23, 2025
09f7ad8
disable cli test inwheels
rgsl888prabhu May 24, 2025
8755199
Add cli support
rgsl888prabhu May 27, 2025
b61959e
Merge branch 'branch-25.05' into add_comments_on_docs
rgsl888prabhu May 27, 2025
fa6ee53
Add path for testing
rgsl888prabhu May 27, 2025
3edc36a
Merge branch 'add_comments_on_docs' of github.com:rgsl888prabhu/cuopt…
rgsl888prabhu May 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
791 changes: 0 additions & 791 deletions THIRD_PARTY_LICENSES

This file was deleted.

9 changes: 9 additions & 0 deletions ci/test_wheel_cuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,13 @@ cd ./datasets
./get_test_data.sh --solomon
./get_test_data.sh --tsp
cd -

RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
export RAPIDS_DATASET_ROOT_DIR

# Run CLI tests
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/

29 changes: 19 additions & 10 deletions cpp/include/cuopt/linear_programming/cuopt_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,54 +27,62 @@
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;

#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.
*/
Expand All @@ -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.
*
Expand All @@ -102,7 +111,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
Expand Down
26 changes: 26 additions & 0 deletions datasets/mip/sample.mps
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion docs/cuopt/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
'''
<script src="https://assets.adobedtm.com/5d4962a43b79/c1061d2c5e7b/launch-191c2462b890.min.js" ></script>
Expand All @@ -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 = ["project.json", "versions1.json"]


# -- Options for Breathe (Doxygen) ----------------------------------------
breathe_projects = {
Expand Down
56 changes: 3 additions & 53 deletions docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <lp-milp-c-api.html>`_.
This example demonstrates how to use the LP solver in C. More details on the API can be found in `C API <lp-milp-c-api.html>`_.

Copy the code below into a file called ``lp_example.c``:

Expand Down Expand Up @@ -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``.
Expand Down Expand Up @@ -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``.
Expand Down Expand Up @@ -494,53 +494,3 @@ You should see the following output:
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

Loading