From 31c2b94427a447bf3b4d708d8d3bf08d430042b1 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Mon, 4 Nov 2024 13:28:19 +0100 Subject: [PATCH 1/9] auditwheel: --exclude libkvikio.so --- ci/build_wheel_cudf.sh | 1 + ci/build_wheel_libcudf.sh | 1 + ci/build_wheel_pylibcudf.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/ci/build_wheel_cudf.sh b/ci/build_wheel_cudf.sh index fef4416a366..ae4eb0d5c66 100755 --- a/ci/build_wheel_cudf.sh +++ b/ci/build_wheel_cudf.sh @@ -23,6 +23,7 @@ export PIP_CONSTRAINT="/tmp/constraints.txt" python -m auditwheel repair \ --exclude libcudf.so \ --exclude libnvcomp.so \ + --exclude libkvikio.so \ -w ${package_dir}/final_dist \ ${package_dir}/dist/* diff --git a/ci/build_wheel_libcudf.sh b/ci/build_wheel_libcudf.sh index b3d6778ea04..aabd3814a24 100755 --- a/ci/build_wheel_libcudf.sh +++ b/ci/build_wheel_libcudf.sh @@ -33,6 +33,7 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" mkdir -p ${package_dir}/final_dist python -m auditwheel repair \ --exclude libnvcomp.so.4 \ + --exclude libkvikio.so \ -w ${package_dir}/final_dist \ ${package_dir}/dist/* diff --git a/ci/build_wheel_pylibcudf.sh b/ci/build_wheel_pylibcudf.sh index 839d98846fe..c4a89f20f5f 100755 --- a/ci/build_wheel_pylibcudf.sh +++ b/ci/build_wheel_pylibcudf.sh @@ -21,6 +21,7 @@ export PIP_CONSTRAINT="/tmp/constraints.txt" python -m auditwheel repair \ --exclude libcudf.so \ --exclude libnvcomp.so \ + --exclude libkvikio.so \ -w ${package_dir}/final_dist \ ${package_dir}/dist/* From af71f88144f3c39273812c8c64c8db8787eb5bd5 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Mon, 4 Nov 2024 13:30:14 +0100 Subject: [PATCH 2/9] USE_LIBKVIKIO_RUNTIME_WHEEL --- ci/build_wheel_libcudf.sh | 2 +- python/libcudf/CMakeLists.txt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ci/build_wheel_libcudf.sh b/ci/build_wheel_libcudf.sh index aabd3814a24..a96f2971a96 100755 --- a/ci/build_wheel_libcudf.sh +++ b/ci/build_wheel_libcudf.sh @@ -25,7 +25,7 @@ python -m pip install \ # 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) export PIP_NO_BUILD_ISOLATION=0 -export SKBUILD_CMAKE_ARGS="-DUSE_NVCOMP_RUNTIME_WHEEL=ON" +export SKBUILD_CMAKE_ARGS="-DUSE_NVCOMP_RUNTIME_WHEEL=ON;-DUSE_LIBKVIKIO_RUNTIME_WHEEL=ON" ./ci/build_wheel.sh "${package_name}" "${package_dir}" RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" diff --git a/python/libcudf/CMakeLists.txt b/python/libcudf/CMakeLists.txt index 5f9a04d3cee..bedc3dafcab 100644 --- a/python/libcudf/CMakeLists.txt +++ b/python/libcudf/CMakeLists.txt @@ -23,6 +23,9 @@ project( ) option(USE_NVCOMP_RUNTIME_WHEEL "Use the nvcomp wheel at runtime instead of the system library" OFF) +option(USE_LIBKVIKIO_RUNTIME_WHEEL + "Use the libkvikio wheel at runtime instead of the system library" OFF +) # Check if cudf is already available. If so, it is the user's responsibility to ensure that the # CMake package is also available at build time of the Python cudf package. @@ -58,3 +61,12 @@ if(USE_NVCOMP_RUNTIME_WHEEL) APPEND ) endif() + +if(USE_LIBKVIKIO_RUNTIME_WHEEL) + set(rpaths "$ORIGIN/../../libkvikio/lib64") + set_property( + TARGET cudf + PROPERTY INSTALL_RPATH ${rpaths} + APPEND + ) +endif() From 6b3c996679e6ad8dceceb51da2ab4fe2c58cb331 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Mon, 4 Nov 2024 13:30:37 +0100 Subject: [PATCH 3/9] depends_on_libkvikio --- dependencies.yaml | 1 + python/libcudf/pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/dependencies.yaml b/dependencies.yaml index 90255ca674c..a92f7258f4b 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -178,6 +178,7 @@ files: table: project includes: - depends_on_nvcomp + - depends_on_libkvikio py_build_pylibcudf: output: pyproject pyproject_dir: python/pylibcudf diff --git a/python/libcudf/pyproject.toml b/python/libcudf/pyproject.toml index c6d9ae56467..62726bb0df4 100644 --- a/python/libcudf/pyproject.toml +++ b/python/libcudf/pyproject.toml @@ -38,6 +38,7 @@ classifiers = [ "Environment :: GPU :: NVIDIA CUDA", ] dependencies = [ + "libkvikio==24.12.*,>=0.0.0a0", "nvidia-nvcomp==4.1.0.6", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. From 2d8eeafe4959357a17f6ad488811837e0a07ba65 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Mon, 4 Nov 2024 13:31:09 +0100 Subject: [PATCH 4/9] Download wheel from Revert before PR merge --- ci/build_wheel_libcudf.sh | 7 +++++++ ci/cudf_pandas_scripts/pandas-tests/run.sh | 8 ++++++++ ci/cudf_pandas_scripts/run_tests.sh | 7 +++++++ ci/test_wheel_cudf.sh | 7 +++++++ ci/test_wheel_cudf_polars.sh | 7 +++++++ ci/test_wheel_dask_cudf.sh | 7 +++++++ 6 files changed, 43 insertions(+) diff --git a/ci/build_wheel_libcudf.sh b/ci/build_wheel_libcudf.sh index a96f2971a96..c010eb40ded 100755 --- a/ci/build_wheel_libcudf.sh +++ b/ci/build_wheel_libcudf.sh @@ -15,6 +15,13 @@ rapids-dependency-file-generator \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" \ | tee /tmp/requirements-build.txt + +# Download wheel from +LIBKVIKIO_CHANNEL=$( + RAPIDS_PY_WHEEL_NAME=libkvikio_cu12 rapids-get-pr-wheel-artifact kvikio 527 cpp +) +echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt + rapids-logger "Installing build requirements" python -m pip install \ -v \ diff --git a/ci/cudf_pandas_scripts/pandas-tests/run.sh b/ci/cudf_pandas_scripts/pandas-tests/run.sh index e5cd4436a3a..639a873193e 100755 --- a/ci/cudf_pandas_scripts/pandas-tests/run.sh +++ b/ci/cudf_pandas_scripts/pandas-tests/run.sh @@ -17,8 +17,16 @@ RAPIDS_PY_WHEEL_NAME="cudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from RAPIDS_PY_WHEEL_NAME="libcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp ./dist RAPIDS_PY_WHEEL_NAME="pylibcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist +# Download wheel from +LIBKVIKIO_CHANNEL=$( +RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? +) +echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt + # echo to expand wildcard before adding `[extra]` requires for pip python -m pip install \ + -v \ + -r /tmp/requirements-build.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test,pandas-tests]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ "$(echo ./dist/pylibcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" diff --git a/ci/cudf_pandas_scripts/run_tests.sh b/ci/cudf_pandas_scripts/run_tests.sh index 61361fffb07..37089815410 100755 --- a/ci/cudf_pandas_scripts/run_tests.sh +++ b/ci/cudf_pandas_scripts/run_tests.sh @@ -57,8 +57,15 @@ else # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints test_python_cudf_pandas ./constraints.txt + # Download wheel from + LIBKVIKIO_CHANNEL=$( + RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? + ) + echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt + python -m pip install \ -v \ + -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test,cudf-pandas-tests]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ diff --git a/ci/test_wheel_cudf.sh b/ci/test_wheel_cudf.sh index ce12744c9e3..ac5acf9089d 100755 --- a/ci/test_wheel_cudf.sh +++ b/ci/test_wheel_cudf.sh @@ -15,9 +15,16 @@ rapids-logger "Install cudf, pylibcudf, and test requirements" # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints py_test_cudf ./constraints.txt +# Download wheel from +LIBKVIKIO_CHANNEL=$( + RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? +) +echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt + # echo to expand wildcard before adding `[extra]` requires for pip python -m pip install \ -v \ + -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ diff --git a/ci/test_wheel_cudf_polars.sh b/ci/test_wheel_cudf_polars.sh index 2884757e46b..340c29eae4c 100755 --- a/ci/test_wheel_cudf_polars.sh +++ b/ci/test_wheel_cudf_polars.sh @@ -33,9 +33,16 @@ rapids-logger "Installing cudf_polars and its dependencies" # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints py_test_cudf_polars ./constraints.txt +# Download wheel from +LIBKVIKIO_CHANNEL=$( + RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? +) +echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt + # echo to expand wildcard before adding `[test]` requires for pip python -m pip install \ -v \ + -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_polars_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ diff --git a/ci/test_wheel_dask_cudf.sh b/ci/test_wheel_dask_cudf.sh index e15949f4bdb..93c8262fc32 100755 --- a/ci/test_wheel_dask_cudf.sh +++ b/ci/test_wheel_dask_cudf.sh @@ -16,9 +16,16 @@ rapids-logger "Install dask_cudf, cudf, pylibcudf, and test requirements" # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints py_test_dask_cudf ./constraints.txt +# Download wheel from +LIBKVIKIO_CHANNEL=$( +RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? +) +echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt + # echo to expand wildcard before adding `[extra]` requires for pip python -m pip install \ -v \ + -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ "$(echo ./dist/dask_cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ From 13afeaf179aa91105b7de1fe16eeb6f20f2b6fb5 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Mon, 4 Nov 2024 21:55:33 +0100 Subject: [PATCH 5/9] Sort alphabetically Co-authored-by: Bradley Dice --- dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index a92f7258f4b..040ce9a984c 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -177,8 +177,8 @@ files: extras: table: project includes: - - depends_on_nvcomp - depends_on_libkvikio + - depends_on_nvcomp py_build_pylibcudf: output: pyproject pyproject_dir: python/pylibcudf From dc8d22bdafb1836a593256416f577e8176850ae7 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 4 Nov 2024 22:05:11 +0000 Subject: [PATCH 6/9] Search for kvikio with lowercase --- cpp/cmake/thirdparty/get_kvikio.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/thirdparty/get_kvikio.cmake b/cpp/cmake/thirdparty/get_kvikio.cmake index 20712beec41..c949f48505e 100644 --- a/cpp/cmake/thirdparty/get_kvikio.cmake +++ b/cpp/cmake/thirdparty/get_kvikio.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -16,7 +16,7 @@ function(find_and_configure_kvikio VERSION) rapids_cpm_find( - KvikIO ${VERSION} + kvikio ${VERSION} GLOBAL_TARGETS kvikio::kvikio CPM_ARGS GIT_REPOSITORY https://github.com/rapidsai/kvikio.git From c0461feaf244df1b5e6b78f6b26499bea1a4e1d6 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Wed, 6 Nov 2024 08:07:36 +0100 Subject: [PATCH 7/9] Revert "Download wheel from " This reverts commit 2d8eeafe4959357a17f6ad488811837e0a07ba65. --- ci/build_wheel_libcudf.sh | 7 ------- ci/cudf_pandas_scripts/pandas-tests/run.sh | 8 -------- ci/cudf_pandas_scripts/run_tests.sh | 7 ------- ci/test_wheel_cudf.sh | 7 ------- ci/test_wheel_cudf_polars.sh | 7 ------- ci/test_wheel_dask_cudf.sh | 7 ------- 6 files changed, 43 deletions(-) diff --git a/ci/build_wheel_libcudf.sh b/ci/build_wheel_libcudf.sh index c010eb40ded..a96f2971a96 100755 --- a/ci/build_wheel_libcudf.sh +++ b/ci/build_wheel_libcudf.sh @@ -15,13 +15,6 @@ rapids-dependency-file-generator \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" \ | tee /tmp/requirements-build.txt - -# Download wheel from -LIBKVIKIO_CHANNEL=$( - RAPIDS_PY_WHEEL_NAME=libkvikio_cu12 rapids-get-pr-wheel-artifact kvikio 527 cpp -) -echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt - rapids-logger "Installing build requirements" python -m pip install \ -v \ diff --git a/ci/cudf_pandas_scripts/pandas-tests/run.sh b/ci/cudf_pandas_scripts/pandas-tests/run.sh index 639a873193e..e5cd4436a3a 100755 --- a/ci/cudf_pandas_scripts/pandas-tests/run.sh +++ b/ci/cudf_pandas_scripts/pandas-tests/run.sh @@ -17,16 +17,8 @@ RAPIDS_PY_WHEEL_NAME="cudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from RAPIDS_PY_WHEEL_NAME="libcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp ./dist RAPIDS_PY_WHEEL_NAME="pylibcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist -# Download wheel from -LIBKVIKIO_CHANNEL=$( -RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? -) -echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt - # echo to expand wildcard before adding `[extra]` requires for pip python -m pip install \ - -v \ - -r /tmp/requirements-build.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test,pandas-tests]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ "$(echo ./dist/pylibcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" diff --git a/ci/cudf_pandas_scripts/run_tests.sh b/ci/cudf_pandas_scripts/run_tests.sh index 37089815410..61361fffb07 100755 --- a/ci/cudf_pandas_scripts/run_tests.sh +++ b/ci/cudf_pandas_scripts/run_tests.sh @@ -57,15 +57,8 @@ else # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints test_python_cudf_pandas ./constraints.txt - # Download wheel from - LIBKVIKIO_CHANNEL=$( - RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? - ) - echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt - python -m pip install \ -v \ - -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test,cudf-pandas-tests]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ diff --git a/ci/test_wheel_cudf.sh b/ci/test_wheel_cudf.sh index ac5acf9089d..ce12744c9e3 100755 --- a/ci/test_wheel_cudf.sh +++ b/ci/test_wheel_cudf.sh @@ -15,16 +15,9 @@ rapids-logger "Install cudf, pylibcudf, and test requirements" # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints py_test_cudf ./constraints.txt -# Download wheel from -LIBKVIKIO_CHANNEL=$( - RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? -) -echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt - # echo to expand wildcard before adding `[extra]` requires for pip python -m pip install \ -v \ - -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ diff --git a/ci/test_wheel_cudf_polars.sh b/ci/test_wheel_cudf_polars.sh index 340c29eae4c..2884757e46b 100755 --- a/ci/test_wheel_cudf_polars.sh +++ b/ci/test_wheel_cudf_polars.sh @@ -33,16 +33,9 @@ rapids-logger "Installing cudf_polars and its dependencies" # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints py_test_cudf_polars ./constraints.txt -# Download wheel from -LIBKVIKIO_CHANNEL=$( - RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? -) -echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt - # echo to expand wildcard before adding `[test]` requires for pip python -m pip install \ -v \ - -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_polars_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ "$(echo ./dist/libcudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ diff --git a/ci/test_wheel_dask_cudf.sh b/ci/test_wheel_dask_cudf.sh index 93c8262fc32..e15949f4bdb 100755 --- a/ci/test_wheel_dask_cudf.sh +++ b/ci/test_wheel_dask_cudf.sh @@ -16,16 +16,9 @@ rapids-logger "Install dask_cudf, cudf, pylibcudf, and test requirements" # generate constraints (possibly pinning to oldest support versions of dependencies) rapids-generate-pip-constraints py_test_dask_cudf ./constraints.txt -# Download wheel from -LIBKVIKIO_CHANNEL=$( -RAPIDS_PY_WHEEL_NAME=libkvikio_${RAPIDS_PY_CUDA_SUFFIX} rapids-get-pr-wheel-artifact kvikio 527 cpp # also python? -) -echo ${LIBKVIKIO_CHANNEL}/libkvikio_*.whl >> /tmp/requirements-build.txt - # echo to expand wildcard before adding `[extra]` requires for pip python -m pip install \ -v \ - -r /tmp/requirements-build.txt \ --constraint ./constraints.txt \ "$(echo ./dist/cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ "$(echo ./dist/dask_cudf_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ From ba6799b2e1f41a2175bec7b9c354679afeb22190 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 6 Nov 2024 22:43:13 +0000 Subject: [PATCH 8/9] Switch to a runtime load of kvikio --- ci/build_wheel_libcudf.sh | 2 +- python/libcudf/CMakeLists.txt | 12 ------------ python/libcudf/libcudf/load.py | 5 +++++ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ci/build_wheel_libcudf.sh b/ci/build_wheel_libcudf.sh index a96f2971a96..aabd3814a24 100755 --- a/ci/build_wheel_libcudf.sh +++ b/ci/build_wheel_libcudf.sh @@ -25,7 +25,7 @@ python -m pip install \ # 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) export PIP_NO_BUILD_ISOLATION=0 -export SKBUILD_CMAKE_ARGS="-DUSE_NVCOMP_RUNTIME_WHEEL=ON;-DUSE_LIBKVIKIO_RUNTIME_WHEEL=ON" +export SKBUILD_CMAKE_ARGS="-DUSE_NVCOMP_RUNTIME_WHEEL=ON" ./ci/build_wheel.sh "${package_name}" "${package_dir}" RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" diff --git a/python/libcudf/CMakeLists.txt b/python/libcudf/CMakeLists.txt index bedc3dafcab..5f9a04d3cee 100644 --- a/python/libcudf/CMakeLists.txt +++ b/python/libcudf/CMakeLists.txt @@ -23,9 +23,6 @@ project( ) option(USE_NVCOMP_RUNTIME_WHEEL "Use the nvcomp wheel at runtime instead of the system library" OFF) -option(USE_LIBKVIKIO_RUNTIME_WHEEL - "Use the libkvikio wheel at runtime instead of the system library" OFF -) # Check if cudf is already available. If so, it is the user's responsibility to ensure that the # CMake package is also available at build time of the Python cudf package. @@ -61,12 +58,3 @@ if(USE_NVCOMP_RUNTIME_WHEEL) APPEND ) endif() - -if(USE_LIBKVIKIO_RUNTIME_WHEEL) - set(rpaths "$ORIGIN/../../libkvikio/lib64") - set_property( - TARGET cudf - PROPERTY INSTALL_RPATH ${rpaths} - APPEND - ) -endif() diff --git a/python/libcudf/libcudf/load.py b/python/libcudf/libcudf/load.py index ba134710868..7bac1658093 100644 --- a/python/libcudf/libcudf/load.py +++ b/python/libcudf/libcudf/load.py @@ -16,8 +16,13 @@ import ctypes import os +import libkvikio + def load_library(): + # libkvikio must be loaded before libcudf + libkvikio.load_library() + # Dynamically load libcudf.so. Prefer a system library if one is present to # avoid clobbering symbols that other packages might expect, but if no # other library is present use the one in the wheel. From 58ca4f922b6dd96e02dfd56567989deb65a15ba7 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 6 Nov 2024 15:24:53 -0800 Subject: [PATCH 9/9] Fix conda devcontainer case --- python/libcudf/libcudf/load.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/python/libcudf/libcudf/load.py b/python/libcudf/libcudf/load.py index 7bac1658093..bf27ecfa7f5 100644 --- a/python/libcudf/libcudf/load.py +++ b/python/libcudf/libcudf/load.py @@ -16,12 +16,18 @@ import ctypes import os -import libkvikio - def load_library(): - # libkvikio must be loaded before libcudf - libkvikio.load_library() + try: + # libkvikio must be loaded before libcudf because libcudf references its symbols + import libkvikio + + libkvikio.load_library() + except ModuleNotFoundError: + # libcudf's runtime dependency on libkvikio may be satisfied by a natively + # installed library or a conda package, in which case the import will fail and + # we assume the library is discoverable on system paths. + pass # Dynamically load libcudf.so. Prefer a system library if one is present to # avoid clobbering symbols that other packages might expect, but if no