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

Migrate to use cuVS for vector search #6085

Merged
merged 52 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2f2c55c
Migrate from raft to cuvs for pairwise_distance and bfknn
benfred Jul 16, 2024
9116ae8
Merge branch 'branch-24.08' into cuvs
benfred Jul 22, 2024
84bc77a
.
benfred Jul 22, 2024
cbb79ec
use cuvs::distance::DistanceType where possible
benfred Jul 22, 2024
f653059
Revert "use cuvs::distance::DistanceType where possible"
benfred Sep 6, 2024
a6f2c2a
use stats from raft
benfred Sep 18, 2024
c2c9c04
Merge remote-tracking branch 'origin/branch-24.10' into cuvs
benfred Sep 18, 2024
95b9c14
use ivf-* from cuvs
benfred Sep 20, 2024
1934d40
Merge remote-tracking branch 'origin/branch-24.10' into cuvs
benfred Sep 20, 2024
0601412
Merge branch 'rapidsai:branch-24.10' into cuvs
benfred Sep 26, 2024
f30f933
add libcuvs to dependencies.yaml
benfred Sep 26, 2024
69d2398
Merge branch 'cuvs' of https://github.com/benfred/cuml into cuvs
benfred Sep 26, 2024
6c46624
attempt to fix build error in CI
benfred Sep 26, 2024
3fb5479
Merge branch 'branch-24.10' into cuvs
benfred Sep 26, 2024
5380c17
fix tsne
benfred Sep 27, 2024
dc1f7a6
Merge branch 'cuvs' of https://github.com/benfred/cuml into cuvs
benfred Sep 27, 2024
fdd18c5
fix ivf-fla
benfred Sep 27, 2024
590865d
fix test_nearest_neighbors_rbc test for haversine distance
benfred Sep 27, 2024
c7d1b0e
re-add MetricProcessor code
benfred Sep 27, 2024
e8c1b18
suggestions from code review
benfred Sep 27, 2024
bd58347
fix dask pytests
benfred Sep 29, 2024
adb450a
attempt to fix python build errors in CI
benfred Sep 29, 2024
df47d3c
use raft in header only mode
benfred Sep 29, 2024
c72173c
Use kmeans/mutual reachability code from pending cuvs PR's
benfred Sep 29, 2024
6139db0
remove comment
benfred Sep 30, 2024
3e1c465
cmake fixes
benfred Sep 30, 2024
732ea10
.
benfred Sep 30, 2024
4942bb0
pick up right cuvs version
benfred Sep 30, 2024
fef9920
.
benfred Sep 30, 2024
3c0c47e
empty commit for ci
benfred Sep 30, 2024
d8e6b6d
Exclude libcuvs.so in auditwheel.
bdice Sep 30, 2024
257898e
add cuvs to python dependencies
benfred Oct 1, 2024
9f805cd
Merge branch 'cuvs' of https://github.com/benfred/cuml into cuvs
benfred Oct 1, 2024
176c9a9
use l2expanded distance in kmeans transform
benfred Oct 2, 2024
2122120
Merge branch 'branch-24.10' into cuvs
benfred Oct 2, 2024
c12f1d5
Set rpath for cuvs
KyleFromNVIDIA Oct 2, 2024
f3edb8f
Don't link Python modules against cuvs directly
KyleFromNVIDIA Oct 2, 2024
f906e79
Remove superfluous cuvs::cuvs references
KyleFromNVIDIA Oct 2, 2024
585acd4
Add cuvs rpath
KyleFromNVIDIA Oct 2, 2024
1964a94
remove cuvs pin
benfred Oct 2, 2024
f1db388
Merge branch 'cuvs' of https://github.com/benfred/cuml into cuvs
benfred Oct 2, 2024
259256a
updates to handle bfknn api changes
benfred Oct 3, 2024
4efd97a
link cuvs statically in python wheels
benfred Oct 3, 2024
41daf01
empty commit for ci
benfred Oct 3, 2024
31331d7
empty commit for ci
benfred Oct 3, 2024
6bef472
empty commit for ci
benfred Oct 3, 2024
3e88b8e
remove pin
benfred Oct 3, 2024
064cced
Merge branch 'branch-24.10' into cuvs
cjnolet Oct 3, 2024
3959c58
re-add pin + suggestions from code review
benfred Oct 3, 2024
dc6de84
Merge branch 'cuvs' of https://github.com/benfred/cuml into cuvs
benfred Oct 3, 2024
461a271
fix
benfred Oct 3, 2024
f50b9d2
remove pin
benfred Oct 3, 2024
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
7 changes: 3 additions & 4 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ 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 runtime" OFF)
option(CUDA_STATIC_MATH_LIBRARIES "Statically link the CUDA math libraries" OFF)
option(CUML_USE_RAFT_STATIC "Build and statically link the RAFT libraries" OFF)
option(CUML_RAFT_COMPILED "Use libraft shared library" ON)
option(CUML_USE_CUVS_STATIC "Build and statically link the CUVS library" OFF)
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)
Expand Down Expand Up @@ -99,7 +98,7 @@ 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 runtime: ${CUDA_STATIC_RUNTIME}")
message(VERBOSE "CUML_CPP: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}")
message(VERBOSE "CUML_CPP: Build and statically link RAFT libraries: ${CUML_USE_RAFT_STATIC}")
message(VERBOSE "CUML_CPP: Build and statically link CUVS libraries: ${CUML_USE_CUVS_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 @@ -625,7 +624,7 @@ if(BUILD_CUML_CPP_LIBRARY)
)

target_link_libraries(${CUML_CPP_TARGET}
PUBLIC rmm::rmm cuvs::cuvs
PUBLIC rmm::rmm ${CUVS_LIB}
${_cuml_cpp_public_libs}
PRIVATE ${_cuml_cpp_private_libs}
)
Expand Down
16 changes: 13 additions & 3 deletions cpp/cmake/thirdparty/get_cuvs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,26 @@ set(CUML_MIN_VERSION_cuvs "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}.00")
set(CUML_BRANCH_VERSION_cuvs "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}")

function(find_and_configure_cuvs)
set(oneValueArgs VERSION FORK PINNED_TAG EXCLUDE_FROM_ALL COMPILE_LIBRARY CLONE_ON_PIN NVTX)
set(oneValueArgs VERSION FORK PINNED_TAG EXCLUDE_FROM_ALL USE_CUVS_STATIC COMPILE_LIBRARY CLONE_ON_PIN NVTX)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )

if(PKG_CLONE_ON_PIN AND NOT PKG_PINNED_TAG STREQUAL "branch-${CUML_BRANCH_VERSION_cuvs}")
message(STATUS "CUML: CUVS pinned tag found: ${PKG_PINNED_TAG}. Cloning cuvs locally.")
set(CPM_DOWNLOAD_cuvs ON)
elseif(PKG_USE_CUVS_STATIC AND (NOT CPM_cuvs_SOURCE))
message(STATUS "CUML: Cloning cuvs locally to build static libraries.")
set(CPM_DOWNLOAD_cuvs ON)
else()
message(STATUS "Not cloning cuvs locally")
endif()

if(PKG_USE_CUVS_STATIC)
set(CUVS_LIB cuvs::cuvs_static PARENT_SCOPE)
else()
set(CUVS_LIB cuvs::cuvs PARENT_SCOPE)
endif()

rapids_cpm_find(cuvs ${PKG_VERSION}
GLOBAL_TARGETS cuvs::cuvs
BUILD_EXPORT_SET cuml-exports
Expand Down Expand Up @@ -56,13 +65,14 @@ endfunction()
# To use a different CUVS locally, set the CMake variable
# CPM_cuvs_SOURCE=/path/to/local/cuvs
find_and_configure_cuvs(VERSION ${CUML_MIN_VERSION_cuvs}
FORK rapidsai
PINNED_TAG branch-${CUML_BRANCH_VERSION_cuvs}
FORK benfred
PINNED_TAG static_lib
benfred marked this conversation as resolved.
Show resolved Hide resolved
EXCLUDE_FROM_ALL ${CUML_EXCLUDE_CUVS_FROM_ALL}
# When PINNED_TAG above doesn't match cuml,
# force local cuvs clone in build directory
# even if it's already installed.
CLONE_ON_PIN ${CUML_CUVS_CLONE_ON_PIN}
COMPILE_LIBRARY ${CUML_CUVS_COMPILED}
USE_CUVS_STATIC ${CUML_USE_CUVS_STATIC}
NVTX ${NVTX}
benfred marked this conversation as resolved.
Show resolved Hide resolved
)
2 changes: 1 addition & 1 deletion python/cuml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if(NOT CUML_CPU)

# Statically link dependencies if building wheels
set(CUDA_STATIC_RUNTIME ON)
set(CUML_USE_RAFT_STATIC ON)
set(CUML_USE_CUVS_STATIC ON)
set(CUML_USE_FAISS_STATIC ON)
set(CUML_USE_TREELITE_STATIC ON)
set(CUML_USE_CUMLPRIMS_MG_STATIC ON)
Expand Down
Loading