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 wheel builds #1013

Merged
merged 125 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from 122 commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
76579a2
Add initial cibuildwheel workflow
sevagh Jul 28, 2022
d7c324d
Build and test ARM64 wheels for RAFT
sevagh Aug 17, 2022
30bfe95
Ignore cibw local wheelhouse dir
sevagh Aug 19, 2022
f06f82d
Adjust cupy install for ARM smoketest
sevagh Aug 19, 2022
bc710ef
DRY wheel workflow with unit tests
sevagh Aug 29, 2022
86a10d0
Install tests for skbuild
sevagh Aug 29, 2022
db9feed
Override libraft install pattern
sevagh Aug 29, 2022
8fb1658
Run CPP unit tests with _venv_placeholder
sevagh Aug 29, 2022
d0b767c
Install libgtest-dev before running googletests
sevagh Aug 29, 2022
ade4feb
Install gtest_main during SKBUILD
sevagh Aug 29, 2022
005373b
Also install gtest
sevagh Aug 29, 2022
36e6336
Install libs for testing
sevagh Aug 29, 2022
d07214f
Debug stub issue
sevagh Aug 29, 2022
532391e
Allow unit tests to fail for now
sevagh Aug 30, 2022
2ddc9ea
Install test deps
sevagh Aug 30, 2022
26bf9cb
Install more test deps
sevagh Aug 30, 2022
a6f5a15
Add one more test dependency, dask-cuda, for pyraft
sevagh Aug 30, 2022
19a2687
Add one more test dependency, dask dataframe, for pyraft
sevagh Aug 30, 2022
719d030
Switch from -cuda11 to -cu11 suffix
sevagh Sep 1, 2022
876aae9
Remove || true from test command
sevagh Sep 7, 2022
02b5374
get raft wheels building
trxcllnt Sep 12, 2022
ae5eca6
fix rpath
trxcllnt Sep 13, 2022
beeb03a
remove unused code
trxcllnt Sep 14, 2022
61452d3
update github action to only build pylibraft and raft-dask wheels
trxcllnt Sep 14, 2022
070fe21
set include_package_data=True for scikit-build
trxcllnt Sep 14, 2022
60b67ea
copy all UCX libs into the wheel if we can (commented out for now, wi…
trxcllnt Sep 14, 2022
1dbcbaf
put all vars on one line, use rapidsai actions
trxcllnt Sep 15, 2022
42d625d
update cibw-test-command for new paths
trxcllnt Sep 15, 2022
0f8923e
align setup.py install_requires with the conda meta.yml dependencies
trxcllnt Sep 15, 2022
aac877d
add nccl pytest mark
trxcllnt Sep 15, 2022
a1b27a2
fix raft_dask smoketest
trxcllnt Sep 15, 2022
4510018
Use updated workflow syntax
sevagh Sep 22, 2022
6ea075e
Try in ubuntu18.04/gcc 8
sevagh Sep 22, 2022
096b8db
Remove repeated keyword
sevagh Sep 22, 2022
f85dc5e
Build in 2_31
sevagh Sep 22, 2022
f471f7f
Go back to manylinux2014
sevagh Sep 22, 2022
75089c0
rapids-cmake PR #276 fixes this
sevagh Sep 27, 2022
2bf4e1c
Typo: RAPID_ -> RAPIDS_
sevagh Sep 27, 2022
c64aa21
Can't have pylibcugraph in pyproject.toml yet
sevagh Sep 28, 2022
07c5e91
Add versioneer overrides to 22.10.00a
sevagh Sep 28, 2022
dca3361
Testing build-tag incrementer
sevagh Sep 29, 2022
12128ca
Manually set -1- build tag
sevagh Sep 29, 2022
ee3ae98
Merge remote-tracking branch 'upstream/branch-22.10' into feat/cibuil…
sevagh Oct 3, 2022
f9d11ce
Bump build-tag and add LICENSE files
sevagh Oct 3, 2022
499532e
Merge remote-tracking branch 'upstream/branch-22.10' into feat/cibuil…
vyasr Oct 6, 2022
2b0c8bc
Bump wheel tag.
vyasr Oct 7, 2022
316f038
Bump wheel tag.
vyasr Oct 10, 2022
63b5774
Add concurrency rules so that prior runs are canceled.
vyasr Oct 10, 2022
21d000e
Install dask-cuda from main branch.
vyasr Oct 10, 2022
b9dba9e
Update dask-cuda requirement in setup.py.
vyasr Oct 10, 2022
ac98942
Update build tag.
vyasr Oct 10, 2022
f04fd3d
Also pin distributed.
vyasr Oct 10, 2022
8ef89f0
Fix pip install from git syntax
sevagh Oct 10, 2022
993fe68
Update build tag
sevagh Oct 10, 2022
453706c
Abuse dask-cuda to get the installation that we need...
vyasr Oct 10, 2022
0687ef2
Update build tag.
vyasr Oct 10, 2022
37fc441
Fix cloning logic.
vyasr Oct 11, 2022
0c46ee1
Clone with https.
vyasr Oct 11, 2022
3c920af
Add quotes.
vyasr Oct 11, 2022
5cf9c67
Don't try to clone and install multiple times.
vyasr Oct 11, 2022
535c735
Bump build tag.
vyasr Oct 11, 2022
6cfb1f5
Add missing semicolon.
vyasr Oct 11, 2022
6ebe313
Install for all Python versions.
vyasr Oct 11, 2022
536f412
Add ucx-py to install_requires.
vyasr Oct 11, 2022
32480a4
Install dask-cuda the nice way.
vyasr Oct 11, 2022
086bbed
Add missing f string.
vyasr Oct 11, 2022
436e0a3
Bump build tag.
vyasr Oct 11, 2022
8a55ff9
Fix versioning scheme for ucx-py.
vyasr Oct 11, 2022
0adcf56
Bump build.
vyasr Oct 11, 2022
cc9473d
Install ucx-py before test.
vyasr Oct 12, 2022
259c7bd
Use a newer manylinux to test raft-dask so that ucx-py can be installed.
vyasr Oct 12, 2022
0ce316b
Remove version pinning for ucx-py.
vyasr Oct 12, 2022
7a411c9
Centralized logic in used workflow.
vyasr Oct 13, 2022
9ca5fd9
Also remove PIP_INDEX_URL.
vyasr Oct 13, 2022
f31e82f
Bump build tag
sevagh Oct 13, 2022
8beee98
Bump build tags for x86_64 runners
sevagh Oct 13, 2022
d49ecff
Bump build tags for x86_64 runners
sevagh Oct 13, 2022
9c2c883
Clean rebuild for stable version 22.10.00
sevagh Oct 17, 2022
a86a4e0
Install pylibraft before testing raft-dask
sevagh Oct 17, 2022
38bb5b7
Merge remote-tracking branch 'origin/branch-22.12' into feat/cibuildw…
vyasr Nov 14, 2022
0e50636
Some cleanup of old wheels logic.
vyasr Nov 14, 2022
c32dd5f
Remove license files.
vyasr Nov 14, 2022
b39e96d
Symlink licenses.
vyasr Nov 14, 2022
70ef0ea
Minimize diffs.
vyasr Nov 14, 2022
358bf6e
Update to latest wheels workflow syntax.
vyasr Nov 14, 2022
77d7d34
Add testing requirements in extras_requires and use in wheels workflows.
vyasr Nov 14, 2022
9b0d05c
Test commit.
vyasr Nov 14, 2022
5806a56
Undo test commit.
vyasr Nov 14, 2022
b918224
Update cuda-python version.
vyasr Nov 14, 2022
0a3a909
Try to remove some pieces that might be preventing dependency install…
vyasr Nov 14, 2022
3f3dec5
Undo removal and add in setup_requires.
vyasr Nov 14, 2022
237cd60
Remove redundant rmm entry in install_requires.
vyasr Nov 14, 2022
70259f3
Make sure rpaths are set correctly for cluster.
vyasr Nov 14, 2022
a12579e
Add cuda-python back to install_requires.
vyasr Nov 14, 2022
b8ae254
Also have rmm at install time.
vyasr Nov 15, 2022
de8c4c6
Add back exxplicit installation of dependencies for now.
vyasr Nov 15, 2022
0d3112b
Add nccl mark.
vyasr Nov 15, 2022
c17ed22
Fix cuda suffixes.
vyasr Nov 16, 2022
ec8e770
Fix pylibraft version.
vyasr Nov 16, 2022
d155414
Hardcode concurrency rule.
vyasr Nov 16, 2022
b4203ec
Get rid of setup_requires using modern PEP 517 backend.
vyasr Nov 17, 2022
ff7ce81
Get rid of manual installations in wheels.yml.
vyasr Nov 17, 2022
e8098b2
Whitespace cleanup.
vyasr Nov 17, 2022
a5d6d3f
Temporarily remove suffix for ucx-py.
vyasr Nov 17, 2022
59e62d0
Fix CMake option description.
vyasr Nov 17, 2022
1d983ae
Revert "Temporarily remove suffix for ucx-py."
vyasr Nov 17, 2022
f6ff85d
Fix versioneer versions for nightlies.
vyasr Nov 17, 2022
7ab6503
Add versioneer to pyproject.toml.
vyasr Nov 18, 2022
2790bfc
Replace calls to dlsym functions with actual functions.
vyasr Nov 18, 2022
7164f9a
Get rid of internal dlopen-based APIs.
vyasr Nov 18, 2022
2c92fe6
Inline trivial ucp function call.
vyasr Nov 18, 2022
84f83c9
Remove now extraneous typedefs.
vyasr Nov 18, 2022
617059f
Update comment.
vyasr Nov 18, 2022
d849000
Remove dlfcn header.
vyasr Nov 18, 2022
f3466c7
Add ucx to the link interface of libraft.
vyasr Nov 18, 2022
889b78a
Fix typo in project name.
vyasr Nov 18, 2022
6709291
Add a new distributed component for ucx.
vyasr Nov 18, 2022
64d7bde
Merge remote-tracking branch 'origin/branch-22.12' into feat/cibuildw…
vyasr Nov 18, 2022
3f14ff8
Add sklearn to test requirements.
vyasr Nov 18, 2022
a42815c
Add missing associated targets.
vyasr Nov 18, 2022
8018cef
Merge branch 'make_ucx_explicit' into feat/cibuildwheel
vyasr Nov 18, 2022
1749e7a
Merge remote-tracking branch 'origin/branch-22.12' into feat/cibuildw…
vyasr Nov 18, 2022
cc14d4e
Remove PR builds.
vyasr Nov 21, 2022
1a2e5ea
Remove incorrect license links.
vyasr Nov 21, 2022
e10d0fc
Fix license links.
vyasr Nov 21, 2022
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
75 changes: 75 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: RAFT wheels

on:
push:
branches:
- 'pull-request/[0-9]+'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have the GPU resources currently to run the build / test workflows on every pull request. We'll need to either run a reduced build / test matrix for PRs or configure this workflow to run on a different event type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been waiting for each PR to get approved before removing this so that everything up to the final set of changes is tested. Since it looks like we're ready I'll go ahead and update.

workflow_call:
inputs:
versioneer-override:
type: string
default: ''
build-tag:
type: string
default: ''
branch:
required: true
type: string
date:
required: true
type: string
sha:
required: true
type: string
build-type:
type: string
default: nightly

concurrency:
group: "raft-${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
pylibraft-wheel:
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux.yml@main
with:
repo: rapidsai/raft

build-type: ${{ inputs.build-type || 'pull-request' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}

package-dir: python/pylibraft
package-name: pylibraft

python-package-versioneer-override: ${{ inputs.versioneer-override }}
python-package-build-tag: ${{ inputs.build-tag }}

skbuild-configure-options: "-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"

test-extras: test
test-unittest: "python -m pytest -v ./python/pylibraft/pylibraft/test"
secrets: inherit
raft-dask-wheel:
needs: pylibraft-wheel
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux.yml@main
with:
repo: rapidsai/raft

build-type: ${{ inputs.build-type || 'pull-request' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}

package-dir: python/raft-dask
package-name: raft_dask

python-package-versioneer-override: ${{ inputs.versioneer-override }}
python-package-build-tag: ${{ inputs.build-tag }}

skbuild-configure-options: "-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"

test-extras: test
test-unittest: "python -m pytest -v ./python/raft-dask/raft_dask/test"
secrets: inherit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ _skbuild

## doxygen build check inside ci/checks/style.sh
doxygen_check/

## cibuildwheel
/wheelhouse
17 changes: 7 additions & 10 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ project(
LANGUAGES CXX CUDA
)

# Needed because GoogleBenchmark changes the state of FindThreads.cmake, causing subsequent runs to
# have different values for the `Threads::Threads` target. Setting this flag ensures
# `Threads::Threads` is the same value in first run and subsequent runs.
set(THREADS_PREFER_PTHREAD_FLAG ON)

# Write the version header
rapids_cmake_write_version_file(include/raft/version_config.hpp)

Expand Down Expand Up @@ -77,6 +72,13 @@ option(RAFT_ENABLE_NN_DEPENDENCIES "Search for raft::nn dependencies like faiss"

option(RAFT_ENABLE_thrust_DEPENDENCY "Enable Thrust dependency" ON)

if(BUILD_TESTS OR BUILD_BENCH)
# Needed because GoogleBenchmark changes the state of FindThreads.cmake, causing subsequent runs
# to have different values for the `Threads::Threads` target. Setting this flag ensures
# `Threads::Threads` is the same value in first run and subsequent runs.
set(THREADS_PREFER_PTHREAD_FLAG ON)
endif()

if(BUILD_TESTS AND NOT RAFT_ENABLE_thrust_DEPENDENCY)
message(VERBOSE "RAFT: BUILD_TESTS is enabled, overriding RAFT_ENABLE_thrust_DEPENDENCY")
set(RAFT_ENABLE_thrust_DEPENDENCY ON)
Expand Down Expand Up @@ -134,12 +136,7 @@ endif()

set(_ctk_static_suffix "")
if(CUDA_STATIC_RUNTIME)
# If we're statically linking CTK cuBLAS, we also want to statically link BLAS
set(BLA_STATIC ON)
set(_ctk_static_suffix "_static")
# Control legacy FindCUDA.cmake behavior too Remove this after we push it into rapids-cmake:
# https://github.com/rapidsai/rapids-cmake/pull/259
set(CUDA_USE_STATIC_CUDA_RUNTIME ON)
endif()

# CUDA runtime
Expand Down
13 changes: 12 additions & 1 deletion python/pylibraft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ option(FIND_RAFT_CPP "Search for existing RAFT C++ installations before defaulti
ON
)

option(RAFT_BUILD_WHEELS "Whether this build is generating a Python wheel." OFF)

# If the user requested it we attempt to find RAFT.
if(FIND_RAFT_CPP)
find_package(raft ${pylibraft_version} REQUIRED COMPONENTS distance)
Expand Down Expand Up @@ -62,7 +64,16 @@ if(NOT raft_FOUND)
set(BUILD_BENCH OFF)
set(RAFT_COMPILE_LIBRARIES OFF)
set(RAFT_COMPILE_DIST_LIBRARY ON)
add_subdirectory(../../cpp raft-cpp)

set(_exclude_from_all "")
if(RAFT_BUILD_WHEELS)
# Statically link dependencies if building wheels
set(CUDA_STATIC_RUNTIME ON)
# Don't install the raft C++ targets into wheels
set(_exclude_from_all EXCLUDE_FROM_ALL)
endif()

add_subdirectory(../../cpp raft-cpp ${_exclude_from_all})

# When building the C++ libraries from source we must copy libraft_distance.so alongside the
# pairwise_distance and random Cython libraries TODO: when we have a single 'compiled' raft
Expand Down
1 change: 1 addition & 0 deletions python/pylibraft/LICENSE
37 changes: 37 additions & 0 deletions python/pylibraft/_custom_build/backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) 2022, NVIDIA CORPORATION.

"""Custom build backend for pylibraft to get versioned requirements.

Based on https://setuptools.pypa.io/en/latest/build_meta.html
"""
import os
from functools import wraps

from setuptools import build_meta as _orig

# Alias the required bits
build_wheel = _orig.build_wheel
build_sdist = _orig.build_sdist


def replace_requirements(func):
@wraps(func)
def wrapper(config_settings=None):
orig_list = getattr(_orig, func.__name__)(config_settings)
append_list = [
f"rmm{os.getenv('RAPIDS_PY_WHEEL_CUDA_SUFFIX', default='')}"
]
return orig_list + append_list

return wrapper


get_requires_for_build_wheel = replace_requirements(
_orig.get_requires_for_build_wheel
)
get_requires_for_build_sdist = replace_requirements(
_orig.get_requires_for_build_sdist
)
get_requires_for_build_editable = replace_requirements(
_orig.get_requires_for_build_editable
)
8 changes: 2 additions & 6 deletions python/pylibraft/pylibraft/cluster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@

# Set the list of Cython files to build
set(cython_sources kmeans.pyx)
set(linked_libraries raft::raft raft::distance)
set(linked_libraries raft::distance)

# Build all of the Cython targets
rapids_cython_create_modules(
CXX
SOURCE_FILES "${cython_sources}"
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX cluster_
LINKED_LIBRARIES "${linked_libraries}" ASSOCIATED_TARGETS raft MODULE_PREFIX cluster_
)

foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS)
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../library")
endforeach()
6 changes: 1 addition & 5 deletions python/pylibraft/pylibraft/neighbors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ set(linked_libraries raft::raft raft::distance)
rapids_cython_create_modules(
CXX
SOURCE_FILES ""
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX neighbors_
LINKED_LIBRARIES "${linked_libraries}" ASSOCIATED_TARGETS raft MODULE_PREFIX neighbors_
)

foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS)
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../library")
endforeach()

add_subdirectory(ivf_pq)
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ set(linked_libraries raft::raft raft::distance)
rapids_cython_create_modules(
CXX
SOURCE_FILES "${cython_sources}"
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX neighbors_ivfpq_
LINKED_LIBRARIES "${linked_libraries}" ASSOCIATED_TARGETS raft MODULE_PREFIX neighbors_ivfpq_
)

foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS)
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../library")
endforeach()
1 change: 1 addition & 0 deletions python/pylibraft/pylibraft/random/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# Set the list of Cython files to build
set(cython_sources rmat_rectangular_generator.pyx)

# TODO: should finally be replaced with 'compiled' library to be more generic, when that is
# available
set(linked_libraries raft::raft raft::distance)
Expand Down
4 changes: 4 additions & 0 deletions python/pylibraft/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ requires = [
"wheel",
"setuptools",
"cython>=0.29,<0.30",
"cuda-python>=11.7.1,<12.0",
"scikit-build>=0.13.1",
"cmake>=3.23.1,!=3.25.0",
"versioneer",
"ninja"
]
build-backend = "backend"
backend-path = ["_custom_build"]
5 changes: 0 additions & 5 deletions python/pylibraft/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,3 @@ skip=
build
dist
__init__.py

[options]
packages = find:
install_requires = numpy
python_requires = >=3.7,<3.9
51 changes: 49 additions & 2 deletions python/pylibraft/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,54 @@
# limitations under the License.
#

import os

import versioneer
from setuptools import find_packages
from skbuild import setup

cuda_suffix = os.getenv("RAPIDS_PY_WHEEL_CUDA_SUFFIX", default="")

install_requires = [
"numpy",
"cuda-python>=11.7.1,<12.0",
f"rmm{cuda_suffix}",
]

extras_require = {
"test": [
"pytest",
"scipy",
"scikit-learn",
]
}


def exclude_libcxx_symlink(cmake_manifest):
return list(
filter(
lambda name: not ("include/rapids/libcxx/include" in name),
cmake_manifest,
)
)


# Make versioneer produce PyPI-compatible nightly versions for wheels.
if "RAPIDS_PY_WHEEL_VERSIONEER_OVERRIDE" in os.environ:
orig_get_versions = versioneer.get_versions

version_override = os.environ["RAPIDS_PY_WHEEL_VERSIONEER_OVERRIDE"]

def get_versions():
data = orig_get_versions()
data["version"] = version_override
return data

versioneer.get_versions = get_versions


setup(
name="pylibraft",
name=f"pylibraft{cuda_suffix}",
description="RAFT: Reusable Algorithms Functions and other Tools",
version=versioneer.get_version(),
classifiers=[
Expand All @@ -29,6 +71,7 @@
"Programming Language :: Python :: 3.9",
],
author="NVIDIA Corporation",
include_package_data=True,
package_data={
# Note: A dict comprehension with an explicit copy is necessary
# (rather than something simpler like a dict.fromkeys) because
Expand All @@ -46,8 +89,12 @@
]
)
},
install_requires=install_requires,
extras_require=extras_require,
# Don't want libcxx getting pulled into wheel builds.
cmake_process_manifest_hook=exclude_libcxx_symlink,
packages=find_packages(include=["pylibraft", "pylibraft.*"]),
license="Apache",
license="Apache 2.0",
cmdclass=versioneer.get_cmdclass(),
zip_safe=False,
)
13 changes: 12 additions & 1 deletion python/raft-dask/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ option(FIND_RAFT_CPP "Search for existing RAFT C++ installations before defaulti
OFF
)

option(RAFT_BUILD_WHEELS "Whether this build is generating a Python wheel." OFF)

# If the user requested it we attempt to find RAFT.
if(FIND_RAFT_CPP)
find_package(raft ${raft_dask_version} REQUIRED COMPONENTS distributed)
Expand All @@ -57,7 +59,16 @@ if(NOT raft_FOUND)
set(RAFT_COMPILE_LIBRARIES OFF)
set(RAFT_COMPILE_DIST_LIBRARY OFF)
set(RAFT_COMPILE_NN_LIBRARY OFF)
add_subdirectory(../../cpp raft-cpp)

set(_exclude_from_all "")
if(RAFT_BUILD_WHEELS)
# Statically link dependencies if building wheels
set(CUDA_STATIC_RUNTIME ON)
# Don't install the raft C++ targets into wheels
set(_exclude_from_all EXCLUDE_FROM_ALL)
endif()

add_subdirectory(../../cpp raft-cpp ${_exclude_from_all})
endif()

include(rapids-cython)
Expand Down
1 change: 1 addition & 0 deletions python/raft-dask/LICENSE
1 change: 0 additions & 1 deletion python/raft-dask/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ requires = [
"scikit-build>=0.13.1",
"cmake>=3.23.1,!=3.25.0",
"ninja",
"pylibraft"
]
2 changes: 1 addition & 1 deletion python/raft-dask/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ markers =
stress: marks stress tests
mg: marks a test as multi-GPU
memleak: marks a test as a memory leak test

nccl: marks a test as using NCCL
3 changes: 2 additions & 1 deletion python/raft-dask/raft_dask/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ include(${raft-dask-python_SOURCE_DIR}/cmake/thirdparty/get_nccl.cmake)
set(cython_sources comms_utils.pyx nccl.pyx)
set(linked_libraries raft::raft raft::distributed NCCL::NCCL)
rapids_cython_create_modules(
SOURCE_FILES "${cython_sources}" LINKED_LIBRARIES "${linked_libraries}" CXX
SOURCE_FILES "${cython_sources}" ASSOCIATED_TARGETS raft LINKED_LIBRARIES "${linked_libraries}"
CXX
)
3 changes: 2 additions & 1 deletion python/raft-dask/raft_dask/include_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
set(cython_sources raft_include_test.pyx)
set(linked_libraries raft::raft)
rapids_cython_create_modules(
SOURCE_FILES "${cython_sources}" LINKED_LIBRARIES "${linked_libraries}" CXX
SOURCE_FILES "${cython_sources}" ASSOCIATED_TARGETS raft LINKED_LIBRARIES "${linked_libraries}"
CXX
)
Loading