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
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
script: ci/build_python.sh
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
# Build a conda package for each CUDA x ARCH x minimum supported Python version
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
upload-conda:
needs: [cpp-build, python-build]
secrets: inherit
Expand Down Expand Up @@ -118,6 +120,8 @@ jobs:
package-name: cuml
package-type: python
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
# Build a wheel for each CUDA x ARCH x minimum supported Python version
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
wheel-publish-cuml:
needs: wheel-build-cuml
secrets: inherit
Expand All @@ -129,3 +133,4 @@ jobs:
date: ${{ inputs.date }}
package-name: cuml
package-type: python
publish-wheel-search-key: cuml_wheel_python_abi3
4 changes: 4 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ jobs:
with:
build_type: pull-request
script: ci/build_python.sh
# Build a conda package for each CUDA x ARCH x minimum supported Python version
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
conda-python-tests-singlegpu:
needs: [conda-python-build, changed-files]
secrets: inherit
Expand Down Expand Up @@ -390,6 +392,8 @@ jobs:
package-name: cuml
package-type: python
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
# Build a wheel for each CUDA x ARCH x minimum supported Python version
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
wheel-tests-cuml:
needs: [wheel-build-cuml, changed-files]
secrets: inherit
Expand Down
15 changes: 14 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ BUILD_REPORT_INCL_CACHE_STATS=OFF
# Set defaults for vars that may not have been defined externally
INSTALL_PREFIX=${INSTALL_PREFIX:=${PREFIX:=${CONDA_PREFIX:=$LIBCUML_BUILD_DIR/install}}}
PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)}
PYTHON_ARGS_FOR_INSTALL=(
-v
--no-build-isolation
--no-deps
--config-settings
"rapidsai.disable-cuda=true"
)

# Default to Ninja if generator is not specified
export CMAKE_GENERATOR="${CMAKE_GENERATOR:=Ninja}"
Expand Down Expand Up @@ -349,11 +356,17 @@ fi

# Build and (optionally) install the cuml Python package
if (! hasArg --configure-only) && (completeBuild || hasArg cuml || hasArg pydocs); then
# If `RAPIDS_PY_VERSION` is set, use that as the lower-bound for the stable ABI CPython version
if [ -n "${RAPIDS_PY_VERSION}" ]; then
RAPIDS_PY_API="cp${RAPIDS_PY_VERSION//./}"
PYTHON_ARGS_FOR_INSTALL+=("--config-settings" "skbuild.wheel.py-api=${RAPIDS_PY_API}")
fi

# Replace spaces with semicolons in SKBUILD_EXTRA_CMAKE_ARGS
SKBUILD_EXTRA_CMAKE_ARGS=${SKBUILD_EXTRA_CMAKE_ARGS// /;}

SKBUILD_CMAKE_ARGS="-DCMAKE_MESSAGE_LOG_LEVEL=${CMAKE_LOG_LEVEL};${SKBUILD_EXTRA_CMAKE_ARGS}" \
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true "${REPODIR}"/python/cuml
python -m pip install "${PYTHON_ARGS_FOR_INSTALL[@]}" "${CUML_EXTRA_PYTHON_ARGS[@]}" "${REPODIR}"/python/cuml

Comment thread
coderabbitai[bot] marked this conversation as resolved.
if hasArg pydocs; then
cd "${REPODIR}"/docs
Expand Down
4 changes: 2 additions & 2 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-github python)
PYTHON_CHANNEL=$(rapids-download-from-github "$(rapids-package-name "conda_python" cuml --stable --cuda "${RAPIDS_CUDA_VERSION}")")

rapids-logger "Create test conda environment"
. /opt/conda/etc/profile.d/conda.sh
Expand Down
5 changes: 4 additions & 1 deletion ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail
Expand Down Expand Up @@ -44,3 +44,6 @@ sccache --stop-server >/dev/null 2>&1 || true
# remove build_cache directory to avoid uploading the entire source tree
# tracked in https://github.com/prefix-dev/rattler-build/issues/1424
rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache

RAPIDS_PACKAGE_NAME="$(rapids-package-name conda_python cuml --stable --cuda)"
export RAPIDS_PACKAGE_NAME
22 changes: 22 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ set -euo pipefail

package_name=$1
package_dir=$2
shift 2

# Parse optional flags
stable_abi=false
while [[ $# -gt 0 ]]; do
case "$1" in
--stable)
stable_abi=true
shift
;;
*)
echo "Unknown option: $1" >&2
exit 1
;;
esac
done

source rapids-configure-sccache
source rapids-date-string
Expand All @@ -28,6 +44,12 @@ RAPIDS_PIP_WHEEL_ARGS=(
--no-deps
--disable-pip-version-check
)

# Add py-api setting for stable ABI builds
if [[ "${stable_abi}" == "true" ]] && [[ -n "${RAPIDS_PY_API:-}" ]]; then
RAPIDS_PIP_WHEEL_ARGS+=(--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}")
fi
Comment on lines +48 to +51
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fail fast if --stable is set but RAPIDS_PY_API is unset.

Right now this silently drops the stable-ABI config. Add an explicit error so the build doesn’t produce the wrong wheel.

🔧 Proposed fix
-# Add py-api setting for stable ABI builds
-if [[ "${stable_abi}" == "true" ]] && [[ -n "${RAPIDS_PY_API:-}" ]]; then
-  RAPIDS_PIP_WHEEL_ARGS+=(--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}")
-fi
+# Add py-api setting for stable ABI builds
+if [[ "${stable_abi}" == "true" ]]; then
+  if [[ -z "${RAPIDS_PY_API:-}" ]]; then
+    echo "RAPIDS_PY_API must be set when --stable is used." >&2
+    exit 1
+  fi
+  RAPIDS_PIP_WHEEL_ARGS+=(--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}")
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Add py-api setting for stable ABI builds
if [[ "${stable_abi}" == "true" ]] && [[ -n "${RAPIDS_PY_API:-}" ]]; then
RAPIDS_PIP_WHEEL_ARGS+=(--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}")
fi
# Add py-api setting for stable ABI builds
if [[ "${stable_abi}" == "true" ]]; then
if [[ -z "${RAPIDS_PY_API:-}" ]]; then
echo "RAPIDS_PY_API must be set when --stable is used." >&2
exit 1
fi
RAPIDS_PIP_WHEEL_ARGS+=(--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}")
fi
🤖 Prompt for AI Agents
In `@ci/build_wheel.sh` around lines 48 - 51, If the stable_abi flag is true but
RAPIDS_PY_API is unset, fail fast instead of silently skipping the setting: in
the block that checks [[ "${stable_abi}" == "true" ]] (where
RAPIDS_PIP_WHEEL_ARGS is appended), add a guard that tests -z
"${RAPIDS_PY_API:-}" and calls exit 1 after printing an explanatory error to
stderr (e.g., using >&2) so the build stops when --stable is specified without
RAPIDS_PY_API; otherwise continue to append
--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}" to
RAPIDS_PIP_WHEEL_ARGS as before.


# Only use --build-constraint when build isolation is enabled.
#
# Passing '--build-constraint' and '--no-build-isolation` together results in an error from 'pip',
Expand Down
10 changes: 9 additions & 1 deletion ci/build_wheel_cuml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ EXCLUDE_ARGS=(
--exclude "librmm.so"
)

# TODO: move this variable into `ci-wheel`
# Format Python limited API version string
RAPIDS_PY_API="cp${RAPIDS_PY_VERSION//./}"
export RAPIDS_PY_API

export SKBUILD_CMAKE_ARGS="-DDISABLE_DEPRECATION_WARNINGS=ON;-DSINGLEGPU=OFF;-DUSE_LIBCUML_WHEEL=ON"
./ci/build_wheel.sh "${package_name}" "${package_dir}"
./ci/build_wheel.sh "${package_name}" "${package_dir}" --stable
Comment thread
gforsyth marked this conversation as resolved.

# repair wheels and write to the location that artifact-uploading code expects to find them
python -m auditwheel repair \
Expand All @@ -44,3 +49,6 @@ python -m auditwheel repair \
${package_dir}/dist/*

./ci/validate_wheel.sh ${package_dir} "${RAPIDS_WHEEL_BLD_OUTPUT_DIR}"

RAPIDS_PACKAGE_NAME="$(rapids-package-name wheel_python cuml --stable --cuda)"
export RAPIDS_PACKAGE_NAME
2 changes: 1 addition & 1 deletion ci/test_notebooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ conda config --set channel_priority strict

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-github python)
PYTHON_CHANNEL=$(rapids-download-from-github "$(rapids-package-name "conda_python" cuml --stable --cuda "${RAPIDS_CUDA_VERSION}")")

rapids-logger "Generate Notebook testing dependencies"
rapids-dependency-file-generator \
Expand Down
4 changes: 2 additions & 2 deletions ci/test_python_common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail
Expand All @@ -11,7 +11,7 @@ conda config --set channel_priority strict

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-github python)
PYTHON_CHANNEL=$(rapids-download-from-github "$(rapids-package-name "conda_python" cuml --stable --cuda "${RAPIDS_CUDA_VERSION}")")

rapids-logger "Generate Python testing dependencies"
rapids-dependency-file-generator \
Expand Down
2 changes: 1 addition & 1 deletion ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -euo pipefail
source rapids-init-pip

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
CUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python)
CUML_WHEELHOUSE=$(rapids-download-from-github "$(rapids-package-name "wheel_python" cuml --stable --cuda "$RAPIDS_CUDA_VERSION")")
LIBCUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
mkdir -p "${RAPIDS_TESTS_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion ci/test_wheel_dask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -euo pipefail
source rapids-init-pip

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
CUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python)
CUML_WHEELHOUSE=$(rapids-download-from-github "$(rapids-package-name "wheel_python" cuml --stable --cuda "$RAPIDS_CUDA_VERSION")")
LIBCUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
mkdir -p "${RAPIDS_TESTS_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion ci/test_wheel_integrations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -euo pipefail
source rapids-init-pip

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
CUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python)
CUML_WHEELHOUSE=$(rapids-download-from-github "$(rapids-package-name "wheel_python" cuml --stable --cuda "$RAPIDS_CUDA_VERSION")")
LIBCUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
Comment on lines 9 to 12
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a GPU availability check before running integration tests.

This script runs GPU-backed tests but doesn’t verify GPU presence. Fail early with a clear message to avoid misleading errors.

🔧 Proposed fix
 LIBCUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
 RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
 mkdir -p "${RAPIDS_TESTS_DIR}"
+
+rapids-logger "Checking GPU availability"
+if ! nvidia-smi; then
+  rapids-logger "GPU not available; aborting integration tests."
+  exit 1
+fi
🤖 Prompt for AI Agents
In `@ci/test_wheel_integrations.sh` around lines 9 - 12, Add a GPU availability
check at the start of the integration test script: before using
RAPIDS_CUDA_VERSION and downloading CUDA wheels (around the block with
RAPIDS_PY_CUDA_SUFFIX, CUML_WHEELHOUSE, LIBCUML_WHEELHOUSE), run a probe like
checking nvidia-smi or /proc/driver/nvidia to verify at least one GPU is
present; if the probe fails, exit nonzero with a clear message like "No GPUs
detected; integration tests require a GPU" so the script fails fast and avoids
spurious test errors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can safely assume that the scripts are executed on the right architecture.

mkdir -p "${RAPIDS_TESTS_DIR}"
Expand Down
20 changes: 16 additions & 4 deletions conda/recipes/cuml/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ context:
cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }}
cuda_major: '${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }}'
date_string: '${{ env.get("RAPIDS_DATE_STRING") }}'
py_version: ${{ env.get("RAPIDS_PY_VERSION") }}
py_buildstring: ${{ py_version | version_to_buildstring }}
py_abi_min: ${{ env.get("RAPIDS_PY_VERSION") }}
py_buildstring : ${{ py_abi_min | version_to_buildstring }}
py_runtime_latest: "3.13"
head_rev: '${{ git.head_rev(".")[:8] }}'

package:
Expand All @@ -20,7 +21,9 @@ source:
path: ../../..

build:
string: cuda${{ cuda_major }}_py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }}
python:
version_independent: true
string: cuda${{ cuda_major }}_cp${{ py_buildstring }}_abi3_${{ date_string }}_${{ head_rev }}
files:
exclude:
- '*libarrow.so.*gdb.py'
Expand All @@ -44,6 +47,7 @@ build:
NVCC_APPEND_FLAGS: ${{ env.get("NVCC_APPEND_FLAGS", default="") }}
PARALLEL_LEVEL: ${{ env.get("PARALLEL_LEVEL", default="8") }}
RAPIDS_ARTIFACTS_DIR: ${{ env.get("RAPIDS_ARTIFACTS_DIR", default="") }}
RAPIDS_PY_VERSION: ${{ py_abi_min }}
SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET", default="") }}
SCCACHE_DIST_AUTH_TYPE: ${{ env.get("SCCACHE_DIST_AUTH_TYPE", default="token") }}
SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE: ${{ env.get("SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE", default="false") }}
Expand Down Expand Up @@ -78,7 +82,8 @@ requirements:
- libcuml =${{ version }}
- pip
- pylibraft =${{ minor_version }}
- python =${{ py_version }}
- python =${{ py_abi_min }}
- python-abi3 ${{ py_abi_min }}.*
- rapids-build-backend >=0.4.0,<0.5.0
- rapids-logger =0.2
- scikit-build-core>=0.11.0
Expand Down Expand Up @@ -113,6 +118,13 @@ requirements:
- cuda-cudart
- cuda-version

tests:
- python:
imports:
- cuml
python_version: ${{ py_runtime_latest }}.*
pip_check: false

about:
homepage: ${{ load_from_file("python/cuml/pyproject.toml").project.urls.Homepage }}
license: ${{ load_from_file("python/cuml/pyproject.toml").project.license }}
Expand Down
Loading