Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove faiss from cuml #5293

Merged
merged 22 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4f66867
Tests seem to pass w/ the new compiled bits
cjnolet Mar 14, 2023
957bd1c
Merge branch 'branch-23.04' into imp-2306-using_raft_compiled_target
cjnolet Mar 20, 2023
083f667
Reverting changes to dependencies.yaml
cjnolet Mar 20, 2023
0abad43
Update cpp/CMakeLists.txt
cjnolet Mar 20, 2023
ef2d8ee
Fixing bad merge
cjnolet Mar 20, 2023
16d39fe
Temporarily using artifacts from commit
cjnolet Mar 21, 2023
241171b
Using correct path
cjnolet Mar 21, 2023
30e531f
Something got reverted. Fixing
cjnolet Mar 21, 2023
3ee94da
Adding cuml_use_faiss_static option back in
cjnolet Mar 21, 2023
2db2603
Adding CUML_USE_RAFT_NN back
cjnolet Mar 21, 2023
3578b83
Turning USE_RAFT_NN on in the proper place
cjnolet Mar 21, 2023
e567150
Fixing get_raft
cjnolet Mar 21, 2023
6ad3f12
remove faiss from cuml
benfred Mar 22, 2023
4c3ce76
fix get_raft
benfred Mar 22, 2023
f850e93
Merge branch 'branch-23.04' into remove_faiss
benfred Mar 23, 2023
b7c5f2f
Use device inline epilogue
benfred Mar 24, 2023
bed5213
Merge branch 'branch-23.04' into remove_faiss
cjnolet Mar 25, 2023
71185fb
Add note about exposing more metrics to hdbscan
benfred Mar 27, 2023
8b39d92
Merge branch 'remove_faiss' of github.com:benfred/cuml into remove_faiss
benfred Mar 27, 2023
6002077
Merge branch 'branch-23.04' into remove_faiss
benfred Mar 27, 2023
f3a1543
remove 'k' param from brute_force::knn code
benfred Mar 28, 2023
3557be1
Merge branch 'remove_faiss' of github.com:benfred/cuml into remove_faiss
benfred Mar 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Copyright (c) 2019-2023, NVIDIA CORPORATION.

# cuml build script

Expand Down Expand Up @@ -47,7 +47,6 @@ HELP="$0 [<target> ...] [<flag> ...]
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
Copy link
Member

Choose a reason for hiding this comment

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

Yay!!!

--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
Expand Down Expand Up @@ -78,7 +77,6 @@ BUILD_DISABLE_DEPRECATION_WARNINGS=ON
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

Expand Down Expand Up @@ -199,9 +197,6 @@ while true; do
--nocloneraft )
DISABLE_FORCE_CLONE_RAFT=ON
;;
--static-faiss )
BUILD_STATIC_FAISS=ON
;;
--static-treelite )
BUILD_STATIC_TREELITE=ON
;;
Expand Down Expand Up @@ -256,7 +251,6 @@ 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} \
-DNVTX=${NVTX} \
-DUSE_CCACHE=${CCACHE} \
Expand Down
2 changes: 1 addition & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

set -euo pipefail

Expand Down
1 change: 0 additions & 1 deletion ci/checks/copyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
]
FILES_TO_EXCLUDE = [
re.compile(r"cpp/src/tsne/cannylab/bh\.cu"),
re.compile(r"cpp/src/hdbscan/detail/faiss_mr\.hpp"),
]

# this will break starting at year 10000, which is probably OK :)
Expand Down
2 changes: 1 addition & 1 deletion ci/test_python_common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

set -euo pipefail

Expand Down
3 changes: 1 addition & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ dependencies:
- libcusparse-dev=11.7.5.86
- libcusparse=11.7.5.86
- libfaiss>=1.7.1
- libraft-distance=23.04.*
- libraft-headers=23.04.*
- libraft-nn=23.04.*
- libraft=23.04.*
- nbsphinx
- ninja
- nltk
Expand Down
3 changes: 1 addition & 2 deletions conda/environments/cpp_all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ dependencies:
- libcusparse-dev=11.7.5.86
- libcusparse=11.7.5.86
- libfaiss>=1.7.1
- libraft-distance=23.04.*
- libraft-headers=23.04.*
- libraft-nn=23.04.*
- libraft=23.04.*
- ninja
- rmm=23.04.*
- sysroot_linux-64==2.17
Expand Down
6 changes: 2 additions & 4 deletions conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ requirements:
- libcusolver-dev {{ libcusolver_host_version }}
- libcusparse {{ libcusparse_host_version }}
- libcusparse-dev {{ libcusparse_host_version }}
- libraft-distance ={{ minor_version }}
- libraft ={{ minor_version }}
- libraft-headers ={{ minor_version }}
- libraft-nn ={{ minor_version }}
- treelite {{ treelite_version }}
- libfaiss>=1.7.1
- faiss-proc=*=cuda
Expand All @@ -84,9 +83,8 @@ outputs:
- libcurand {{ libcurand_run_version }}
- libcusparse {{ libcusparse_run_version }}
- libcusparse-dev {{ libcusparse_run_version }}
- libraft-distance ={{ minor_version }}
- libraft ={{ minor_version }}
- libraft-headers ={{ minor_version }}
- libraft-nn ={{ minor_version }}
- treelite {{ treelite_version }}
- libfaiss>=1.7.1
- faiss-proc=*=cuda
Expand Down
15 changes: 3 additions & 12 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,15 @@ option(SINGLEGPU "Disable all mnmg components and comms libraries" OFF)
option(USE_CCACHE "Cache build artifacts with ccache" OFF)
option(CUDA_STATIC_RUNTIME "Statically link the CUDA toolkit runtime and libraries" OFF)
option(CUML_USE_RAFT_STATIC "Build and statically link the RAFT libraries" OFF)
option(CUML_USE_FAISS_STATIC "Build and statically link the FAISS library for nearest neighbors search on GPU" OFF)
option(CUML_RAFT_COMPILED "Use libraft shared library" ON)
option(CUML_USE_TREELITE_STATIC "Build and statically link the treelite library" OFF)
option(CUML_EXPORT_TREELITE_LINKAGE "Whether to publicly or privately link treelite to libcuml++" OFF)
option(CUML_USE_CUMLPRIMS_MG_STATIC "Build and statically link the cumlprims_mg library" OFF)
option(CUML_ENABLE_NN_DEPENDENCIES "Whether to enable FAISS dependency" ON)

# The options below allow incorporating libcuml into another build process
# without installing all its components. This is useful if total file size is
# at a premium and we do not expect other consumers to use any APIs of the
# dependency except those that are directly linked to by the dependent library.
option(CUML_EXCLUDE_FAISS_FROM_ALL "Exclude FAISS targets from RAFT's 'all' target" ON)
option(CUML_EXCLUDE_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF)
option(CUML_EXCLUDE_TREELITE_FROM_ALL "Exclude Treelite targets from cuML's 'all' target" OFF)
option(CUML_EXCLUDE_CUMLPRIMS_MG_FROM_ALL "Exclude cumlprims_mg targets from cuML's 'all' target" OFF)
Expand All @@ -98,7 +96,6 @@ message(VERBOSE "CUML_CPP: Disabling all mnmg components and comms libraries: ${
message(VERBOSE "CUML_CPP: Cache build artifacts with ccache: ${USE_CCACHE}")
message(VERBOSE "CUML_CPP: Statically link the CUDA toolkit runtime and libraries: ${CUDA_STATIC_RUNTIME}")
message(VERBOSE "CUML_CPP: Build and statically link RAFT libraries: ${CUML_USE_RAFT_STATIC}")
message(VERBOSE "CUML_CPP: Build and statically link FAISS library: ${CUML_USE_FAISS_STATIC}")
message(VERBOSE "CUML_CPP: Build and statically link Treelite library: ${CUML_USE_TREELITE_STATIC}")

set(CUML_ALGORITHMS "ALL" CACHE STRING "Experimental: Choose which algorithms are built into libcuml++.so. Can specify individual algorithms or groups in a semicolon-separated list.")
Expand Down Expand Up @@ -171,7 +168,7 @@ include(cmake/modules/ConfigureCUDA.cmake)
##############################################################################
# - Set options based on user defined one -----------------------------------
set(CUML_USE_RAFT_NN OFF)
set(CUML_USE_RAFT_DIST OFF)
set(CUML_RAFT_COMPILED OFF)
set(LINK_TREELITE OFF)
set(LINK_CUFFT OFF)
include(cmake/modules/ConfigureAlgorithms.cmake)
Expand Down Expand Up @@ -223,10 +220,6 @@ endif()

include(cmake/thirdparty/get_raft.cmake)

if(CUML_USE_RAFT_NN)
include(cmake/thirdparty/get_faiss.cmake)
endif()

if(LINK_TREELITE)
include(cmake/thirdparty/get_treelite.cmake)
endif()
Expand Down Expand Up @@ -586,7 +579,6 @@ if(BUILD_CUML_CPP_LIBRARY)
# These are always private:
list(APPEND _cuml_cpp_private_libs
raft::raft
$<$<BOOL:${CUML_USE_RAFT_NN}>:faiss>
$<TARGET_NAME_IF_EXISTS:GPUTreeShap::GPUTreeShap>
$<$<BOOL:${LINK_CUFFT}>:CUDA::cufft${_ctk_static_suffix}>
${TREELITE_LIBS}
Expand All @@ -606,8 +598,7 @@ if(BUILD_CUML_CPP_LIBRARY)
# because cumlprims_mg and cuML inherit their CUDA libs from the raft::raft
# INTERFACE target.
list(APPEND ${_cuml_cpp_libs_var_name}
$<$<BOOL:${CUML_USE_RAFT_NN}>:raft::nn>
$<$<BOOL:${CUML_USE_RAFT_DIST}>:raft::distance>
$<$<BOOL:${CUML_RAFT_COMPILED}>:raft::compiled>
$<TARGET_NAME_IF_EXISTS:cumlprims_mg::cumlprims_mg>
)

Expand Down
4 changes: 1 addition & 3 deletions cpp/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ if(BUILD_CUML_BENCH)
benchmark::benchmark
${TREELITE_LIBS}
raft::raft
raft::nn
faiss::faiss
raft::distance
raft::compiled
)

target_include_directories(${CUML_CPP_BENCH_TARGET}
Expand Down
4 changes: 2 additions & 2 deletions cpp/bench/sg/svc.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

#if defined RAFT_DISTANCE_COMPILED
#if defined RAFT_COMPILED
#include <raft/distance/specializations.cuh>
#endif

Expand Down
4 changes: 2 additions & 2 deletions cpp/bench/sg/svr.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

#if defined RAFT_DISTANCE_COMPILED
#if defined RAFT_COMPILED
#include <raft/distance/specializations.cuh>
#endif

Expand Down
9 changes: 5 additions & 4 deletions cpp/cmake/modules/ConfigureAlgorithms.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@

if(CUML_ALGORITHMS STREQUAL "ALL")
set(CUML_USE_RAFT_NN ON)
set(CUML_USE_RAFT_DIST ON)
set(CUML_RAFT_COMPILED ON)
set(LINK_TREELITE ON)
set(LINK_CUFFT ON)
set(all_algo ON)
Expand All @@ -32,7 +32,7 @@ else()
set(BUILD_CUML_BENCH OFF)
set(BUILD_CUML_EXAMPLES OFF)
set(CUML_USE_RAFT_NN OFF)
set(CUML_USE_RAFT_DIST OFF)
set(CUML_RAFT_COMPILED OFF)

foreach(algo ${CUML_ALGORITHMS})
string(TOLOWER ${algo} lower_algo)
Expand Down Expand Up @@ -107,6 +107,7 @@ else()

if(knn_algo)
set(CUML_USE_RAFT_NN ON)
set(CUML_RAFT_COMPILED ON)
endif()

if(randomforest_algo)
Expand All @@ -119,7 +120,7 @@ else()
endif()

if(metrics_algo)
set(CUML_USE_RAFT_DIST ON)
set(CUML_RAFT_COMPILED ON)
endif()
endif()

89 changes: 0 additions & 89 deletions cpp/cmake/thirdparty/get_faiss.cmake

This file was deleted.

Loading