Skip to content

Commit

Permalink
Roll back to 6b2fe56 faiss-1.7.2
Browse files Browse the repository at this point in the history
Signed-off-by: Cai Yudong <yudong.cai@zilliz.com>
  • Loading branch information
cydrain committed Sep 11, 2024
1 parent 2da33d7 commit 26b5009
Show file tree
Hide file tree
Showing 675 changed files with 22,551 additions and 88,215 deletions.
73 changes: 73 additions & 0 deletions cmake/libs/RAPIDS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#=============================================================================
# Copyright (c) 2021-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.
# 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.
#=============================================================================
#
# This is the preferred entry point for projects using rapids-cmake
#

# Allow users to control which version is used
if(NOT rapids-cmake-version)
# Define a default version if the user doesn't set one
set(rapids-cmake-version 23.12)
endif()

# Allow users to control which GitHub repo is fetched
if(NOT rapids-cmake-repo)
# Define a default repo if the user doesn't set one
set(rapids-cmake-repo rapidsai/rapids-cmake)
endif()

# Allow users to control which branch is fetched
if(NOT rapids-cmake-branch)
# Define a default branch if the user doesn't set one
set(rapids-cmake-branch "branch-${rapids-cmake-version}")
endif()

# Allow users to control the exact URL passed to FetchContent
if(NOT rapids-cmake-url)
# Construct a default URL if the user doesn't set one
set(rapids-cmake-url "https://github.com/${rapids-cmake-repo}/")
# In order of specificity
if(rapids-cmake-sha)
# An exact git SHA takes precedence over anything
string(APPEND rapids-cmake-url "archive/${rapids-cmake-sha}.zip")
elseif(rapids-cmake-tag)
# Followed by a git tag name
string(APPEND rapids-cmake-url "archive/refs/tags/${rapids-cmake-tag}.zip")
else()
# Or if neither of the above two were defined, use a branch
string(APPEND rapids-cmake-url "archive/refs/heads/${rapids-cmake-branch}.zip")
endif()
endif()

if(POLICY CMP0135)
cmake_policy(PUSH)
cmake_policy(SET CMP0135 NEW)
endif()
include(FetchContent)
FetchContent_Declare(rapids-cmake URL "${rapids-cmake-url}")
if(POLICY CMP0135)
cmake_policy(POP)
endif()
FetchContent_GetProperties(rapids-cmake)
if(rapids-cmake_POPULATED)
# Something else has already populated rapids-cmake, only thing
# we need to do is setup the CMAKE_MODULE_PATH
if(NOT "${rapids-cmake-dir}" IN_LIST CMAKE_MODULE_PATH)
list(APPEND CMAKE_MODULE_PATH "${rapids-cmake-dir}")
endif()
else()
FetchContent_MakeAvailable(rapids-cmake)
endif()
74 changes: 0 additions & 74 deletions cmake/libs/libcardinal.cmake

This file was deleted.

107 changes: 107 additions & 0 deletions cmake/libs/libcutlass.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# =============================================================================
# Copyright (c) 2021-2022, 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_cutlass)
set(oneValueArgs VERSION REPOSITORY PINNED_TAG)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}"
${ARGN})

# if(RAFT_ENABLE_DIST_DEPENDENCIES OR RAFT_COMPILE_LIBRARIES)
set(CUTLASS_ENABLE_HEADERS_ONLY
ON
CACHE BOOL "Enable only the header library")
set(CUTLASS_NAMESPACE
"raft_cutlass"
CACHE STRING "Top level namespace of CUTLASS")
set(CUTLASS_ENABLE_CUBLAS
OFF
CACHE BOOL "Disable CUTLASS to build with cuBLAS library.")

if(CUDA_STATIC_RUNTIME)
set(CUDART_LIBRARY
"${CUDA_cudart_static_LIBRARY}"
CACHE FILEPATH "fixing cutlass cmake code" FORCE)
endif()

rapids_cpm_find(
NvidiaCutlass
${PKG_VERSION}
GLOBAL_TARGETS
nvidia::cutlass::cutlass
CPM_ARGS
GIT_REPOSITORY
${PKG_REPOSITORY}
GIT_TAG
${PKG_PINNED_TAG}
GIT_SHALLOW
TRUE
OPTIONS
"CUDAToolkit_ROOT ${CUDAToolkit_LIBRARY_DIR}")

if(TARGET CUTLASS AND NOT TARGET nvidia::cutlass::cutlass)
add_library(nvidia::cutlass::cutlass ALIAS CUTLASS)
endif()

if(NvidiaCutlass_ADDED)
rapids_export(
BUILD
NvidiaCutlass
EXPORT_SET
NvidiaCutlass
GLOBAL_TARGETS
nvidia::cutlass::cutlass
NAMESPACE
nvidia::cutlass::)
endif()
# endif()

# We generate the cutlass-config files when we built cutlass locally, so
# always do `find_dependency`
rapids_export_package(BUILD NvidiaCutlass raft-distance-exports
GLOBAL_TARGETS nvidia::cutlass::cutlass)
rapids_export_package(INSTALL NvidiaCutlass raft-distance-exports
GLOBAL_TARGETS nvidia::cutlass::cutlass)
rapids_export_package(BUILD NvidiaCutlass raft-nn-exports GLOBAL_TARGETS
nvidia::cutlass::cutlass)
rapids_export_package(INSTALL NvidiaCutlass raft-nn-exports GLOBAL_TARGETS
nvidia::cutlass::cutlass)

# Tell cmake where it can find the generated NvidiaCutlass-config.cmake we
# wrote.
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(
INSTALL NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}/../]=]
raft-distance-exports)
rapids_export_find_package_root(
BUILD NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}]=] raft-distance-exports)
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(
INSTALL NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}/../]=] raft-nn-exports)
rapids_export_find_package_root(
BUILD NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}]=] raft-nn-exports)
endfunction()

if(NOT RAFT_CUTLASS_GIT_TAG)
set(RAFT_CUTLASS_GIT_TAG v2.9.1)
endif()

if(NOT RAFT_CUTLASS_GIT_REPOSITORY)
set(RAFT_CUTLASS_GIT_REPOSITORY https://github.com/NVIDIA/cutlass.git)
endif()

find_and_configure_cutlass(
VERSION 2.9.1 REPOSITORY ${RAFT_CUTLASS_GIT_REPOSITORY} PINNED_TAG
${RAFT_CUTLASS_GIT_TAG})
16 changes: 6 additions & 10 deletions cmake/libs/libdiskann.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ set(DISKANN_SOURCES
find_package(folly REQUIRED)

add_library(diskann STATIC ${DISKANN_SOURCES})
target_link_libraries(
diskann
PUBLIC ${AIO_LIBRARIES}
${DISKANN_BOOST_PROGRAM_OPTIONS_LIB}
nlohmann_json::nlohmann_json
Folly::folly
fmt::fmt-header-only
prometheus-cpp::core
prometheus-cpp::push
glog::glog)
target_link_libraries(diskann PUBLIC ${AIO_LIBRARIES}
${DISKANN_BOOST_PROGRAM_OPTIONS_LIB}
nlohmann_json::nlohmann_json
Folly::folly
fmt::fmt-header-only
glog::glog)
if(__X86_64)
target_compile_options(
diskann PRIVATE -fno-builtin-malloc -fno-builtin-calloc
Expand Down
Loading

0 comments on commit 26b5009

Please sign in to comment.