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

add build wheel script and accompanying version info #167

Merged
merged 86 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
28afe76
add build wheel script and accompanying version info
msarahan Jan 17, 2024
a92cf98
move pip args to requirements output
msarahan Jan 17, 2024
14c8799
Remove hardcoded versions
vyasr Jan 17, 2024
d48d5a4
Fix sed expressions so that they run (overzealous, but OK)
vyasr Jan 17, 2024
99b940d
Find Development.Embed component to make Python3::Python target avail…
vyasr Jan 17, 2024
7e2426c
SKBUILD_CMAKE_ARGS is semicolon-separated
vyasr Jan 17, 2024
955b360
Don't change to dir and just use absolute paths everywhere
vyasr Jan 17, 2024
6c894db
Make sure ucxx_python is also installed
vyasr Jan 17, 2024
a175ee7
Make sure all associated targets are set
vyasr Jan 17, 2024
ef88198
Enabling Python is now automatic
vyasr Jan 17, 2024
a0c72b0
Don't load gtest if not necessary
vyasr Jan 17, 2024
0d6c53a
Consolidate rmm logic and ensure it is only called when requested
vyasr Jan 17, 2024
b7a9d6e
Properly enable Python by default
vyasr Jan 17, 2024
df1150d
Switch back to raw find_package
vyasr Jan 17, 2024
d0e2046
Make `ci/test_wheel.sh` executable
pentschev Jan 17, 2024
697c799
Remove policy from upload artifact
vyasr Jan 17, 2024
e24e23c
Also update cudf
vyasr Jan 18, 2024
3580d0b
Fix cupy dependencies and patching
vyasr Jan 18, 2024
cd01361
Move CI C++/Python test implementations to common script
pentschev Jan 18, 2024
47ed425
Add basic wheel test set
pentschev Jan 18, 2024
fd4aab7
Fix `BINARY_PATH`
pentschev Jan 18, 2024
5f8b0c9
Check for `ucx_info` presence before running
pentschev Jan 18, 2024
3742bb5
Fix `ucx_info` chek
pentschev Jan 18, 2024
9305a32
Prevent `which` call from causing a failure
pentschev Jan 18, 2024
1da02e6
Simplify `ucx_info` error handling
pentschev Jan 18, 2024
fff8e48
Disable C++ testing in wheels tests
pentschev Jan 18, 2024
f888489
Run tests with `python -m`
pentschev Jan 18, 2024
7378821
Patch UCX libraries
pentschev Jan 18, 2024
40d5e8a
Switch to `rapids-dask-dependency` for `dask-cudf`
pentschev Jan 18, 2024
fb1c523
Build wheel for distributed-ucxx package
pentschev Jan 18, 2024
abe6e7e
Merge remote-tracking branch 'upstream/branch-0.36' into wheel-build-ci
pentschev Jan 18, 2024
f470e02
Fix pyproject
pentschev Jan 18, 2024
e2e9951
Add distributed-ucxx build/tests to GH workflows
pentschev Jan 18, 2024
5858b02
Add execution permission for new wheel build scripts
pentschev Jan 18, 2024
257ad3d
Add missing `fi` statement
pentschev Jan 18, 2024
07f9b42
Fix distributed-ucxx package directory
pentschev Jan 18, 2024
7818f33
Set `RAPIDS_PY_CUDA_SUFFIX` in caller scripts
pentschev Jan 18, 2024
0d7330b
Export `RAPIDS_PY_CUDA_SUFFIX`
pentschev Jan 18, 2024
a43a9bf
Update distributed-ucxx versioning
pentschev Jan 18, 2024
3e1fb71
Add missing distributed-ucxx wheel build step
pentschev Jan 18, 2024
17adea4
Package name fixes
pentschev Jan 18, 2024
0ad3955
Do not export `PROJECT_NAME`
pentschev Jan 18, 2024
bcbed26
Use `rapids-dask-dependency` for `distributed-ucxx` conda package
pentschev Jan 18, 2024
f09d4d7
Comment out distributed-ucxx wheels GH workflows
pentschev Jan 18, 2024
d7dc399
Only use rapids-dask-dependency in conda until we enable distributed-…
bdice Jan 18, 2024
3de787f
Skip distributed-ucxx jobs.
bdice Jan 18, 2024
535a830
Use RAPIDS version for rapids-dask-dependency.
bdice Jan 18, 2024
f7044a3
Merge remote-tracking branch 'upstream/branch-0.36' into wheel-build-ci
bdice Jan 19, 2024
1b6c1df
Increase nofile ulimit in CI workflows for wheels
pentschev Jan 19, 2024
32c14a2
Merge remote-tracking branch 'upstream/branch-0.37' into wheel-build-ci
bdice Jan 19, 2024
27f68dc
Update to 24.04.
bdice Jan 19, 2024
0fa2763
Uncomment distributed-ucxx CI jobs.
bdice Jan 19, 2024
05fb96b
Rename ucxx dependency lists.
bdice Jan 19, 2024
0ee77f6
Use rapids-dependency-file-generator for distributed-ucxx.
bdice Jan 19, 2024
360f559
Fix conda dependency list.
bdice Jan 19, 2024
a12e420
Add ucxx dependency to distributed-ucxx.
bdice Jan 19, 2024
0ab6f18
Update update-version.sh.
bdice Jan 19, 2024
dbb3350
Rewrite alpha_spec for distributed-ucxx's dependency on ucxx.
bdice Jan 19, 2024
3d97f46
Fix sed command.
bdice Jan 19, 2024
6199aea
Fix sed command again.
bdice Jan 19, 2024
199cb25
Install ucxx from this build when testing distributed-ucxx.
bdice Jan 19, 2024
128237d
Install ucxx deps.
bdice Jan 20, 2024
f5182cc
Add missing RMM dependency to ucxx run requirements.
bdice Jan 22, 2024
47bceb5
Merge remote-tracking branch 'upstream/branch-0.37' into wheel-build-ci
vyasr Jan 23, 2024
27573d9
Update VERSION to 0.37.00
bdice Jan 24, 2024
b596c25
Merge remote-tracking branch 'upstream/branch-0.37' into wheel-build-ci
bdice Jan 25, 2024
8b5007f
Clean up merge diff.
bdice Jan 25, 2024
7748935
Add VERSION symlink to distributed-ucxx.
bdice Jan 25, 2024
35c211d
Update copyrights.
bdice Jan 25, 2024
1348dcb
Add alpha_spec to rapids-dask-dependency.
bdice Jan 25, 2024
7ba3ae7
Merge remote-tracking branch 'upstream/branch-0.37' into wheel-build-ci
pentschev Jan 29, 2024
02dc566
Install Distributed development version in wheel test
pentschev Jan 29, 2024
3ef814b
Add smoke tests for aarch wheel
pentschev Jan 29, 2024
dd4e439
Don't print ucx info
vyasr Jan 30, 2024
e782fc7
Run pytest via python
vyasr Jan 30, 2024
cc017be
Fix path to wheel smoke tests
pentschev Jan 30, 2024
90c3152
Merge remote-tracking branch 'msarahan/wheel-build-ci' into wheel-bui…
pentschev Jan 30, 2024
3d43a5c
Fix smoke test copyright headers
pentschev Jan 30, 2024
2107f16
Remove irrelevant comment from wheel smoke test
pentschev Jan 30, 2024
1b3977f
Fix CMake comment on spdlog
pentschev Jan 30, 2024
9e6ce88
Move `ci/test_utils.sh` functions to `ci/test_common.sh`
pentschev Jan 30, 2024
d6af7c6
Remove unneeded wheel test import
pentschev Jan 30, 2024
6e4482f
GH workflow fixes
pentschev Jan 30, 2024
4fa91fb
Make wheel build script more consistent
pentschev Jan 31, 2024
2a8495d
Move `RAPIDS_PY_CUDA_SUFFIX` and build to `ci/build_wheel.sh`
pentschev Jan 31, 2024
035c453
Do not prevent errors in `print_ucx_config`
pentschev Jan 31, 2024
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
19 changes: 19 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,22 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-build:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
bdice marked this conversation as resolved.
Show resolved Hide resolved
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel.sh
wheel-publish:
needs: wheel-build
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: ucxx
16 changes: 16 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
- conda-cpp-build
- conda-cpp-tests
- conda-python-tests
- wheel-build
- wheel-tests
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
checks:
Expand Down Expand Up @@ -43,3 +45,17 @@ jobs:
with:
build_type: pull-request
container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000"
wheel-build:
needs: checks
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
script: ci/build_wheel.sh
wheel-tests:
needs: wheel-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
script: ci/test_wheel.sh
9 changes: 9 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ jobs:
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000"
wheel-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: ci/test_wheel.sh
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.36.00
bdice marked this conversation as resolved.
Show resolved Hide resolved
46 changes: 46 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

set -euo pipefail

package_name="ucxx"
package_dir="python"

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

version=$(rapids-generate-version)
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 -E "s/^name = \"${package_name}(.*)?\"$/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}
echo "${version}" > VERSION
sed -i "/^__git_commit__/ s/= .*/= \"${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

# Add -cuXX to package name
sed -r -i "s/rmm(.*)\"/rmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file}
vyasr marked this conversation as resolved.
Show resolved Hide resolved

SKBUILD_CMAKE_ARGS="-DUCXX_ENABLE_RMM=ON" \
python -m pip wheel "${package_dir}"/ -w "${package_dir}"/dist -vvv --no-deps --disable-pip-version-check

python -m auditwheel repair -w ${package_dir}/final_dist ${package_dir}/dist/*

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="ucxx_${AUDITWHEEL_POLICY}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 ${package_dir}/final_dist
vyasr marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 28 additions & 0 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

export PROJECT_NAME="ucxx"

mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="${PROJECT_NAME}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist

# On arm also need to install CMake because treelite needs to be compiled (no wheels available for arm).
if [[ "$(arch)" == "aarch64" ]]; then
python -m pip install cmake
fi

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/${PROJECT_NAME}*.whl)[test]

# Run smoke tests for aarch64 pull requests
# if [[ "$(arch)" == "aarch64" && "${RAPIDS_BUILD_TYPE}" == "pull-request" ]]; then
# python ci/wheel_smoke_test.py
# else
# python -m pytest ./python/${PROJECT_NAME}/tests -k 'not test_sparse_pca_inputs' -n 4 --ignore=python/cuml/tests/dask && python -m pytest ./python/${PROJECT_NAME}/tests -k 'test_sparse_pca_inputs' && python -m pytest ./python/cuml/tests/dask
# fi

echo "Please add meaningful tests here. This file was copied from CuML and needs to be adapted to UCXX's needs."
exit 1
18 changes: 10 additions & 8 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@ rapids_find_package(
# add third party dependencies using CPM
rapids_cpm_init()
# find rmm
include(cmake/thirdparty/get_rmm.cmake)
if(UCXX_ENABLE_RMM)
include(cmake/thirdparty/get_rmm.cmake)
endif()
# find or install GoogleTest
include(cmake/thirdparty/get_gtest.cmake)
if(BUILD_TESTS)
include(cmake/thirdparty/get_gtest.cmake)
endif()

# ##################################################################################################
# * library targets -------------------------------------------------------------------------------
Expand Down Expand Up @@ -157,17 +161,15 @@ target_compile_definitions(

# Enable RMM if necessary
if(UCXX_ENABLE_RMM)
target_compile_definitions(ucxx PUBLIC UCXX_ENABLE_RMM)
target_link_libraries(ucxx PUBLIC rmm::rmm)
target_compile_definitions(ucxx PUBLIC UCXX_ENABLE_RMM "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")
endif()

# Define spdlog level
vyasr marked this conversation as resolved.
Show resolved Hide resolved
target_compile_definitions(ucxx PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")

# Specify the target module library dependencies
target_link_libraries(
vyasr marked this conversation as resolved.
Show resolved Hide resolved
ucxx
PUBLIC rmm::rmm ucx::ucp
)
target_link_libraries(ucxx PUBLIC ucx::ucp)


# Add Conda library, and include paths if specified
if(TARGET conda_env)
Expand Down
6 changes: 6 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ dependencies:
- output_types: [requirements, pyproject]
packages:
- scikit-build-core[pyproject]>=0.7.0
- output_types: requirements
packages:
# pip recognizes the index as a global option for the requirements.txt file
# This index is needed for rmm.
- --extra-index-url=https://pypi.nvidia.com
- --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple
checks:
common:
- output_types: [conda, requirements]
Expand Down
5 changes: 5 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ include(rapids-cython-core)
if(NOT ucxx_FOUND)
set(BUILD_TESTS OFF)
set(BUILD_BENCHMARKS OFF)
set(UCXX_ENABLE_PYTHON ON)
vyasr marked this conversation as resolved.
Show resolved Hide resolved

set(_exclude_from_all "")

Expand All @@ -40,10 +41,14 @@ if(NOT ucxx_FOUND)
# and modify the rpaths appropriately.
set(cython_lib_dir ucxx)
install(TARGETS ucxx DESTINATION ${cython_lib_dir})
install(TARGETS ucxx_python DESTINATION ${cython_lib_dir})
endif()

rapids_cython_init()

find_package(
Python3 REQUIRED COMPONENTS Development.Embed
)
add_subdirectory(ucxx/examples)
add_subdirectory(ucxx/_lib)

Expand Down
1 change: 1 addition & 0 deletions python/ucxx/VERSION
3 changes: 2 additions & 1 deletion python/ucxx/_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ set(linked_libraries ucxx::ucxx ucxx::python Python3::Python)
rapids_cython_create_modules(
CXX
SOURCE_FILES "${cython_sources}"
LINKED_LIBRARIES "${linked_libraries}" ASSOCIATED_TARGETS ucxx
LINKED_LIBRARIES "${linked_libraries}"
ASSOCIATED_TARGETS ucxx ucxx_python
)

find_package(Python REQUIRED COMPONENTS Development NumPy)
Expand Down
18 changes: 18 additions & 0 deletions python/ucxx/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import importlib.resources

__version__ = importlib.resources.files("ucxx").joinpath("VERSION").read_text().strip()
__git_commit__ = ""
1 change: 1 addition & 0 deletions python/ucxx/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rapids_cython_create_modules(
CXX
SOURCE_FILES "${cython_sources}"
LINKED_LIBRARIES "${linked_libraries}"
ASSOCIATED_TARGETS ucxx ucxx_python
)

target_include_directories(python_future_task_app PRIVATE ".")
Loading