Skip to content

Commit a6ca0f0

Browse files
Use nvcomp wheel instead of bundling nvcomp (#16946)
Contributes to rapidsai/rapids-wheels-planning#74 Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - Robert Maynard (https://github.com/robertmaynard) - Bradley Dice (https://github.com/bdice) - Vyas Ramasubramani (https://github.com/vyasr) URL: #16946
1 parent bac81cb commit a6ca0f0

File tree

5 files changed

+47
-13
lines changed

5 files changed

+47
-13
lines changed

ci/build_wheel_libcudf.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ set -euo pipefail
55

66
package_dir="python/libcudf"
77

8+
export SKBUILD_CMAKE_ARGS="-DUSE_NVCOMP_RUNTIME_WHEEL=ON"
89
./ci/build_wheel.sh ${package_dir}
910

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

1213
mkdir -p ${package_dir}/final_dist
13-
python -m auditwheel repair -w ${package_dir}/final_dist ${package_dir}/dist/*
14+
python -m auditwheel repair \
15+
--exclude libnvcomp.so.4 \
16+
-w ${package_dir}/final_dist \
17+
${package_dir}/dist/*
1418

1519
RAPIDS_PY_WHEEL_NAME="libcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 cpp ${package_dir}/final_dist

cpp/cmake/thirdparty/get_nvcomp.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# =============================================================================
2-
# Copyright (c) 2021-2022, NVIDIA CORPORATION.
2+
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
# in compliance with the License. You may obtain a copy of the License at
@@ -16,11 +16,7 @@
1616
function(find_and_configure_nvcomp)
1717

1818
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
19-
rapids_cpm_nvcomp(
20-
BUILD_EXPORT_SET cudf-exports
21-
INSTALL_EXPORT_SET cudf-exports
22-
USE_PROPRIETARY_BINARY ${CUDF_USE_PROPRIETARY_NVCOMP}
23-
)
19+
rapids_cpm_nvcomp(USE_PROPRIETARY_BINARY ${CUDF_USE_PROPRIETARY_NVCOMP})
2420

2521
# Per-thread default stream
2622
if(TARGET nvcomp AND CUDF_USE_PER_THREAD_DEFAULT_STREAM)

dependencies.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ files:
1515
- depends_on_cupy
1616
- depends_on_libkvikio
1717
- depends_on_librmm
18+
- depends_on_nvcomp
1819
- depends_on_rmm
1920
- develop
2021
- docs
@@ -152,6 +153,13 @@ files:
152153
- build_cpp
153154
- depends_on_libkvikio
154155
- depends_on_librmm
156+
py_run_libcudf:
157+
output: pyproject
158+
pyproject_dir: python/libcudf
159+
extras:
160+
table: project
161+
includes:
162+
- depends_on_nvcomp
155163
py_build_pylibcudf:
156164
output: pyproject
157165
pyproject_dir: python/pylibcudf
@@ -367,9 +375,27 @@ dependencies:
367375
- fmt>=11.0.2,<12
368376
- flatbuffers==24.3.25
369377
- librdkafka>=2.5.0,<2.6.0a0
378+
- spdlog>=1.14.1,<1.15
379+
depends_on_nvcomp:
380+
common:
381+
- output_types: conda
382+
packages:
370383
# Align nvcomp version with rapids-cmake
371384
- nvcomp==4.0.1
372-
- spdlog>=1.14.1,<1.15
385+
specific:
386+
- output_types: [requirements, pyproject]
387+
matrices:
388+
- matrix:
389+
cuda: "12.*"
390+
packages:
391+
- nvidia-nvcomp-cu12==4.0.1
392+
- matrix:
393+
cuda: "11.*"
394+
packages:
395+
- nvidia-nvcomp-cu11==4.0.1
396+
- matrix:
397+
packages:
398+
- nvidia-nvcomp==4.0.1
373399
rapids_build_skbuild:
374400
common:
375401
- output_types: [conda, requirements, pyproject]

python/libcudf/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ project(
2222
LANGUAGES CXX
2323
)
2424

25+
option(USE_NVCOMP_RUNTIME_WHEEL "Use the nvcomp wheel at runtime instead of the system library" OFF)
26+
2527
# Check if cudf is already available. If so, it is the user's responsibility to ensure that the
2628
# CMake package is also available at build time of the Python cudf package.
2729
find_package(cudf "${RAPIDS_VERSION}")
@@ -45,8 +47,11 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
4547

4648
add_subdirectory(../../cpp cudf-cpp)
4749

48-
# Ensure other libraries needed by libcudf.so get installed alongside it.
49-
include(cmake/Modules/WheelHelpers.cmake)
50-
install_aliased_imported_targets(
51-
TARGETS cudf nvcomp::nvcomp DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
52-
)
50+
if(USE_NVCOMP_RUNTIME_WHEEL)
51+
set(rpaths "$ORIGIN/../../nvidia/nvcomp")
52+
set_property(
53+
TARGET cudf
54+
PROPERTY INSTALL_RPATH ${rpaths}
55+
APPEND
56+
)
57+
endif()

python/libcudf/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ classifiers = [
3737
"Programming Language :: C++",
3838
"Environment :: GPU :: NVIDIA CUDA",
3939
]
40+
dependencies = [
41+
"nvidia-nvcomp==4.0.1",
42+
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
4043

4144
[project.urls]
4245
Homepage = "https://github.com/rapidsai/cudf"

0 commit comments

Comments
 (0)