Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 1 addition & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-25.08
with:
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
Expand All @@ -56,7 +55,6 @@ jobs:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-25.08
with:
matrix_filter: map(select((.CUDA_VER | startswith("12")) and .PY_VER != "3.13"))
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
Expand All @@ -80,7 +78,6 @@ jobs:
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel_cuopt_mps_parser.sh
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
package-name: cuopt_mps_parser
package-type: python
append-cuda-suffix: false
Expand All @@ -107,7 +104,7 @@ jobs:
script: ci/build_wheel_libcuopt.sh
package-name: libcuopt
package-type: cpp
matrix_filter: map(select((.CUDA_VER | startswith("12")) and .PY_VER == "3.12"))
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
wheel-publish-libcuopt:
needs: wheel-build-libcuopt
secrets: inherit
Expand All @@ -124,7 +121,6 @@ jobs:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08
with:
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
Expand All @@ -148,7 +144,6 @@ jobs:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08
with:
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
Expand Down Expand Up @@ -192,7 +187,6 @@ jobs:
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel_cuopt_sh_client.sh
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
package-name: cuopt_sh_client
package-type: python
append-cuda-suffix: false
Expand Down
25 changes: 2 additions & 23 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ jobs:
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-25.08
with:
build_type: pull-request
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/build_cpp.sh
conda-cpp-tests:
needs: [conda-cpp-build, changed-files]
Expand All @@ -131,15 +130,13 @@ jobs:
#if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
with:
build_type: pull-request
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/test_cpp.sh
conda-python-build:
needs: conda-cpp-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-25.08
with:
build_type: pull-request
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/build_python.sh
conda-python-tests:
needs: [conda-python-build, changed-files]
Expand All @@ -149,7 +146,6 @@ jobs:
with:
run_codecov: false
build_type: pull-request
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/test_python.sh
docs-build:
needs: conda-python-build
Expand All @@ -163,17 +159,6 @@ jobs:
artifact-name: "cuopt_docs"
container_image: "rapidsai/ci-conda:25.08-latest"
script: "ci/build_docs.sh"
#conda-notebook-tests:
# needs: [conda-python-build, changed-files]
# secrets: inherit
# uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-25.08
# #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks
# with:
# build_type: pull-request
# node_type: "gpu-l4-latest-1"
# arch: "amd64"
# container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10"
# run_script: "ci/test_notebooks.sh"
wheel-build-cuopt-mps-parser:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08
Expand All @@ -183,14 +168,13 @@ jobs:
package-name: cuopt_mps_parser
package-type: python
append-cuda-suffix: false
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
wheel-build-libcuopt:
needs: wheel-build-cuopt-mps-parser
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08
with:
# build for every combination of arch and CUDA version, but only for the latest Python
matrix_filter: map(select((.CUDA_VER | startswith("12")) and .PY_VER == "3.12"))
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
package-type: cpp
package-name: libcuopt
build_type: pull-request
Expand All @@ -204,16 +188,14 @@ jobs:
script: ci/build_wheel_cuopt.sh
package-name: cuopt
package-type: python
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
wheel-tests-cuopt:
needs: [wheel-build-cuopt, wheel-build-cuopt-mps-parser, changed-files]
needs: [wheel-build-cuopt, wheel-build-cuopt-mps-parser, wheel-build-cuopt-sh-client, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-25.08
#if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cuopt
with:
build_type: pull-request
script: ci/test_wheel_cuopt.sh
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
wheel-build-cuopt-server:
needs: wheel-build-cuopt
secrets: inherit
Expand All @@ -223,14 +205,12 @@ jobs:
script: ci/build_wheel_cuopt_server.sh
package-name: cuopt_server
package-type: python
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
wheel-build-cuopt-sh-client:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08
with:
build_type: pull-request
script: ci/build_wheel_cuopt_sh_client.sh
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
package-name: cuopt_sh_client
package-type: python
append-cuda-suffix: false
Expand All @@ -242,7 +222,6 @@ jobs:
with:
build_type: pull-request
script: ci/test_wheel_cuopt_server.sh
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
test-self-hosted-server:
needs: [wheel-build-cuopt-server, changed-files]
secrets: inherit
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/test_cpp.sh
conda-python-tests:
secrets: inherit
Expand All @@ -51,7 +50,6 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/test_python.sh
wheel-tests-cuopt:
secrets: inherit
Expand All @@ -61,7 +59,6 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/test_wheel_cuopt.sh
wheel-tests-cuopt-server:
secrets: inherit
Expand All @@ -71,5 +68,4 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
matrix_filter: map(select((.CUDA_VER | startswith("12"))))
script: ci/test_wheel_cuopt_server.sh
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ cd $CUOPT_HOME
./build.sh --help
```

#### Deb package

`libcuopt.so` can be packaged as a deb package with option deb. This is a beta-feature and dependecies of libcuopt needs to be installed manually while installing it using deb package.
This is only available to be built through source code and libcuopt is not being released as deb package in any official space.

```bash
./build.sh libmps_parser libcuopt deb
```

#### Building for development

To build all libraries and tests, simply run
Expand Down
27 changes: 19 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ REPODIR=$(cd "$(dirname "$0")"; pwd)
LIBCUOPT_BUILD_DIR=${LIBCUOPT_BUILD_DIR:=${REPODIR}/cpp/build}
LIBMPS_PARSER_BUILD_DIR=${LIBMPS_PARSER_BUILD_DIR:=${REPODIR}/cpp/libmps_parser/build}

VALIDARGS="clean libcuopt libmps_parser cuopt_mps_parser cuopt cuopt_server cuopt_sh_client docs -a -b -g -v -l= --verbose-pdlp [--cmake-args=\\\"<args>\\\"] [--cache-tool=<tool>] -n --allgpuarch --ci-only-arch --show_depr_warn -h --help"
VALIDARGS="clean libcuopt libmps_parser cuopt_mps_parser cuopt cuopt_server cuopt_sh_client docs deb -a -b -g -v -l= --verbose-pdlp [--cmake-args=\\\"<args>\\\"] [--cache-tool=<tool>] -n --allgpuarch --ci-only-arch --show_depr_warn -h --help"
HELP="$0 [<target> ...] [<flag> ...]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
Expand All @@ -38,6 +38,7 @@ HELP="$0 [<target> ...] [<flag> ...]
cuopt_server - build the cuopt_server Python package
cuopt_sh_client - build cuopt self host client
docs - build the docs
deb - build deb package (requires libcuopt to be built first)
and <flag> is:
-v - verbose build mode
-g - build for debug
Expand Down Expand Up @@ -268,13 +269,8 @@ if [ ${BUILD_ALL_GPU_ARCH} -eq 1 ]; then
echo "Building for *ALL* supported GPU architectures..."
else
if [ ${BUILD_CI_ONLY} -eq 1 ]; then
if [[ ${CUDA_VERSION} == 11* ]]; then
CUOPT_CMAKE_CUDA_ARCHITECTURES="70-real;80"
echo "Building for Volta and Ampere architectures..."
else
CUOPT_CMAKE_CUDA_ARCHITECTURES="RAPIDS"
echo "Building for Volta, Ampere and Hopper architectures..."
fi
CUOPT_CMAKE_CUDA_ARCHITECTURES="RAPIDS"
echo "Building for RAPIDS supported architectures..."
else
CUOPT_CMAKE_CUDA_ARCHITECTURES="NATIVE"
echo "Building for the architecture of the GPU in the system..."
Expand Down Expand Up @@ -321,6 +317,21 @@ if buildAll || hasArg libcuopt; then
fi
fi

################################################################################
# Build deb package
if hasArg deb; then
# Check if libcuopt has been built
if [ ! -d "${LIBCUOPT_BUILD_DIR}" ]; then
echo "Error: libcuopt must be built before creating deb package. Run with 'libcuopt' target first."
exit 1
fi

echo "Building deb package..."
cd "${LIBCUOPT_BUILD_DIR}"
cpack -G DEB
echo "Deb package created in ${LIBCUOPT_BUILD_DIR}"
fi


# Build and install the cuopt Python package
if buildAll || hasArg cuopt; then
Expand Down
4 changes: 4 additions & 0 deletions ci/test_self_hosted_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ if [ "$doservertest" -eq 1 ]; then
# Test for message on absolute path, bad directory
run_cli_test "Absolute path '/nohay' does not exist" cuopt_sh -s -c "$CLIENT_CERT" -p $CUOPT_SERVER_PORT -f /nohay/nada

# Set all current and deprecated solver_config values and make sure the service does not reject the dataset
# This is a smoketest against parameter name misalignment
run_cli_test "'status': 'Optimal'" cuopt_sh -s -c $CLIENT_CERT -p $CUOPT_SERVER_PORT ../../datasets/cuopt_service_data/lpmip_configs.json

rapids-logger "Running cuopt_self_hosted Python tests"
pytest tests

Expand Down
16 changes: 16 additions & 0 deletions ci/test_wheel_cuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,33 @@

set -euo pipefail

# sets up a constraints file for 'pip' and puts its location in an exported variable PIP_EXPORT,
# so those constraints will affect all future 'pip install' calls
source rapids-init-pip

# Download the packages built in the previous step
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
CUOPT_MPS_PARSER_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_mps_parser" rapids-download-wheels-from-github python)
CUOPT_SH_CLIENT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_sh_client" rapids-download-wheels-from-github python)
CUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python)
LIBCUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)

# update pip constraints.txt to ensure all future 'pip install' (including those in ci/thirdparty-testing)
# use these wheels for cuopt packages
cat > "${PIP_CONSTRAINT}" <<EOF
cuopt-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${CUOPT_WHEELHOUSE}/cuopt_${RAPIDS_PY_CUDA_SUFFIX}-*.whl)
cuopt-mps-parser @ file://$(echo ${CUOPT_MPS_PARSER_WHEELHOUSE}/cuopt_mps_parser-*.whl)
cuopt-sh-client @ file://$(echo ${CUOPT_SH_CLIENT_WHEELHOUSE}/cuopt_sh_client-*.whl)
libcuopt-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUOPT_WHEELHOUSE}/libcuopt_${RAPIDS_PY_CUDA_SUFFIX}-*.whl)
EOF

# echo to expand wildcard before adding `[extra]` requires for pip
rapids-pip-retry install \
--extra-index-url=https://pypi.nvidia.com \
--constraint "${PIP_CONSTRAINT}" \
"${CUOPT_MPS_PARSER_WHEELHOUSE}"/cuopt_mps_parser*.whl \
"$(echo "${CUOPT_WHEELHOUSE}"/cuopt*.whl)[test]" \
"${CUOPT_SH_CLIENT_WHEELHOUSE}"/cuopt_sh_client*.whl \
"${LIBCUOPT_WHEELHOUSE}"/libcuopt*.whl

python -c "import cuopt"
Expand Down Expand Up @@ -59,3 +73,5 @@ 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/

# run cvxpy integration tests
./ci/thirdparty-testing/run_cvxpy_tests.sh
44 changes: 44 additions & 0 deletions ci/thirdparty-testing/run_cvxpy_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/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 -e -u -o pipefail

echo "building 'cvxpy' from source"
git clone https://github.com/cvxpy/cvxpy.git
pushd ./cvxpy || exit 1
pip wheel \
-w dist \
.

# NOTE: installing cvxpy[CUOPT] alongside CI artifacts is helpful to catch dependency conflicts
echo "installing 'cvxpy' with cuopt"
python -m pip install \
--constraint "${PIP_CONSTRAINT}" \
--extra-index-url=https://pypi.nvidia.com \
--extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
'pytest-error-for-skips>=2.0.2' \
"$(echo ./dist/cvxpy*.whl)[CUOPT,testing]"

# ensure that environment is still consistent (i.e. cvxpy requirements do not conflict with cuopt's)
pip check

echo "running 'cvxpy' tests"
timeout 3m python -m pytest \
--verbose \
--capture=no \
--error-for-skips \
-k "TestCUOPT" \
./cvxpy/tests/test_conic_solvers.py
2 changes: 1 addition & 1 deletion conda/recipes/libcuopt/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cache:
export CXXFLAGS=$(echo $CXXFLAGS | sed -E 's@\-fdebug\-prefix\-map[^ ]*@@g')
set +x

./build.sh -n -v -a libmps_parser libcuopt --ci-only-arch --cmake-args=\"-DCMAKE_INSTALL_LIBDIR=lib\"
./build.sh -n -v -a libmps_parser libcuopt deb --allgpuarch --cmake-args=\"-DCMAKE_INSTALL_LIBDIR=lib\"
secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
Expand Down
Loading
Loading