From e645fb2367c372e6456bd835ad6b4a1d77e68fbb Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 4 Mar 2024 13:57:09 -0600 Subject: [PATCH 01/13] Only install compiled component in build_libraft.sh. --- conda/recipes/libraft/build_libraft.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conda/recipes/libraft/build_libraft.sh b/conda/recipes/libraft/build_libraft.sh index 7d4173e8bb..be072844c2 100644 --- a/conda/recipes/libraft/build_libraft.sh +++ b/conda/recipes/libraft/build_libraft.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. -./build.sh libraft --allgpuarch --compile-lib --build-metrics=compile_lib --incl-cache-stats --no-nvtx +./build.sh libraft --allgpuarch --compile-lib --build-metrics=compile_lib --incl-cache-stats --no-nvtx -n +cmake --install cpp/build --component compiled From 00b1d0ee259c010bc5ad8b2bc4961a95ddf31cdd Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 4 Mar 2024 14:06:12 -0600 Subject: [PATCH 02/13] Use component raft for header-only package. --- conda/recipes/libraft/build_libraft_headers.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conda/recipes/libraft/build_libraft_headers.sh b/conda/recipes/libraft/build_libraft_headers.sh index cc3b840e43..18c59276e5 100644 --- a/conda/recipes/libraft/build_libraft_headers.sh +++ b/conda/recipes/libraft/build_libraft_headers.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. -./build.sh libraft --allgpuarch --no-nvtx +./build.sh libraft --allgpuarch --no-nvtx -n +cmake --install cpp/build --component raft From c101777bbf47aaf1a1d815920c004cea1d2e1c95 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 5 Mar 2024 08:02:25 -0800 Subject: [PATCH 03/13] Add hnswlib component. --- conda/recipes/libraft/build_libraft_headers.sh | 1 + cpp/cmake/thirdparty/get_hnswlib.cmake | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/conda/recipes/libraft/build_libraft_headers.sh b/conda/recipes/libraft/build_libraft_headers.sh index 18c59276e5..beaf29b23f 100644 --- a/conda/recipes/libraft/build_libraft_headers.sh +++ b/conda/recipes/libraft/build_libraft_headers.sh @@ -2,4 +2,5 @@ # Copyright (c) 2022-2024, NVIDIA CORPORATION. ./build.sh libraft --allgpuarch --no-nvtx -n +cmake --install cpp/build --component hnswlib cmake --install cpp/build --component raft diff --git a/cpp/cmake/thirdparty/get_hnswlib.cmake b/cpp/cmake/thirdparty/get_hnswlib.cmake index 4d28e9a064..f66cd70f8c 100644 --- a/cpp/cmake/thirdparty/get_hnswlib.cmake +++ b/cpp/cmake/thirdparty/get_hnswlib.cmake @@ -47,7 +47,11 @@ function(find_and_configure_hnswlib) "$") if(NOT PKG_EXCLUDE_FROM_ALL) - install(TARGETS hnswlib EXPORT hnswlib-exports) + install( + TARGETS hnswlib + COMPONENT hnswlib + EXPORT hnswlib-exports + ) install(DIRECTORY "${hnswlib_SOURCE_DIR}/hnswlib/" DESTINATION include/hnswlib) # write install export rules From 2f18cec15f676bdd7743469e1ea7e98d04f5fd42 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Mar 2024 07:41:19 -0800 Subject: [PATCH 04/13] Also install hnswlib headers. --- cpp/cmake/thirdparty/get_hnswlib.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_hnswlib.cmake b/cpp/cmake/thirdparty/get_hnswlib.cmake index f66cd70f8c..ef337be8e3 100644 --- a/cpp/cmake/thirdparty/get_hnswlib.cmake +++ b/cpp/cmake/thirdparty/get_hnswlib.cmake @@ -52,7 +52,11 @@ function(find_and_configure_hnswlib) COMPONENT hnswlib EXPORT hnswlib-exports ) - install(DIRECTORY "${hnswlib_SOURCE_DIR}/hnswlib/" DESTINATION include/hnswlib) + install( + DIRECTORY "${hnswlib_SOURCE_DIR}/hnswlib/" + COMPONENT hnswlib + DESTINATION include/hnswlib + ) # write install export rules rapids_export( From 26bdafd75e250019fc1080d240cfc17515f2a4ba Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Mar 2024 07:44:47 -0800 Subject: [PATCH 05/13] Fix style. --- cpp/test/sparse/spmm.cu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/test/sparse/spmm.cu b/cpp/test/sparse/spmm.cu index 3ad9059d17..f53e857cd8 100644 --- a/cpp/test/sparse/spmm.cu +++ b/cpp/test/sparse/spmm.cu @@ -15,14 +15,17 @@ */ #include "../test_utils.cuh" -#include + #include #include #include #include #include + #include +#include + namespace raft { namespace sparse { namespace linalg { From 16bf75ead63077a8e5be440047def769151a7a1c Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 6 Mar 2024 11:35:56 -0500 Subject: [PATCH 06/13] Ensure users of libraft find the CCCL package provied by librmm --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 650bc1a059..cb81021200 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -179,8 +179,8 @@ rapids_cpm_init() if(NOT BUILD_CPU_ONLY) # CCCL before rmm/cuco so we get the right version of CCCL - include(cmake/thirdparty/get_cccl.cmake) include(cmake/thirdparty/get_rmm.cmake) + include(cmake/thirdparty/get_cccl.cmake) include(cmake/thirdparty/get_cutlass.cmake) include(${rapids-cmake-dir}/cpm/cuco.cmake) From cfda6acd2892fca189c961f3bab2f794f791013f Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 6 Mar 2024 11:36:16 -0500 Subject: [PATCH 07/13] Add debug lines --- cpp/template/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/template/build.sh b/cpp/template/build.sh index 3ac00fc9af..fa18336ea5 100755 --- a/cpp/template/build.sh +++ b/cpp/template/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # raft empty project template build script @@ -13,7 +13,7 @@ BUILD_TYPE=Release BUILD_DIR=build/ RAFT_REPO_REL="" -EXTRA_CMAKE_ARGS="" +EXTRA_CMAKE_ARGS="--trace" set -e From e08c6c3399667ba6786accc4b7b4afdb2a7f8ecd Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 6 Mar 2024 12:03:08 -0500 Subject: [PATCH 08/13] Revert "Ensure users of libraft find the CCCL package provied by librmm" This reverts commit 16bf75ead63077a8e5be440047def769151a7a1c. --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index cb81021200..650bc1a059 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -179,8 +179,8 @@ rapids_cpm_init() if(NOT BUILD_CPU_ONLY) # CCCL before rmm/cuco so we get the right version of CCCL - include(cmake/thirdparty/get_rmm.cmake) include(cmake/thirdparty/get_cccl.cmake) + include(cmake/thirdparty/get_rmm.cmake) include(cmake/thirdparty/get_cutlass.cmake) include(${rapids-cmake-dir}/cpm/cuco.cmake) From 411262b12d04eb01b30a687f67746247f7eaf775 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Mar 2024 09:22:53 -0800 Subject: [PATCH 09/13] Revert changes to build_libraft_headers.sh and hnswlib install rules. --- conda/recipes/libraft/build_libraft_headers.sh | 7 ++++--- cpp/cmake/thirdparty/get_hnswlib.cmake | 12 ++---------- cpp/template/build.sh | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/conda/recipes/libraft/build_libraft_headers.sh b/conda/recipes/libraft/build_libraft_headers.sh index beaf29b23f..84dd66411a 100644 --- a/conda/recipes/libraft/build_libraft_headers.sh +++ b/conda/recipes/libraft/build_libraft_headers.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2022-2024, NVIDIA CORPORATION. -./build.sh libraft --allgpuarch --no-nvtx -n -cmake --install cpp/build --component hnswlib -cmake --install cpp/build --component raft +# We must install everything (not just the "raft" component) because some +# dependencies like cuCollections and cutlass place their install rules in the +# "all" component. +./build.sh libraft --allgpuarch --no-nvtx diff --git a/cpp/cmake/thirdparty/get_hnswlib.cmake b/cpp/cmake/thirdparty/get_hnswlib.cmake index ef337be8e3..4d28e9a064 100644 --- a/cpp/cmake/thirdparty/get_hnswlib.cmake +++ b/cpp/cmake/thirdparty/get_hnswlib.cmake @@ -47,16 +47,8 @@ function(find_and_configure_hnswlib) "$") if(NOT PKG_EXCLUDE_FROM_ALL) - install( - TARGETS hnswlib - COMPONENT hnswlib - EXPORT hnswlib-exports - ) - install( - DIRECTORY "${hnswlib_SOURCE_DIR}/hnswlib/" - COMPONENT hnswlib - DESTINATION include/hnswlib - ) + install(TARGETS hnswlib EXPORT hnswlib-exports) + install(DIRECTORY "${hnswlib_SOURCE_DIR}/hnswlib/" DESTINATION include/hnswlib) # write install export rules rapids_export( diff --git a/cpp/template/build.sh b/cpp/template/build.sh index fa18336ea5..3ac00fc9af 100755 --- a/cpp/template/build.sh +++ b/cpp/template/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2023-2024, NVIDIA CORPORATION. +# Copyright (c) 2023, NVIDIA CORPORATION. # raft empty project template build script @@ -13,7 +13,7 @@ BUILD_TYPE=Release BUILD_DIR=build/ RAFT_REPO_REL="" -EXTRA_CMAKE_ARGS="--trace" +EXTRA_CMAKE_ARGS="" set -e From cff0977c1521f57a8191b2a52ec021e739276ce1 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Mar 2024 10:34:04 -0800 Subject: [PATCH 10/13] Use benchmark conda package instead of building it. --- conda/recipes/libraft/conda_build_config.yaml | 3 +++ conda/recipes/libraft/meta.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/conda/recipes/libraft/conda_build_config.yaml b/conda/recipes/libraft/conda_build_config.yaml index f1229281bb..9c39da4507 100644 --- a/conda/recipes/libraft/conda_build_config.yaml +++ b/conda/recipes/libraft/conda_build_config.yaml @@ -19,6 +19,9 @@ cmake_version: nccl_version: - ">=2.9.9" +gbench_version: + - "==1.8.0" + gtest_version: - ">=1.13.0" diff --git a/conda/recipes/libraft/meta.yaml b/conda/recipes/libraft/meta.yaml index 7fd1705b7b..4559173e2e 100644 --- a/conda/recipes/libraft/meta.yaml +++ b/conda/recipes/libraft/meta.yaml @@ -300,6 +300,7 @@ outputs: - libcusolver-dev - libcusparse-dev {% endif %} + - benchmark {{ gbench_version }} - gmock {{ gtest_version }} - gtest {{ gtest_version }} run: @@ -314,6 +315,7 @@ outputs: - libcusparse {% endif %} - {{ pin_subpackage('libraft', exact=True) }} + - benchmark {{ gbench_version }} - gmock {{ gtest_version }} - gtest {{ gtest_version }} about: From 49474daadacfcfd489259eb2aeac44ae85669ae5 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Mar 2024 10:43:40 -0800 Subject: [PATCH 11/13] Add --compile-lib. Without this flag, both the shared and static libraries are enabled. --- conda/recipes/libraft/build_libraft_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipes/libraft/build_libraft_tests.sh b/conda/recipes/libraft/build_libraft_tests.sh index 05a2b59eb0..774bf4502f 100644 --- a/conda/recipes/libraft/build_libraft_tests.sh +++ b/conda/recipes/libraft/build_libraft_tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash # Copyright (c) 2022-2023, NVIDIA CORPORATION. -./build.sh tests bench-prims --allgpuarch --no-nvtx --build-metrics=tests_bench_prims --incl-cache-stats +./build.sh tests bench-prims --allgpuarch --compile-lib --no-nvtx --build-metrics=tests_bench_prims --incl-cache-stats cmake --install cpp/build --component testing From ae9e5b12f112b350b14009b3bd0f9f9fdadba9c6 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Mar 2024 10:50:04 -0800 Subject: [PATCH 12/13] Fix copyright. --- conda/recipes/libraft/build_libraft_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipes/libraft/build_libraft_tests.sh b/conda/recipes/libraft/build_libraft_tests.sh index 774bf4502f..6f68a50f91 100644 --- a/conda/recipes/libraft/build_libraft_tests.sh +++ b/conda/recipes/libraft/build_libraft_tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. ./build.sh tests bench-prims --allgpuarch --compile-lib --no-nvtx --build-metrics=tests_bench_prims --incl-cache-stats cmake --install cpp/build --component testing From baed39a23fa92910e8b3de7de6ab3b58ac6d5820 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Mar 2024 14:38:50 -0800 Subject: [PATCH 13/13] Try building tests with a host dependency on libraft-static. --- conda/recipes/libraft/build_libraft_tests.sh | 2 +- conda/recipes/libraft/meta.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conda/recipes/libraft/build_libraft_tests.sh b/conda/recipes/libraft/build_libraft_tests.sh index 6f68a50f91..799d16ed75 100644 --- a/conda/recipes/libraft/build_libraft_tests.sh +++ b/conda/recipes/libraft/build_libraft_tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash # Copyright (c) 2022-2024, NVIDIA CORPORATION. -./build.sh tests bench-prims --allgpuarch --compile-lib --no-nvtx --build-metrics=tests_bench_prims --incl-cache-stats +./build.sh tests bench-prims --allgpuarch --no-nvtx --build-metrics=tests_bench_prims --incl-cache-stats cmake --install cpp/build --component testing diff --git a/conda/recipes/libraft/meta.yaml b/conda/recipes/libraft/meta.yaml index 4559173e2e..55f326dc53 100644 --- a/conda/recipes/libraft/meta.yaml +++ b/conda/recipes/libraft/meta.yaml @@ -280,7 +280,11 @@ outputs: - ninja - sysroot_{{ target_platform }} {{ sysroot_version }} host: + # We must include both libraft and libraft-static to prevent the test + # builds from packaging those libraries. However, tests only depend on + # the shared library in libraft. - {{ pin_subpackage('libraft', exact=True) }} + - {{ pin_subpackage('libraft-static', exact=True) }} - cuda-version ={{ cuda_version }} {% if cuda_major == "11" %} - cuda-profiler-api {{ cuda11_cuda_profiler_api_run_version }}