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

Allow nightly dependencies and set up consistent nightly versions for conda and pip packages #5607

Merged
merged 28 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9030c51
Enable consistent versioning
vyasr Oct 6, 2023
935455c
Add missing commit override
vyasr Oct 6, 2023
e92a24f
Enable extended regex
vyasr Oct 6, 2023
61967ad
Remove extraneous equals
vyasr Oct 6, 2023
0909550
Add missing quotes
vyasr Oct 6, 2023
6b338a9
Use the new version tool for wheels too
vyasr Oct 6, 2023
33f6940
Remove extra quotes
vyasr Oct 6, 2023
6fe34f7
Also set version for cuml-cpu conda package
vyasr Oct 6, 2023
9e26d4e
Address PR feedback
vyasr Oct 6, 2023
b552d3e
Merge remote-tracking branch 'origin/branch-23.12' into feat/nightly_…
vyasr Oct 6, 2023
ac28646
Change commit_override to git_commit
vyasr Oct 6, 2023
d8d171b
Remove the quotes again
vyasr Oct 6, 2023
dce083f
Apply suggestions from code review
vyasr Oct 6, 2023
e6b5a37
export RAPIDS_PACKAGE_VERSION
vyasr Oct 6, 2023
71ac542
Port PR suggestions from rmm
vyasr Oct 9, 2023
3e2ff1c
Merge branch 'branch-23.12' into feat/nightly_versions
vyasr Oct 10, 2023
7780198
Update build_wheel.sh
vyasr Oct 10, 2023
ff50d0a
Require package version env var in conda builds
vyasr Oct 17, 2023
f99244b
Merge remote-tracking branch 'origin/branch-23.12' into feat/nightly_…
vyasr Oct 17, 2023
c8da2ce
Update update-version.sh
vyasr Oct 19, 2023
23edbe5
Switch to VERSION file
vyasr Oct 24, 2023
33249c6
update-version.sh
vyasr Oct 24, 2023
caf2343
Merge branch 'branch-23.12' into feat/nightly_versions
vyasr Oct 24, 2023
b32767e
Switch to using importlib.resources
vyasr Oct 26, 2023
6177c54
Merge branch 'branch-23.12' into feat/nightly_versions
vyasr Oct 26, 2023
91131c9
Merge branch 'branch-23.12' into feat/nightly_versions
vyasr Oct 27, 2023
5425001
Remove now unnecessary quote stripping
vyasr Oct 30, 2023
cbc9b7f
Merge branch 'branch-23.12' into feat/nightly_versions
vyasr Oct 31, 2023
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
4 changes: 3 additions & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

version_override=$(rapids-generate-version)

rapids-logger "Begin cpp build"

rapids-conda-retry mambabuild conda/recipes/libcuml
RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild conda/recipes/libcuml

rapids-upload-conda-to-s3 cpp
13 changes: 11 additions & 2 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

package_name="cuml"
package_dir="python"

version_override=$(rapids-generate-version)
vyasr marked this conversation as resolved.
Show resolved Hide resolved
commit_override=$(git rev-parse HEAD)

sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${package_dir}/${package_name}/__init__.py
sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${package_dir}/${package_name}/__init__.py

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=${version_override} rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/cuml
Expand All @@ -24,7 +33,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=${version_override} rapids-conda-retry mambabuild \
--no-test \
conda/recipes/cuml-cpu
fi
Expand Down
42 changes: 36 additions & 6 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,50 @@

set -euo pipefail

package_name="cuml"
package_dir="python"

source rapids-configure-sccache
source rapids-date-string

# Use gha-tools rapids-pip-wheel-version to generate wheel version then
# update the necessary files
vyasr marked this conversation as resolved.
Show resolved Hide resolved
version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})"
version_override=$(rapids-generate-version)
commit_override=$(git rev-parse HEAD)

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

ci/release/apply_wheel_modifications.sh ${version_override} "-${RAPIDS_PY_CUDA_SUFFIX}"
echo "The package name and/or version was modified in the package source. The git diff is:"
git diff

cd python/
# 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"
init_file="${package_dir}/${package_name}/__init__.py"

sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}
sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${init_file}
sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${init_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

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

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
csadorf marked this conversation as resolved.
Show resolved Hide resolved

cd ${package_dir}

SKBUILD_CONFIGURE_OPTIONS="-DCUML_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DDISABLE_DEPRECATION_WARNINGS=ON -DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/" \
python -m pip wheel . \
Expand Down
22 changes: 0 additions & 22 deletions ci/release/apply_wheel_modifications.sh

This file was deleted.

4 changes: 2 additions & 2 deletions conda/recipes/cuml-cpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage:
# conda build . -c conda-forge -c numba -c rapidsai -c pytorch
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set py_version = environ['CONDA_PY'] %}
{% set date_string = environ['RAPIDS_DATE_STRING'] %}

Expand All @@ -11,7 +11,7 @@ package:
version: {{ version }}

source:
git_url: ../../..
path: ../../..
csadorf marked this conversation as resolved.
Show resolved Hide resolved

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

source:
git_url: ../../..
path: ../../..

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
Expand All @@ -11,7 +11,7 @@ package:
name: libcuml-split

source:
git_url: ../../..
path: ../../..

build:
ignore_run_exports_from:
Expand Down
1 change: 1 addition & 0 deletions python/cuml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@

# Version configuration
__version__ = "23.12.00"
__git_commit__ = "HEAD"
vyasr marked this conversation as resolved.
Show resolved Hide resolved


def __getattr__(name):
Expand Down
5 changes: 4 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ filterwarnings = [

[project]
name = "cuml"
version = "23.12.00"
dynamic = ["version"]
description = "cuML - RAPIDS ML Algorithms"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
Expand Down Expand Up @@ -104,6 +104,9 @@ Documentation = "https://docs.rapids.ai/api/cuml/stable/"
[tool.setuptools]
license-files = ["LICENSE"]

[tool.setuptools.dynamic]
version = {attr = "cuml.__version__"}

[tool.black]
line-length = 79
target-version = ["py39"]
Expand Down