-
Notifications
You must be signed in to change notification settings - Fork 197
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
Revert "Revert "Build C++ wheel (#2264)"" #2306
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,41 +67,45 @@ jobs: | |
node_type: "gpu-v100-latest-1" | ||
run_script: "ci/build_docs.sh" | ||
sha: ${{ inputs.sha }} | ||
wheel-build-pylibraft: | ||
wheel-build-cpp: | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
with: | ||
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber))) | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
branch: ${{ inputs.branch }} | ||
sha: ${{ inputs.sha }} | ||
date: ${{ inputs.date }} | ||
script: ci/build_wheel_pylibraft.sh | ||
wheel-publish-pylibraft: | ||
needs: wheel-build-pylibraft | ||
script: ci/build_wheel_cpp.sh | ||
wheel-build-python: | ||
needs: wheel-build-cpp | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish[email protected] | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-build[email protected] | ||
with: | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
branch: ${{ inputs.branch }} | ||
sha: ${{ inputs.sha }} | ||
date: ${{ inputs.date }} | ||
package-name: pylibraft | ||
wheel-build-raft-dask: | ||
script: ci/build_wheel_python.sh | ||
wheel-publish-cpp: | ||
needs: wheel-build-cpp | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-build[email protected] | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish[email protected] | ||
with: | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
branch: ${{ inputs.branch }} | ||
sha: ${{ inputs.sha }} | ||
date: ${{ inputs.date }} | ||
script: ci/build_wheel_raft_dask.sh | ||
wheel-publish-raft-dask: | ||
needs: wheel-build-raft-dask | ||
package-name: raft | ||
package-type: cpp | ||
wheel-publish-python: | ||
needs: wheel-build-python | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
with: | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
branch: ${{ inputs.branch }} | ||
sha: ${{ inputs.sha }} | ||
date: ${{ inputs.date }} | ||
package-name: raft_dask | ||
package-name: raft | ||
package-type: python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,9 @@ jobs: | |
- conda-python-build | ||
- conda-python-tests | ||
- docs-build | ||
- wheel-build-pylibraft | ||
- wheel-build-cpp | ||
- wheel-build-python | ||
- wheel-tests-pylibraft | ||
- wheel-build-raft-dask | ||
- wheel-tests-raft-dask | ||
- devcontainer | ||
secrets: inherit | ||
|
@@ -74,29 +74,30 @@ jobs: | |
arch: "amd64" | ||
container_image: "rapidsai/ci-conda:latest" | ||
run_script: "ci/build_docs.sh" | ||
wheel-build-pylibraft: | ||
wheel-build-cpp: | ||
needs: checks | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
with: | ||
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber))) | ||
build_type: pull-request | ||
script: ci/build_wheel_pylibraft.sh | ||
wheel-tests-pylibraft: | ||
needs: wheel-build-pylibraft | ||
script: ci/build_wheel_cpp.sh | ||
wheel-build-python: | ||
needs: wheel-build-cpp | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-test[email protected] | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-build[email protected] | ||
with: | ||
build_type: pull-request | ||
script: ci/test_wheel_pylibraft.sh | ||
wheel-build-raft-dask: | ||
needs: wheel-tests-pylibraft | ||
script: ci/build_wheel_python.sh | ||
wheel-tests-pylibraft: | ||
needs: wheel-build-python | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-build[email protected] | ||
uses: rapidsai/shared-workflows/.github/workflows/wheels-test[email protected] | ||
with: | ||
build_type: pull-request | ||
script: "ci/build_wheel_raft_dask.sh" | ||
script: ci/test_wheel_pylibraft.sh | ||
wheel-tests-raft-dask: | ||
needs: wheel-build-raft-dask | ||
needs: wheel-build-python | ||
secrets: inherit | ||
uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
|
||
set -euo pipefail | ||
|
||
package_name="libraft" | ||
package_dir="python/libraft" | ||
|
||
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})" | ||
|
||
# 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}/${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 | ||
|
||
sed -r -i "s/librmm(.*)\"/librmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file} | ||
|
||
cd "${package_dir}" | ||
|
||
python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check | ||
|
||
mkdir -p final_dist | ||
python -m auditwheel repair -w final_dist dist/* | ||
|
||
RAPIDS_PY_WHEEL_NAME="raft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 cpp final_dist |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2023-2024, NVIDIA CORPORATION. | ||
|
||
set -euo pipefail | ||
|
||
# Clear out system ucx files to ensure that we're getting ucx from the wheel | ||
# when building raft-dask. | ||
rm -rf /usr/lib64/ucx | ||
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}" | ||
|
||
echo "${version}" > VERSION | ||
|
||
# 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 | ||
|
||
CPP_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="raft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp /tmp/libraft_dist) | ||
PYTHON_WHEELHOUSE="${PWD}/dist/" | ||
PYTHON_AUDITED_WHEELHOUSE="${PWD}/final_dist/" | ||
WHEELHOUSES=("${PYTHON_WHEELHOUSE}" "${CPP_WHEELHOUSE}") | ||
mkdir -p "${PYTHON_AUDITED_WHEELHOUSE}" | ||
|
||
FIND_LINKS="" | ||
# Iterate over the array | ||
for wheelhouse in "${WHEELHOUSES[@]}"; do | ||
FIND_LINKS+="--find-links ${wheelhouse} " | ||
done | ||
|
||
|
||
build_wheel () { | ||
local package_name="${1}" | ||
local underscore_package_name=$(echo "${package_name}" | tr "-" "_") | ||
|
||
local package_dir="python/${package_name}" | ||
local pyproject_file="${package_dir}/pyproject.toml" | ||
local version_file="${package_dir}/${underscore_package_name}/_version.py" | ||
|
||
sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} | ||
sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${version_file} | ||
|
||
sed -r -i "s/libucx(.*)\"/libucx${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file} | ||
|
||
for dep in rmm libraft pylibraft ucx-py distributed-ucxx; do | ||
sed -r -i "s/${dep}==(.*)\"/${dep}${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} | ||
done | ||
|
||
# dask-cuda & rapids-dask-dependency don't get a suffix, but they do get an alpha spec. | ||
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-9a]*/cuda-python>=12.0,<13.0a0/g" ${pyproject_file} | ||
sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} | ||
fi | ||
|
||
pushd "${package_dir}" | ||
|
||
python -m pip wheel . -w "${PYTHON_WHEELHOUSE}" -vvv --no-deps --disable-pip-version-check ${FIND_LINKS} | ||
popd | ||
} | ||
|
||
build_wheel pylibraft | ||
build_wheel raft-dask | ||
|
||
python -m auditwheel repair -w "${PYTHON_AUDITED_WHEELHOUSE}" --exclude libraft.so --exclude "libucp.so.0" "${PYTHON_WHEELHOUSE}"/* | ||
RAPIDS_PY_WHEEL_NAME="raft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python "${PYTHON_AUDITED_WHEELHOUSE}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever we pick this back up, I think it'd be preferable to switch away from FIND_LINKS towards a constraint file, as described in rapidsai/build-planning#69 (comment).