Skip to content

Commit

Permalink
Use rapids-build-backend (#2331)
Browse files Browse the repository at this point in the history
Contributes to rapidsai/build-planning#31

Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #2331
  • Loading branch information
KyleFromNVIDIA authored May 24, 2024
1 parent 642f475 commit b63caf8
Show file tree
Hide file tree
Showing 23 changed files with 156 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ repos:
args: ["--toml", "pyproject.toml"]
exclude: (?x)^(^CHANGELOG.md$)
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.8.0
rev: v1.13.9
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -496,18 +496,18 @@ fi
# Build and (optionally) install the pylibraft Python package
if (( ${NUMARGS} == 0 )) || hasArg pylibraft; then
SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \
python -m pip install --no-build-isolation --no-deps ${REPODIR}/python/pylibraft
python -m pip install --no-build-isolation --no-deps --config-setting rapidsai.disable-cuda=true ${REPODIR}/python/pylibraft
fi

# Build and (optionally) install the raft-dask Python package
if (( ${NUMARGS} == 0 )) || hasArg raft-dask; then
SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \
python -m pip install --no-build-isolation --no-deps ${REPODIR}/python/raft-dask
python -m pip install --no-build-isolation --no-deps --config-setting rapidsai.disable-cuda=true ${REPODIR}/python/raft-dask
fi

# Build and (optionally) install the raft-ann-bench Python package
if (( ${NUMARGS} == 0 )) || hasArg bench-ann; then
python -m pip install --no-build-isolation --no-deps ${REPODIR}/python/raft-ann-bench -vvv
python -m pip install --no-build-isolation --no-deps --config-setting rapidsai.disable-cuda=true ${REPODIR}/python/raft-ann-bench -vvv
fi

if hasArg docs; then
Expand Down
6 changes: 0 additions & 6 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ git_commit=$(git rev-parse HEAD)
export RAPIDS_PACKAGE_VERSION=${version}
echo "${version}" > VERSION

package_dir="python"
for package_name in pylibraft raft-dask; do
underscore_package_name=$(echo "${package_name}" | tr "-" "_")
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/${underscore_package_name}/_version.py"
done

# TODO: Remove `--no-test` flags once importing on a CPU
# node works correctly
rapids-conda-retry mambabuild \
Expand Down
40 changes: 1 addition & 39 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,9 @@ rm -rf /usr/lib64/libuc*
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"
version_file="${package_dir}/${underscore_package_name}/_version.py"

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

# 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

if [[ ${package_name} == "raft-dask" ]]; then
sed -r -i "s/pylibraft==(.*)\"/pylibraft${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file}
sed -r -i "s/libucx(.*)\"/libucx${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file}
sed -r -i "s/ucx-py==(.*)\"/ucx-py${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file}
sed -r -i "s/rapids-dask-dependency==(.*)\"/rapids-dask-dependency==\1${alpha_spec}\"/g" ${pyproject_file}
sed -r -i "s/dask-cuda==(.*)\"/dask-cuda==\1${alpha_spec}\"/g" ${pyproject_file}
sed -r -i "s/distributed-ucxx==(.*)\"/distributed-ucxx${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file}
else
sed -r -i "s/rmm(.*)\"/rmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file}
fi

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

cd "${package_dir}"

Expand Down
7 changes: 4 additions & 3 deletions conda/environments/all_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dask-cuda==24.8.*
- dask-cuda==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*
- doxygen>=1.8.20
- gcc_linux-aarch64=11.*
Expand All @@ -46,9 +46,10 @@ dependencies:
- pydata-sphinx-theme
- pytest-cov
- pytest==7.*
- rapids-dask-dependency==24.8.*
- 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
- scipy
Expand Down
7 changes: 4 additions & 3 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dask-cuda==24.8.*
- dask-cuda==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*
- doxygen>=1.8.20
- gcc_linux-64=11.*
Expand All @@ -46,9 +46,10 @@ dependencies:
- pydata-sphinx-theme
- pytest-cov
- pytest==7.*
- rapids-dask-dependency==24.8.*
- 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
- scipy
Expand Down
7 changes: 4 additions & 3 deletions conda/environments/all_cuda-122_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dask-cuda==24.8.*
- dask-cuda==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*
- doxygen>=1.8.20
- gcc_linux-aarch64=11.*
Expand All @@ -42,9 +42,10 @@ dependencies:
- pydata-sphinx-theme
- pytest-cov
- pytest==7.*
- rapids-dask-dependency==24.8.*
- 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
- scipy
Expand Down
7 changes: 4 additions & 3 deletions conda/environments/all_cuda-122_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dask-cuda==24.8.*
- dask-cuda==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*
- doxygen>=1.8.20
- gcc_linux-64=11.*
Expand All @@ -42,9 +42,10 @@ dependencies:
- pydata-sphinx-theme
- pytest-cov
- pytest==7.*
- rapids-dask-dependency==24.8.*
- 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
- scipy
Expand Down
3 changes: 2 additions & 1 deletion conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ dependencies:
- openblas
- pandas
- pyyaml
- rmm==24.8.*
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rmm==24.8.*,>=0.0.0a0
- scikit-build-core>=0.7.0
- sysroot_linux-aarch64==2.17
name: bench_ann_cuda-118_arch-aarch64
3 changes: 2 additions & 1 deletion conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ dependencies:
- openblas
- pandas
- pyyaml
- rmm==24.8.*
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rmm==24.8.*,>=0.0.0a0
- scikit-build-core>=0.7.0
- sysroot_linux-64==2.17
name: bench_ann_cuda-118_arch-x86_64
3 changes: 2 additions & 1 deletion conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ dependencies:
- openblas
- pandas
- pyyaml
- rmm==24.8.*
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rmm==24.8.*,>=0.0.0a0
- scikit-build-core>=0.7.0
- sysroot_linux-aarch64==2.17
name: bench_ann_cuda-120_arch-aarch64
3 changes: 2 additions & 1 deletion conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ dependencies:
- openblas
- pandas
- pyyaml
- rmm==24.8.*
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rmm==24.8.*,>=0.0.0a0
- scikit-build-core>=0.7.0
- sysroot_linux-64==2.17
name: bench_ann_cuda-120_arch-x86_64
1 change: 1 addition & 0 deletions conda/recipes/pylibraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ requirements:
- rmm ={{ minor_version }}
- scikit-build-core >=0.7.0
- setuptools
- 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
1 change: 1 addition & 0 deletions conda/recipes/raft-ann-bench-cpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ requirements:
- python
- pyyaml
- pandas
- rapids-build-backend>=0.3.0,<0.4.0.dev0

run:
- glog {{ glog_version }}
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/raft-ann-bench/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ requirements:
- pyyaml
# rmm is needed to determine if package is gpu-enabled
- rmm ={{ minor_version }}
- rapids-build-backend>=0.3.0,<0.4.0.dev0

run:
- python
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/raft-dask/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ requirements:
- setuptools
- ucx-py {{ ucx_py_version }}
- ucxx {{ ucxx_version }}
- rapids-build-backend>=0.3.0,<0.4.0.dev0
run:
{% if cuda_major == "11" %}
- cudatoolkit
Expand Down
Loading

0 comments on commit b63caf8

Please sign in to comment.