Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rapids-build-backend #2331

Merged
merged 13 commits into from
May 24, 2024
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 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 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 disable-cuda=true ${REPODIR}/python/raft-ann-bench -vvv
fi

if hasArg docs; then
Expand Down
35 changes: 0 additions & 35 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,7 @@ 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

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.2.0,<0.3.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.2.0,<0.3.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.2.0,<0.3.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.2.0,<0.3.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.2.0,<0.3.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.2.0,<0.3.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.2.0,<0.3.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.2.0,<0.3.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.2.0,<0.3.0.dev0
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
Expand Down
61 changes: 47 additions & 14 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ files:
arch: [x86_64, aarch64]
includes:
- build
- rapids_build
- build_pylibraft
- cuda
- cuda_version
Expand All @@ -28,6 +29,7 @@ files:
arch: [x86_64, aarch64]
includes:
- build
- rapids_build
- cuda
- cuda_version
- develop
Expand Down Expand Up @@ -66,6 +68,14 @@ files:
table: build-system
includes:
- build
py_rapids_build_pylibraft:
output: pyproject
pyproject_dir: python/pylibraft
extras:
table: tool.rapids-build-backend
key: requires
includes:
- rapids_build
- build_pylibraft
py_run_pylibraft:
output: pyproject
Expand All @@ -91,6 +101,14 @@ files:
table: build-system
includes:
- build
py_rapids_build_raft_dask:
output: pyproject
pyproject_dir: python/raft-dask
extras:
table: tool.rapids-build-backend
key: requires
includes:
- rapids_build
- depends_on_ucx_build
py_run_raft_dask:
output: pyproject
Expand Down Expand Up @@ -130,6 +148,16 @@ channels:
- nvidia
dependencies:
build:
common:
- output_types: [conda]
packages:
- rapids-build-backend>=0.2.0,<0.3.0.dev0
- scikit-build-core>=0.7.0
- output_types: [requirements, pyproject]
packages:
- rapids-build-backend>=0.2.0,<0.3.0.dev0
- scikit-build-core[pyproject]>=0.7.0
rapids_build:
common:
- output_types: [conda, requirements, pyproject]
packages:
Expand All @@ -142,10 +170,6 @@ dependencies:
- cxx-compiler
- nccl>=2.9.9
- libucxx==0.39.*
- scikit-build-core>=0.7.0
- output_types: [requirements, pyproject]
packages:
- scikit-build-core[pyproject]>=0.7.0
specific:
- output_types: conda
matrices:
Expand Down Expand Up @@ -184,7 +208,7 @@ dependencies:
common:
- output_types: [conda]
packages:
- &rmm_conda rmm==24.8.*
- &rmm_conda rmm==24.8.*,>=0.0.0a0
- output_types: requirements
packages:
# pip recognizes the index as a global option for the requirements.txt file
Expand All @@ -198,17 +222,21 @@ dependencies:
cuda: "12.*"
packages:
- &cuda_python12 cuda-python>=12.0,<13.0a0
- matrix: # All CUDA 11 versions
- matrix:
cuda: "11.*"
packages:
- &cuda_python11 cuda-python>=11.7.1,<12.0a0
- matrix:
packages:
- &cuda_python cuda-python
- output_types: [requirements, pyproject]
matrices:
- matrix: {cuda: "12.*"}
packages:
- &rmm_cu12 rmm-cu12==24.8.*
- &rmm_cu12 rmm-cu12==24.8.*,>=0.0.0a0
- matrix: {cuda: "11.*"}
packages:
- &rmm_cu11 rmm-cu11==24.8.*
- &rmm_cu11 rmm-cu11==24.8.*,>=0.0.0a0
- {matrix: null, packages: [*rmm_conda] }
checks:
common:
Expand Down Expand Up @@ -381,6 +409,7 @@ dependencies:
packages:
- wheel
- setuptools
- rapids-build-backend>=0.2.0,<0.3.0.dev0
py_version:
specific:
- output_types: conda
Expand Down Expand Up @@ -421,9 +450,13 @@ dependencies:
cuda: "12.*"
packages:
- *cuda_python12
- matrix: # All CUDA 11 versions
- matrix:
cuda: "11.*"
packages:
- *cuda_python11
- matrix:
packages:
- *cuda_python
- output_types: [requirements, pyproject]
matrices:
- matrix: {cuda: "12.*"}
Expand All @@ -437,18 +470,18 @@ dependencies:
common:
- output_types: [conda, pyproject]
packages:
- dask-cuda==24.8.*
- dask-cuda==24.8.*,>=0.0.0a0
- joblib>=0.11
- numba>=0.57
- *numpy
- rapids-dask-dependency==24.8.*
- rapids-dask-dependency==24.8.*,>=0.0.0a0
- ucx-py==0.39.*
- output_types: conda
packages:
- &ucx_py_conda ucx-py==0.39.*
- output_types: pyproject
packages:
- &pylibraft_conda pylibraft==24.8.*
- &pylibraft_conda pylibraft==24.8.*,>=0.0.0a0
- output_types: requirements
packages:
# pip recognizes the index as a global option for the requirements.txt file
Expand All @@ -460,11 +493,11 @@ dependencies:
matrices:
- matrix: {cuda: "12.*"}
packages:
- &pylibraft_cu12 pylibraft-cu12==24.8.*
- &pylibraft_cu12 pylibraft-cu12==24.8.*,>=0.0.0a0
- &ucx_py_cu12 ucx-py-cu12==0.39.*
- matrix: {cuda: "11.*"}
packages:
- &pylibraft_cu11 pylibraft-cu11==24.8.*
- &pylibraft_cu11 pylibraft-cu11==24.8.*,>=0.0.0a0
- &ucx_py_cu11 ucx-py-cu11==0.39.*
- {matrix: null, packages: [*pylibraft_conda, *ucx_py_conda]}
test_python_common:
Expand Down
Loading
Loading