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

[FEA] Add option to build faiss shared libs #345

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
07644ec
add option to build faiss shared libs
trxcllnt Sep 30, 2021
f3e1f09
add FAISS::FAISS to the list of global targets
trxcllnt Sep 30, 2021
e038644
update cuco
trxcllnt Sep 30, 2021
3fa9c94
create a faissTargets export-set
trxcllnt Sep 30, 2021
fc132ef
Merge branch 'fix/build-shared-faiss' into fix/node-rapids-21.10
trxcllnt Sep 30, 2021
85572d0
add faiss to raft-exports
trxcllnt Sep 30, 2021
b19a4b6
revert
trxcllnt Sep 30, 2021
6c74570
Merge branch 'fix/build-shared-faiss' into fix/node-rapids-21.10
trxcllnt Sep 30, 2021
14785ff
create a faiss-exports export-set
trxcllnt Sep 30, 2021
25b62e6
mark faiss to be found as part of resolving raft-exports dependencies
trxcllnt Sep 30, 2021
76edf36
create faiss-exports export set
trxcllnt Sep 30, 2021
92851b3
create faiss-exports export set
trxcllnt Sep 30, 2021
8e266ef
export faiss::faiss target to build export set
trxcllnt Oct 5, 2021
9d535fb
Merge branch 'fix/node-rapids-21.10' into fix/build-shared-faiss
trxcllnt Oct 5, 2021
7c990b1
Merge branch 'branch-21.10' of github.com:rapidsai/raft into fix/buil…
trxcllnt Oct 5, 2021
3a20c64
Merge branch 'branch-21.12' of github.com:rapidsai/raft into fix/buil…
trxcllnt Oct 5, 2021
83e3aa6
fix faiss GLOBAL_TARGETS
trxcllnt Oct 6, 2021
2773edc
update rapids-cmake version
trxcllnt Oct 6, 2021
3ff1c4d
fix naming for generated Findfaiss.cmake module so we find conda-inst…
trxcllnt Oct 6, 2021
cbb6f2d
ensure faiss::faiss target is available in build and install export sets
trxcllnt Oct 7, 2021
713a872
add gtest to raft-exports, remove dead code
trxcllnt Oct 7, 2021
ceb4d8b
update CMake faiss variable name
trxcllnt Oct 12, 2021
1d3ffab
make -v set cmake --log-level=VERBOSE
trxcllnt Oct 12, 2021
b48e393
update cuco hash to the commit that uses rapids-cmake v21.12
trxcllnt Oct 13, 2021
dc076ae
Merge branch 'branch-21.12' of github.com:rapidsai/raft into fix/buil…
trxcllnt Oct 14, 2021
e824384
Merge branch 'branch-21.12' of github.com:rapidsai/raft into fix/buil…
trxcllnt Nov 10, 2021
078e33c
Merge branch 'branch-21.12' of github.com:rapidsai/raft into fix/buil…
trxcllnt Nov 11, 2021
30dafb6
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Nov 18, 2021
aedc6d7
update cuco version
trxcllnt Nov 19, 2021
245ea3d
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Nov 20, 2021
2b99f1a
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Dec 1, 2021
bb4b7c7
move faiss into separate raft-faiss-exports export set, only include …
trxcllnt Dec 1, 2021
e798ab1
check for faiss in raft_FIND_COMPONENTS for build side export set too
trxcllnt Dec 2, 2021
2d5898d
pass EXCLUDE_FROM_ALL in get_faiss.cmake
trxcllnt Dec 2, 2021
2cb3c3a
enable CUDA language in code_string
trxcllnt Dec 2, 2021
23912f5
pass TRUE
trxcllnt Dec 2, 2021
fc306f6
drop CUDA from the list of global languages
trxcllnt Dec 2, 2021
61c263a
link raft to faiss if faiss component is requested
trxcllnt Dec 2, 2021
41bd51b
link raft to faiss if faiss component requested
trxcllnt Dec 8, 2021
4a95f2e
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Dec 15, 2021
082eea9
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Dec 16, 2021
ce8a005
fix FAISS::FAISS -> faiss::faiss
trxcllnt Dec 16, 2021
fb7ec4c
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Jan 6, 2022
99c009b
Merge branch 'fix/build-shared-faiss' of github.com:trxcllnt/raft int…
trxcllnt Jan 6, 2022
6cd76c7
remove LANGUAGES CUDA
trxcllnt Jan 7, 2022
745dd84
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Jan 11, 2022
c8e28fe
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Jan 13, 2022
31e7daf
Merge branch 'branch-22.02' of github.com:rapidsai/raft into fix/buil…
trxcllnt Jan 13, 2022
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
2 changes: 2 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ option(DISABLE_DEPRECATION_WARNINGS "Disable depreaction warnings " ON)
option(DISABLE_OPENMP "Disable OpenMP" OFF)
option(NVTX "Enable nvtx markers" OFF)

option(RAFT_USE_FAISS_STATIC "Build and statically link the FAISS library for nearest neighbors search on GPU" ON)

message(VERBOSE "RAFT: Build RAFT unit-tests: ${BUILD_TESTS}")
message(VERBOSE "RAFT: Enable detection of conda environment for dependencies: ${DETECT_CONDA_ENV}")
message(VERBOSE "RAFT: Disable depreaction warnings " ${DISABLE_DEPRECATION_WARNINGS})
Expand Down
21 changes: 17 additions & 4 deletions cpp/cmake/thirdparty/get_faiss.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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} )

Expand All @@ -24,22 +24,34 @@ 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 FAISS::FAISS
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
BUILD_EXPORT_SET raft-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}"
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
"CUDAToolkit_ROOT ${CUDAToolkit_LIBRARY_DIR}"
"FAISS_ENABLE_GPU ON"
"BUILD_TESTING OFF"
"CMAKE_MESSAGE_LOG_LEVEL VERBOSE"
)

if(FAISS_ADDED)
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
set(FAISS_GPU_HEADERS ${FAISS_SOURCE_DIR} PARENT_SCOPE)
target_include_directories(faiss INTERFACE $<BUILD_INTERFACE:${FAISS_SOURCE_DIR}>)
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
install(TARGETS faiss EXPORT faiss-exports)
rapids_export(BUILD faiss
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
EXPORT_SET faiss-exports
GLOBAL_TARGETS faiss
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
NAMESPACE raft::
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
LANGUAGES CUDA)
endif()

trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
if(TARGET faiss AND NOT TARGET FAISS::FAISS)
Expand All @@ -50,4 +62,5 @@ endfunction()

find_and_configure_faiss(VERSION 1.7.0
PINNED_TAG bde7c0027191f29c9dadafe4f6e68ca0ee31fb30
BUILD_STATIC_LIBS ${RAFT_USE_FAISS_STATIC}
)
1 change: 0 additions & 1 deletion cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ target_compile_options(test_raft
target_include_directories(test_raft
PUBLIC "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/test>"
"${FAISS_GPU_HEADERS}"
)


Expand Down