Skip to content

Commit fd04d94

Browse files
committed
Merge branch 'add_exception_handling_pdlp' of github.com:Iroy30/NvidiaCuopt into add_exception_handling_pdlp
2 parents 5e3f201 + 81d3d05 commit fd04d94

File tree

31 files changed

+373
-134
lines changed

31 files changed

+373
-134
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ assignees: ''
1111
A clear and concise description of what the bug is.
1212

1313
**Steps/Code to reproduce bug**
14-
Follow this guide http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports to craft a minimal bug report. This helps us reproduce the issue you're having and resolve the issue more quickly.
14+
Follow the [RAPIDS issue guidelines](https://docs.rapids.ai/contributing/issues/) (search existing issues first, then describe the problem so it can be understood and reproduced). Use the cuOpt issue template that best fits; the RAPIDS page describes general practices. Provide clear steps (and code or data) so we can reproduce the issue and resolve it more quickly.
1515

1616
**Expected behavior**
1717
A clear and concise description of what you expected to happen.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: "Numerical issues"
3+
about: "Report numerical issues (e.g., NaNs/Infs, ill-conditioning, tolerance or scaling issues)"
4+
title: "[NUMERICAL_ISSUES]"
5+
labels: "? - Needs Triage, numerical issues"
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the numerical issue**
11+
A clear description of the numerical problem (e.g., NaN/Inf values, unexpected divergence, extreme sensitivity to small input changes).
12+
13+
**Steps / minimal reproduction**
14+
Follow the [RAPIDS issue guidelines](https://docs.rapids.ai/contributing/issues/) (search existing issues first, then describe the problem so it can be understood and reproduced). Use the cuOpt issue template that best fits; the RAPIDS page describes general practices. Include inputs, API calls, and solver settings (tolerances, scaling, precision) that reproduce the behavior.
15+
16+
**Expected vs actual behavior**
17+
What you expected numerically, and what you observed (including any error messages or logs).
18+
19+
**Environment details (please complete the following information):**
20+
- Environment location: [Bare-metal, Docker, Cloud (specify cloud provider)]
21+
- Method of cuOpt install: [conda, Docker, or from source]
22+
- If method of install is [Docker], provide `docker pull` & `docker run` commands used
23+
24+
**Additional context**
25+
Add any other context (hardware, CUDA/driver versions, data scaling, problem size) that may help diagnose the issue.

.github/workflows/trigger-breaking-change-alert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
trigger-notifier:
1616
if: contains(github.event.pull_request.labels.*.name, 'breaking')
1717
secrets: inherit
18-
uses: rapidsai/shared-workflows/.github/workflows/breaking-change-alert.yaml@main
18+
uses: rapidsai/shared-workflows/.github/workflows/breaking-change-alert.yaml@release/26.04
1919
with:
2020
sender_login: ${{ github.event.sender.login }}
2121
sender_avatar: ${{ github.event.sender.avatar_url }}

RAPIDS_BRANCH

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
main
1+
release/26.04

ci/test_self_hosted_service.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ CUOPT_SERVER_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_server_${RAPIDS_PY_CUDA_SU
1414
CUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python)
1515
LIBCUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
1616

17-
# echo to expand wildcard before adding `[extra]` requires for pip
17+
# generate constraints (possibly pinning to oldest support versions of dependencies)
18+
rapids-generate-pip-constraints test_python "${PIP_CONSTRAINT}"
19+
20+
# notes:
21+
#
22+
# * echo to expand wildcard before adding `[test]` requires for pip
23+
# * just providing --constraint="${PIP_CONSTRAINT}" to be explicit, and because
24+
# that environment variable is ignored if any other --constraint are passed via the CLI
25+
#
1826
rapids-pip-retry install \
27+
--prefer-binary \
28+
--constraint "${PIP_CONSTRAINT}" \
1929
"${CUOPT_MPS_PARSER_WHEELHOUSE}"/cuopt_mps_parser*.whl \
2030
"${CUOPT_WHEELHOUSE}"/cuopt*.whl \
2131
"${LIBCUOPT_WHEELHOUSE}"/libcuopt*.whl \

ci/test_wheel_cuopt.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@ cuopt-sh-client @ file://$(echo ${CUOPT_SH_CLIENT_WHEELHOUSE}/cuopt_sh_client-*.
2525
libcuopt-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUOPT_WHEELHOUSE}/libcuopt_${RAPIDS_PY_CUDA_SUFFIX}-*.whl)
2626
EOF
2727

28-
# echo to expand wildcard before adding `[extra]` requires for pip
28+
# generate constraints (possibly pinning to oldest support versions of dependencies)
29+
rapids-generate-pip-constraints test_python "${PIP_CONSTRAINT}"
30+
31+
# notes:
32+
#
33+
# * echo to expand wildcard before adding `[test]` requires for pip
34+
# * just providing --constraint="${PIP_CONSTRAINT}" to be explicit, and because
35+
# that environment variable is ignored if any other --constraint are passed via the CLI
36+
#
2937
rapids-pip-retry install \
38+
--prefer-binary \
39+
--constraint "${PIP_CONSTRAINT}" \
3040
--constraint "${PIP_CONSTRAINT}" \
3141
"${CUOPT_MPS_PARSER_WHEELHOUSE}"/cuopt_mps_parser*.whl \
3242
"$(echo "${CUOPT_WHEELHOUSE}"/cuopt*.whl)[test]" \
@@ -67,4 +77,6 @@ timeout 30m ./ci/run_cuopt_pytests.sh --verbose --capture=no
6777
if [[ "${RAPIDS_BUILD_TYPE}" == "nightly" ]]; then
6878
./ci/thirdparty-testing/run_jump_tests.sh
6979
./ci/thirdparty-testing/run_cvxpy_tests.sh
80+
./ci/thirdparty-testing/run_pulp_tests.sh
81+
./ci/thirdparty-testing/run_pyomo_tests.sh
7082
fi

ci/test_wheel_cuopt_server.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,18 @@ CUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-
1515
CUOPT_SH_CLIENT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_sh_client" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-github python)
1616
LIBCUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
1717

18-
# echo to expand wildcard before adding `[extra]` requires for pip
18+
# generate constraints (possibly pinning to oldest support versions of dependencies)
19+
rapids-generate-pip-constraints test_python "${PIP_CONSTRAINT}"
20+
21+
# notes:
22+
#
23+
# * echo to expand wildcard before adding `[test]` requires for pip
24+
# * just providing --constraint="${PIP_CONSTRAINT}" to be explicit, and because
25+
# that environment variable is ignored if any other --constraint are passed via the CLI
26+
#
1927
rapids-pip-retry install \
28+
--prefer-binary \
29+
--constraint "${PIP_CONSTRAINT}" \
2030
"${CUOPT_MPS_PARSER_WHEELHOUSE}"/cuopt_mps_parser*.whl \
2131
"$(echo "${CUOPT_SERVER_WHEELHOUSE}"/cuopt_server*.whl)[test]" \
2232
"${CUOPT_WHEELHOUSE}"/cuopt*.whl \
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
set -e -u -o pipefail
6+
7+
rapids-logger "building 'pulp' from source and running cuOpt tests"
8+
9+
if [ -z "${PIP_CONSTRAINT:-}" ]; then
10+
rapids-logger "PIP_CONSTRAINT is not set; ensure ci/test_wheel_cuopt.sh (or equivalent) has set it so cuopt wheels are used."
11+
exit 1
12+
fi
13+
14+
git clone --depth 1 https://github.com/coin-or/pulp.git
15+
pushd ./pulp || exit 1
16+
17+
# Install PuLP in editable form so it uses the environment's cuopt (from PIP_CONSTRAINT)
18+
python -m pip install \
19+
--constraint "${PIP_CONSTRAINT}" \
20+
--extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
21+
pytest \
22+
-e .
23+
24+
pip check
25+
26+
rapids-logger "running PuLP tests (cuOpt-related)"
27+
# PuLP uses pytest; run only tests that reference cuopt/CUOPT
28+
# Exit code 5 = no tests collected; then try run_tests.py which detects solvers (including cuopt)
29+
pytest_rc=0
30+
timeout 5m python -m pytest \
31+
--verbose \
32+
--capture=no \
33+
-k "cuopt or CUOPT" \
34+
pulp/tests/ || pytest_rc=$?
35+
36+
if [ "$pytest_rc" -eq 5 ]; then
37+
rapids-logger "No pytest -k cuopt tests found; running PuLP run_tests.py (solver auto-detection, includes cuopt)"
38+
timeout 5m python pulp/tests/run_tests.py
39+
pytest_rc=$?
40+
fi
41+
42+
popd || exit 1
43+
exit "$pytest_rc"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
set -e -u -o pipefail
6+
7+
rapids-logger "building 'pyomo' from source and running cuOpt tests"
8+
9+
if [ -z "${PIP_CONSTRAINT:-}" ]; then
10+
rapids-logger "PIP_CONSTRAINT is not set; ensure ci/test_wheel_cuopt.sh (or equivalent) has set it so cuopt wheels are used."
11+
exit 1
12+
fi
13+
14+
git clone --depth 1 https://github.com/Pyomo/pyomo.git
15+
pushd ./pyomo || exit 1
16+
17+
# Install Pyomo in editable form so it uses the environment's cuopt (from PIP_CONSTRAINT)
18+
python -m pip install \
19+
--constraint "${PIP_CONSTRAINT}" \
20+
--extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
21+
pytest \
22+
-e .
23+
24+
pip check
25+
26+
rapids-logger "running Pyomo tests (cuopt_direct / cuOpt-related)"
27+
# Run only tests that reference cuopt (cuopt_direct solver)
28+
timeout 5m python -m pytest \
29+
--verbose \
30+
--capture=no \
31+
-k "cuopt or CUOPT" \
32+
pyomo/solvers/tests/
33+
34+
popd || exit 1

cpp/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ if(BUILD_MSAN)
109109
add_link_options(-fsanitize=memory)
110110
endif(BUILD_MSAN)
111111

112+
# Note: -UNDEBUG is applied via CUOPT_CXX_FLAGS / CUOPT_CUDA_FLAGS (not add_definitions)
113+
# to avoid leaking into dependencies that are built in-tree.
112114
if(DEFINE_ASSERT)
113115
add_definitions(-DASSERT_MODE)
116+
list(APPEND CUOPT_CXX_FLAGS -UNDEBUG)
117+
list(APPEND CUOPT_CUDA_FLAGS -UNDEBUG)
114118
endif(DEFINE_ASSERT)
115119

116120
if(DEFINE_BENCHMARK)
@@ -184,13 +188,6 @@ elseif(CMAKE_CUDA_LINEINFO)
184188
set(CMAKE_CUDA_FLAGS_RELEASE "${CMAKE_CUDA_FLAGS_RELEASE} -lineinfo")
185189
endif(CMAKE_BUILD_TYPE MATCHES Debug)
186190

187-
# Undefine NDEBUG if assert mode is on
188-
if(DEFINE_ASSERT)
189-
message(STATUS "Undefining NDEBUG with assert mode enabled")
190-
add_definitions(-UNDEBUG)
191-
endif()
192-
193-
194191
# ##################################################################################################
195192
# - find CPM based dependencies ------------------------------------------------------------------
196193
rapids_cpm_init()

0 commit comments

Comments
 (0)