From 31c931ba180a8bd282f719d438e64c7611413191 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 15:48:11 -0500 Subject: [PATCH 01/65] add option to build faiss and treelite shared libs --- cpp/CMakeLists.txt | 6 ++++-- cpp/cmake/thirdparty/get_faiss.cmake | 13 ++++++++++--- cpp/cmake/thirdparty/get_raft.cmake | 4 +++- cpp/cmake/thirdparty/get_treelite.cmake | 10 ++++++---- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index dbbd58ca09..76f469d843 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -63,6 +63,8 @@ option(ENABLE_CUMLPRIMS_MG "Enable algorithms that use libcumlprims_mg" ON) option(NVTX "Enable nvtx markers" OFF) option(SINGLEGPU "Disable all mnmg components and comms libraries" OFF) option(USE_CCACHE "Cache build artifacts with ccache" OFF) +option(CUML_USE_FAISS_STATIC "Build and statically link the FAISS library for nearest neighbors search on GPU" ON) +option(CUML_USE_TREELITE_STATIC "Build and statically link the treelite library" ON) set(CUML_CPP_ALGORITHMS "ALL" CACHE STRING "Experimental: Choose which algorithms are built into libcuml++.so. Only 'FIL' and 'ALL' are supported right now.") set_property(CACHE CUML_CPP_ALGORITHMS PROPERTY STRINGS "ALL" "FIL") @@ -385,8 +387,8 @@ if(BUILD_CUML_CPP_LIBRARY) CUDA::cusparse $<$:CUDA::nvToolsExt> $<$:FAISS::FAISS> - $,treelite::treelite_static,treelite::treelite> - $,treelite::treelite_runtime_static,treelite::treelite_runtime> + $,treelite::treelite_static,treelite::treelite> + $,treelite::treelite_runtime_static,treelite::treelite_runtime> $<$:OpenMP::OpenMP_CXX> $<$,$>:NCCL::NCCL> $<$:${MPI_CXX_LIBRARIES}> diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 8a88f9694e..758bfc5540 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -15,7 +15,7 @@ #============================================================================= function(find_and_configure_faiss) - set(oneValueArgs VERSION PINNED_TAG) + set(oneValueArgs VERSION PINNED_TAG BUILD_STATIC_LIBS) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) @@ -24,14 +24,20 @@ function(find_and_configure_faiss) LIBRARY_NAMES faiss ) + set(BUILD_SHARED_LIBS OFF) + if (NOT BUILD_STATIC_LIBS) + set(BUILD_SHARED_LIBS ON) + endif() + rapids_cpm_find(FAISS ${PKG_VERSION} - GLOBAL_TARGETS faiss + GLOBAL_TARGETS faiss + BUILD_EXPORT_SET cuml-exports CPM_ARGS GIT_REPOSITORY https://github.com/facebookresearch/faiss.git GIT_TAG ${PKG_PINNED_TAG} OPTIONS "FAISS_ENABLE_PYTHON OFF" - "BUILD_SHARED_LIBS OFF" + "BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}" "CUDAToolkit_ROOT ${CUDAToolkit_LIBRARY_DIR}" "FAISS_ENABLE_GPU ON" "BUILD_TESTING OFF" @@ -50,4 +56,5 @@ endfunction() find_and_configure_faiss(VERSION 1.7.0 PINNED_TAG bde7c0027191f29c9dadafe4f6e68ca0ee31fb30 + BUILD_STATIC_LIBS ${CUML_USE_FAISS_STATIC} ) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 50845ec4b8..ff08e9aa89 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -16,7 +16,7 @@ function(find_and_configure_raft) - set(oneValueArgs VERSION FORK PINNED_TAG) + set(oneValueArgs VERSION FORK PINNED_TAG USE_FAISS_STATIC) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) @@ -35,6 +35,7 @@ function(find_and_configure_raft) SOURCE_SUBDIR cpp OPTIONS "BUILD_TESTS OFF" + "RAFT_USE_FAISS_STATIC ${USE_FAISS_STATIC}" ) if(raft_ADDED) @@ -58,4 +59,5 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} FORK rapidsai PINNED_TAG branch-${CUML_BRANCH_VERSION_raft} + USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 171706ea20..c7b7e7e0ae 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -16,18 +16,19 @@ function(find_and_configure_treelite) - set(oneValueArgs VERSION PINNED_TAG) + set(oneValueArgs VERSION PINNED_TAG BUILD_STATIC_LIBS) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) rapids_cpm_find(Treelite ${PKG_VERSION} - GLOBAL_TARGETS treelite::treelite treelite + GLOBAL_TARGETS treelite::treelite treelite + BUILD_EXPORT_SET cuml-exports CPM_ARGS GIT_REPOSITORY https://github.com/dmlc/treelite.git GIT_TAG ${PKG_PINNED_TAG} OPTIONS "USE_OPENMP ON" - "BUILD_STATIC_LIBS ON" + "BUILD_STATIC_LIBS ${BUILD_STATIC_LIBS}" ) set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) @@ -55,4 +56,5 @@ function(find_and_configure_treelite) endfunction() find_and_configure_treelite(VERSION 2.1.0 - PINNED_TAG e5248931c62e3807248e0b150e27b2530a510634) + PINNED_TAG e5248931c62e3807248e0b150e27b2530a510634 + BUILD_STATIC_LIBS ${CUML_USE_TREELITE_STATIC}) From 1254657f09b6d1b0877d2701ebc831ab29b085e9 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 16:18:20 -0500 Subject: [PATCH 02/65] simplify treelite targets linkage --- cpp/CMakeLists.txt | 3 +-- cpp/bench/CMakeLists.txt | 6 ++---- cpp/cmake/thirdparty/get_treelite.cmake | 8 ++++++++ cpp/test/CMakeLists.txt | 3 +-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 76f469d843..2f5d6b5515 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -385,10 +385,9 @@ if(BUILD_CUML_CPP_LIBRARY) CUDA::cusolver CUDA::cudart CUDA::cusparse + ${TREELITE_LIBS} $<$:CUDA::nvToolsExt> $<$:FAISS::FAISS> - $,treelite::treelite_static,treelite::treelite> - $,treelite::treelite_runtime_static,treelite::treelite_runtime> $<$:OpenMP::OpenMP_CXX> $<$,$>:NCCL::NCCL> $<$:${MPI_CXX_LIBRARIES}> diff --git a/cpp/bench/CMakeLists.txt b/cpp/bench/CMakeLists.txt index 95527d7db6..8c28ec91d8 100644 --- a/cpp/bench/CMakeLists.txt +++ b/cpp/bench/CMakeLists.txt @@ -45,8 +45,7 @@ if(BUILD_CUML_BENCH) cuml::${CUML_CPP_TARGET} benchmark::benchmark raft::raft - $,treelite::treelite_static,treelite::treelite> - $,treelite::treelite_runtime_static,treelite::treelite_runtime> + ${${TREELITE_LIBS}} ) target_include_directories(${CUML_CPP_BENCH_TARGET} @@ -87,8 +86,7 @@ if(BUILD_CUML_PRIMS_BENCH) CUDA::cublas benchmark::benchmark raft::raft - $,treelite::treelite_static,treelite::treelite> - $,treelite::treelite_runtime_static,treelite::treelite_runtime> + ${TREELITE_LIBS} ) target_include_directories(${PRIMS_BENCH_TARGET} diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index c7b7e7e0ae..1b4f9b15ee 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -53,6 +53,14 @@ function(find_and_configure_treelite) endif() endif() + if (Treelite_ADDED AND BUILD_STATIC_LIBS) + list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) + else() + list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) + endif() + + set(TREELITE_LIBS ${TREELITE_LIBS} PARENT_SCOPE) + endfunction() find_and_configure_treelite(VERSION 2.1.0 diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 6823d6d6e7..53b00d6c16 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -28,8 +28,7 @@ set(COMMON_TEST_LINK_LIBRARIES GTest::gtest_main OpenMP::OpenMP_CXX Threads::Threads - $,treelite::treelite_static,treelite::treelite> - $,treelite::treelite_runtime_static,treelite::treelite_runtime> + ${TREELITE_LIBS} $ ) From 0a4a0066c515f1e15ddcb5617bfb075bc9154c85 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 16:25:26 -0500 Subject: [PATCH 03/65] add FAISS::FAISS to the list of global targets --- cpp/cmake/thirdparty/get_faiss.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 758bfc5540..47da6ea82c 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -30,7 +30,7 @@ function(find_and_configure_faiss) endif() rapids_cpm_find(FAISS ${PKG_VERSION} - GLOBAL_TARGETS faiss + GLOBAL_TARGETS faiss FAISS::FAISS BUILD_EXPORT_SET cuml-exports CPM_ARGS GIT_REPOSITORY https://github.com/facebookresearch/faiss.git From 7ce8aadea0cd97e852f21faa4823bcf4cbb4c5e6 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 17:17:59 -0500 Subject: [PATCH 04/65] fix typo --- cpp/bench/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/bench/CMakeLists.txt b/cpp/bench/CMakeLists.txt index 8c28ec91d8..c480462e1f 100644 --- a/cpp/bench/CMakeLists.txt +++ b/cpp/bench/CMakeLists.txt @@ -45,7 +45,7 @@ if(BUILD_CUML_BENCH) cuml::${CUML_CPP_TARGET} benchmark::benchmark raft::raft - ${${TREELITE_LIBS}} + ${TREELITE_LIBS} ) target_include_directories(${CUML_CPP_BENCH_TARGET} From b690f0777daa07d2d0a54a45dc503be3e075fa9b Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 17:26:56 -0500 Subject: [PATCH 05/65] point to my raft fork --- cpp/cmake/thirdparty/get_raft.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index ff08e9aa89..4acc1e4bc1 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -57,7 +57,7 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") # To use a different RAFT locally, set the CMake variable # CPM_raft_SOURCE=/path/to/local/raft find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} - FORK rapidsai - PINNED_TAG branch-${CUML_BRANCH_VERSION_raft} + FORK trxcllnt + PINNED_TAG fix/node-rapids-21.10 USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) From 4502850e1063cd8490391cdb181a375875754f80 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 18:28:32 -0500 Subject: [PATCH 06/65] create a faiss-exports export-set --- cpp/cmake/thirdparty/get_faiss.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 47da6ea82c..04a6e59076 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -46,6 +46,11 @@ function(find_and_configure_faiss) if(FAISS_ADDED) target_include_directories(faiss INTERFACE $) + rapids_export(BUILD faiss + EXPORT_SET faiss-exports + GLOBAL_TARGETS faiss + NAMESPACE cuml:: + ) endif() if(TARGET faiss AND NOT TARGET FAISS::FAISS) From 6435a6d676b84ae1e55d62c2b53986457861b42b Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 18:32:50 -0500 Subject: [PATCH 07/65] mark faiss to be found as part of resolving cuml-exports dependencies --- cpp/cmake/thirdparty/get_faiss.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 04a6e59076..34e7b09cf3 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -57,6 +57,8 @@ function(find_and_configure_faiss) add_library(FAISS::FAISS ALIAS faiss) endif() + rapids_export_package(BUILD faiss cuml-exports) + endfunction() find_and_configure_faiss(VERSION 1.7.0 From 77b596d38abc487a255eb84d61fafd803d479f44 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 18:44:57 -0500 Subject: [PATCH 08/65] create faiss-exports export set --- cpp/cmake/thirdparty/get_faiss.cmake | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 34e7b09cf3..53c413f1e4 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -46,19 +46,18 @@ function(find_and_configure_faiss) if(FAISS_ADDED) target_include_directories(faiss INTERFACE $) - rapids_export(BUILD faiss - EXPORT_SET faiss-exports - GLOBAL_TARGETS faiss - NAMESPACE cuml:: - ) + install(TARGETS faiss EXPORT faiss-exports) + rapids_export(BUILD faiss + EXPORT_SET faiss-exports + GLOBAL_TARGETS faiss + NAMESPACE cuml:: + LANGUAGES CUDA) endif() if(TARGET faiss AND NOT TARGET FAISS::FAISS) add_library(FAISS::FAISS ALIAS faiss) endif() - rapids_export_package(BUILD faiss cuml-exports) - endfunction() find_and_configure_faiss(VERSION 1.7.0 From 97072be529bfbc0f0dc0f9019c3f56ec5d4b28c1 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 18:44:57 -0500 Subject: [PATCH 09/65] create faiss-exports export set --- cpp/cmake/thirdparty/get_faiss.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 47da6ea82c..53c413f1e4 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -46,6 +46,12 @@ function(find_and_configure_faiss) if(FAISS_ADDED) target_include_directories(faiss INTERFACE $) + install(TARGETS faiss EXPORT faiss-exports) + rapids_export(BUILD faiss + EXPORT_SET faiss-exports + GLOBAL_TARGETS faiss + NAMESPACE cuml:: + LANGUAGES CUDA) endif() if(TARGET faiss AND NOT TARGET FAISS::FAISS) From d0393a0fc1ce9b16efe3dd710f7b7cf7a8c96fa8 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 18:53:03 -0500 Subject: [PATCH 10/65] add a build export-set to go alongside the existing TreeliteTargets install export-set --- cpp/cmake/thirdparty/get_treelite.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 1b4f9b15ee..57835ef005 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -51,6 +51,8 @@ function(find_and_configure_treelite) add_library(treelite::treelite_static ALIAS treelite_static) add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) endif() + + rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) endif() if (Treelite_ADDED AND BUILD_STATIC_LIBS) From 73add8391c8d6ee1e2ece610638c7d3c2e342f3a Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:06:18 -0500 Subject: [PATCH 11/65] modify and export the correct shared or static treelite targets --- cpp/cmake/thirdparty/get_treelite.cmake | 56 ++++++++++++++----------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 57835ef005..14964d799f 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -34,31 +34,39 @@ function(find_and_configure_treelite) set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) if(Treelite_ADDED) - target_include_directories(treelite - PUBLIC $ - $) - target_include_directories(treelite_static - PUBLIC $ - $) - target_include_directories(treelite_runtime - PUBLIC $ - $) - target_include_directories(treelite_runtime_static - PUBLIC $ - $) - - if(NOT TARGET treelite::treelite_static) - add_library(treelite::treelite_static ALIAS treelite_static) - add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) + if (NOT BUILD_STATIC_LIBS) + target_include_directories(treelite + PUBLIC $ + $) + target_include_directories(treelite_runtime + PUBLIC $ + $) + if(NOT TARGET treelite::treelite) + add_library(treelite::treelite ALIAS treelite) + endif() + if(NOT TARGET treelite::treelite_runtime) + add_library(treelite::treelite_runtime ALIAS treelite_runtime) + endif() + rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) + rapids_export(BUILD treelite_runtime EXPORT_SET TreeliteTargets) + list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) + else() + target_include_directories(treelite_static + PUBLIC $ + $) + target_include_directories(treelite_runtime_static + PUBLIC $ + $) + if(NOT TARGET treelite::treelite_static) + add_library(treelite::treelite_static ALIAS treelite_static) + endif() + if(NOT TARGET treelite::treelite_runtime_static) + add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) + endif() + rapids_export(BUILD treelite_static EXPORT_SET TreeliteTargets) + rapids_export(BUILD treelite_runtime_static EXPORT_SET TreeliteTargets) + list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) endif() - - rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) - endif() - - if (Treelite_ADDED AND BUILD_STATIC_LIBS) - list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) - else() - list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) endif() set(TREELITE_LIBS ${TREELITE_LIBS} PARENT_SCOPE) From 656901e17ab22163d5718a6094b7086bab83a6f3 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:10:10 -0500 Subject: [PATCH 12/65] test without adding treelite targets to export set --- cpp/cmake/thirdparty/get_treelite.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 14964d799f..3325f4e663 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -47,8 +47,10 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime) add_library(treelite::treelite_runtime ALIAS treelite_runtime) endif() - rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) - rapids_export(BUILD treelite_runtime EXPORT_SET TreeliteTargets) + # rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) + # rapids_export(BUILD treelite_runtime EXPORT_SET TreeliteTargets) + # rapids_export_package(BUILD treelite cuml-exports) + # rapids_export_package(BUILD treelite_runtime cuml-exports) list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) else() target_include_directories(treelite_static @@ -63,8 +65,10 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime_static) add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) endif() - rapids_export(BUILD treelite_static EXPORT_SET TreeliteTargets) - rapids_export(BUILD treelite_runtime_static EXPORT_SET TreeliteTargets) + # rapids_export(BUILD treelite_static EXPORT_SET TreeliteTargets) + # rapids_export(BUILD treelite_runtime_static EXPORT_SET TreeliteTargets) + # rapids_export_package(BUILD treelite_static cuml-exports) + # rapids_export_package(BUILD treelite_runtime_static cuml-exports) list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) endif() endif() From 25e6d32e7daae083b684e78d4833e2fc9f479994 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:11:12 -0500 Subject: [PATCH 13/65] what about this --- cpp/cmake/thirdparty/get_treelite.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 3325f4e663..1570b504be 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -49,8 +49,8 @@ function(find_and_configure_treelite) endif() # rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) # rapids_export(BUILD treelite_runtime EXPORT_SET TreeliteTargets) - # rapids_export_package(BUILD treelite cuml-exports) - # rapids_export_package(BUILD treelite_runtime cuml-exports) + rapids_export_package(BUILD treelite cuml-exports) + rapids_export_package(BUILD treelite_runtime cuml-exports) list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) else() target_include_directories(treelite_static @@ -67,8 +67,8 @@ function(find_and_configure_treelite) endif() # rapids_export(BUILD treelite_static EXPORT_SET TreeliteTargets) # rapids_export(BUILD treelite_runtime_static EXPORT_SET TreeliteTargets) - # rapids_export_package(BUILD treelite_static cuml-exports) - # rapids_export_package(BUILD treelite_runtime_static cuml-exports) + rapids_export_package(BUILD treelite_static cuml-exports) + rapids_export_package(BUILD treelite_runtime_static cuml-exports) list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) endif() endif() From 33909b4b5dfa8f2485a88f10a7adb12be9196ff5 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:11:59 -0500 Subject: [PATCH 14/65] both --- cpp/cmake/thirdparty/get_treelite.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 1570b504be..d6e6be8c80 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -47,8 +47,8 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime) add_library(treelite::treelite_runtime ALIAS treelite_runtime) endif() - # rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) - # rapids_export(BUILD treelite_runtime EXPORT_SET TreeliteTargets) + rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) + rapids_export(BUILD treelite_runtime EXPORT_SET TreeliteTargets) rapids_export_package(BUILD treelite cuml-exports) rapids_export_package(BUILD treelite_runtime cuml-exports) list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) @@ -65,8 +65,8 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime_static) add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) endif() - # rapids_export(BUILD treelite_static EXPORT_SET TreeliteTargets) - # rapids_export(BUILD treelite_runtime_static EXPORT_SET TreeliteTargets) + rapids_export(BUILD treelite_static EXPORT_SET TreeliteTargets) + rapids_export(BUILD treelite_runtime_static EXPORT_SET TreeliteTargets) rapids_export_package(BUILD treelite_static cuml-exports) rapids_export_package(BUILD treelite_runtime_static cuml-exports) list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) From e93589fa6c0f1e9455265ef34cbe67d2cae9a0a6 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:16:00 -0500 Subject: [PATCH 15/65] I'll make my own then --- cpp/cmake/thirdparty/get_treelite.cmake | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index d6e6be8c80..b9e85d1c9b 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -47,10 +47,7 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime) add_library(treelite::treelite_runtime ALIAS treelite_runtime) endif() - rapids_export(BUILD treelite EXPORT_SET TreeliteTargets) - rapids_export(BUILD treelite_runtime EXPORT_SET TreeliteTargets) - rapids_export_package(BUILD treelite cuml-exports) - rapids_export_package(BUILD treelite_runtime cuml-exports) + install(TARGETS treelite treelite_runtime EXPORT treelite-exports) list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) else() target_include_directories(treelite_static @@ -65,14 +62,15 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime_static) add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) endif() - rapids_export(BUILD treelite_static EXPORT_SET TreeliteTargets) - rapids_export(BUILD treelite_runtime_static EXPORT_SET TreeliteTargets) - rapids_export_package(BUILD treelite_static cuml-exports) - rapids_export_package(BUILD treelite_runtime_static cuml-exports) list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) endif() endif() + rapids_export(BUILD treelite + EXPORT_SET treelite-exports + GLOBAL_TARGETS ${TREELITE_LIBS} + NAMESPACE cuml::) + set(TREELITE_LIBS ${TREELITE_LIBS} PARENT_SCOPE) endfunction() From e8d8c19673e62df0ae51c70f434498a237ded820 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:18:11 -0500 Subject: [PATCH 16/65] only modify the treelite targets for the library type we're using, add the targets to a build export-set --- cpp/cmake/thirdparty/get_treelite.cmake | 54 +++++++++++++++---------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 1b4f9b15ee..b9e85d1c9b 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -34,30 +34,42 @@ function(find_and_configure_treelite) set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) if(Treelite_ADDED) - target_include_directories(treelite - PUBLIC $ - $) - target_include_directories(treelite_static - PUBLIC $ - $) - target_include_directories(treelite_runtime - PUBLIC $ - $) - target_include_directories(treelite_runtime_static - PUBLIC $ - $) - - if(NOT TARGET treelite::treelite_static) - add_library(treelite::treelite_static ALIAS treelite_static) - add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) + if (NOT BUILD_STATIC_LIBS) + target_include_directories(treelite + PUBLIC $ + $) + target_include_directories(treelite_runtime + PUBLIC $ + $) + if(NOT TARGET treelite::treelite) + add_library(treelite::treelite ALIAS treelite) + endif() + if(NOT TARGET treelite::treelite_runtime) + add_library(treelite::treelite_runtime ALIAS treelite_runtime) + endif() + install(TARGETS treelite treelite_runtime EXPORT treelite-exports) + list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) + else() + target_include_directories(treelite_static + PUBLIC $ + $) + target_include_directories(treelite_runtime_static + PUBLIC $ + $) + if(NOT TARGET treelite::treelite_static) + add_library(treelite::treelite_static ALIAS treelite_static) + endif() + if(NOT TARGET treelite::treelite_runtime_static) + add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) + endif() + list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) endif() endif() - if (Treelite_ADDED AND BUILD_STATIC_LIBS) - list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) - else() - list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) - endif() + rapids_export(BUILD treelite + EXPORT_SET treelite-exports + GLOBAL_TARGETS ${TREELITE_LIBS} + NAMESPACE cuml::) set(TREELITE_LIBS ${TREELITE_LIBS} PARENT_SCOPE) From 788305df16fc19cfb3f198307431c8d0cd94ce47 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:20:49 -0500 Subject: [PATCH 17/65] only create treelite-exports if treelite_added is true --- cpp/cmake/thirdparty/get_treelite.cmake | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index b9e85d1c9b..c4358da913 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -33,6 +33,14 @@ function(find_and_configure_treelite) set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) + if(Treelite_ADDED AND BUILD_STATIC_LIBS) + list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) + else() + list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) + endif() + + set(TREELITE_LIBS ${TREELITE_LIBS} PARENT_SCOPE) + if(Treelite_ADDED) if (NOT BUILD_STATIC_LIBS) target_include_directories(treelite @@ -48,7 +56,6 @@ function(find_and_configure_treelite) add_library(treelite::treelite_runtime ALIAS treelite_runtime) endif() install(TARGETS treelite treelite_runtime EXPORT treelite-exports) - list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) else() target_include_directories(treelite_static PUBLIC $ @@ -62,16 +69,13 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime_static) add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) endif() - list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) endif() - endif() - - rapids_export(BUILD treelite - EXPORT_SET treelite-exports - GLOBAL_TARGETS ${TREELITE_LIBS} - NAMESPACE cuml::) - set(TREELITE_LIBS ${TREELITE_LIBS} PARENT_SCOPE) + rapids_export(BUILD treelite + EXPORT_SET treelite-exports + GLOBAL_TARGETS ${TREELITE_LIBS} + NAMESPACE cuml::) + endif() endfunction() From 3c44eae924c1189882311759ebbbf68f3f396acc Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:22:50 -0500 Subject: [PATCH 18/65] fix typo --- cpp/cmake/thirdparty/get_treelite.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index c4358da913..99e562fbb4 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -55,7 +55,6 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime) add_library(treelite::treelite_runtime ALIAS treelite_runtime) endif() - install(TARGETS treelite treelite_runtime EXPORT treelite-exports) else() target_include_directories(treelite_static PUBLIC $ From b1f8e8b7971fed46eeec52707fd2970bd6788888 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 30 Sep 2021 19:25:13 -0500 Subject: [PATCH 19/65] always make treelite-exports export set --- cpp/cmake/thirdparty/get_treelite.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 99e562fbb4..6d197c772f 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -55,6 +55,7 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime) add_library(treelite::treelite_runtime ALIAS treelite_runtime) endif() + install(TARGETS treelite treelite_runtime EXPORT treelite-exports) else() target_include_directories(treelite_static PUBLIC $ @@ -68,6 +69,7 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime_static) add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) endif() + install(TARGETS treelite_static treelite_runtime_static EXPORT treelite-exports) endif() rapids_export(BUILD treelite From a411c308db66084169592bbbbd228dd2cf95d7e1 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Tue, 5 Oct 2021 17:06:01 -0500 Subject: [PATCH 20/65] get faiss::faiss from raft --- cpp/CMakeLists.txt | 31 +++++++++--- cpp/cmake/thirdparty/get_faiss.cmake | 66 ------------------------- cpp/cmake/thirdparty/get_raft.cmake | 16 +++--- cpp/cmake/thirdparty/get_treelite.cmake | 13 +++-- cpp/test/CMakeLists.txt | 2 +- 5 files changed, 43 insertions(+), 85 deletions(-) delete mode 100644 cpp/cmake/thirdparty/get_faiss.cmake diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 2f5d6b5515..28ce2fad1d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -194,10 +194,6 @@ rapids_cpm_init() include(cmake/thirdparty/get_thrust.cmake) include(cmake/thirdparty/get_rmm.cmake) -if(LINK_FAISS) - include(cmake/thirdparty/get_faiss.cmake) -endif() - include(cmake/thirdparty/get_treelite.cmake) include(cmake/thirdparty/get_raft.cmake) @@ -387,7 +383,7 @@ if(BUILD_CUML_CPP_LIBRARY) CUDA::cusparse ${TREELITE_LIBS} $<$:CUDA::nvToolsExt> - $<$:FAISS::FAISS> + $<$:faiss::faiss> $<$:OpenMP::OpenMP_CXX> $<$,$>:NCCL::NCCL> $<$:${MPI_CXX_LIBRARIES}> @@ -433,7 +429,7 @@ if(BUILD_CUML_C_LIBRARY) PUBLIC ${CUML_CPP_TARGET} PRIVATE - FAISS::FAISS + faiss::faiss ) # ensure CUDA symbols aren't relocated to the middle of the debug build binaries @@ -497,6 +493,29 @@ set(code_string thrust_create_target(cuml::Thrust FROM_OPTIONS) ]=]) +if (TARGET treelite::treelite) + string(APPEND code_string +[=[ +if (TARGET treelite::treelite AND (NOT TARGET treelite)) + add_library(treelite ALIAS treelite::treelite) +endif() +if (TARGET treelite::treelite_runtime AND (NOT TARGET treelite_runtime)) + add_library(treelite_runtime ALIAS treelite::treelite_runtime) +endif() +]=]) +else() + string(APPEND code_string +[=[ +if (TARGET treelite::treelite_static AND (NOT TARGET treelite_static)) + add_library(treelite_static ALIAS treelite::treelite_static) +endif() +if (TARGET treelite::treelite_runtime_static AND (NOT TARGET treelite_runtime_static)) + add_library(treelite_runtime_static ALIAS treelite::treelite_runtime_static) +endif() +]=]) + +endif() + rapids_export(INSTALL cuml EXPORT_SET cuml-exports GLOBAL_TARGETS cuml diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake deleted file mode 100644 index 53c413f1e4..0000000000 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ /dev/null @@ -1,66 +0,0 @@ -#============================================================================= -# Copyright (c) 2021, 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. -#============================================================================= - -function(find_and_configure_faiss) - set(oneValueArgs VERSION PINNED_TAG BUILD_STATIC_LIBS) - cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN} ) - - rapids_find_generate_module(FAISS - HEADER_NAMES faiss/IndexFlat.h - LIBRARY_NAMES faiss - ) - - set(BUILD_SHARED_LIBS OFF) - if (NOT BUILD_STATIC_LIBS) - set(BUILD_SHARED_LIBS ON) - endif() - - rapids_cpm_find(FAISS ${PKG_VERSION} - GLOBAL_TARGETS faiss FAISS::FAISS - BUILD_EXPORT_SET cuml-exports - CPM_ARGS - GIT_REPOSITORY https://github.com/facebookresearch/faiss.git - GIT_TAG ${PKG_PINNED_TAG} - OPTIONS - "FAISS_ENABLE_PYTHON OFF" - "BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}" - "CUDAToolkit_ROOT ${CUDAToolkit_LIBRARY_DIR}" - "FAISS_ENABLE_GPU ON" - "BUILD_TESTING OFF" - "CMAKE_MESSAGE_LOG_LEVEL VERBOSE" - ) - - if(FAISS_ADDED) - target_include_directories(faiss INTERFACE $) - install(TARGETS faiss EXPORT faiss-exports) - rapids_export(BUILD faiss - EXPORT_SET faiss-exports - GLOBAL_TARGETS faiss - NAMESPACE cuml:: - LANGUAGES CUDA) - endif() - - if(TARGET faiss AND NOT TARGET FAISS::FAISS) - add_library(FAISS::FAISS ALIAS faiss) - endif() - -endfunction() - -find_and_configure_faiss(VERSION 1.7.0 - PINNED_TAG bde7c0027191f29c9dadafe4f6e68ca0ee31fb30 - BUILD_STATIC_LIBS ${CUML_USE_FAISS_STATIC} - ) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 4acc1e4bc1..52c40765bf 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -20,10 +20,10 @@ function(find_and_configure_raft) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) - if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) - set(CPM_DL_ALL_CACHE ${CPM_DOWNLOAD_ALL}) - set(CPM_DOWNLOAD_ALL ON) - endif() + # if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) + # set(CPM_DL_ALL_CACHE ${CPM_DOWNLOAD_ALL}) + # set(CPM_DOWNLOAD_ALL ON) + # endif() rapids_cpm_find(raft ${PKG_VERSION} GLOBAL_TARGETS raft::raft @@ -44,9 +44,9 @@ function(find_and_configure_raft) message(VERBOSE "CUML: Using RAFT located in ${raft_DIR}") endif() - if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) - set(CPM_DOWNLOAD_ALL ${CPM_DL_ALL_CACHE}) - endif() + # if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) + # set(CPM_DOWNLOAD_ALL ${CPM_DL_ALL_CACHE}) + # endif() endfunction() @@ -58,6 +58,6 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") # CPM_raft_SOURCE=/path/to/local/raft find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} FORK trxcllnt - PINNED_TAG fix/node-rapids-21.10 + PINNED_TAG fix/node-rapids-21.10-1 USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 6d197c772f..578ef747d6 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -31,6 +31,7 @@ function(find_and_configure_treelite) "BUILD_STATIC_LIBS ${BUILD_STATIC_LIBS}" ) + set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) if(Treelite_ADDED AND BUILD_STATIC_LIBS) @@ -55,7 +56,6 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime) add_library(treelite::treelite_runtime ALIAS treelite_runtime) endif() - install(TARGETS treelite treelite_runtime EXPORT treelite-exports) else() target_include_directories(treelite_static PUBLIC $ @@ -69,15 +69,20 @@ function(find_and_configure_treelite) if(NOT TARGET treelite::treelite_runtime_static) add_library(treelite::treelite_runtime_static ALIAS treelite_runtime_static) endif() - install(TARGETS treelite_static treelite_runtime_static EXPORT treelite-exports) endif() rapids_export(BUILD treelite - EXPORT_SET treelite-exports + EXPORT_SET TreeliteTargets GLOBAL_TARGETS ${TREELITE_LIBS} - NAMESPACE cuml::) + NAMESPACE treelite::) endif() + # We generate the treelite-config files when we built treelite locally, so always do `find_dependency` + rapids_export_package(BUILD treelite cuml-exports) + + # Tell cmake where it can find the generated treelite-config.cmake we wrote. + include("${rapids-cmake-dir}/export/find_package_root.cmake") + rapids_export_find_package_root(BUILD treelite [=[${CMAKE_CURRENT_LIST_DIR}]=] cuml-exports) endfunction() find_and_configure_treelite(VERSION 2.1.0 diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 53b00d6c16..dddc77a159 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -23,7 +23,7 @@ set(COMMON_TEST_LINK_LIBRARIES CUDA::cufft rmm::rmm raft::raft - $<$:FAISS::FAISS> + $<$:faiss::faiss> GTest::gtest GTest::gtest_main OpenMP::OpenMP_CXX From 49a15fb6186853324382a171f4f939a2b6e8e951 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Tue, 5 Oct 2021 18:06:47 -0500 Subject: [PATCH 21/65] use fix/node-rapids-21.10 branch --- cpp/cmake/thirdparty/get_raft.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 52c40765bf..049432c4d5 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -58,6 +58,6 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") # CPM_raft_SOURCE=/path/to/local/raft find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} FORK trxcllnt - PINNED_TAG fix/node-rapids-21.10-1 + PINNED_TAG fix/node-rapids-21.10 USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) From ea0745dd0b101f5ab6ef835a09051bb9af8f36c6 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Tue, 5 Oct 2021 18:19:03 -0500 Subject: [PATCH 22/65] use rapidsai/raft again --- cpp/cmake/thirdparty/get_raft.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 049432c4d5..8770acc2a2 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -57,7 +57,7 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") # To use a different RAFT locally, set the CMake variable # CPM_raft_SOURCE=/path/to/local/raft find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} - FORK trxcllnt - PINNED_TAG fix/node-rapids-21.10 + FORK rapidsai/raft + PINNED_TAG branch-21.12 USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) From 662659b7ed8220ebd44704b1389dfb16edd44a6b Mon Sep 17 00:00:00 2001 From: ptaylor Date: Tue, 5 Oct 2021 18:24:23 -0500 Subject: [PATCH 23/65] use CUML_BRANCH_VERSION_raft --- cpp/cmake/thirdparty/get_raft.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 8770acc2a2..6c5ce560cb 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -58,6 +58,6 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") # CPM_raft_SOURCE=/path/to/local/raft find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} FORK rapidsai/raft - PINNED_TAG branch-21.12 + PINNED_TAG branch-${CUML_BRANCH_VERSION_raft} USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) From 36ae29b6ec717e49beee0bafe4afccf275cc22f5 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Tue, 5 Oct 2021 18:25:23 -0500 Subject: [PATCH 24/65] fix FORK --- cpp/cmake/thirdparty/get_raft.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 6c5ce560cb..67cc5fb223 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -57,7 +57,7 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") # To use a different RAFT locally, set the CMake variable # CPM_raft_SOURCE=/path/to/local/raft find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} - FORK rapidsai/raft + FORK rapidsai PINNED_TAG branch-${CUML_BRANCH_VERSION_raft} USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) From 50529c668b240841474b4774ff954e99e5d653ea Mon Sep 17 00:00:00 2001 From: ptaylor Date: Tue, 5 Oct 2021 18:28:17 -0500 Subject: [PATCH 25/65] uncomment CPM_DOWNLOAD_ALL logic --- cpp/cmake/thirdparty/get_raft.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 67cc5fb223..ff08e9aa89 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -20,10 +20,10 @@ function(find_and_configure_raft) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) - # if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) - # set(CPM_DL_ALL_CACHE ${CPM_DOWNLOAD_ALL}) - # set(CPM_DOWNLOAD_ALL ON) - # endif() + if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) + set(CPM_DL_ALL_CACHE ${CPM_DOWNLOAD_ALL}) + set(CPM_DOWNLOAD_ALL ON) + endif() rapids_cpm_find(raft ${PKG_VERSION} GLOBAL_TARGETS raft::raft @@ -44,9 +44,9 @@ function(find_and_configure_raft) message(VERBOSE "CUML: Using RAFT located in ${raft_DIR}") endif() - # if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) - # set(CPM_DOWNLOAD_ALL ${CPM_DL_ALL_CACHE}) - # endif() + if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) + set(CPM_DOWNLOAD_ALL ${CPM_DL_ALL_CACHE}) + endif() endfunction() From 3b8de87e030f191e3665031f210fa3725e852132 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 6 Oct 2021 10:49:44 -0500 Subject: [PATCH 26/65] globalize non-prefixed treelite targets --- cpp/cmake/thirdparty/get_treelite.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 578ef747d6..d278265891 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -33,8 +33,10 @@ function(find_and_configure_treelite) set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) + list(APPEND TREELITE_LIBS_NO_PREFIX treelite treelite_runtime) if(Treelite_ADDED AND BUILD_STATIC_LIBS) + list(APPEND TREELITE_LIBS_NO_PREFIX treelite_static treelite_runtime_static) list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) else() list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) @@ -73,7 +75,7 @@ function(find_and_configure_treelite) rapids_export(BUILD treelite EXPORT_SET TreeliteTargets - GLOBAL_TARGETS ${TREELITE_LIBS} + GLOBAL_TARGETS ${TREELITE_LIBS_NO_PREFIX} NAMESPACE treelite::) endif() From eccb1cc6943dfa19cc44e3a2c60c59266a54f8b6 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 6 Oct 2021 13:27:13 -0500 Subject: [PATCH 27/65] update rapids-cmake version --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 5c3a877e08..0fd559d8f3 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -15,7 +15,7 @@ #============================================================================= cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR) -file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.10/RAPIDS.cmake +file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.12/RAPIDS.cmake ${CMAKE_BINARY_DIR}/RAPIDS.cmake) include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) include(rapids-cmake) From 5d5cf970ad5c66c762b45fe44514cfca2da55419 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 6 Oct 2021 14:26:13 -0500 Subject: [PATCH 28/65] use Treelite vs. treelite --- cpp/cmake/thirdparty/get_treelite.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index d278265891..367a2d0f2b 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -73,18 +73,18 @@ function(find_and_configure_treelite) endif() endif() - rapids_export(BUILD treelite + rapids_export(BUILD Treelite EXPORT_SET TreeliteTargets GLOBAL_TARGETS ${TREELITE_LIBS_NO_PREFIX} NAMESPACE treelite::) endif() # We generate the treelite-config files when we built treelite locally, so always do `find_dependency` - rapids_export_package(BUILD treelite cuml-exports) + rapids_export_package(BUILD Treelite cuml-exports) # Tell cmake where it can find the generated treelite-config.cmake we wrote. include("${rapids-cmake-dir}/export/find_package_root.cmake") - rapids_export_find_package_root(BUILD treelite [=[${CMAKE_CURRENT_LIST_DIR}]=] cuml-exports) + rapids_export_find_package_root(BUILD Treelite [=[${CMAKE_CURRENT_LIST_DIR}]=] cuml-exports) endfunction() find_and_configure_treelite(VERSION 2.1.0 From 8487b97201757cf0a8bdc572292759e5d73aaa18 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 6 Oct 2021 14:41:38 -0500 Subject: [PATCH 29/65] add namespaced treelite targets to GLOBAL_TARGETS --- cpp/cmake/thirdparty/get_treelite.cmake | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 367a2d0f2b..1b23ecced5 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -20,28 +20,30 @@ function(find_and_configure_treelite) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + if(NOT BUILD_STATIC_LIBS) + list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) + else() + list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) + endif() + rapids_cpm_find(Treelite ${PKG_VERSION} - GLOBAL_TARGETS treelite::treelite treelite - BUILD_EXPORT_SET cuml-exports + GLOBAL_TARGETS ${TREELITE_LIBS} + BUILD_EXPORT_SET cuml-exports CPM_ARGS - GIT_REPOSITORY https://github.com/dmlc/treelite.git - GIT_TAG ${PKG_PINNED_TAG} + GIT_REPOSITORY https://github.com/dmlc/treelite.git + GIT_TAG ${PKG_PINNED_TAG} OPTIONS "USE_OPENMP ON" "BUILD_STATIC_LIBS ${BUILD_STATIC_LIBS}" ) - set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) list(APPEND TREELITE_LIBS_NO_PREFIX treelite treelite_runtime) - if(Treelite_ADDED AND BUILD_STATIC_LIBS) list(APPEND TREELITE_LIBS_NO_PREFIX treelite_static treelite_runtime_static) - list(APPEND TREELITE_LIBS treelite::treelite_static treelite::treelite_runtime_static) - else() - list(APPEND TREELITE_LIBS treelite::treelite treelite::treelite_runtime) endif() + set(Treelite_ADDED ${Treelite_ADDED} PARENT_SCOPE) set(TREELITE_LIBS ${TREELITE_LIBS} PARENT_SCOPE) if(Treelite_ADDED) From 1b8426de2d39653771263a68082fa9f439660c56 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 6 Oct 2021 14:43:36 -0500 Subject: [PATCH 30/65] mark in cuml-exports install_export_set --- cpp/cmake/thirdparty/get_treelite.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_treelite.cmake b/cpp/cmake/thirdparty/get_treelite.cmake index 1b23ecced5..e1700b8e31 100644 --- a/cpp/cmake/thirdparty/get_treelite.cmake +++ b/cpp/cmake/thirdparty/get_treelite.cmake @@ -28,7 +28,7 @@ function(find_and_configure_treelite) rapids_cpm_find(Treelite ${PKG_VERSION} GLOBAL_TARGETS ${TREELITE_LIBS} - BUILD_EXPORT_SET cuml-exports + INSTALL_EXPORT_SET cuml-exports CPM_ARGS GIT_REPOSITORY https://github.com/dmlc/treelite.git GIT_TAG ${PKG_PINNED_TAG} From b250ee4f5bdb8f6ad22e9d6d80634c04a8245b52 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 6 Oct 2021 23:45:49 -0500 Subject: [PATCH 31/65] remove redundant dependencies that raft provides, remove dead code --- cpp/CMakeLists.txt | 25 ++++-------------------- cpp/bench/CMakeLists.txt | 5 +---- cpp/cmake/thirdparty/get_gtest.cmake | 24 ----------------------- cpp/cmake/thirdparty/get_rmm.cmake | 26 ------------------------- cpp/cmake/thirdparty/get_spdlog.cmake | 24 ----------------------- cpp/cmake/thirdparty/get_thrust.cmake | 28 --------------------------- cpp/test/CMakeLists.txt | 13 +++---------- 7 files changed, 8 insertions(+), 137 deletions(-) delete mode 100644 cpp/cmake/thirdparty/get_gtest.cmake delete mode 100644 cpp/cmake/thirdparty/get_rmm.cmake delete mode 100644 cpp/cmake/thirdparty/get_spdlog.cmake delete mode 100644 cpp/cmake/thirdparty/get_thrust.cmake diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 0fd559d8f3..27e2ccbb6f 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -191,11 +191,8 @@ endif() # add third party dependencies using CPM rapids_cpm_init() -include(cmake/thirdparty/get_thrust.cmake) -include(cmake/thirdparty/get_rmm.cmake) - -include(cmake/thirdparty/get_treelite.cmake) include(cmake/thirdparty/get_raft.cmake) +include(cmake/thirdparty/get_treelite.cmake) if(NOT SINGLEGPU) include(cmake/thirdparty/get_nccl.cmake) @@ -206,11 +203,7 @@ if(ENABLE_CUMLPRIMS_MG) include(cmake/thirdparty/get_cumlprims_mg.cmake) endif() -if(BUILD_CUML_TESTS OR BUILD_PRIMS_TESTS) - include(cmake/thirdparty/get_gtest.cmake) -endif() - -if(BUILD_CUML_BENCH) +if(BUILD_CUML_BENCH OR BUILD_CUML_PRIMS_BENCH) include(cmake/thirdparty/get_gbench.cmake) endif() @@ -371,16 +364,9 @@ if(BUILD_CUML_CPP_LIBRARY) target_link_libraries(${CUML_CPP_TARGET} PUBLIC - rmm::rmm - cuml::Thrust raft::raft PRIVATE - CUDA::cublas CUDA::cufft - CUDA::curand - CUDA::cusolver - CUDA::cudart - CUDA::cusparse ${TREELITE_LIBS} $<$:CUDA::nvToolsExt> $<$:faiss::faiss> @@ -488,10 +474,7 @@ functions that share compatible APIs with other RAPIDS projects. ]=]) -set(code_string -[=[ -thrust_create_target(cuml::Thrust FROM_OPTIONS) -]=]) +set(code_string ) if (TARGET treelite::treelite) string(APPEND code_string @@ -516,7 +499,7 @@ endif() endif() - rapids_export(INSTALL cuml +rapids_export(INSTALL cuml EXPORT_SET cuml-exports GLOBAL_TARGETS cuml NAMESPACE cuml:: diff --git a/cpp/bench/CMakeLists.txt b/cpp/bench/CMakeLists.txt index c480462e1f..de48217b47 100644 --- a/cpp/bench/CMakeLists.txt +++ b/cpp/bench/CMakeLists.txt @@ -44,7 +44,6 @@ if(BUILD_CUML_BENCH) PUBLIC cuml::${CUML_CPP_TARGET} benchmark::benchmark - raft::raft ${TREELITE_LIBS} ) @@ -82,10 +81,8 @@ if(BUILD_CUML_PRIMS_BENCH) target_link_libraries(${PRIMS_BENCH_TARGET} PUBLIC - cuml - CUDA::cublas + cuml::${CUML_CPP_TARGET} benchmark::benchmark - raft::raft ${TREELITE_LIBS} ) diff --git a/cpp/cmake/thirdparty/get_gtest.cmake b/cpp/cmake/thirdparty/get_gtest.cmake deleted file mode 100644 index d72769ff33..0000000000 --- a/cpp/cmake/thirdparty/get_gtest.cmake +++ /dev/null @@ -1,24 +0,0 @@ -#============================================================================= -# Copyright (c) 2021, 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. -#============================================================================= - -function(find_and_configure_gtest) - - include(${rapids-cmake-dir}/cpm/gtest.cmake) - rapids_cpm_gtest() - -endfunction() - -find_and_configure_gtest() diff --git a/cpp/cmake/thirdparty/get_rmm.cmake b/cpp/cmake/thirdparty/get_rmm.cmake deleted file mode 100644 index 325a5b8010..0000000000 --- a/cpp/cmake/thirdparty/get_rmm.cmake +++ /dev/null @@ -1,26 +0,0 @@ -#============================================================================= -# Copyright (c) 2021, 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. -#============================================================================= - -function(find_and_configure_rmm) - - include(${rapids-cmake-dir}/cpm/rmm.cmake) - rapids_cpm_rmm( - BUILD_EXPORT_SET cuml-exports - INSTALL_EXPORT_SET cuml-exports - ) - -endfunction() -find_and_configure_rmm() diff --git a/cpp/cmake/thirdparty/get_spdlog.cmake b/cpp/cmake/thirdparty/get_spdlog.cmake deleted file mode 100644 index bb0fe45dc9..0000000000 --- a/cpp/cmake/thirdparty/get_spdlog.cmake +++ /dev/null @@ -1,24 +0,0 @@ -#============================================================================= -# Copyright (c) 2021, 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. -#============================================================================= - -function(find_and_configure_spdlog) - - include(${rapids-cmake-dir}/cpm/spdlog.cmake) - rapids_cpm_spdlog() - -endfunction() - -find_and_configure_spdlog() diff --git a/cpp/cmake/thirdparty/get_thrust.cmake b/cpp/cmake/thirdparty/get_thrust.cmake deleted file mode 100644 index de56eb93d3..0000000000 --- a/cpp/cmake/thirdparty/get_thrust.cmake +++ /dev/null @@ -1,28 +0,0 @@ -#============================================================================= -# Copyright (c) 2021, 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. -#============================================================================= - -function(find_and_configure_thrust) - include(${rapids-cmake-dir}/cpm/thrust.cmake) - - rapids_cpm_thrust( - NAMESPACE cuml - BUILD_EXPORT_SET cuml-exports - INSTALL_EXPORT_SET cuml-exports - ) - -endfunction() - -find_and_configure_thrust() diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index dddc77a159..f8261cb9ed 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -15,14 +15,7 @@ #============================================================================= set(COMMON_TEST_LINK_LIBRARIES - CUDA::cublas - CUDA::curand - CUDA::cusolver - CUDA::cudart - CUDA::cusparse CUDA::cufft - rmm::rmm - raft::raft $<$:faiss::faiss> GTest::gtest GTest::gtest_main @@ -93,7 +86,7 @@ if(BUILD_CUML_TESTS) target_link_libraries(${CUML_CPP_TEST_TARGET} PRIVATE - ${CUML_CPP_TARGET} + cuml::${CUML_CPP_TARGET} $<$:${CUML_C_TARGET}> ${COMMON_TEST_LINK_LIBRARIES} ) @@ -128,7 +121,7 @@ if(BUILD_CUML_MG_TESTS) ) target_link_libraries(${CUML_MG_TEST_TARGET} - ${CUML_CPP_TARGET} + cuml::${CUML_CPP_TARGET} ${COMMON_TEST_LINK_LIBRARIES} NCCL::NCCL ${MPI_CXX_LIBRARIES} @@ -220,7 +213,7 @@ if(BUILD_PRIMS_TESTS) target_link_libraries(${PRIMS_TEST_TARGET} PRIVATE - ${CUML_CPP_TARGET} + cuml::${CUML_CPP_TARGET} ${COMMON_TEST_LINK_LIBRARIES} ) From 212bf6c20eac055654c4a7db2b6c8db9914e5c30 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 7 Oct 2021 18:49:36 -0500 Subject: [PATCH 32/65] remove DISABLE_FORCE_CLONE_RAFT workaround --- cpp/cmake/thirdparty/get_raft.cmake | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index ff08e9aa89..5641b797e9 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -20,11 +20,6 @@ function(find_and_configure_raft) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) - if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) - set(CPM_DL_ALL_CACHE ${CPM_DOWNLOAD_ALL}) - set(CPM_DOWNLOAD_ALL ON) - endif() - rapids_cpm_find(raft ${PKG_VERSION} GLOBAL_TARGETS raft::raft BUILD_EXPORT_SET cuml-exports @@ -44,10 +39,6 @@ function(find_and_configure_raft) message(VERBOSE "CUML: Using RAFT located in ${raft_DIR}") endif() - if(DEFINED CPM_raft_SOURCE OR NOT DISABLE_FORCE_CLONE_RAFT) - set(CPM_DOWNLOAD_ALL ${CPM_DL_ALL_CACHE}) - endif() - endfunction() set(CUML_MIN_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}.00") From ff4dbedd41b4161b07f4ca2db4c604008a306afa Mon Sep 17 00:00:00 2001 From: ptaylor Date: Tue, 12 Oct 2021 08:55:02 -0500 Subject: [PATCH 33/65] add options to build static faiss and treelite --- build.sh | 57 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/build.sh b/build.sh index fb077e50ec..838d4d7a34 100755 --- a/build.sh +++ b/build.sh @@ -23,30 +23,32 @@ VALIDFLAGS="-v -g -n --allgpuarch --singlegpu --nolibcumltest --nvtx --show_depr VALIDARGS="${VALIDTARGETS} ${VALIDFLAGS}" HELP="$0 [ ...] [ ...] where is: - clean - remove all existing build artifacts and configuration (start over) - libcuml - build the cuml C++ code only. Also builds the C-wrapper library - around the C++ code. - cuml - build the cuml Python package - cpp-mgtests - build libcuml mnmg tests. Builds MPI communicator, adding MPI as dependency. - prims - build the ml-prims tests - bench - build the libcuml C++ benchmark - prims-bench - build the ml-prims C++ benchmark - cppdocs - build the C++ API doxygen documentation - pydocs - build the general and Python API documentation + clean - remove all existing build artifacts and configuration (start over) + libcuml - build the cuml C++ code only. Also builds the C-wrapper library + around the C++ code. + cuml - build the cuml Python package + cpp-mgtests - build libcuml mnmg tests. Builds MPI communicator, adding MPI as dependency. + prims - build the ml-prims tests + bench - build the libcuml C++ benchmark + prims-bench - build the ml-prims C++ benchmark + cppdocs - build the C++ API doxygen documentation + pydocs - build the general and Python API documentation and is: - -v - verbose build mode - -g - build for debug - -n - no install step - -h - print this text - --allgpuarch - build for all supported GPU architectures - --singlegpu - Build libcuml and cuml without multigpu components - --nolibcumltest - disable building libcuml C++ tests for a faster build - --nvtx - Enable nvtx for profiling support - --show_depr_warn - show cmake deprecation warnings - --codecov - Enable code coverage support by compiling with Cython linetracing - and profiling enabled (WARNING: Impacts performance) - --ccache - Use ccache to cache previous compilations - --nocloneraft - CMake will clone RAFT even if it is in the environment, use this flag to disable that behavior + -v - verbose build mode + -g - build for debug + -n - no install step + -h - print this text + --allgpuarch - build for all supported GPU architectures + --singlegpu - Build libcuml and cuml without multigpu components + --nolibcumltest - disable building libcuml C++ tests for a faster build + --nvtx - Enable nvtx for profiling support + --show_depr_warn - show cmake deprecation warnings + --codecov - Enable code coverage support by compiling with Cython linetracing + and profiling enabled (WARNING: Impacts performance) + --ccache - Use ccache to cache previous compilations + --nocloneraft - CMake will clone RAFT even if it is in the environment, use this flag to disable that behavior + --static-faiss - Force CMake to use the FAISS static libs, cloning and building them if necessary + --static-treelite - Force CMake to use the Treelite static libs, cloning and building them if necessary default action (no args) is to build and install 'libcuml', 'cuml', and 'prims' targets only for the detected GPU arch @@ -77,6 +79,7 @@ BUILD_CUML_STD_COMMS=ON BUILD_CUML_TESTS=ON BUILD_CUML_MG_TESTS=OFF BUILD_STATIC_FAISS=OFF +BUILD_STATIC_TREELITE=OFF CMAKE_LOG_LEVEL=WARNING DISABLE_FORCE_CLONE_RAFT=OFF @@ -194,6 +197,12 @@ while true; do --nocloneraft ) DISABLE_FORCE_CLONE_RAFT=ON ;; + --static-faiss ) + BUILD_STATIC_FAISS=ON + ;; + --static-treelite ) + BUILD_STATIC_TREELITE=ON + ;; --) shift break @@ -245,6 +254,8 @@ if completeBuild || hasArg libcuml || hasArg prims || hasArg bench || hasArg pri -DBUILD_CUML_TESTS=${BUILD_CUML_TESTS} \ -DBUILD_CUML_MPI_COMMS=${BUILD_CUML_MG_TESTS} \ -DBUILD_CUML_MG_TESTS=${BUILD_CUML_MG_TESTS} \ + -DCUML_USE_FAISS_STATIC=${BUILD_STATIC_FAISS} \ + -DCUML_USE_TREELITE_STATIC=${BUILD_STATIC_TREELITE} \ -DDISABLE_FORCE_CLONE_RAFT=${DISABLE_FORCE_CLONE_RAFT} \ -DNVTX=${NVTX} \ -DUSE_CCACHE=${CCACHE} \ From 6128872db01290d3893a4bb5323d42505d86168b Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 13 Oct 2021 16:58:13 -0500 Subject: [PATCH 34/65] switch to my fork to test in CI --- cpp/cmake/thirdparty/get_raft.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 5641b797e9..15e319b3bb 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -48,7 +48,9 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") # To use a different RAFT locally, set the CMake variable # CPM_raft_SOURCE=/path/to/local/raft find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} - FORK rapidsai - PINNED_TAG branch-${CUML_BRANCH_VERSION_raft} + # FORK rapidsai + # PINNED_TAG branch-${CUML_BRANCH_VERSION_raft} + FORK trxcllnt + PINNED_TAG fix/build-shared-faiss USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) From 7cd5b959d4e4f8d26618fe35007daf94050f6744 Mon Sep 17 00:00:00 2001 From: divyegala Date: Tue, 19 Oct 2021 14:42:28 -0700 Subject: [PATCH 35/65] accounting for hpp file name --- cpp/bench/prims/fused_l2_nn.cu | 2 +- cpp/bench/prims/gram_matrix.cu | 2 +- cpp/bench/prims/permute.cu | 2 +- cpp/bench/prims/rng.cu | 2 +- cpp/bench/sg/arima_loglikelihood.cu | 2 +- cpp/bench/sg/dataset_ts.cuh | 2 +- cpp/cmake/thirdparty/get_raft.cmake | 4 ++-- cpp/src/glm/ols.cuh | 6 +++--- cpp/src/glm/preprocess.cuh | 4 ++-- cpp/src/glm/qn/glm_base.cuh | 2 +- cpp/src/glm/qn/glm_regularizer.cuh | 2 +- cpp/src/glm/ridge.cuh | 6 +++--- cpp/src/kmeans/common.cuh | 2 +- cpp/src/pca/pca.cuh | 4 ++-- cpp/src/pca/pca_mg.cu | 2 +- cpp/src/random_projection/rproj_utils.cuh | 2 +- cpp/src/randomforest/randomforest.cuh | 4 ++-- cpp/src/solver/sgd.cuh | 4 ++-- cpp/src/tsne/fft_tsne.cuh | 2 +- cpp/src/tsne/utils.cuh | 4 ++-- cpp/src/tsvd/tsvd.cuh | 4 ++-- cpp/src/tsvd/tsvd_mg.cu | 2 +- cpp/src/umap/fuzzy_simpl_set/naive.cuh | 2 +- cpp/src/umap/init_embed/random_algo.cuh | 2 +- cpp/src/umap/init_embed/spectral_algo.cuh | 2 +- cpp/src/umap/optimize.cuh | 2 +- cpp/src/umap/simpl_set_embed/optimize_batch_kernel.cuh | 2 +- cpp/src_prims/functions/hinge.cuh | 4 ++-- cpp/src_prims/functions/linearReg.cuh | 4 ++-- cpp/src_prims/functions/logisticReg.cuh | 4 ++-- cpp/src_prims/linalg/lstsq.cuh | 2 +- cpp/src_prims/linalg/rsvd.cuh | 2 +- cpp/src_prims/metrics/scores.cuh | 2 +- cpp/src_prims/random/make_arima.cuh | 2 +- cpp/src_prims/random/make_blobs.cuh | 2 +- cpp/src_prims/random/make_regression.cuh | 2 +- cpp/src_prims/selection/processing.cuh | 4 ++-- cpp/src_prims/stats/cov.cuh | 2 +- cpp/src_prims/timeSeries/stationarity.cuh | 2 +- cpp/test/prims/add_sub_dev_scalar.cu | 2 +- cpp/test/prims/batched/gemv.cu | 2 +- cpp/test/prims/batched/make_symm.cu | 2 +- cpp/test/prims/cov.cu | 4 ++-- cpp/test/prims/dispersion.cu | 2 +- cpp/test/prims/dist_adj.cu | 2 +- cpp/test/prims/distance_base.cuh | 2 +- cpp/test/prims/eltwise2d.cu | 2 +- cpp/test/prims/gather.cu | 2 +- cpp/test/prims/gram.cu | 2 +- cpp/test/prims/hinge.cu | 2 +- cpp/test/prims/histogram.cu | 2 +- cpp/test/prims/knn_regression.cu | 2 +- cpp/test/prims/kselection.cu | 2 +- cpp/test/prims/linalg_block.cu | 2 +- cpp/test/prims/linearReg.cu | 2 +- cpp/test/prims/logisticReg.cu | 2 +- cpp/test/prims/minmax.cu | 2 +- cpp/test/prims/penalty.cu | 2 +- cpp/test/prims/permute.cu | 2 +- cpp/test/prims/power.cu | 2 +- cpp/test/prims/reduce_cols_by_key.cu | 2 +- cpp/test/prims/reduce_rows_by_key.cu | 2 +- cpp/test/prims/reverse.cu | 2 +- cpp/test/prims/rsvd.cu | 2 +- cpp/test/prims/score.cu | 2 +- cpp/test/prims/sqrt.cu | 2 +- cpp/test/prims/ternary_op.cu | 2 +- cpp/test/prims/weighted_mean.cu | 2 +- cpp/test/sg/fil_test.cu | 2 +- cpp/test/sg/knn_test.cu | 2 +- cpp/test/sg/lars_test.cu | 2 +- cpp/test/sg/multi_sum_test.cu | 2 +- cpp/test/sg/pca_test.cu | 2 +- cpp/test/sg/svc_test.cu | 2 +- cpp/test/sg/tsvd_test.cu | 2 +- 75 files changed, 91 insertions(+), 91 deletions(-) diff --git a/cpp/bench/prims/fused_l2_nn.cu b/cpp/bench/prims/fused_l2_nn.cu index ef21a03881..8466b265f5 100644 --- a/cpp/bench/prims/fused_l2_nn.cu +++ b/cpp/bench/prims/fused_l2_nn.cu @@ -19,7 +19,7 @@ #include #include #include -#include +#include namespace MLCommon { namespace Bench { diff --git a/cpp/bench/prims/gram_matrix.cu b/cpp/bench/prims/gram_matrix.cu index 8efb858b30..0774213f88 100644 --- a/cpp/bench/prims/gram_matrix.cu +++ b/cpp/bench/prims/gram_matrix.cu @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/bench/prims/permute.cu b/cpp/bench/prims/permute.cu index 34475d18ca..6daf186e87 100644 --- a/cpp/bench/prims/permute.cu +++ b/cpp/bench/prims/permute.cu @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include namespace MLCommon { diff --git a/cpp/bench/prims/rng.cu b/cpp/bench/prims/rng.cu index 5eb6caa31a..8642b2bb07 100644 --- a/cpp/bench/prims/rng.cu +++ b/cpp/bench/prims/rng.cu @@ -16,7 +16,7 @@ #include #include -#include +#include namespace MLCommon { namespace Bench { diff --git a/cpp/bench/sg/arima_loglikelihood.cu b/cpp/bench/sg/arima_loglikelihood.cu index 3cd4855f0b..1cd8929922 100644 --- a/cpp/bench/sg/arima_loglikelihood.cu +++ b/cpp/bench/sg/arima_loglikelihood.cu @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/bench/sg/dataset_ts.cuh b/cpp/bench/sg/dataset_ts.cuh index a8b9ac0790..b66671f306 100644 --- a/cpp/bench/sg/dataset_ts.cuh +++ b/cpp/bench/sg/dataset_ts.cuh @@ -19,7 +19,7 @@ #include #include #include -#include +#include namespace ML { namespace Bench { diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 50845ec4b8..67278459d5 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -30,8 +30,8 @@ function(find_and_configure_raft) BUILD_EXPORT_SET cuml-exports INSTALL_EXPORT_SET cuml-exports CPM_ARGS - GIT_REPOSITORY https://github.com/${PKG_FORK}/raft.git - GIT_TAG ${PKG_PINNED_TAG} + GIT_REPOSITORY https://github.com/divyegala/raft.git + GIT_TAG imp-21.12-detail_refactor SOURCE_SUBDIR cpp OPTIONS "BUILD_TESTS OFF" diff --git a/cpp/src/glm/ols.cuh b/cpp/src/glm/ols.cuh index 9e2e8212e0..f4da85a795 100644 --- a/cpp/src/glm/ols.cuh +++ b/cpp/src/glm/ols.cuh @@ -23,10 +23,10 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include "preprocess.cuh" diff --git a/cpp/src/glm/preprocess.cuh b/cpp/src/glm/preprocess.cuh index 9875fd1c40..2b7f2d9060 100644 --- a/cpp/src/glm/preprocess.cuh +++ b/cpp/src/glm/preprocess.cuh @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/cpp/src/glm/qn/glm_base.cuh b/cpp/src/glm/qn/glm_base.cuh index ff9f9e822f..bb7d63e1d1 100644 --- a/cpp/src/glm/qn/glm_base.cuh +++ b/cpp/src/glm/qn/glm_base.cuh @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "simple_mat.cuh" diff --git a/cpp/src/glm/qn/glm_regularizer.cuh b/cpp/src/glm/qn/glm_regularizer.cuh index 55c346c406..dc9d79bdf9 100644 --- a/cpp/src/glm/qn/glm_regularizer.cuh +++ b/cpp/src/glm/qn/glm_regularizer.cuh @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "simple_mat.cuh" namespace ML { diff --git a/cpp/src/glm/ridge.cuh b/cpp/src/glm/ridge.cuh index 6431eb0297..25da5d9e77 100644 --- a/cpp/src/glm/ridge.cuh +++ b/cpp/src/glm/ridge.cuh @@ -24,10 +24,10 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include "preprocess.cuh" diff --git a/cpp/src/kmeans/common.cuh b/cpp/src/kmeans/common.cuh index 4a29941724..46e3192a6f 100644 --- a/cpp/src/kmeans/common.cuh +++ b/cpp/src/kmeans/common.cuh @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/src/pca/pca.cuh b/cpp/src/pca/pca.cuh index 9feb344996..37307168bd 100644 --- a/cpp/src/pca/pca.cuh +++ b/cpp/src/pca/pca.cuh @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/cpp/src/pca/pca_mg.cu b/cpp/src/pca/pca_mg.cu index bd147b3343..2120454d30 100644 --- a/cpp/src/pca/pca_mg.cu +++ b/cpp/src/pca/pca_mg.cu @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include diff --git a/cpp/src/random_projection/rproj_utils.cuh b/cpp/src/random_projection/rproj_utils.cuh index 951e076897..928c263618 100644 --- a/cpp/src/random_projection/rproj_utils.cuh +++ b/cpp/src/random_projection/rproj_utils.cuh @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/randomforest/randomforest.cuh b/cpp/src/randomforest/randomforest.cuh index c15331080c..b1dad1e0af 100644 --- a/cpp/src/randomforest/randomforest.cuh +++ b/cpp/src/randomforest/randomforest.cuh @@ -26,12 +26,12 @@ #include #include -#include +#include #include #include #include -#include +#include #ifdef _OPENMP #include diff --git a/cpp/src/solver/sgd.cuh b/cpp/src/solver/sgd.cuh index d4594f3d8f..b78ab62e33 100644 --- a/cpp/src/solver/sgd.cuh +++ b/cpp/src/solver/sgd.cuh @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include "learning_rate.h" #include "shuffle.h" diff --git a/cpp/src/tsne/fft_tsne.cuh b/cpp/src/tsne/fft_tsne.cuh index b7e6b54009..6a63b35bf7 100644 --- a/cpp/src/tsne/fft_tsne.cuh +++ b/cpp/src/tsne/fft_tsne.cuh @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include "fft_kernels.cuh" diff --git a/cpp/src/tsne/utils.cuh b/cpp/src/tsne/utils.cuh index 583e7719f9..bbf8820ca1 100644 --- a/cpp/src/tsne/utils.cuh +++ b/cpp/src/tsne/utils.cuh @@ -31,8 +31,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/cpp/src/tsvd/tsvd.cuh b/cpp/src/tsvd/tsvd.cuh index 0e1d156dd3..a4315ecdd2 100644 --- a/cpp/src/tsvd/tsvd.cuh +++ b/cpp/src/tsvd/tsvd.cuh @@ -30,9 +30,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/cpp/src/tsvd/tsvd_mg.cu b/cpp/src/tsvd/tsvd_mg.cu index 96bb7a943c..3bb49e3c96 100644 --- a/cpp/src/tsvd/tsvd_mg.cu +++ b/cpp/src/tsvd/tsvd_mg.cu @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include diff --git a/cpp/src/umap/fuzzy_simpl_set/naive.cuh b/cpp/src/umap/fuzzy_simpl_set/naive.cuh index 969f6f50c0..16f0df6988 100644 --- a/cpp/src/umap/fuzzy_simpl_set/naive.cuh +++ b/cpp/src/umap/fuzzy_simpl_set/naive.cuh @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include diff --git a/cpp/src/umap/init_embed/random_algo.cuh b/cpp/src/umap/init_embed/random_algo.cuh index 3d77cf0c83..20c5382fe7 100644 --- a/cpp/src/umap/init_embed/random_algo.cuh +++ b/cpp/src/umap/init_embed/random_algo.cuh @@ -17,7 +17,7 @@ #pragma once #include -#include +#include namespace UMAPAlgo { namespace InitEmbed { diff --git a/cpp/src/umap/init_embed/spectral_algo.cuh b/cpp/src/umap/init_embed/spectral_algo.cuh index 69e12a3d03..aa54afc88d 100644 --- a/cpp/src/umap/init_embed/spectral_algo.cuh +++ b/cpp/src/umap/init_embed/spectral_algo.cuh @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/umap/optimize.cuh b/cpp/src/umap/optimize.cuh index 122c6b43ed..43a026e8f5 100644 --- a/cpp/src/umap/optimize.cuh +++ b/cpp/src/umap/optimize.cuh @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/src/umap/simpl_set_embed/optimize_batch_kernel.cuh b/cpp/src/umap/simpl_set_embed/optimize_batch_kernel.cuh index bb330a7436..966dd7f626 100644 --- a/cpp/src/umap/simpl_set_embed/optimize_batch_kernel.cuh +++ b/cpp/src/umap/simpl_set_embed/optimize_batch_kernel.cuh @@ -22,7 +22,7 @@ #include #include -#include +#include #include diff --git a/cpp/src_prims/functions/hinge.cuh b/cpp/src_prims/functions/hinge.cuh index 0539b10528..cbdede8b45 100644 --- a/cpp/src_prims/functions/hinge.cuh +++ b/cpp/src_prims/functions/hinge.cuh @@ -28,8 +28,8 @@ #include #include #include -#include -#include +#include +#include #include #include "penalty.cuh" diff --git a/cpp/src_prims/functions/linearReg.cuh b/cpp/src_prims/functions/linearReg.cuh index c1893309f1..846e86e6ad 100644 --- a/cpp/src_prims/functions/linearReg.cuh +++ b/cpp/src_prims/functions/linearReg.cuh @@ -26,8 +26,8 @@ #include #include #include -#include -#include +#include +#include #include #include "penalty.cuh" diff --git a/cpp/src_prims/functions/logisticReg.cuh b/cpp/src_prims/functions/logisticReg.cuh index c8ba8cea8e..265bdf5607 100644 --- a/cpp/src_prims/functions/logisticReg.cuh +++ b/cpp/src_prims/functions/logisticReg.cuh @@ -26,8 +26,8 @@ #include #include #include -#include -#include +#include +#include #include #include "penalty.cuh" #include "sigmoid.cuh" diff --git a/cpp/src_prims/linalg/lstsq.cuh b/cpp/src_prims/linalg/lstsq.cuh index abc143003e..a58db2ebd7 100644 --- a/cpp/src_prims/linalg/lstsq.cuh +++ b/cpp/src_prims/linalg/lstsq.cuh @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/src_prims/linalg/rsvd.cuh b/cpp/src_prims/linalg/rsvd.cuh index 56d3913bed..9269193dd3 100644 --- a/cpp/src_prims/linalg/rsvd.cuh +++ b/cpp/src_prims/linalg/rsvd.cuh @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace MLCommon { namespace LinAlg { diff --git a/cpp/src_prims/metrics/scores.cuh b/cpp/src_prims/metrics/scores.cuh index 14ea268a50..7baabcabb8 100644 --- a/cpp/src_prims/metrics/scores.cuh +++ b/cpp/src_prims/metrics/scores.cuh @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/src_prims/random/make_arima.cuh b/cpp/src_prims/random/make_arima.cuh index 3aaee2b962..22476c15a6 100644 --- a/cpp/src_prims/random/make_arima.cuh +++ b/cpp/src_prims/random/make_arima.cuh @@ -23,7 +23,7 @@ #include #include -#include +#include #include namespace MLCommon { diff --git a/cpp/src_prims/random/make_blobs.cuh b/cpp/src_prims/random/make_blobs.cuh index 5adc636bfe..1ddb3901d4 100644 --- a/cpp/src_prims/random/make_blobs.cuh +++ b/cpp/src_prims/random/make_blobs.cuh @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include "permute.cuh" diff --git a/cpp/src_prims/random/make_regression.cuh b/cpp/src_prims/random/make_regression.cuh index acb32c910f..1806ded0ed 100644 --- a/cpp/src_prims/random/make_regression.cuh +++ b/cpp/src_prims/random/make_regression.cuh @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include "permute.cuh" diff --git a/cpp/src_prims/selection/processing.cuh b/cpp/src_prims/selection/processing.cuh index b9c7da58b5..b9a4f79e86 100644 --- a/cpp/src_prims/selection/processing.cuh +++ b/cpp/src_prims/selection/processing.cuh @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/cpp/src_prims/stats/cov.cuh b/cpp/src_prims/stats/cov.cuh index a6e1dec2d2..72cae394ad 100644 --- a/cpp/src_prims/stats/cov.cuh +++ b/cpp/src_prims/stats/cov.cuh @@ -18,7 +18,7 @@ #include #include -#include +#include namespace MLCommon { namespace Stats { diff --git a/cpp/src_prims/timeSeries/stationarity.cuh b/cpp/src_prims/timeSeries/stationarity.cuh index deee13caae..da63565d13 100644 --- a/cpp/src_prims/timeSeries/stationarity.cuh +++ b/cpp/src_prims/timeSeries/stationarity.cuh @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include "arima_helpers.cuh" diff --git a/cpp/test/prims/add_sub_dev_scalar.cu b/cpp/test/prims/add_sub_dev_scalar.cu index 9e8a20d55e..f7b1173f57 100644 --- a/cpp/test/prims/add_sub_dev_scalar.cu +++ b/cpp/test/prims/add_sub_dev_scalar.cu @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include "test_utils.h" diff --git a/cpp/test/prims/batched/gemv.cu b/cpp/test/prims/batched/gemv.cu index 546e0980b1..4424a57bec 100644 --- a/cpp/test/prims/batched/gemv.cu +++ b/cpp/test/prims/batched/gemv.cu @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "../test_utils.h" namespace MLCommon { diff --git a/cpp/test/prims/batched/make_symm.cu b/cpp/test/prims/batched/make_symm.cu index 5aef9da08f..c3597e033b 100644 --- a/cpp/test/prims/batched/make_symm.cu +++ b/cpp/test/prims/batched/make_symm.cu @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "../test_utils.h" diff --git a/cpp/test/prims/cov.cu b/cpp/test/prims/cov.cu index 5815570d1f..8cbc7c2db9 100644 --- a/cpp/test/prims/cov.cu +++ b/cpp/test/prims/cov.cu @@ -16,8 +16,8 @@ #include #include -#include -#include +#include +#include #include #include #include "test_utils.h" diff --git a/cpp/test/prims/dispersion.cu b/cpp/test/prims/dispersion.cu index 91969f1120..f9927138d7 100644 --- a/cpp/test/prims/dispersion.cu +++ b/cpp/test/prims/dispersion.cu @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include "test_utils.h" diff --git a/cpp/test/prims/dist_adj.cu b/cpp/test/prims/dist_adj.cu index ff2914580d..b6f4d09d93 100644 --- a/cpp/test/prims/dist_adj.cu +++ b/cpp/test/prims/dist_adj.cu @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "test_utils.h" namespace MLCommon { diff --git a/cpp/test/prims/distance_base.cuh b/cpp/test/prims/distance_base.cuh index bf695a165c..4ee8ef23a5 100644 --- a/cpp/test/prims/distance_base.cuh +++ b/cpp/test/prims/distance_base.cuh @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "test_utils.h" namespace MLCommon { diff --git a/cpp/test/prims/eltwise2d.cu b/cpp/test/prims/eltwise2d.cu index 32456d9217..1be90e9c5e 100644 --- a/cpp/test/prims/eltwise2d.cu +++ b/cpp/test/prims/eltwise2d.cu @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "test_utils.h" namespace MLCommon { diff --git a/cpp/test/prims/gather.cu b/cpp/test/prims/gather.cu index ce7e9e4032..11f73c7d14 100644 --- a/cpp/test/prims/gather.cu +++ b/cpp/test/prims/gather.cu @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "test_utils.h" diff --git a/cpp/test/prims/gram.cu b/cpp/test/prims/gram.cu index 0ea834c0f5..8cc60498f6 100644 --- a/cpp/test/prims/gram.cu +++ b/cpp/test/prims/gram.cu @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "test_utils.h" diff --git a/cpp/test/prims/hinge.cu b/cpp/test/prims/hinge.cu index ce8456e701..b0824fe893 100644 --- a/cpp/test/prims/hinge.cu +++ b/cpp/test/prims/hinge.cu @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "test_utils.h" namespace MLCommon { diff --git a/cpp/test/prims/histogram.cu b/cpp/test/prims/histogram.cu index f2afa07b83..7faf3edb42 100644 --- a/cpp/test/prims/histogram.cu +++ b/cpp/test/prims/histogram.cu @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include "test_utils.h" diff --git a/cpp/test/prims/knn_regression.cu b/cpp/test/prims/knn_regression.cu index 3de9d371ca..37afb62e8f 100644 --- a/cpp/test/prims/knn_regression.cu +++ b/cpp/test/prims/knn_regression.cu @@ -21,7 +21,7 @@ #include