Skip to content

Commit

Permalink
Use rapids-build-backend (rapidsai#5804)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA authored Jun 4, 2024
1 parent 1b70cec commit 225c5aa
Show file tree
Hide file tree
Showing 17 changed files with 148 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ repos:
pass_filenames: false
language: python
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.8.0
rev: v1.13.11
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ if (! hasArg --configure-only) && (completeBuild || hasArg cuml || hasArg pydocs
fi

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

if hasArg pydocs; then
cd ${REPODIR}/docs
Expand All @@ -304,5 +304,5 @@ fi

if hasArg cuml-cpu; then
SKBUILD_CMAKE_ARGS="-DCUML_CPU=ON;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE" \
python -m pip install --no-build-isolation --no-deps -v ${REPODIR}/python
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true ${REPODIR}/python
fi
6 changes: 2 additions & 4 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -13,10 +13,8 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

version=$(rapids-generate-version)

rapids-logger "Begin cpp build"

RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libcuml
RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcuml

rapids-upload-conda-to-s3 cpp
16 changes: 4 additions & 12 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -13,23 +13,15 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

package_name="cuml"
package_dir="python"

version=$(rapids-generate-version)
git_commit=$(git rev-parse HEAD)
export RAPIDS_PACKAGE_VERSION=${version}

echo "${version}" > VERSION
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/_version.py"
rapids-generate-version > ./VERSION

rapids-logger "Begin py build"

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

# TODO: Remove `--no-test` flag once importing on a CPU
# node works correctly
rapids-conda-retry mambabuild \
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/cuml
Expand All @@ -38,7 +30,7 @@ rapids-conda-retry mambabuild \
# version
RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then
rapids-conda-retry mambabuild \
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \
--no-test \
conda/recipes/cuml-cpu
fi
Expand Down
34 changes: 2 additions & 32 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -9,43 +9,13 @@ package_dir="python"
source rapids-configure-sccache
source rapids-date-string

version=$(rapids-generate-version)
git_commit=$(git rev-parse HEAD)

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# This is the version of the suffix with a preceding hyphen. It's used
# everywhere except in the final wheel name.
PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"

# Patch project metadata files to include the CUDA version suffix and version override.
pyproject_file="${package_dir}/pyproject.toml"

sed -i "/^name.*cuml/ s/= \"cuml\"/= \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}
echo "${version}" > VERSION
sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/_version.py"

# For nightlies we want to ensure that we're pulling in alphas as well. The
# easiest way to do so is to augment the spec with a constraint containing a
# min alpha version that doesn't affect the version bounds but does allow usage
# of alpha versions for that dependency without --pre
alpha_spec=''
if ! rapids-is-release-build; then
alpha_spec=',>=0.0.0a0'
fi

for dep in cudf pylibraft raft-dask rmm; do
sed -r -i "s/${dep}==(.*)\"/${dep}${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file}
done

for dep in dask-cuda rapids-dask-dependency; do
sed -r -i "s/${dep}==(.*)\"/${dep}==\1${alpha_spec}\"/g" ${pyproject_file}
done

if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then
sed -i "s/cuda-python[<=>\.,0-9]*/cuda-python>=12.0,<13.0/g" ${pyproject_file}
sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file}
fi
rapids-generate-version > ./VERSION

cd ${package_dir}

Expand Down
2 changes: 1 addition & 1 deletion ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ DEPENDENCIES=(
)
for FILE in dependencies.yaml conda/environments/*.yaml; do
for DEP in "${DEPENDENCIES[@]}"; do
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*/g" "${FILE}"
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}"
done
done

Expand Down
23 changes: 12 additions & 11 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ dependencies:
- cuda-python>=11.7.1,<12.0a0
- cuda-version=11.8
- cudatoolkit
- cudf==24.8.*
- cudf==24.8.*,>=0.0.0a0
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dask-cuda==24.8.*
- dask-cudf==24.8.*
- dask-cuda==24.8.*,>=0.0.0a0
- dask-cudf==24.8.*,>=0.0.0a0
- dask-ml
- doxygen=1.9.1
- gcc_linux-64=11.*
Expand All @@ -31,16 +31,16 @@ dependencies:
- libcublas=11.11.3.6
- libcufft-dev=10.9.0.58
- libcufft=10.9.0.58
- libcumlprims==24.8.*
- libcumlprims==24.8.*,>=0.0.0a0
- libcurand-dev=10.3.0.86
- libcurand=10.3.0.86
- libcusolver-dev=11.4.1.48
- libcusolver=11.4.1.48
- libcusparse-dev=11.7.5.86
- libcusparse=11.7.5.86
- libraft-headers==24.8.*
- libraft==24.8.*
- librmm==24.8.*
- libraft-headers==24.8.*,>=0.0.0a0
- libraft==24.8.*,>=0.0.0a0
- librmm==24.8.*,>=0.0.0a0
- nbsphinx
- ninja
- nltk
Expand All @@ -50,18 +50,19 @@ dependencies:
- packaging
- pip
- pydata-sphinx-theme!=0.14.2
- pylibraft==24.8.*
- pylibraft==24.8.*,>=0.0.0a0
- pynndescent==0.5.8
- pytest-benchmark
- pytest-cases
- pytest-cov
- pytest-xdist
- pytest==7.*
- python>=3.9,<3.12
- raft-dask==24.8.*
- rapids-dask-dependency==24.8.*
- raft-dask==24.8.*,>=0.0.0a0
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rapids-dask-dependency==24.8.*,>=0.0.0a0
- recommonmark
- rmm==24.8.*
- rmm==24.8.*,>=0.0.0a0
- scikit-build-core>=0.7.0
- scikit-learn==1.5
- scipy>=1.8.0
Expand Down
23 changes: 12 additions & 11 deletions conda/environments/all_cuda-122_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ dependencies:
- cuda-profiler-api
- cuda-python>=12.0,<13.0a0
- cuda-version=12.2
- cudf==24.8.*
- cudf==24.8.*,>=0.0.0a0
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dask-cuda==24.8.*
- dask-cudf==24.8.*
- dask-cuda==24.8.*,>=0.0.0a0
- dask-cudf==24.8.*,>=0.0.0a0
- dask-ml
- doxygen=1.9.1
- gcc_linux-64=11.*
Expand All @@ -31,13 +31,13 @@ dependencies:
- joblib>=0.11
- libcublas-dev
- libcufft-dev
- libcumlprims==24.8.*
- libcumlprims==24.8.*,>=0.0.0a0
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libraft-headers==24.8.*
- libraft==24.8.*
- librmm==24.8.*
- libraft-headers==24.8.*,>=0.0.0a0
- libraft==24.8.*,>=0.0.0a0
- librmm==24.8.*,>=0.0.0a0
- nbsphinx
- ninja
- nltk
Expand All @@ -46,18 +46,19 @@ dependencies:
- packaging
- pip
- pydata-sphinx-theme!=0.14.2
- pylibraft==24.8.*
- pylibraft==24.8.*,>=0.0.0a0
- pynndescent==0.5.8
- pytest-benchmark
- pytest-cases
- pytest-cov
- pytest-xdist
- pytest==7.*
- python>=3.9,<3.12
- raft-dask==24.8.*
- rapids-dask-dependency==24.8.*
- raft-dask==24.8.*,>=0.0.0a0
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rapids-dask-dependency==24.8.*,>=0.0.0a0
- recommonmark
- rmm==24.8.*
- rmm==24.8.*,>=0.0.0a0
- scikit-build-core>=0.7.0
- scikit-learn==1.5
- scipy>=1.8.0
Expand Down
8 changes: 4 additions & 4 deletions conda/environments/clang_tidy_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ dependencies:
- libcublas=11.11.3.6
- libcufft-dev=10.9.0.58
- libcufft=10.9.0.58
- libcumlprims==24.8.*
- libcumlprims==24.8.*,>=0.0.0a0
- libcurand-dev=10.3.0.86
- libcurand=10.3.0.86
- libcusolver-dev=11.4.1.48
- libcusolver=11.4.1.48
- libcusparse-dev=11.7.5.86
- libcusparse=11.7.5.86
- libraft-headers==24.8.*
- libraft==24.8.*
- librmm==24.8.*
- libraft-headers==24.8.*,>=0.0.0a0
- libraft==24.8.*,>=0.0.0a0
- librmm==24.8.*,>=0.0.0a0
- ninja
- nvcc_linux-64=11.8
- sysroot_linux-64==2.17
Expand Down
8 changes: 4 additions & 4 deletions conda/environments/cpp_all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ dependencies:
- libcublas=11.11.3.6
- libcufft-dev=10.9.0.58
- libcufft=10.9.0.58
- libcumlprims==24.8.*
- libcumlprims==24.8.*,>=0.0.0a0
- libcurand-dev=10.3.0.86
- libcurand=10.3.0.86
- libcusolver-dev=11.4.1.48
- libcusolver=11.4.1.48
- libcusparse-dev=11.7.5.86
- libcusparse=11.7.5.86
- libraft-headers==24.8.*
- libraft==24.8.*
- librmm==24.8.*
- libraft-headers==24.8.*,>=0.0.0a0
- libraft==24.8.*,>=0.0.0a0
- librmm==24.8.*,>=0.0.0a0
- ninja
- nvcc_linux-64=11.8
- sysroot_linux-64==2.17
Expand Down
8 changes: 4 additions & 4 deletions conda/environments/cpp_all_cuda-122_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ dependencies:
- gcc_linux-64=11.*
- libcublas-dev
- libcufft-dev
- libcumlprims==24.8.*
- libcumlprims==24.8.*,>=0.0.0a0
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libraft-headers==24.8.*
- libraft==24.8.*
- librmm==24.8.*
- libraft-headers==24.8.*,>=0.0.0a0
- libraft==24.8.*,>=0.0.0a0
- librmm==24.8.*,>=0.0.0a0
- ninja
- sysroot_linux-64==2.17
name: cpp_all_cuda-122_arch-x86_64
1 change: 1 addition & 0 deletions conda/recipes/cuml-cpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ requirements:
- python x.x
- scikit-build-core >=0.7.0
- cython>=3.0.0
- rapids-build-backend>=0.3.0,<0.4.0.dev0
run:
- python x.x
- numpy>=1.23,<2.0a0
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ requirements:
- raft-dask ={{ minor_version }}
- scikit-build-core >=0.7.0
- treelite {{ treelite_version }}
- rapids-build-backend>=0.3.0,<0.4.0.dev0
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
Expand Down
Loading

0 comments on commit 225c5aa

Please sign in to comment.