From 945044f2f3390506aaf608db0bc3d8b76aff451c Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 17 Apr 2024 16:33:25 -0700 Subject: [PATCH 01/20] initial commit --- cpp/bench/ann/CMakeLists.txt | 11 + cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 304 ++++++++++++++++++ cpp/cmake/thirdparty/get_diskann.cmake | 40 +++ 3 files changed, 355 insertions(+) create mode 100644 cpp/bench/ann/src/diskann/diskann_wrapper.cuh create mode 100644 cpp/cmake/thirdparty/get_diskann.cmake diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index ee84f7515a..9e625af49e 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -31,6 +31,7 @@ option(RAFT_ANN_BENCH_USE_RAFT_BRUTE_FORCE "Include raft's brute force knn in be option(RAFT_ANN_BENCH_USE_RAFT_CAGRA_HNSWLIB "Include raft's CAGRA in benchmark" ON) option(RAFT_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(RAFT_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" ON) +option(RAFT_ANN_BENCH_USE_DISKANN "Include diskann algorithm in benchmark" ON) option(RAFT_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF ) @@ -56,6 +57,7 @@ if(BUILD_CPU_ONLY) set(RAFT_ANN_BENCH_USE_RAFT_BRUTE_FORCE OFF) set(RAFT_ANN_BENCH_USE_RAFT_CAGRA_HNSWLIB OFF) set(RAFT_ANN_BENCH_USE_GGNN OFF) + set(RAFT_ANN_BENCH_USE_DISKANN OFF) else() # Disable faiss benchmarks on CUDA 12 since faiss is not yet CUDA 12-enabled. # https://github.com/rapidsai/raft/issues/1627 @@ -115,6 +117,10 @@ if(RAFT_ANN_BENCH_USE_FAISS) include(cmake/thirdparty/get_faiss.cmake) endif() +if(RAFT_ANN_BENCH_USE_DISKANN) + include(cmake/thirdparty/get_diskann.cmake) +endif() + # ################################################################################################## # * Enable NVTX if available @@ -332,6 +338,11 @@ if(RAFT_ANN_BENCH_USE_GGNN) ConfigureAnnBench(NAME GGNN PATH bench/ann/src/ggnn/ggnn_benchmark.cu LINKS glog::glog ggnn::ggnn) endif() +if(RAFT_ANN_BENCH_USE_DISKANN) + ConfigureAnnBench( + NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cpp LINKS diskann::diskann + ) + # ################################################################################################## # * Dynamically-loading ANN_BENCH executable ------------------------------------------------------- if(RAFT_ANN_BENCH_SINGLE_EXE) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh new file mode 100644 index 0000000000..ee79541be1 --- /dev/null +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2023-2024, 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. + */ +#pragma once + +#include "../common/ann_types.hpp" +#include "../common/thread_pool.hpp" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +#include "program_options_utils.hpp" +#include "raft/neighbors/cagra_types.hpp" + +#include +#include +#include +#include + +#include + +#ifndef _WINDOWS +#include +#include +#else +#include +#endif + +#include "ann_exception.h" +#include "memory_mapper.h" + +#include + +namespace raft::bench::ann { + +diskann::Metric parse_metric_type(raft::bench::ann::Metric metric) +{ + if (metric == raft::bench::ann::Metric::kInnerProduct) { + return diskann::Metric::INNER_PRODUCT; + } else if (metric == raft::bench::ann::Metric::kEuclidean) { + return diskann::Metric::L2; + } else { + throw std::runtime_error("currently only inner product and L2 supported for benchmarking"); + } +} + +template +class DiskANNMemory : public ANN { + public: + optional_configs.add_options()( + "num_threads,T", + po::value(&num_threads)->default_value(omp_get_num_procs()), + program_options_utils::NUMBER_THREADS_DESCRIPTION); + optional_configs.add_options()("max_degree,R", + po::value(&R)->default_value(64), + program_options_utils::MAX_BUILD_DEGREE); + optional_configs.add_options()("cagra_"); + optional_configs.add_options()("Lbuild,L", + po::value(&L)->default_value(100), + program_options_utils::GRAPH_BUILD_COMPLEXITY); + optional_configs.add_options()("alpha", + po::value(&alpha)->default_value(1.2f), + program_options_utils::GRAPH_BUILD_ALPHA); + optional_configs.add_options()("build_PQ_bytes", + po::value(&build_PQ_bytes)->default_value(0), + program_options_utils::BUIlD_GRAPH_PQ_BYTES); + optional_configs.add_options()("use_opq", + po::bool_switch()->default_value(false), + program_options_utils::USE_OPQ); + optional_configs.add_options()("label_file", + po::value(&label_file)->default_value(""), + program_options_utils::LABEL_FILE); + optional_configs.add_options()("universal_label", + po::value(&universal_label)->default_value(""), + program_options_utils::UNIVERSAL_LABEL); + + optional_configs.add_options()("FilteredLbuild", + po::value(&Lf)->default_value(0), + program_options_utils::FILTERED_LBUILD); + optional_configs.add_options()("label_type", + po::value(&label_type)->default_value("uint"), + program_options_utils::LABEL_TYPE_DESCRIPTION); + + struct BuildParam { + uint32_t R; + uint32_t Lb; + float alpha; + int num_threads = omp_get_num_procs(); + bool use_raft_cagra; + bool filtered_index; + raft::neighbors::cagra::index_params cagra_params; + }; + + using typename ANN::AnnSearchParam; + struct SearchParam : public AnnSearchParam { + uint32_t Ls; + int num_threads = omp_get_num_procs(); + }; + + DiskANNMemory(Metric metric, int dim, const BuildParam& param); + + void build(const T* dataset, size_t nrow) override; + + void set_search_param(const AnnSearchParam& param) override; + void search( + const T* query, int batch_size, int k, size_t* indices, float* distances) const override; + + void save(const std::string& path_to_index) const override; + void load(const std::string& path_to_index) override; + + AlgoProperty get_preference() const override + { + AlgoProperty property; + property.dataset_memory_type = MemoryType::Host; + property.query_memory_type = MemoryType::Host; + return property; + } + + private: + void get_search_knn_results_(const T* query, int k, size_t* indices, float* distances) const; + + using ANN::metric_; + using ANN::dim_; + int num_threads_; +}; + +template +DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) + : ANN(metric, dim) +{ + assert(dim_ > 0); + + this->index_build_params = std::make_shared(diskann::IndexWriteParametersBuilder(param.L, param.R) + .with_filter_list_size(0) + .with_alpha(param.alpha) + .with_saturate_graph(false) + .with_num_threads(param.num_threads) + .build()); + + bool use_pq_build = param.build_PQ_bytes > 0; + this->index_build_config_ = diskann::IndexConfigBuilder() + .with_metric(parse_metric_type(metric_)) + .with_dimension(dim_) + .with_max_points(0) + .with_data_load_store_strategy(diskann::DataStoreStrategy::MEMORY) + .with_graph_load_store_strategy(diskann::GraphStoreStrategy::MEMORY) + .with_data_type(diskann::diskann_type_to_name()) + .with_label_type(diskann::diskann_type_to_name()) + .is_dynamic_index(false) + .with_index_write_params(this->index_build_params_) + .is_enable_tags(false) + .is_use_opq(false) + .is_pq_dist_build(use_pq_build) + .with_num_pq_chunks(this->build_PQ_bytes) + .build(); +} + +template +void DiskANNMemory::build(const T* dataset, size_t nrow) +{ + this->index_build_config_.with_max_points(nrow) + + Index::Index(metric_, + dim_, + nrow, + this->index_build_params, + nullptr, + 0, + false, + false, + false, + use_pq_build, + this->build_PQ_bytes, + false); +} + +template +void HnswLib::set_search_param(const AnnSearchParam& param_) +{ + auto param = dynamic_cast(param_); + appr_alg_->ef_ = param.ef; + metric_objective_ = param.metric_objective; + num_threads_ = param.num_threads; + + // Create a pool if multiple query threads have been set and the pool hasn't been created already + bool create_pool = (metric_objective_ == Objective::LATENCY && num_threads_ > 1 && !thread_pool_); + if (create_pool) { thread_pool_ = std::make_shared(num_threads_); } +} + +template +void DiskANNMemory::search( + const T* query, int batch_size, int k, size_t* indices, float* distances) const +{ + auto f = [&](int i) { + // hnsw can only handle a single vector at a time. + get_search_knn_results_(query + i * dim_, k, indices + i * k, distances + i * k); + }; + if (metric_objective_ == Objective::LATENCY && num_threads_ > 1) { + thread_pool_->submit(f, batch_size); + } else { + for (int i = 0; i < batch_size; i++) { + f(i); + } + } + +#pragma omp parallel for schedule(dynamic, 1) + for (int64_t i = 0; i < (int64_t)query_num; i++) { + if (filtered_search && !tags) { + std::string raw_filter = query_filters.size() == 1 ? query_filters[0] : query_filters[i]; + + auto retval = index->search_with_filters(query + i * query_aligned_dim, + raw_filter, + recall_at, + L, + query_result_ids[test_id].data() + i * recall_at, + query_result_dists[test_id].data() + i * recall_at); + cmp_stats[i] = retval.second; + } else if (metric == diskann::FAST_L2) { + index->search_with_optimized_layout(query + i * query_aligned_dim, + recall_at, + L, + query_result_ids[test_id].data() + i * recall_at); + } else if (tags) { + if (!filtered_search) { + index->search_with_tags(query + i * query_aligned_dim, + recall_at, + L, + query_result_tags.data() + i * recall_at, + nullptr, + res); + } else { + std::string raw_filter = query_filters.size() == 1 ? query_filters[0] : query_filters[i]; + + index->search_with_tags(query + i * query_aligned_dim, + recall_at, + L, + query_result_tags.data() + i * recall_at, + nullptr, + res, + true, + raw_filter); + } + + for (int64_t r = 0; r < (int64_t)recall_at; r++) { + query_result_ids[test_id][recall_at * i + r] = query_result_tags[recall_at * i + r]; + } + } else { + cmp_stats[i] = index + ->search(query + i * query_aligned_dim, + recall_at, + L, + query_result_ids[test_id].data() + i * recall_at) + .second; + } + auto qe = std::chrono::high_resolution_clock::now(); + std::chrono::duration diff = qe - qs; + latency_stats[i] = (float)(diff.count() * 1000000); + } +} + +template +void DiskANNMemory::save(const std::string& path_to_index) const +{ + index_->save(path_to_index.c_str()); +} + +template +void DiskANNMemory::load(const std::string& path_to_index) +{ + index_->load(path_to_index.c_str(), num_threads, search_l); +} + +}; // namespace raft::bench::ann diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake new file mode 100644 index 0000000000..5cbae0ec18 --- /dev/null +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -0,0 +1,40 @@ +#============================================================================= +# Copyright (c) 2024, 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_diskann) + set(oneValueArgs VERSION REPOSITORY PINNED_TAG) + cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN} ) + + rapids_cpm_find(diskann ${PKG_VERSION} + GLOBAL_TARGETS diskann::diskann + CPM_ARGS + GIT_REPOSITORY ${PKG_REPOSITORY} + GIT_TAG ${PKG_PINNED_TAG} + ) +endfunction() + +if(NOT RAFT_DISKANN_GIT_TAG) + set(RAFT_DISKANN_GIT_TAG cagra_int) +endif() + +if(NOT RAFT_DISKANN_GIT_REPOSITORY) + # set(RAFT_FAISS_GIT_REPOSITORY https://github.com/tarang-jain/DiskANN.git) +endif() + +find_and_configure_diskann(VERSION 0.7.0 + REPOSITORY ${RAFT_DISKANN_GIT_REPOSITORY} + PINNED_TAG ${RAFT_DISKANN_GIT_TAG}) From 08da994585d0756cdc077467ab26bc834705cf75 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 23 Apr 2024 16:23:50 -0700 Subject: [PATCH 02/20] add diskann patch --- cpp/bench/ann/CMakeLists.txt | 1 + .../ann/src/diskann/diskann_benchmark.cpp | 132 +++ cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 304 ------- cpp/bench/ann/src/diskann/diskann_wrapper.h | 192 +++++ cpp/bench/prims/CMakeLists.txt | 11 +- cpp/cmake/patches/diskann.diff | 783 ++++++++++++++++++ cpp/cmake/thirdparty/get_diskann.cmake | 18 +- rapids_config.cmake | 6 +- 8 files changed, 1130 insertions(+), 317 deletions(-) create mode 100644 cpp/bench/ann/src/diskann/diskann_benchmark.cpp delete mode 100644 cpp/bench/ann/src/diskann/diskann_wrapper.cuh create mode 100644 cpp/bench/ann/src/diskann/diskann_wrapper.h create mode 100644 cpp/cmake/patches/diskann.diff diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 9e625af49e..c561a144e5 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -342,6 +342,7 @@ if(RAFT_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cpp LINKS diskann::diskann ) +endif() # ################################################################################################## # * Dynamically-loading ANN_BENCH executable ------------------------------------------------------- diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp new file mode 100644 index 0000000000..46652bb092 --- /dev/null +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2023-2024, 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. + */ + +#include "../common/ann_types.hpp" +#include "diskann_wrapper.h" +#include "hnswlib_wrapper.h" + +#define JSON_DIAGNOSTICS 1 +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace raft::bench::ann { + +template +void parse_build_param(const nlohmann::json& conf, + typename raft::bench::ann::DiskANNMemory::BuildParam& param) +{ + param.ef_construction = conf.at("efConstruction"); + param.M = conf.at("M"); + param.R = conf.at("R"); + param.Lb = conf.at("Lb"); + param.alpha = conf.at("alpha"); + if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } + param.use_raft_cagra = conf.at("use_raft_cagra"); + param.filtered_index = false; + if (param.use_raft_cagra) { + raft::neighbors::cagra::index_params cagra_index_params; + cagra_index_params.graph_degree = conf.at("cagra_params_graph_degree"); + cagra_index_params.intermediate_graph_degree = + conf.at("cagra_params_intermediate_graph_degree"); + } +} + +template +void parse_search_param(const nlohmann::json& conf, + typename raft::bench::ann::DiskANNMemory::SearchParam& param) +{ + param.Ls = conf.at("Ls"); + if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } +} + +template class Algo> +std::unique_ptr> make_algo(raft::bench::ann::Metric metric, + int dim, + const nlohmann::json& conf) +{ + typename Algo::BuildParam param; + parse_build_param(conf, param); + return std::make_unique>(metric, dim, param); +} + +template class Algo> +std::unique_ptr> make_algo(raft::bench::ann::Metric metric, + int dim, + const nlohmann::json& conf, + const std::vector& dev_list) +{ + typename Algo::BuildParam param; + parse_build_param(conf, param); + + (void)dev_list; + return std::make_unique>(metric, dim, param); +} + +template +std::unique_ptr> create_algo(const std::string& algo, + const std::string& distance, + int dim, + const nlohmann::json& conf, + const std::vector& dev_list) +{ + // stop compiler warning; not all algorithms support multi-GPU so it may not be used + (void)dev_list; + + raft::bench::ann::Metric metric = parse_metric(distance); + std::unique_ptr> ann; + + if constexpr (std::is_same_v) { + if (algo == "hnswlib") { ann = make_algo(metric, dim, conf); } + } + + if constexpr (std::is_same_v) { + if (algo == "hnswlib") { ann = make_algo(metric, dim, conf); } + } + + if (!ann) { throw std::runtime_error("invalid algo: '" + algo + "'"); } + return ann; +} + +template +std::unique_ptr::AnnSearchParam> create_search_param( + const std::string& algo, const nlohmann::json& conf) +{ + if (algo == "hnswlib") { + auto param = std::make_unique::SearchParam>(); + parse_search_param(conf, *param); + return param; + } + // else + throw std::runtime_error("invalid algo: '" + algo + "'"); +} + +}; // namespace raft::bench::ann + +REGISTER_ALGO_INSTANCE(float); +REGISTER_ALGO_INSTANCE(std::int8_t); +REGISTER_ALGO_INSTANCE(std::uint8_t); + +#ifdef ANN_BENCH_BUILD_MAIN +#include "../common/benchmark.hpp" +int main(int argc, char** argv) { return raft::bench::ann::run_main(argc, argv); } +#endif \ No newline at end of file diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh deleted file mode 100644 index ee79541be1..0000000000 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (c) 2023-2024, 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. - */ -#pragma once - -#include "../common/ann_types.hpp" -#include "../common/thread_pool.hpp" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. - -#include "program_options_utils.hpp" -#include "raft/neighbors/cagra_types.hpp" - -#include -#include -#include -#include - -#include - -#ifndef _WINDOWS -#include -#include -#else -#include -#endif - -#include "ann_exception.h" -#include "memory_mapper.h" - -#include - -namespace raft::bench::ann { - -diskann::Metric parse_metric_type(raft::bench::ann::Metric metric) -{ - if (metric == raft::bench::ann::Metric::kInnerProduct) { - return diskann::Metric::INNER_PRODUCT; - } else if (metric == raft::bench::ann::Metric::kEuclidean) { - return diskann::Metric::L2; - } else { - throw std::runtime_error("currently only inner product and L2 supported for benchmarking"); - } -} - -template -class DiskANNMemory : public ANN { - public: - optional_configs.add_options()( - "num_threads,T", - po::value(&num_threads)->default_value(omp_get_num_procs()), - program_options_utils::NUMBER_THREADS_DESCRIPTION); - optional_configs.add_options()("max_degree,R", - po::value(&R)->default_value(64), - program_options_utils::MAX_BUILD_DEGREE); - optional_configs.add_options()("cagra_"); - optional_configs.add_options()("Lbuild,L", - po::value(&L)->default_value(100), - program_options_utils::GRAPH_BUILD_COMPLEXITY); - optional_configs.add_options()("alpha", - po::value(&alpha)->default_value(1.2f), - program_options_utils::GRAPH_BUILD_ALPHA); - optional_configs.add_options()("build_PQ_bytes", - po::value(&build_PQ_bytes)->default_value(0), - program_options_utils::BUIlD_GRAPH_PQ_BYTES); - optional_configs.add_options()("use_opq", - po::bool_switch()->default_value(false), - program_options_utils::USE_OPQ); - optional_configs.add_options()("label_file", - po::value(&label_file)->default_value(""), - program_options_utils::LABEL_FILE); - optional_configs.add_options()("universal_label", - po::value(&universal_label)->default_value(""), - program_options_utils::UNIVERSAL_LABEL); - - optional_configs.add_options()("FilteredLbuild", - po::value(&Lf)->default_value(0), - program_options_utils::FILTERED_LBUILD); - optional_configs.add_options()("label_type", - po::value(&label_type)->default_value("uint"), - program_options_utils::LABEL_TYPE_DESCRIPTION); - - struct BuildParam { - uint32_t R; - uint32_t Lb; - float alpha; - int num_threads = omp_get_num_procs(); - bool use_raft_cagra; - bool filtered_index; - raft::neighbors::cagra::index_params cagra_params; - }; - - using typename ANN::AnnSearchParam; - struct SearchParam : public AnnSearchParam { - uint32_t Ls; - int num_threads = omp_get_num_procs(); - }; - - DiskANNMemory(Metric metric, int dim, const BuildParam& param); - - void build(const T* dataset, size_t nrow) override; - - void set_search_param(const AnnSearchParam& param) override; - void search( - const T* query, int batch_size, int k, size_t* indices, float* distances) const override; - - void save(const std::string& path_to_index) const override; - void load(const std::string& path_to_index) override; - - AlgoProperty get_preference() const override - { - AlgoProperty property; - property.dataset_memory_type = MemoryType::Host; - property.query_memory_type = MemoryType::Host; - return property; - } - - private: - void get_search_knn_results_(const T* query, int k, size_t* indices, float* distances) const; - - using ANN::metric_; - using ANN::dim_; - int num_threads_; -}; - -template -DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) - : ANN(metric, dim) -{ - assert(dim_ > 0); - - this->index_build_params = std::make_shared(diskann::IndexWriteParametersBuilder(param.L, param.R) - .with_filter_list_size(0) - .with_alpha(param.alpha) - .with_saturate_graph(false) - .with_num_threads(param.num_threads) - .build()); - - bool use_pq_build = param.build_PQ_bytes > 0; - this->index_build_config_ = diskann::IndexConfigBuilder() - .with_metric(parse_metric_type(metric_)) - .with_dimension(dim_) - .with_max_points(0) - .with_data_load_store_strategy(diskann::DataStoreStrategy::MEMORY) - .with_graph_load_store_strategy(diskann::GraphStoreStrategy::MEMORY) - .with_data_type(diskann::diskann_type_to_name()) - .with_label_type(diskann::diskann_type_to_name()) - .is_dynamic_index(false) - .with_index_write_params(this->index_build_params_) - .is_enable_tags(false) - .is_use_opq(false) - .is_pq_dist_build(use_pq_build) - .with_num_pq_chunks(this->build_PQ_bytes) - .build(); -} - -template -void DiskANNMemory::build(const T* dataset, size_t nrow) -{ - this->index_build_config_.with_max_points(nrow) - - Index::Index(metric_, - dim_, - nrow, - this->index_build_params, - nullptr, - 0, - false, - false, - false, - use_pq_build, - this->build_PQ_bytes, - false); -} - -template -void HnswLib::set_search_param(const AnnSearchParam& param_) -{ - auto param = dynamic_cast(param_); - appr_alg_->ef_ = param.ef; - metric_objective_ = param.metric_objective; - num_threads_ = param.num_threads; - - // Create a pool if multiple query threads have been set and the pool hasn't been created already - bool create_pool = (metric_objective_ == Objective::LATENCY && num_threads_ > 1 && !thread_pool_); - if (create_pool) { thread_pool_ = std::make_shared(num_threads_); } -} - -template -void DiskANNMemory::search( - const T* query, int batch_size, int k, size_t* indices, float* distances) const -{ - auto f = [&](int i) { - // hnsw can only handle a single vector at a time. - get_search_knn_results_(query + i * dim_, k, indices + i * k, distances + i * k); - }; - if (metric_objective_ == Objective::LATENCY && num_threads_ > 1) { - thread_pool_->submit(f, batch_size); - } else { - for (int i = 0; i < batch_size; i++) { - f(i); - } - } - -#pragma omp parallel for schedule(dynamic, 1) - for (int64_t i = 0; i < (int64_t)query_num; i++) { - if (filtered_search && !tags) { - std::string raw_filter = query_filters.size() == 1 ? query_filters[0] : query_filters[i]; - - auto retval = index->search_with_filters(query + i * query_aligned_dim, - raw_filter, - recall_at, - L, - query_result_ids[test_id].data() + i * recall_at, - query_result_dists[test_id].data() + i * recall_at); - cmp_stats[i] = retval.second; - } else if (metric == diskann::FAST_L2) { - index->search_with_optimized_layout(query + i * query_aligned_dim, - recall_at, - L, - query_result_ids[test_id].data() + i * recall_at); - } else if (tags) { - if (!filtered_search) { - index->search_with_tags(query + i * query_aligned_dim, - recall_at, - L, - query_result_tags.data() + i * recall_at, - nullptr, - res); - } else { - std::string raw_filter = query_filters.size() == 1 ? query_filters[0] : query_filters[i]; - - index->search_with_tags(query + i * query_aligned_dim, - recall_at, - L, - query_result_tags.data() + i * recall_at, - nullptr, - res, - true, - raw_filter); - } - - for (int64_t r = 0; r < (int64_t)recall_at; r++) { - query_result_ids[test_id][recall_at * i + r] = query_result_tags[recall_at * i + r]; - } - } else { - cmp_stats[i] = index - ->search(query + i * query_aligned_dim, - recall_at, - L, - query_result_ids[test_id].data() + i * recall_at) - .second; - } - auto qe = std::chrono::high_resolution_clock::now(); - std::chrono::duration diff = qe - qs; - latency_stats[i] = (float)(diff.count() * 1000000); - } -} - -template -void DiskANNMemory::save(const std::string& path_to_index) const -{ - index_->save(path_to_index.c_str()); -} - -template -void DiskANNMemory::load(const std::string& path_to_index) -{ - index_->load(path_to_index.c_str(), num_threads, search_l); -} - -}; // namespace raft::bench::ann diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h new file mode 100644 index 0000000000..606d0acc6e --- /dev/null +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2023-2024, 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. + */ +#pragma once + +#include "../common/ann_types.hpp" +#include "../common/thread_pool.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +#include "program_options_utils.hpp" +#include "raft/neighbors/cagra_types.hpp" + +#include +#include +#include +#include + +#include + +#ifndef _WINDOWS +#include +#include +#else +#include +#endif + +#include "ann_exception.h" +#include "memory_mapper.h" + +#include + +namespace raft::bench::ann { + +diskann::Metric parse_metric_type(raft::bench::ann::Metric metric) +{ + if (metric == raft::bench::ann::Metric::kInnerProduct) { + return diskann::Metric::INNER_PRODUCT; + } else if (metric == raft::bench::ann::Metric::kEuclidean) { + return diskann::Metric::L2; + } else { + throw std::runtime_error("currently only inner product and L2 supported for benchmarking"); + } +} + +template +class DiskANNMemory : public ANN { + public: + struct BuildParam { + uint32_t R; + uint32_t L_build; + float alpha; + int num_threads = omp_get_num_procs(); + bool use_raft_cagra; + bool filtered_index; + raft::neighbors::cagra::index_params cagra_index_params; + }; + + using typename ANN::AnnSearchParam; + struct SearchParam : public AnnSearchParam { + uint32_t L_search; + uint32_t L_load; + int num_threads = omp_get_num_procs(); + }; + + DiskANNMemory(Metric metric, int dim, const BuildParam& param); + + void build(const T* dataset, size_t nrow) override; + + void set_search_param(const AnnSearchParam& param) override; + void search( + const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const override; + + void save(const std::string& path_to_index) const override; + void load(const std::string& path_to_index) override; + + AlgoProperty get_preference() const override + { + AlgoProperty property; + property.dataset_memory_type = MemoryType::Host; + property.query_memory_type = MemoryType::Host; + return property; + } + + private: + bool use_pq_build_; + uint32_t build_PQ_bytes_; + std::shared_ptr diskann_index_write_params_{nullptr}; + std::shared_ptr diskann_index_search_params_{nullptr}; + std::unique_ptr> diskann_index_{nullptr}; + int num_threads_search_; + uint32_t L_search_; +}; + +template +DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) + : ANN(metric, dim) +{ + assert(dim_ > 0); + + this->diskann_index_write_params_ = std::make_shared( + diskann::IndexWriteParametersBuilder(param.L_build, param.R) + .with_filter_list_size(0) + .with_alpha(param.alpha) + .with_saturate_graph(false) + .with_num_threads(param.num_threads) + .build()); +} + +template +void DiskANNMemory::build(const T* dataset, size_t nrow) +{ + this->diskann_index_ = + std::make_unique>(diskann::Index(parse_metric_type(this->metric_), + this->dim_, + nrow, + this->diskann_index_write_params_, + nullptr, + 0, + false, + false, + false, + this->use_pq_build_, + this->build_PQ_bytes_, + false)); +} + +template +void DiskANNMemory::set_search_param(const AnnSearchParam& param_) +{ + auto param = dynamic_cast(param_); + this->num_threads_search_ = param.num_threads; + L_search_ = param.L_search; +} + +template +void DiskANNMemory::search( + const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const +{ + omp_set_num_threads(num_threads_search_); +#pragma omp parallel for schedule(dynamic, 1) + for (int64_t i = 0; i < (int64_t)batch_size; i++) { + diskann_index_->search(queries + i * dim_, k, L_search_, neighbors, distances); + } +} + +template +void DiskANNMemory::save(const std::string& path_to_index) const +{ + this->diskann_index_->save(path_to_index.c_str()); +} + +template +void DiskANNMemory::load(const std::string& path_to_index) +{ + this->diskann_index_->load(path_to_index.c_str(), num_threads_search_, L_search_); +} + +}; // namespace raft::bench::ann diff --git a/cpp/bench/prims/CMakeLists.txt b/cpp/bench/prims/CMakeLists.txt index 0c5521d447..3150659650 100644 --- a/cpp/bench/prims/CMakeLists.txt +++ b/cpp/bench/prims/CMakeLists.txt @@ -128,17 +128,12 @@ if(BUILD_PRIMS_BENCH) ConfigureBench( NAME RANDOM_BENCH PATH bench/prims/random/make_blobs.cu bench/prims/random/permute.cu - bench/prims/random/rng.cu bench/prims/random/subsample.cu bench/prims/main.cpp + bench/prims/random/rng.cu bench/prims/random/subsample.cu bench/prims/main.cpp ) ConfigureBench( - NAME - SPARSE_BENCH - PATH - bench/prims/sparse/bitmap_to_csr.cu - bench/prims/sparse/convert_csr.cu - bench/prims/sparse/select_k_csr.cu - bench/prims/main.cpp + NAME SPARSE_BENCH PATH bench/prims/sparse/bitmap_to_csr.cu bench/prims/sparse/convert_csr.cu + bench/prims/sparse/select_k_csr.cu bench/prims/main.cpp ) ConfigureBench( diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff new file mode 100644 index 0000000000..bae50b8246 --- /dev/null +++ b/cpp/cmake/patches/diskann.diff @@ -0,0 +1,783 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d3d2b8..c775d07 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,6 +23,28 @@ set(CMAKE_STANDARD 17) + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + ++cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) ++ ++# ------------- configure rapids-cmake --------------# ++ ++include(cmake/thirdparty/fetch_rapids.cmake) ++include(rapids-cmake) ++include(rapids-cpm) ++include(rapids-cuda) ++include(rapids-export) ++include(rapids-find) ++ ++# ------------- configure project --------------# ++ ++rapids_cuda_init_architectures(${PROJECT_NAME}) ++ ++project(${PROJECT_NAME} LANGUAGES CXX CUDA) ++ ++# ------------- configure raft -----------------# ++ ++rapids_cpm_init() ++include(cmake/thirdparty/get_raft.cmake) ++ + if(NOT MSVC) + set(CMAKE_CXX_COMPILER g++) + endif() +@@ -331,3 +353,7 @@ include(clang-format.cmake) + if(PYBIND) + add_subdirectory(python) + endif() ++ ++if(NOT TARGET raft::raft) ++ find_package(raft COMPONENTS compiled distributed) ++endif() +diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt +index e42c0b6..2401163 100644 +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -2,7 +2,7 @@ + # Licensed under the MIT license. + + set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_COMPILE_WARNING_AS_ERROR ON) ++set(CMAKE_COMPILE_WARNING_AS_ERROR OFF) + + add_executable(build_memory_index build_memory_index.cpp) + target_link_libraries(build_memory_index ${PROJECT_NAME} ${DISKANN_TOOLS_TCMALLOC_LINK_OPTIONS} Boost::program_options) +diff --git a/apps/restapi/CMakeLists.txt b/apps/restapi/CMakeLists.txt +index c73b427..de0b794 100644 +--- a/apps/restapi/CMakeLists.txt ++++ b/apps/restapi/CMakeLists.txt +@@ -37,4 +37,4 @@ if(MSVC) + target_link_libraries(client optimized ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE}/diskann_dll.lib Boost::program_options) + else() + target_link_libraries(client ${PROJECT_NAME} -lboost_system -lcrypto -lssl -lcpprest Boost::program_options) +-endif() +\ No newline at end of file ++endif() +diff --git a/build.sh b/build.sh +new file mode 100755 +index 0000000..fd20a3b +--- /dev/null ++++ b/build.sh +@@ -0,0 +1,36 @@ ++#!/bin/bash ++ ++# NOTE: This file is temporary for the proof-of-concept branch and will be removed before this PR is merged ++ ++BUILD_TYPE=Release ++BUILD_DIR=build/ ++ ++RAFT_REPO_REL="" ++EXTRA_CMAKE_ARGS="" ++set -e ++ ++if [[ ${RAFT_REPO_REL} != "" ]]; then ++ RAFT_REPO_PATH="`readlink -f \"${RAFT_REPO_REL}\"`" ++ EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCPM_raft_SOURCE=${RAFT_REPO_PATH}" ++fi ++ ++if [ "$1" == "clean" ]; then ++ rm -rf build ++ rm -rf .cache ++ exit 0 ++fi ++ ++mkdir -p $BUILD_DIR ++cd $BUILD_DIR ++ ++cmake \ ++ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ ++ -DCMAKE_CUDA_ARCHITECTURES="NATIVE" \ ++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ ++ -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \ ++ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ ++ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ ++ ${EXTRA_CMAKE_ARGS} \ ++ ../ ++ ++make -j30 +diff --git a/cmake/thirdparty/fetch_rapids.cmake b/cmake/thirdparty/fetch_rapids.cmake +new file mode 100644 +index 0000000..11d2403 +--- /dev/null ++++ b/cmake/thirdparty/fetch_rapids.cmake +@@ -0,0 +1,21 @@ ++# ============================================================================= ++# Copyright (c) 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. ++ ++# Use this variable to update RAPIDS and RAFT versions ++set(RAPIDS_VERSION "24.06") ++ ++if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) ++ file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION}/RAPIDS.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) ++endif() ++include(${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) +diff --git a/cmake/thirdparty/get_raft.cmake b/cmake/thirdparty/get_raft.cmake +new file mode 100644 +index 0000000..6128b5c +--- /dev/null ++++ b/cmake/thirdparty/get_raft.cmake +@@ -0,0 +1,63 @@ ++# ============================================================================= ++# Copyright (c) 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. ++ ++# Use RAPIDS_VERSION from cmake/thirdparty/fetch_rapids.cmake ++set(RAFT_VERSION "${RAPIDS_VERSION}") ++set(RAFT_FORK "rapidsai") ++set(RAFT_PINNED_TAG "branch-${RAPIDS_VERSION}") ++ ++function(find_and_configure_raft) ++ set(oneValueArgs VERSION FORK PINNED_TAG COMPILE_LIBRARY ENABLE_NVTX ENABLE_MNMG_DEPENDENCIES) ++ cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" ++ "${multiValueArgs}" ${ARGN} ) ++ ++ set(RAFT_COMPONENTS "") ++ if(PKG_COMPILE_LIBRARY) ++ string(APPEND RAFT_COMPONENTS " compiled") ++ endif() ++ ++ if(PKG_ENABLE_MNMG_DEPENDENCIES) ++ string(APPEND RAFT_COMPONENTS " distributed") ++ endif() ++ ++ #----------------------------------------------------- ++ # Invoke CPM find_package() ++ #----------------------------------------------------- ++ rapids_cpm_find(raft ${PKG_VERSION} ++ GLOBAL_TARGETS raft::raft ++ BUILD_EXPORT_SET raft-template-exports ++ INSTALL_EXPORT_SET raft-template-exports ++ COMPONENTS ${RAFT_COMPONENTS} ++ CPM_ARGS ++ GIT_REPOSITORY https://github.com/${PKG_FORK}/raft.git ++ GIT_TAG ${PKG_PINNED_TAG} ++ SOURCE_SUBDIR cpp ++ OPTIONS ++ "BUILD_TESTS OFF" ++ "BUILD_PRIMS_BENCH OFF" ++ "BUILD_ANN_BENCH OFF" ++ "RAFT_NVTX ${ENABLE_NVTX}" ++ "RAFT_COMPILE_LIBRARY ${PKG_COMPILE_LIBRARY}" ++ ) ++endfunction() ++ ++# Change pinned tag here to test a commit in CI ++# To use a different RAFT locally, set the CMake variable ++# CPM_raft_SOURCE=/path/to/local/raft ++find_and_configure_raft(VERSION ${RAFT_VERSION}.00 ++ FORK ${RAFT_FORK} ++ PINNED_TAG ${RAFT_PINNED_TAG} ++ COMPILE_LIBRARY ON ++ ENABLE_MNMG_DEPENDENCIES OFF ++ ENABLE_NVTX OFF ++) +diff --git a/include/distance.h b/include/distance.h +index f3b1de2..4e92738 100644 +--- a/include/distance.h ++++ b/include/distance.h +@@ -77,6 +77,7 @@ class DistanceCosineInt8 : public Distance + DistanceCosineInt8() : Distance(diskann::Metric::COSINE) + { + } ++ // using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const; + }; + +@@ -86,6 +87,7 @@ class DistanceL2Int8 : public Distance + DistanceL2Int8() : Distance(diskann::Metric::L2) + { + } ++ // using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t size) const; + }; + +@@ -96,6 +98,7 @@ class AVXDistanceL2Int8 : public Distance + AVXDistanceL2Int8() : Distance(diskann::Metric::L2) + { + } ++ // using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const; + }; + +@@ -105,6 +108,7 @@ class DistanceCosineFloat : public Distance + DistanceCosineFloat() : Distance(diskann::Metric::COSINE) + { + } ++ // using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; + }; + +@@ -114,6 +118,7 @@ class DistanceL2Float : public Distance + DistanceL2Float() : Distance(diskann::Metric::L2) + { + } ++ // using Distance::compare; + + #ifdef _WINDOWS + DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t size) const; +@@ -128,6 +133,7 @@ class AVXDistanceL2Float : public Distance + AVXDistanceL2Float() : Distance(diskann::Metric::L2) + { + } ++ // using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; + }; + +@@ -146,6 +152,7 @@ class SlowDistanceCosineUInt8 : public Distance + SlowDistanceCosineUInt8() : Distance(diskann::Metric::COSINE) + { + } ++ using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t length) const; + }; + +@@ -155,6 +162,7 @@ class DistanceL2UInt8 : public Distance + DistanceL2UInt8() : Distance(diskann::Metric::L2) + { + } ++ // using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t size) const; + }; + +@@ -170,6 +178,8 @@ template class DistanceInnerProduct : public Distance + } + inline float inner_product(const T *a, const T *b, unsigned size) const; + ++ // using Distance::compare; ++ + inline float compare(const T *a, const T *b, unsigned size) const + { + float result = inner_product(a, b, size); +@@ -198,6 +208,7 @@ class AVXDistanceInnerProductFloat : public Distance + AVXDistanceInnerProductFloat() : Distance(diskann::Metric::INNER_PRODUCT) + { + } ++ using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; + }; + +@@ -213,6 +224,7 @@ class AVXNormalizedCosineDistanceFloat : public Distance + AVXNormalizedCosineDistanceFloat() : Distance(diskann::Metric::COSINE) + { + } ++ using Distance::compare; + DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const + { + // Inner product returns negative values to indicate distance. +diff --git a/include/index.h b/include/index.h +index b9bf4f3..bd2c07e 100644 +--- a/include/index.h ++++ b/include/index.h +@@ -29,6 +29,11 @@ + #define EXPAND_IF_FULL 0 + #define DEFAULT_MAXC 750 + ++// namespace raft::neighbors::cagra{ ++// template ++// class index; ++// } ++ + namespace diskann + { + +@@ -66,7 +71,7 @@ template clas + const size_t num_frozen_pts = 0, const bool dynamic_index = false, + const bool enable_tags = false, const bool concurrent_consolidate = false, + const bool pq_dist_build = false, const size_t num_pq_chunks = 0, +- const bool use_opq = false, const bool filtered_index = false); ++ const bool use_opq = false, const bool filtered_index = false, const bool raft_cagra_index = false, const std::shared_ptr raft_cagra_index_params = nullptr); + + DISKANN_DLLEXPORT ~Index(); + +@@ -236,6 +241,9 @@ template clas + Index(const Index &) = delete; + Index &operator=(const Index &) = delete; + ++ // Build the raft CAGRA index ++ void build_raft_cagra_index(const T* data); ++ + // Use after _data and _nd have been populated + // Acquire exclusive _update_lock before calling + void build_with_data_populated(const std::vector &tags); +@@ -286,6 +294,8 @@ template clas + // Acquire exclusive _update_lock before calling + void link(); + ++ void add_raft_cagra_nbrs(); ++ + // Acquire exclusive _tag_lock and _delete_lock before calling + int reserve_location(); + +@@ -444,5 +454,11 @@ template clas + std::vector _locks; + + static const float INDEX_GROWTH_FACTOR; ++ ++ // optional around the Raft Cagra index ++ // raft::neighbors::cagra::index* raft_knn_index; ++ bool _raft_cagra_index = false; ++ std::shared_ptr _raft_cagra_index_params = nullptr; ++ std::vector host_cagra_graph; + }; + } // namespace diskann +diff --git a/include/index_config.h b/include/index_config.h +index 452498b..c9110da 100644 +--- a/include/index_config.h ++++ b/include/index_config.h +@@ -1,5 +1,10 @@ + #include "common_includes.h" + #include "parameters.h" ++#include ++ ++namespace raft::neighbors::cagra{ ++struct index_params; ++} + + namespace diskann + { +@@ -41,18 +46,23 @@ struct IndexConfig + // Params for searching index + std::shared_ptr index_search_params; + ++ bool raft_cagra_index; ++ std::shared_ptr raft_cagra_index_params; ++ + private: + IndexConfig(DataStoreStrategy data_strategy, GraphStoreStrategy graph_strategy, Metric metric, size_t dimension, + size_t max_points, size_t num_pq_chunks, size_t num_frozen_points, bool dynamic_index, bool enable_tags, +- bool pq_dist_build, bool concurrent_consolidate, bool use_opq, bool filtered_index, ++ bool pq_dist_build, bool concurrent_consolidate, bool use_opq, bool filtered_index, bool raft_cagra_index, + std::string &data_type, const std::string &tag_type, const std::string &label_type, + std::shared_ptr index_write_params, +- std::shared_ptr index_search_params) ++ std::shared_ptr index_search_params, ++ std::shared_ptr raft_cagra_index_params ++ ) + : data_strategy(data_strategy), graph_strategy(graph_strategy), metric(metric), dimension(dimension), + max_points(max_points), dynamic_index(dynamic_index), enable_tags(enable_tags), pq_dist_build(pq_dist_build), +- concurrent_consolidate(concurrent_consolidate), use_opq(use_opq), filtered_index(filtered_index), ++ concurrent_consolidate(concurrent_consolidate), use_opq(use_opq), filtered_index(filtered_index), raft_cagra_index(raft_cagra_index), + num_pq_chunks(num_pq_chunks), num_frozen_pts(num_frozen_points), label_type(label_type), tag_type(tag_type), +- data_type(data_type), index_write_params(index_write_params), index_search_params(index_search_params) ++ data_type(data_type), index_write_params(index_write_params), index_search_params(index_search_params), raft_cagra_index_params{raft_cagra_index_params} + { + } + +@@ -194,6 +204,18 @@ class IndexConfigBuilder + return *this; + } + ++ IndexConfigBuilder &is_raft_cagra_index(bool is_raft_cagra_index) ++ { ++ this->_raft_cagra_index = is_raft_cagra_index; ++ return *this; ++ } ++ ++ IndexConfigBuilder &with_raft_cagra_index_params(std::shared_ptr raft_cagra_index_params_ptr) ++ { ++ this->_raft_cagra_index_params = raft_cagra_index_params_ptr; ++ return *this; ++ } ++ + IndexConfig build() + { + if (_data_type == "" || _data_type.empty()) +@@ -218,9 +240,9 @@ class IndexConfigBuilder + } + + return IndexConfig(_data_strategy, _graph_strategy, _metric, _dimension, _max_points, _num_pq_chunks, +- _num_frozen_pts, _dynamic_index, _enable_tags, _pq_dist_build, _concurrent_consolidate, ++ _num_frozen_pts, _dynamic_index, _enable_tags, _pq_dist_build, _concurrent_consolidate, _raft_cagra_index, + _use_opq, _filtered_index, _data_type, _tag_type, _label_type, _index_write_params, +- _index_search_params); ++ _index_search_params, _raft_cagra_index_params); + } + + IndexConfigBuilder(const IndexConfigBuilder &) = delete; +@@ -240,6 +262,7 @@ class IndexConfigBuilder + bool _concurrent_consolidate = false; + bool _use_opq = false; + bool _filtered_index{defaults::HAS_LABELS}; ++ bool _raft_cagra_index = false; + + size_t _num_pq_chunks = 0; + size_t _num_frozen_pts{defaults::NUM_FROZEN_POINTS_STATIC}; +@@ -250,5 +273,6 @@ class IndexConfigBuilder + + std::shared_ptr _index_write_params; + std::shared_ptr _index_search_params; ++ std::shared_ptr _raft_cagra_index_params; + }; + } // namespace diskann +diff --git a/include/index_factory.h b/include/index_factory.h +index 80bc40d..138adcb 100644 +--- a/include/index_factory.h ++++ b/include/index_factory.h +@@ -46,4 +46,4 @@ class IndexFactory + std::unique_ptr _config; + }; + +-} // namespace diskann ++} // namespace diskann +\ No newline at end of file +diff --git a/include/utils.h b/include/utils.h +index d3af5c3..2cb2181 100644 +--- a/include/utils.h ++++ b/include/utils.h +@@ -1,4 +1,4 @@ +-// Copyright (c) Microsoft Corporation. All rights reserved. ++// Copyright (c) Microsoft Corporation. All rights reserved. + // Licensed under the MIT license. + + #pragma once +@@ -29,6 +29,7 @@ typedef int FileHandle; + #include "types.h" + #include "tag_uint128.h" + #include ++#include + + #ifdef EXEC_ENV_OLS + #include "content_buf.h" +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index cbca264..5bec876 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -2,14 +2,14 @@ + #Licensed under the MIT license. + + set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_COMPILE_WARNING_AS_ERROR ON) ++set(CMAKE_COMPILE_WARNING_AS_ERROR OFF) + + if(MSVC) + add_subdirectory(dll) + else() + #file(GLOB CPP_SOURCES *.cpp) + set(CPP_SOURCES abstract_data_store.cpp ann_exception.cpp disk_utils.cpp +- distance.cpp index.cpp in_mem_graph_store.cpp in_mem_data_store.cpp ++ distance.cpp index.cu in_mem_graph_store.cpp in_mem_data_store.cpp + linux_aligned_file_reader.cpp math_utils.cpp natural_number_map.cpp + in_mem_data_store.cpp in_mem_graph_store.cpp + natural_number_set.cpp memory_mapper.cpp partition.cpp pq.cpp +@@ -19,6 +19,9 @@ else() + endif() + add_library(${PROJECT_NAME} ${CPP_SOURCES}) + add_library(${PROJECT_NAME}_s STATIC ${CPP_SOURCES}) ++ ++ target_link_libraries(${PROJECT_NAME} PRIVATE raft::raft raft::compiled) ++ target_link_libraries(${PROJECT_NAME}_s PRIVATE raft::raft raft::compiled) + endif() + + if (NOT MSVC) +diff --git a/src/dll/CMakeLists.txt b/src/dll/CMakeLists.txt +index 096d1b7..e36fe7c 100644 +--- a/src/dll/CMakeLists.txt ++++ b/src/dll/CMakeLists.txt +@@ -2,7 +2,7 @@ + #Licensed under the MIT license. + + add_library(${PROJECT_NAME} SHARED dllmain.cpp ../abstract_data_store.cpp ../partition.cpp ../pq.cpp ../pq_flash_index.cpp ../logger.cpp ../utils.cpp +- ../windows_aligned_file_reader.cpp ../distance.cpp ../pq_l2_distance.cpp ../memory_mapper.cpp ../index.cpp ++ ../windows_aligned_file_reader.cpp ../distance.cpp ../pq_l2_distance.cpp ../memory_mapper.cpp ../index.cu + ../in_mem_data_store.cpp ../pq_data_store.cpp ../in_mem_graph_store.cpp ../math_utils.cpp ../disk_utils.cpp ../filter_utils.cpp + ../ann_exception.cpp ../natural_number_set.cpp ../natural_number_map.cpp ../scratch.cpp ../index_factory.cpp ../abstract_index.cpp) + +@@ -32,4 +32,4 @@ foreach(RUNTIME_FILE ${RUNTIME_FILES_TO_COPY}) + add_custom_command(TARGET ${PROJECT_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${RUNTIME_FILE}" "${TARGET_DIR}") +-endforeach() +\ No newline at end of file ++endforeach() +diff --git a/src/index.cpp b/src/index.cu +similarity index 96% +rename from src/index.cpp +rename to src/index.cu +index bf93344..0f9571d 100644 +--- a/src/index.cpp ++++ b/src/index.cu +@@ -1,6 +1,7 @@ + // Copyright (c) Microsoft Corporation. All rights reserved. + // Licensed under the MIT license. + ++#include + #include + + #include +@@ -22,11 +23,27 @@ + #endif + + #include "index.h" ++#include ++#include + + #define MAX_POINTS_FOR_USING_BITSET 10000000 + + namespace diskann + { ++ ++raft::distance::DistanceType parse_metric_to_raft(diskann::Metric m) ++{ ++ switch (m) ++ { ++ case diskann::Metric::L2: ++ return raft::distance::DistanceType::L2Expanded; ++ case diskann::Metric::INNER_PRODUCT: ++ return raft::distance::DistanceType::InnerProduct; ++ default: ++ throw ANNException("ERROR: RAFT only supports L2 and INNER_PRODUCT.", -1, __FUNCSIG__, __FILE__, __LINE__); ++ } ++} ++ + // Initialize an index with metric m, load the data of type T with filename + // (bin), and initialize max_points + template +@@ -38,7 +55,8 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr), _conc_consolidate(index_config.concurrent_consolidate) ++ _delete_set(new tsl::robin_set), _conc_consolidate(index_config.concurrent_consolidate), ++ _raft_cagra_index(index_config.raft_cagra_index) + { + if (_dynamic_index && !_enable_tags) + { +@@ -109,6 +127,21 @@ Index::Index(const IndexConfig &index_config, std::shared_ptrget_dims()); + } + } ++ ++ if (_raft_cagra_index) ++ { ++ if (index_config.raft_cagra_index_params != nullptr) ++ { ++ assert(parse_metric_to_raft(_dist_metric) == raft_cagra_index_params->metric); ++ _raft_cagra_index_params = index_config.raft_cagra_index_params; ++ } ++ else ++ { ++ raft::neighbors::cagra::index_params raft_cagra_index_params; ++ raft_cagra_index_params.metric = parse_metric_to_raft(_dist_metric); ++ _raft_cagra_index_params = std::make_shared(raft_cagra_index_params); ++ } ++ } + } + + template +@@ -117,7 +150,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point + const std::shared_ptr index_search_params, const size_t num_frozen_pts, + const bool dynamic_index, const bool enable_tags, const bool concurrent_consolidate, + const bool pq_dist_build, const size_t num_pq_chunks, const bool use_opq, +- const bool filtered_index) ++ const bool filtered_index, const bool raft_cagra_index, ++ const std::shared_ptr raft_cagra_index_params) + : Index( + IndexConfigBuilder() + .with_metric(m) +@@ -134,6 +168,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point + .is_use_opq(use_opq) + .is_filtered(filtered_index) + .with_data_type(diskann_type_to_name()) ++ .is_raft_cagra_index(raft_cagra_index) ++ .with_raft_cagra_index_params(raft_cagra_index_params) + .build(), + IndexFactory::construct_datastore(DataStoreStrategy::MEMORY, + (max_points == 0 ? (size_t)1 : max_points) + +@@ -732,6 +768,7 @@ template int Index + + template uint32_t Index::calculate_entry_point() + { ++ std::cout << "inside calculate entry point" << std::endl; + // REFACTOR TODO: This function does not support multi-threaded calculation of medoid. + // Must revisit if perf is a concern. + return _data_store->calculate_medoid(); +@@ -739,6 +776,7 @@ template uint32_t Index std::vector Index::get_init_ids() + { ++ // std::cout << "num_frozen_pts" << _num_frozen_pts << std::endl; + std::vector init_ids; + init_ids.reserve(1 + _num_frozen_pts); + +@@ -839,6 +877,8 @@ std::pair Index::iterate_to_fixed_point( + _pq_data_store->get_distance(scratch->aligned_query(), ids, dists_out, scratch); + }; + ++ // raft::print_host_vector("init_ids", init_ids.data(), init_ids.size(), std::cout); ++ + // Initialize the candidate pool with starting points + for (auto id : init_ids) + { +@@ -1371,6 +1411,56 @@ template void Index void Index::add_raft_cagra_nbrs() ++{ ++ uint32_t num_threads = _indexingThreads; ++ if (num_threads != 0) ++ omp_set_num_threads(num_threads); ++ ++ assert(_num_frozen_pts == 0); ++ ++ /* visit_order is a vector that is initialized to the entire graph */ ++ std::vector visit_order; ++ tsl::robin_set visited; ++ visit_order.reserve(_nd + _num_frozen_pts); ++ for (uint32_t i = 0; i < (uint32_t)_nd; i++) ++ { ++ visit_order.emplace_back(i); ++ } ++ ++ // if there are frozen points, the first such one is set to be the _start ++ if (_num_frozen_pts > 0) ++ _start = (uint32_t)_max_points; ++ else ++ _start = calculate_entry_point(); ++ ++#pragma omp parallel for schedule(dynamic, 2048) ++ for (int64_t node_ctr = 0; node_ctr < (int64_t)(visit_order.size()); node_ctr++) ++ { ++ auto node = visit_order[node_ctr]; ++ ++ std::vector cagra_nbrs(_indexingRange); ++ uint32_t *nbr_start_ptr = host_cagra_graph.data() + node * _indexingRange; ++ uint32_t *nbr_end_ptr = nbr_start_ptr + _indexingRange; ++ std::copy(nbr_start_ptr, nbr_end_ptr, cagra_nbrs.data()); ++ ++ assert(cagra_nbrs.size() > 0); ++ ++ { ++ LockGuard guard(_locks[node]); ++ ++ _graph_store->set_neighbours(node, cagra_nbrs); ++ assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); ++ } ++ ++ if (node_ctr % 100000 == 0) ++ { ++ diskann::cout << "\r" << (100.0 * node_ctr) / (visit_order.size()) << "% of index build completed." ++ << std::flush; ++ } ++ } ++} ++ + template + void Index::prune_all_neighbors(const uint32_t max_degree, const uint32_t max_occlusion_size, + const float alpha) +@@ -1448,8 +1538,6 @@ void Index::set_start_points(const T *data, size_t data_count) + if (data_count != _num_frozen_pts * _dim) + throw ANNException("Invalid number of points", -1, __FUNCSIG__, __FILE__, __LINE__); + +- // memcpy(_data + _aligned_dim * _max_points, data, _aligned_dim * +- // sizeof(T) * _num_frozen_pts); + for (location_t i = 0; i < _num_frozen_pts; i++) + { + _data_store->set_vector((location_t)(i + _max_points), data + i * _dim); +@@ -1505,6 +1593,24 @@ void Index::set_start_points_at_random(T radius, uint32_t rando + set_start_points(points_data.data(), points_data.size()); + } + ++template void Index::build_raft_cagra_index(const T *data) ++{ ++ raft::device_resources handle; ++ auto dataset_view = raft::make_host_matrix_view(data, int64_t(_nd), _dim); ++ auto raft_knn_index = raft::neighbors::cagra::build(handle, *_raft_cagra_index_params, dataset_view); ++ ++ auto stream = handle.get_stream(); ++ auto device_graph = raft_knn_index.graph(); ++ host_cagra_graph.resize(device_graph.extent(0) * device_graph.extent(1)); ++ ++ std::cout << "host_cagra_graph_size" << host_cagra_graph.size() << std::endl; ++ ++ thrust::copy(thrust::device_ptr(device_graph.data_handle()), ++ thrust::device_ptr(device_graph.data_handle() + device_graph.size()), ++ host_cagra_graph.data()); ++ handle.sync_stream(); ++} ++ + template + void Index::build_with_data_populated(const std::vector &tags) + { +@@ -1542,7 +1648,14 @@ void Index::build_with_data_populated(const std::vector & + } + + generate_frozen_point(); +- link(); ++ if (_raft_cagra_index) ++ { ++ add_raft_cagra_nbrs(); ++ } ++ else ++ { ++ link(); ++ } + + size_t max = 0, min = SIZE_MAX, total = 0, cnt = 0; + for (size_t i = 0; i < _nd; i++) +@@ -1559,6 +1672,7 @@ void Index::build_with_data_populated(const std::vector & + + _has_built = true; + } ++ + template + void Index::_build(const DataType &data, const size_t num_points_to_load, TagVector &tags) + { +@@ -1597,6 +1711,8 @@ void Index::build(const T *data, const size_t num_points_to_loa + _data_store->populate_data(data, (location_t)num_points_to_load); + } + ++ build_raft_cagra_index(data); ++ + build_with_data_populated(tags); + } + +@@ -1683,6 +1799,9 @@ void Index::build(const char *filename, const size_t num_points + std::unique_lock tl(_tag_lock); + _nd = num_points_to_load; + } ++ ++ auto _in_mem_data_store = std::static_pointer_cast>(_data_store); ++ build_raft_cagra_index(_in_mem_data_store->_data); + build_with_data_populated(tags); + } + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 6af8405..a44caab 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -38,4 +38,3 @@ add_executable(${PROJECT_NAME}_unit_tests ${DISKANN_SOURCES} ${DISKANN_UNIT_TEST + target_link_libraries(${PROJECT_NAME}_unit_tests ${PROJECT_NAME} ${DISKANN_TOOLS_TCMALLOC_LINK_OPTIONS} Boost::unit_test_framework) + + add_test(NAME ${PROJECT_NAME}_unit_tests COMMAND ${PROJECT_NAME}_unit_tests) +- diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index 5cbae0ec18..0309d18c3b 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -18,21 +18,33 @@ function(find_and_configure_diskann) set(oneValueArgs VERSION REPOSITORY PINNED_TAG) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + + set(patch_files_to_run "${CMAKE_CURRENT_SOURCE_DIR}/cmake/patches/diskann.diff") + set(patch_issues_to_ref "fix compile issues") + set(patch_script "${CMAKE_BINARY_DIR}/rapids-cmake/patches/diskann/patch.cmake") + set(log_file "${CMAKE_BINARY_DIR}/rapids-cmake/patches/diskann/log") + string(TIMESTAMP current_year "%Y" UTC) + configure_file(${rapids-cmake-dir}/cpm/patches/command_template.cmake.in "${patch_script}" + @ONLY) - rapids_cpm_find(diskann ${PKG_VERSION} + rapids_cpm_find(diskann GLOBAL_TARGETS diskann::diskann CPM_ARGS GIT_REPOSITORY ${PKG_REPOSITORY} GIT_TAG ${PKG_PINNED_TAG} ) + + if(TARGET diskann AND NOT TARGET diskann::diskann) + add_library(diskann::diskann ALIAS diskann) + endif() endfunction() if(NOT RAFT_DISKANN_GIT_TAG) - set(RAFT_DISKANN_GIT_TAG cagra_int) + set(RAFT_DISKANN_GIT_TAG main) endif() if(NOT RAFT_DISKANN_GIT_REPOSITORY) - # set(RAFT_FAISS_GIT_REPOSITORY https://github.com/tarang-jain/DiskANN.git) + set(RAFT_FAISS_GIT_REPOSITORY https://github.com/microsoft/DiskANN.git) endif() find_and_configure_diskann(VERSION 0.7.0 diff --git a/rapids_config.cmake b/rapids_config.cmake index c8077f7f4b..a40d7130c0 100644 --- a/rapids_config.cmake +++ b/rapids_config.cmake @@ -22,13 +22,15 @@ else() string(REPLACE "\n" "\n " _rapids_version_formatted " ${_rapids_version}") message( FATAL_ERROR - "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}") + "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}" + ) endif() if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") file( DOWNLOAD "https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION_MAJOR_MINOR}/RAPIDS.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") + "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake" + ) endif() include("${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") From 1b0512817b56a8d4b55f9d3c34502ea50d3c81ee Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 25 Apr 2024 12:25:20 -0700 Subject: [PATCH 03/20] update cmake --- cpp/bench/ann/CMakeLists.txt | 2 +- .../ann/src/diskann/diskann_benchmark.cpp | 31 +++++++------------ cpp/bench/ann/src/diskann/diskann_wrapper.h | 13 +++----- cpp/cmake/thirdparty/get_diskann.cmake | 7 +++-- 4 files changed, 20 insertions(+), 33 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index c561a144e5..b97df90280 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -340,7 +340,7 @@ endif() if(RAFT_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( - NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cpp LINKS diskann::diskann + NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cpp LINKS diskann::diskann raft::compiled ) endif() diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp index 46652bb092..12f28bcd14 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -16,7 +16,6 @@ #include "../common/ann_types.hpp" #include "diskann_wrapper.h" -#include "hnswlib_wrapper.h" #define JSON_DIAGNOSTICS 1 #include @@ -35,19 +34,15 @@ template void parse_build_param(const nlohmann::json& conf, typename raft::bench::ann::DiskANNMemory::BuildParam& param) { - param.ef_construction = conf.at("efConstruction"); - param.M = conf.at("M"); param.R = conf.at("R"); - param.Lb = conf.at("Lb"); + param.L_build = conf.at("Lb"); param.alpha = conf.at("alpha"); if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } param.use_raft_cagra = conf.at("use_raft_cagra"); - param.filtered_index = false; if (param.use_raft_cagra) { - raft::neighbors::cagra::index_params cagra_index_params; - cagra_index_params.graph_degree = conf.at("cagra_params_graph_degree"); - cagra_index_params.intermediate_graph_degree = - conf.at("cagra_params_intermediate_graph_degree"); + param.cagra_graph_degree = conf.at("cagra_graph_degree"); + param.cagra_intermediate_graph_degree = + conf.at("cagra_intermediate_graph_degree"); } } @@ -55,7 +50,7 @@ template void parse_search_param(const nlohmann::json& conf, typename raft::bench::ann::DiskANNMemory::SearchParam& param) { - param.Ls = conf.at("Ls"); + param.L_search = conf.at("Ls"); if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } } @@ -95,15 +90,12 @@ std::unique_ptr> create_algo(const std::string& algo, raft::bench::ann::Metric metric = parse_metric(distance); std::unique_ptr> ann; - if constexpr (std::is_same_v) { - if (algo == "hnswlib") { ann = make_algo(metric, dim, conf); } + if constexpr (std::is_same_v || std::is_same_v || + std::is_same_v) { + if (algo == "diskann") { ann = make_algo(metric, dim, conf); } } - - if constexpr (std::is_same_v) { - if (algo == "hnswlib") { ann = make_algo(metric, dim, conf); } - } - if (!ann) { throw std::runtime_error("invalid algo: '" + algo + "'"); } + return ann; } @@ -111,12 +103,11 @@ template std::unique_ptr::AnnSearchParam> create_search_param( const std::string& algo, const nlohmann::json& conf) { - if (algo == "hnswlib") { - auto param = std::make_unique::SearchParam>(); + if (algo == "diskann") { + auto param = std::make_unique::SearchParam>(); parse_search_param(conf, *param); return param; } - // else throw std::runtime_error("invalid algo: '" + algo + "'"); } diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 606d0acc6e..55fca6ec70 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -16,9 +16,6 @@ #pragma once #include "../common/ann_types.hpp" -#include "../common/thread_pool.hpp" - -#include #include #include @@ -38,10 +35,6 @@ #include #include -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. - -#include "program_options_utils.hpp" #include "raft/neighbors/cagra_types.hpp" #include @@ -61,7 +54,7 @@ #include "ann_exception.h" #include "memory_mapper.h" -#include +// #include namespace raft::bench::ann { @@ -86,7 +79,8 @@ class DiskANNMemory : public ANN { int num_threads = omp_get_num_procs(); bool use_raft_cagra; bool filtered_index; - raft::neighbors::cagra::index_params cagra_index_params; + uint32_t cagra_graph_degree; + uint32_t cagra_intermediate_graph_degree; }; using typename ANN::AnnSearchParam; @@ -149,6 +143,7 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) nrow, this->diskann_index_write_params_, nullptr, + nullptr, 0, false, false, diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index 0309d18c3b..5e609d2280 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -27,14 +27,15 @@ function(find_and_configure_diskann) configure_file(${rapids-cmake-dir}/cpm/patches/command_template.cmake.in "${patch_script}" @ONLY) - rapids_cpm_find(diskann + rapids_cpm_find(diskann ${PKG_VERSION} GLOBAL_TARGETS diskann::diskann CPM_ARGS GIT_REPOSITORY ${PKG_REPOSITORY} GIT_TAG ${PKG_PINNED_TAG} ) - if(TARGET diskann AND NOT TARGET diskann::diskann) + if(NOT TARGET diskann::diskann) + target_include_directories(diskann INTERFACE "$") add_library(diskann::diskann ALIAS diskann) endif() endfunction() @@ -44,7 +45,7 @@ if(NOT RAFT_DISKANN_GIT_TAG) endif() if(NOT RAFT_DISKANN_GIT_REPOSITORY) - set(RAFT_FAISS_GIT_REPOSITORY https://github.com/microsoft/DiskANN.git) + set(RAFT_DISKANN_GIT_REPOSITORY https://github.com/microsoft/DiskANN.git) endif() find_and_configure_diskann(VERSION 0.7.0 From 0b9cad47545eb09c23d8f40052dbdc623d886e9b Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 25 Apr 2024 12:49:50 -0700 Subject: [PATCH 04/20] add patch --- cpp/cmake/thirdparty/get_diskann.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index 5e609d2280..d1021a01ab 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -32,9 +32,13 @@ function(find_and_configure_diskann) CPM_ARGS GIT_REPOSITORY ${PKG_REPOSITORY} GIT_TAG ${PKG_PINNED_TAG} + GIT_SHALLOW TRUE + DOWNLOAD_ONLY ON + PATCH_COMMAND ${CMAKE_COMMAND} -P ${patch_script} ) if(NOT TARGET diskann::diskann) + add_library(diskann INTERFACE) target_include_directories(diskann INTERFACE "$") add_library(diskann::diskann ALIAS diskann) endif() From 21f7b555b5303fc49df4a4900ed90ee0ff238e18 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 29 Apr 2024 14:24:00 -0700 Subject: [PATCH 05/20] diskann wrapper --- cpp/bench/ann/CMakeLists.txt | 2 +- ...ann_benchmark.cpp => diskann_benchmark.cu} | 6 +- ...{diskann_wrapper.h => diskann_wrapper.cuh} | 67 +- cpp/cmake/patches/diskann.diff | 784 ++++-------------- 4 files changed, 212 insertions(+), 647 deletions(-) rename cpp/bench/ann/src/diskann/{diskann_benchmark.cpp => diskann_benchmark.cu} (97%) rename cpp/bench/ann/src/diskann/{diskann_wrapper.h => diskann_wrapper.cuh} (73%) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index b97df90280..9a521f3397 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -340,7 +340,7 @@ endif() if(RAFT_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( - NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cpp LINKS diskann::diskann raft::compiled + NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cu LINKS diskann::diskann raft::compiled ) endif() diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cu similarity index 97% rename from cpp/bench/ann/src/diskann/diskann_benchmark.cpp rename to cpp/bench/ann/src/diskann/diskann_benchmark.cu index 12f28bcd14..cd84af5070 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cu @@ -15,7 +15,7 @@ */ #include "../common/ann_types.hpp" -#include "diskann_wrapper.h" +#include "diskann_wrapper.cuh" #define JSON_DIAGNOSTICS 1 #include @@ -38,8 +38,8 @@ void parse_build_param(const nlohmann::json& conf, param.L_build = conf.at("Lb"); param.alpha = conf.at("alpha"); if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } - param.use_raft_cagra = conf.at("use_raft_cagra"); - if (param.use_raft_cagra) { + param.use_cagra_graph = conf.at("use_raft_cagra"); + if (param.use_cagra_graph) { param.cagra_graph_degree = conf.at("cagra_graph_degree"); param.cagra_intermediate_graph_degree = conf.at("cagra_intermediate_graph_degree"); diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh similarity index 73% rename from cpp/bench/ann/src/diskann/diskann_wrapper.h rename to cpp/bench/ann/src/diskann/diskann_wrapper.cuh index 55fca6ec70..549e4c870b 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -16,33 +16,15 @@ #pragma once #include "../common/ann_types.hpp" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#include "raft/core/host_mdspan.hpp" #include "raft/neighbors/cagra_types.hpp" +#include "raft/neighbors/cagra.cuh" -#include -#include -#include +#include #include +#include -#include +#include #ifndef _WINDOWS #include @@ -77,7 +59,7 @@ class DiskANNMemory : public ANN { uint32_t L_build; float alpha; int num_threads = omp_get_num_procs(); - bool use_raft_cagra; + bool use_cagra_graph; bool filtered_index; uint32_t cagra_graph_degree; uint32_t cagra_intermediate_graph_degree; @@ -100,6 +82,8 @@ class DiskANNMemory : public ANN { void save(const std::string& path_to_index) const override; void load(const std::string& path_to_index) override; + std::unique_ptr> copy() override { + return std::make_unique>(*this); }; AlgoProperty get_preference() const override { @@ -110,13 +94,17 @@ class DiskANNMemory : public ANN { } private: + bool use_cagra_graph_; bool use_pq_build_; - uint32_t build_PQ_bytes_; + uint32_t build_pq_bytes_; std::shared_ptr diskann_index_write_params_{nullptr}; - std::shared_ptr diskann_index_search_params_{nullptr}; - std::unique_ptr> diskann_index_{nullptr}; + std::shared_ptr diskann_index_search_params_{nullptr}; + std::shared_ptr> diskann_index_{nullptr}; int num_threads_search_; + uint32_t L_build_; uint32_t L_search_; + uint32_t cagra_graph_degree_; + uint32_t cagra_intermediate_graph_degree_; }; template @@ -138,19 +126,34 @@ template void DiskANNMemory::build(const T* dataset, size_t nrow) { this->diskann_index_ = - std::make_unique>(diskann::Index(parse_metric_type(this->metric_), + std::make_shared>(diskann::Index(parse_metric_type(this->metric_), this->dim_, nrow, this->diskann_index_write_params_, nullptr, - nullptr, 0, false, false, false, this->use_pq_build_, - this->build_PQ_bytes_, - false)); + this->build_pq_bytes_, + false, + false, + this->use_cagra_graph_, + cagra_graph_degree_)); + + if (!this->use_cagra_graph_) { + auto intermediate_graph = raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_); + auto knn_graph = raft::make_host_matrix(nrow, cagra_graph_degree_); + auto dataset_view = raft::make_host_matrix_view(dataset, (int64_t)nrow, (int64_t)this->dim_); + raft::resources res; + raft::neighbors::cagra::build_knn_graph(res, + dataset_view, + intermediate_graph.view()); + raft::neighbors::cagra::optimize(res, intermediate_graph.view(), knn_graph.view()); + diskann_index_->build(dataset, nrow, std::vector(), std::shared_ptr(knn_graph.data_handle())); + } + diskann_index_->build(dataset, nrow, std::vector()); } template @@ -168,7 +171,7 @@ void DiskANNMemory::search( omp_set_num_threads(num_threads_search_); #pragma omp parallel for schedule(dynamic, 1) for (int64_t i = 0; i < (int64_t)batch_size; i++) { - diskann_index_->search(queries + i * dim_, k, L_search_, neighbors, distances); + diskann_index_->search(queries + i * this->dim_, k, L_search_, neighbors, distances); } } diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index bae50b8246..9e9cbc6e51 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,465 +1,249 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..c775d07 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -23,6 +23,28 @@ set(CMAKE_STANDARD 17) - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - -+cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -+ -+# ------------- configure rapids-cmake --------------# -+ -+include(cmake/thirdparty/fetch_rapids.cmake) -+include(rapids-cmake) -+include(rapids-cpm) -+include(rapids-cuda) -+include(rapids-export) -+include(rapids-find) -+ -+# ------------- configure project --------------# -+ -+rapids_cuda_init_architectures(${PROJECT_NAME}) -+ -+project(${PROJECT_NAME} LANGUAGES CXX CUDA) -+ -+# ------------- configure raft -----------------# -+ -+rapids_cpm_init() -+include(cmake/thirdparty/get_raft.cmake) -+ - if(NOT MSVC) - set(CMAKE_CXX_COMPILER g++) - endif() -@@ -331,3 +353,7 @@ include(clang-format.cmake) - if(PYBIND) - add_subdirectory(python) - endif() -+ -+if(NOT TARGET raft::raft) -+ find_package(raft COMPONENTS compiled distributed) -+endif() -diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt -index e42c0b6..2401163 100644 ---- a/apps/CMakeLists.txt -+++ b/apps/CMakeLists.txt -@@ -2,7 +2,7 @@ - # Licensed under the MIT license. - - set(CMAKE_CXX_STANDARD 17) --set(CMAKE_COMPILE_WARNING_AS_ERROR ON) -+set(CMAKE_COMPILE_WARNING_AS_ERROR OFF) - - add_executable(build_memory_index build_memory_index.cpp) - target_link_libraries(build_memory_index ${PROJECT_NAME} ${DISKANN_TOOLS_TCMALLOC_LINK_OPTIONS} Boost::program_options) -diff --git a/apps/restapi/CMakeLists.txt b/apps/restapi/CMakeLists.txt -index c73b427..de0b794 100644 ---- a/apps/restapi/CMakeLists.txt -+++ b/apps/restapi/CMakeLists.txt -@@ -37,4 +37,4 @@ if(MSVC) - target_link_libraries(client optimized ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE}/diskann_dll.lib Boost::program_options) - else() - target_link_libraries(client ${PROJECT_NAME} -lboost_system -lcrypto -lssl -lcpprest Boost::program_options) --endif() -\ No newline at end of file -+endif() -diff --git a/build.sh b/build.sh -new file mode 100755 -index 0000000..fd20a3b ---- /dev/null -+++ b/build.sh -@@ -0,0 +1,36 @@ -+#!/bin/bash -+ -+# NOTE: This file is temporary for the proof-of-concept branch and will be removed before this PR is merged -+ -+BUILD_TYPE=Release -+BUILD_DIR=build/ -+ -+RAFT_REPO_REL="" -+EXTRA_CMAKE_ARGS="" -+set -e -+ -+if [[ ${RAFT_REPO_REL} != "" ]]; then -+ RAFT_REPO_PATH="`readlink -f \"${RAFT_REPO_REL}\"`" -+ EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCPM_raft_SOURCE=${RAFT_REPO_PATH}" -+fi -+ -+if [ "$1" == "clean" ]; then -+ rm -rf build -+ rm -rf .cache -+ exit 0 -+fi -+ -+mkdir -p $BUILD_DIR -+cd $BUILD_DIR -+ -+cmake \ -+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -+ -DCMAKE_CUDA_ARCHITECTURES="NATIVE" \ -+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -+ -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \ -+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -+ ${EXTRA_CMAKE_ARGS} \ -+ ../ -+ -+make -j30 -diff --git a/cmake/thirdparty/fetch_rapids.cmake b/cmake/thirdparty/fetch_rapids.cmake -new file mode 100644 -index 0000000..11d2403 ---- /dev/null -+++ b/cmake/thirdparty/fetch_rapids.cmake -@@ -0,0 +1,21 @@ -+# ============================================================================= -+# Copyright (c) 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. -+ -+# Use this variable to update RAPIDS and RAFT versions -+set(RAPIDS_VERSION "24.06") -+ -+if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) -+ file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION}/RAPIDS.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) -+endif() -+include(${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) -diff --git a/cmake/thirdparty/get_raft.cmake b/cmake/thirdparty/get_raft.cmake -new file mode 100644 -index 0000000..6128b5c ---- /dev/null -+++ b/cmake/thirdparty/get_raft.cmake -@@ -0,0 +1,63 @@ -+# ============================================================================= -+# Copyright (c) 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. -+ -+# Use RAPIDS_VERSION from cmake/thirdparty/fetch_rapids.cmake -+set(RAFT_VERSION "${RAPIDS_VERSION}") -+set(RAFT_FORK "rapidsai") -+set(RAFT_PINNED_TAG "branch-${RAPIDS_VERSION}") -+ -+function(find_and_configure_raft) -+ set(oneValueArgs VERSION FORK PINNED_TAG COMPILE_LIBRARY ENABLE_NVTX ENABLE_MNMG_DEPENDENCIES) -+ cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" -+ "${multiValueArgs}" ${ARGN} ) -+ -+ set(RAFT_COMPONENTS "") -+ if(PKG_COMPILE_LIBRARY) -+ string(APPEND RAFT_COMPONENTS " compiled") -+ endif() -+ -+ if(PKG_ENABLE_MNMG_DEPENDENCIES) -+ string(APPEND RAFT_COMPONENTS " distributed") -+ endif() -+ -+ #----------------------------------------------------- -+ # Invoke CPM find_package() -+ #----------------------------------------------------- -+ rapids_cpm_find(raft ${PKG_VERSION} -+ GLOBAL_TARGETS raft::raft -+ BUILD_EXPORT_SET raft-template-exports -+ INSTALL_EXPORT_SET raft-template-exports -+ COMPONENTS ${RAFT_COMPONENTS} -+ CPM_ARGS -+ GIT_REPOSITORY https://github.com/${PKG_FORK}/raft.git -+ GIT_TAG ${PKG_PINNED_TAG} -+ SOURCE_SUBDIR cpp -+ OPTIONS -+ "BUILD_TESTS OFF" -+ "BUILD_PRIMS_BENCH OFF" -+ "BUILD_ANN_BENCH OFF" -+ "RAFT_NVTX ${ENABLE_NVTX}" -+ "RAFT_COMPILE_LIBRARY ${PKG_COMPILE_LIBRARY}" -+ ) -+endfunction() -+ -+# Change pinned tag here to test a commit in CI -+# To use a different RAFT locally, set the CMake variable -+# CPM_raft_SOURCE=/path/to/local/raft -+find_and_configure_raft(VERSION ${RAFT_VERSION}.00 -+ FORK ${RAFT_FORK} -+ PINNED_TAG ${RAFT_PINNED_TAG} -+ COMPILE_LIBRARY ON -+ ENABLE_MNMG_DEPENDENCIES OFF -+ ENABLE_NVTX OFF -+) diff --git a/include/distance.h b/include/distance.h -index f3b1de2..4e92738 100644 +index f3b1de2..c2f0728 100644 --- a/include/distance.h +++ b/include/distance.h -@@ -77,6 +77,7 @@ class DistanceCosineInt8 : public Distance +@@ -77,7 +77,8 @@ class DistanceCosineInt8 : public Distance DistanceCosineInt8() : Distance(diskann::Metric::COSINE) { } -+ // using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const; +- DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const; ++ using Distance::compare; ++ DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const override; }; -@@ -86,6 +87,7 @@ class DistanceL2Int8 : public Distance + class DistanceL2Int8 : public Distance +@@ -86,7 +87,8 @@ class DistanceL2Int8 : public Distance DistanceL2Int8() : Distance(diskann::Metric::L2) { } -+ // using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t size) const; +- DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t size) const; ++ using Distance::compare; ++ DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t size) const override; }; -@@ -96,6 +98,7 @@ class AVXDistanceL2Int8 : public Distance + // AVX implementations. Borrowed from HNSW code. +@@ -96,7 +98,8 @@ class AVXDistanceL2Int8 : public Distance AVXDistanceL2Int8() : Distance(diskann::Metric::L2) { } -+ // using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const; +- DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const; ++ using Distance::compare; ++ DISKANN_DLLEXPORT virtual float compare(const int8_t *a, const int8_t *b, uint32_t length) const override; }; -@@ -105,6 +108,7 @@ class DistanceCosineFloat : public Distance + class DistanceCosineFloat : public Distance +@@ -105,7 +108,8 @@ class DistanceCosineFloat : public Distance DistanceCosineFloat() : Distance(diskann::Metric::COSINE) { } -+ // using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; +- DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; ++ using Distance::compare; ++ DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const override; }; -@@ -114,6 +118,7 @@ class DistanceL2Float : public Distance - DistanceL2Float() : Distance(diskann::Metric::L2) + class DistanceL2Float : public Distance +@@ -115,10 +119,11 @@ class DistanceL2Float : public Distance { } -+ // using Distance::compare; ++ using Distance::compare; #ifdef _WINDOWS DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t size) const; -@@ -128,6 +133,7 @@ class AVXDistanceL2Float : public Distance + #else +- DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t size) const __attribute__((hot)); ++ DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t size) const override __attribute__((hot)); + #endif + }; + +@@ -128,7 +133,8 @@ class AVXDistanceL2Float : public Distance AVXDistanceL2Float() : Distance(diskann::Metric::L2) { } -+ // using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; +- DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; ++ using Distance::compare; ++ DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const override; }; -@@ -146,6 +152,7 @@ class SlowDistanceCosineUInt8 : public Distance + template class SlowDistanceL2 : public Distance +@@ -146,7 +152,8 @@ class SlowDistanceCosineUInt8 : public Distance SlowDistanceCosineUInt8() : Distance(diskann::Metric::COSINE) { } +- DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t length) const; + using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t length) const; ++ DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t length) const override; }; -@@ -155,6 +162,7 @@ class DistanceL2UInt8 : public Distance + class DistanceL2UInt8 : public Distance +@@ -155,7 +162,8 @@ class DistanceL2UInt8 : public Distance DistanceL2UInt8() : Distance(diskann::Metric::L2) { } -+ // using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t size) const; +- DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t size) const; ++ using Distance::compare; ++ DISKANN_DLLEXPORT virtual float compare(const uint8_t *a, const uint8_t *b, uint32_t size) const override; }; -@@ -170,6 +178,8 @@ template class DistanceInnerProduct : public Distance - } - inline float inner_product(const T *a, const T *b, unsigned size) const; - -+ // using Distance::compare; -+ - inline float compare(const T *a, const T *b, unsigned size) const - { - float result = inner_product(a, b, size); -@@ -198,6 +208,7 @@ class AVXDistanceInnerProductFloat : public Distance + template class DistanceInnerProduct : public Distance +@@ -198,7 +206,8 @@ class AVXDistanceInnerProductFloat : public Distance AVXDistanceInnerProductFloat() : Distance(diskann::Metric::INNER_PRODUCT) { } +- DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; + using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const; ++ DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const override; }; -@@ -213,6 +224,7 @@ class AVXNormalizedCosineDistanceFloat : public Distance + class AVXNormalizedCosineDistanceFloat : public Distance +@@ -213,7 +222,8 @@ class AVXNormalizedCosineDistanceFloat : public Distance AVXNormalizedCosineDistanceFloat() : Distance(diskann::Metric::COSINE) { } +- DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const + using Distance::compare; - DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const ++ DISKANN_DLLEXPORT virtual float compare(const float *a, const float *b, uint32_t length) const override { // Inner product returns negative values to indicate distance. + // This will ensure that cosine is between -1 and 1. diff --git a/include/index.h b/include/index.h -index b9bf4f3..bd2c07e 100644 +index b9bf4f3..0691566 100644 --- a/include/index.h +++ b/include/index.h -@@ -29,6 +29,11 @@ - #define EXPAND_IF_FULL 0 - #define DEFAULT_MAXC 750 - -+// namespace raft::neighbors::cagra{ -+// template -+// class index; -+// } -+ - namespace diskann - { - -@@ -66,7 +71,7 @@ template clas +@@ -66,7 +66,8 @@ template clas const size_t num_frozen_pts = 0, const bool dynamic_index = false, const bool enable_tags = false, const bool concurrent_consolidate = false, const bool pq_dist_build = false, const size_t num_pq_chunks = 0, - const bool use_opq = false, const bool filtered_index = false); -+ const bool use_opq = false, const bool filtered_index = false, const bool raft_cagra_index = false, const std::shared_ptr raft_cagra_index_params = nullptr); ++ const bool use_opq = false, const bool filtered_index = false, ++ const bool raft_cagra_graph = false, const size_t raft_cagra_graph_degree = 0); DISKANN_DLLEXPORT ~Index(); -@@ -236,6 +241,9 @@ template clas - Index(const Index &) = delete; - Index &operator=(const Index &) = delete; +@@ -98,7 +99,8 @@ template clas + DISKANN_DLLEXPORT void build(const char *filename, const size_t num_points_to_load, const char *tag_filename); -+ // Build the raft CAGRA index -+ void build_raft_cagra_index(const T* data); -+ - // Use after _data and _nd have been populated - // Acquire exclusive _update_lock before calling - void build_with_data_populated(const std::vector &tags); -@@ -286,6 +294,8 @@ template clas - // Acquire exclusive _update_lock before calling - void link(); + // Batch build from a data array, which must pad vectors to aligned_dim +- DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags); ++ DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags, ++ const std::shared_ptr raft_cagra_graph_ptr = nullptr); -+ void add_raft_cagra_nbrs(); + // Based on filter params builds a filtered or unfiltered index + DISKANN_DLLEXPORT void build(const std::string &data_file, const size_t num_points_to_load, +@@ -233,8 +235,10 @@ template clas + virtual void _set_universal_label(const LabelType universal_label) override; + + // No copy/assign. +- Index(const Index &) = delete; +- Index &operator=(const Index &) = delete; ++ // Index(const Index &) = delete; ++ // Index &operator=(const Index &) = delete; + - // Acquire exclusive _tag_lock and _delete_lock before calling - int reserve_location(); ++ void add_raft_cagra_neighbours(const std::shared_ptr raft_cagra_graph_ptr); -@@ -444,5 +454,11 @@ template clas + // Use after _data and _nd have been populated + // Acquire exclusive _update_lock before calling +@@ -444,5 +448,8 @@ template clas std::vector _locks; static const float INDEX_GROWTH_FACTOR; + -+ // optional around the Raft Cagra index -+ // raft::neighbors::cagra::index* raft_knn_index; -+ bool _raft_cagra_index = false; -+ std::shared_ptr _raft_cagra_index_params = nullptr; -+ std::vector host_cagra_graph; ++ bool _raft_cagra_graph = false; ++ size_t _raft_cagra_graph_degree = 0; }; } // namespace diskann diff --git a/include/index_config.h b/include/index_config.h -index 452498b..c9110da 100644 +index 452498b..b6bcdce 100644 --- a/include/index_config.h +++ b/include/index_config.h -@@ -1,5 +1,10 @@ - #include "common_includes.h" - #include "parameters.h" -+#include -+ -+namespace raft::neighbors::cagra{ -+struct index_params; -+} +@@ -28,9 +28,11 @@ struct IndexConfig + bool concurrent_consolidate; + bool use_opq; + bool filtered_index; ++ bool raft_cagra_graph; - namespace diskann - { -@@ -41,18 +46,23 @@ struct IndexConfig - // Params for searching index - std::shared_ptr index_search_params; + size_t num_pq_chunks; + size_t num_frozen_pts; ++ size_t raft_cagra_graph_degree; + + std::string label_type; + std::string tag_type; +@@ -43,15 +45,16 @@ struct IndexConfig -+ bool raft_cagra_index; -+ std::shared_ptr raft_cagra_index_params; -+ private: IndexConfig(DataStoreStrategy data_strategy, GraphStoreStrategy graph_strategy, Metric metric, size_t dimension, - size_t max_points, size_t num_pq_chunks, size_t num_frozen_points, bool dynamic_index, bool enable_tags, +- size_t max_points, size_t num_pq_chunks, size_t num_frozen_points, bool dynamic_index, bool enable_tags, - bool pq_dist_build, bool concurrent_consolidate, bool use_opq, bool filtered_index, -+ bool pq_dist_build, bool concurrent_consolidate, bool use_opq, bool filtered_index, bool raft_cagra_index, - std::string &data_type, const std::string &tag_type, const std::string &label_type, - std::shared_ptr index_write_params, -- std::shared_ptr index_search_params) -+ std::shared_ptr index_search_params, -+ std::shared_ptr raft_cagra_index_params -+ ) +- std::string &data_type, const std::string &tag_type, const std::string &label_type, +- std::shared_ptr index_write_params, ++ size_t max_points, size_t num_pq_chunks, size_t num_frozen_points, size_t raft_cagra_graph_degree, ++ bool dynamic_index, bool enable_tags, bool pq_dist_build, bool concurrent_consolidate, bool use_opq, ++ bool filtered_index, bool raft_cagra_graph, std::string &data_type, const std::string &tag_type, ++ const std::string &label_type, std::shared_ptr index_write_params, + std::shared_ptr index_search_params) : data_strategy(data_strategy), graph_strategy(graph_strategy), metric(metric), dimension(dimension), max_points(max_points), dynamic_index(dynamic_index), enable_tags(enable_tags), pq_dist_build(pq_dist_build), -- concurrent_consolidate(concurrent_consolidate), use_opq(use_opq), filtered_index(filtered_index), -+ concurrent_consolidate(concurrent_consolidate), use_opq(use_opq), filtered_index(filtered_index), raft_cagra_index(raft_cagra_index), - num_pq_chunks(num_pq_chunks), num_frozen_pts(num_frozen_points), label_type(label_type), tag_type(tag_type), -- data_type(data_type), index_write_params(index_write_params), index_search_params(index_search_params) -+ data_type(data_type), index_write_params(index_write_params), index_search_params(index_search_params), raft_cagra_index_params{raft_cagra_index_params} + concurrent_consolidate(concurrent_consolidate), use_opq(use_opq), filtered_index(filtered_index), +- num_pq_chunks(num_pq_chunks), num_frozen_pts(num_frozen_points), label_type(label_type), tag_type(tag_type), ++ raft_cagra_graph(raft_cagra_graph), num_pq_chunks(num_pq_chunks), num_frozen_pts(num_frozen_points), ++ raft_cagra_graph_degree(raft_cagra_graph_degree), label_type(label_type), tag_type(tag_type), + data_type(data_type), index_write_params(index_write_params), index_search_params(index_search_params) { } - -@@ -194,6 +204,18 @@ class IndexConfigBuilder +@@ -130,6 +133,12 @@ class IndexConfigBuilder return *this; } -+ IndexConfigBuilder &is_raft_cagra_index(bool is_raft_cagra_index) ++ IndexConfigBuilder &is_raft_cagra_graph(bool raft_cagra_graph) + { -+ this->_raft_cagra_index = is_raft_cagra_index; ++ this->_raft_cagra_graph = raft_cagra_graph; + return *this; + } + -+ IndexConfigBuilder &with_raft_cagra_index_params(std::shared_ptr raft_cagra_index_params_ptr) + IndexConfigBuilder &with_num_pq_chunks(size_t num_pq_chunks) + { + this->_num_pq_chunks = num_pq_chunks; +@@ -142,6 +151,12 @@ class IndexConfigBuilder + return *this; + } + ++ IndexConfigBuilder &with_raft_cagra_graph_degree(size_t raft_cagra_graph_degree) + { -+ this->_raft_cagra_index_params = raft_cagra_index_params_ptr; ++ this->_raft_cagra_graph_degree = raft_cagra_graph_degree; + return *this; + } + - IndexConfig build() + IndexConfigBuilder &with_label_type(const std::string &label_type) { - if (_data_type == "" || _data_type.empty()) -@@ -218,9 +240,9 @@ class IndexConfigBuilder + this->_label_type = label_type; +@@ -218,9 +233,9 @@ class IndexConfigBuilder } return IndexConfig(_data_strategy, _graph_strategy, _metric, _dimension, _max_points, _num_pq_chunks, - _num_frozen_pts, _dynamic_index, _enable_tags, _pq_dist_build, _concurrent_consolidate, -+ _num_frozen_pts, _dynamic_index, _enable_tags, _pq_dist_build, _concurrent_consolidate, _raft_cagra_index, - _use_opq, _filtered_index, _data_type, _tag_type, _label_type, _index_write_params, +- _use_opq, _filtered_index, _data_type, _tag_type, _label_type, _index_write_params, - _index_search_params); -+ _index_search_params, _raft_cagra_index_params); ++ _num_frozen_pts, _raft_cagra_graph_degree, _dynamic_index, _enable_tags, _pq_dist_build, ++ _concurrent_consolidate, _use_opq, _filtered_index, _raft_cagra_graph, _data_type, _tag_type, ++ _label_type, _index_write_params, _index_search_params); } IndexConfigBuilder(const IndexConfigBuilder &) = delete; -@@ -240,6 +262,7 @@ class IndexConfigBuilder +@@ -240,9 +255,11 @@ class IndexConfigBuilder bool _concurrent_consolidate = false; bool _use_opq = false; bool _filtered_index{defaults::HAS_LABELS}; -+ bool _raft_cagra_index = false; ++ bool _raft_cagra_graph = false; size_t _num_pq_chunks = 0; size_t _num_frozen_pts{defaults::NUM_FROZEN_POINTS_STATIC}; -@@ -250,5 +273,6 @@ class IndexConfigBuilder - - std::shared_ptr _index_write_params; - std::shared_ptr _index_search_params; -+ std::shared_ptr _raft_cagra_index_params; - }; - } // namespace diskann -diff --git a/include/index_factory.h b/include/index_factory.h -index 80bc40d..138adcb 100644 ---- a/include/index_factory.h -+++ b/include/index_factory.h -@@ -46,4 +46,4 @@ class IndexFactory - std::unique_ptr _config; - }; ++ size_t _raft_cagra_graph_degree = 0; --} // namespace diskann -+} // namespace diskann -\ No newline at end of file + std::string _label_type{"uint32"}; + std::string _tag_type{"uint32"}; diff --git a/include/utils.h b/include/utils.h -index d3af5c3..2cb2181 100644 +index d3af5c3..417af31 100644 --- a/include/utils.h +++ b/include/utils.h -@@ -1,4 +1,4 @@ --// Copyright (c) Microsoft Corporation. All rights reserved. -+// Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT license. - - #pragma once @@ -29,6 +29,7 @@ typedef int FileHandle; #include "types.h" #include "tag_uint128.h" @@ -468,316 +252,94 @@ index d3af5c3..2cb2181 100644 #ifdef EXEC_ENV_OLS #include "content_buf.h" -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index cbca264..5bec876 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -2,14 +2,14 @@ - #Licensed under the MIT license. - - set(CMAKE_CXX_STANDARD 17) --set(CMAKE_COMPILE_WARNING_AS_ERROR ON) -+set(CMAKE_COMPILE_WARNING_AS_ERROR OFF) - - if(MSVC) - add_subdirectory(dll) - else() - #file(GLOB CPP_SOURCES *.cpp) - set(CPP_SOURCES abstract_data_store.cpp ann_exception.cpp disk_utils.cpp -- distance.cpp index.cpp in_mem_graph_store.cpp in_mem_data_store.cpp -+ distance.cpp index.cu in_mem_graph_store.cpp in_mem_data_store.cpp - linux_aligned_file_reader.cpp math_utils.cpp natural_number_map.cpp - in_mem_data_store.cpp in_mem_graph_store.cpp - natural_number_set.cpp memory_mapper.cpp partition.cpp pq.cpp -@@ -19,6 +19,9 @@ else() - endif() - add_library(${PROJECT_NAME} ${CPP_SOURCES}) - add_library(${PROJECT_NAME}_s STATIC ${CPP_SOURCES}) -+ -+ target_link_libraries(${PROJECT_NAME} PRIVATE raft::raft raft::compiled) -+ target_link_libraries(${PROJECT_NAME}_s PRIVATE raft::raft raft::compiled) - endif() - - if (NOT MSVC) -diff --git a/src/dll/CMakeLists.txt b/src/dll/CMakeLists.txt -index 096d1b7..e36fe7c 100644 ---- a/src/dll/CMakeLists.txt -+++ b/src/dll/CMakeLists.txt -@@ -2,7 +2,7 @@ - #Licensed under the MIT license. - - add_library(${PROJECT_NAME} SHARED dllmain.cpp ../abstract_data_store.cpp ../partition.cpp ../pq.cpp ../pq_flash_index.cpp ../logger.cpp ../utils.cpp -- ../windows_aligned_file_reader.cpp ../distance.cpp ../pq_l2_distance.cpp ../memory_mapper.cpp ../index.cpp -+ ../windows_aligned_file_reader.cpp ../distance.cpp ../pq_l2_distance.cpp ../memory_mapper.cpp ../index.cu - ../in_mem_data_store.cpp ../pq_data_store.cpp ../in_mem_graph_store.cpp ../math_utils.cpp ../disk_utils.cpp ../filter_utils.cpp - ../ann_exception.cpp ../natural_number_set.cpp ../natural_number_map.cpp ../scratch.cpp ../index_factory.cpp ../abstract_index.cpp) - -@@ -32,4 +32,4 @@ foreach(RUNTIME_FILE ${RUNTIME_FILES_TO_COPY}) - add_custom_command(TARGET ${PROJECT_NAME} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${RUNTIME_FILE}" "${TARGET_DIR}") --endforeach() -\ No newline at end of file -+endforeach() -diff --git a/src/index.cpp b/src/index.cu -similarity index 96% -rename from src/index.cpp -rename to src/index.cu -index bf93344..0f9571d 100644 +diff --git a/src/index.cpp b/src/index.cpp +index bf93344..7c7eca7 100644 --- a/src/index.cpp -+++ b/src/index.cu -@@ -1,6 +1,7 @@ - // Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT license. - -+#include - #include - - #include -@@ -22,11 +23,27 @@ - #endif - - #include "index.h" -+#include -+#include - - #define MAX_POINTS_FOR_USING_BITSET 10000000 - - namespace diskann - { -+ -+raft::distance::DistanceType parse_metric_to_raft(diskann::Metric m) -+{ -+ switch (m) -+ { -+ case diskann::Metric::L2: -+ return raft::distance::DistanceType::L2Expanded; -+ case diskann::Metric::INNER_PRODUCT: -+ return raft::distance::DistanceType::InnerProduct; -+ default: -+ throw ANNException("ERROR: RAFT only supports L2 and INNER_PRODUCT.", -1, __FUNCSIG__, __FILE__, __LINE__); -+ } -+} -+ - // Initialize an index with metric m, load the data of type T with filename - // (bin), and initialize max_points - template -@@ -38,7 +55,8 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr::Index(const IndexConfig &index_config, std::shared_ptr), _conc_consolidate(index_config.concurrent_consolidate) -+ _delete_set(new tsl::robin_set), _conc_consolidate(index_config.concurrent_consolidate), -+ _raft_cagra_index(index_config.raft_cagra_index) ++ _filtered_index(index_config.filtered_index), _raft_cagra_graph(index_config.raft_cagra_graph), ++ _num_pq_chunks(index_config.num_pq_chunks), _delete_set(new tsl::robin_set), ++ _conc_consolidate(index_config.concurrent_consolidate), ++ _raft_cagra_graph_degree(index_config.raft_cagra_graph_degree) { if (_dynamic_index && !_enable_tags) { -@@ -109,6 +127,21 @@ Index::Index(const IndexConfig &index_config, std::shared_ptrget_dims()); - } - } -+ -+ if (_raft_cagra_index) -+ { -+ if (index_config.raft_cagra_index_params != nullptr) -+ { -+ assert(parse_metric_to_raft(_dist_metric) == raft_cagra_index_params->metric); -+ _raft_cagra_index_params = index_config.raft_cagra_index_params; -+ } -+ else -+ { -+ raft::neighbors::cagra::index_params raft_cagra_index_params; -+ raft_cagra_index_params.metric = parse_metric_to_raft(_dist_metric); -+ _raft_cagra_index_params = std::make_shared(raft_cagra_index_params); -+ } -+ } - } - - template -@@ -117,7 +150,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -117,7 +119,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point const std::shared_ptr index_search_params, const size_t num_frozen_pts, const bool dynamic_index, const bool enable_tags, const bool concurrent_consolidate, const bool pq_dist_build, const size_t num_pq_chunks, const bool use_opq, - const bool filtered_index) -+ const bool filtered_index, const bool raft_cagra_index, -+ const std::shared_ptr raft_cagra_index_params) ++ const bool filtered_index, const bool raft_cagra_graph, ++ const size_t raft_cagra_graph_degree) : Index( IndexConfigBuilder() .with_metric(m) -@@ -134,6 +168,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -134,6 +137,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point .is_use_opq(use_opq) .is_filtered(filtered_index) .with_data_type(diskann_type_to_name()) -+ .is_raft_cagra_index(raft_cagra_index) -+ .with_raft_cagra_index_params(raft_cagra_index_params) ++ .is_raft_cagra_graph(raft_cagra_graph) ++ .with_raft_cagra_graph_degree(raft_cagra_graph_degree) .build(), IndexFactory::construct_datastore(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -732,6 +768,7 @@ template int Index - - template uint32_t Index::calculate_entry_point() - { -+ std::cout << "inside calculate entry point" << std::endl; - // REFACTOR TODO: This function does not support multi-threaded calculation of medoid. - // Must revisit if perf is a concern. - return _data_store->calculate_medoid(); -@@ -739,6 +776,7 @@ template uint32_t Index std::vector Index::get_init_ids() - { -+ // std::cout << "num_frozen_pts" << _num_frozen_pts << std::endl; - std::vector init_ids; - init_ids.reserve(1 + _num_frozen_pts); - -@@ -839,6 +877,8 @@ std::pair Index::iterate_to_fixed_point( - _pq_data_store->get_distance(scratch->aligned_query(), ids, dists_out, scratch); - }; - -+ // raft::print_host_vector("init_ids", init_ids.data(), init_ids.size(), std::cout); -+ - // Initialize the candidate pool with starting points - for (auto id : init_ids) - { -@@ -1371,6 +1411,56 @@ template void Index::set_start_points_at_random(T radius, uint32_t rando + set_start_points(points_data.data(), points_data.size()); } -+template void Index::add_raft_cagra_nbrs() ++template ++void Index::add_raft_cagra_neighbours(const std::shared_ptr raft_cagra_graph_ptr) +{ -+ uint32_t num_threads = _indexingThreads; -+ if (num_threads != 0) -+ omp_set_num_threads(num_threads); -+ -+ assert(_num_frozen_pts == 0); -+ -+ /* visit_order is a vector that is initialized to the entire graph */ -+ std::vector visit_order; -+ tsl::robin_set visited; -+ visit_order.reserve(_nd + _num_frozen_pts); -+ for (uint32_t i = 0; i < (uint32_t)_nd; i++) -+ { -+ visit_order.emplace_back(i); -+ } -+ -+ // if there are frozen points, the first such one is set to be the _start -+ if (_num_frozen_pts > 0) -+ _start = (uint32_t)_max_points; -+ else -+ _start = calculate_entry_point(); -+ ++ uint32_t *raw_ptr = raft_cagra_graph_ptr.get(); +#pragma omp parallel for schedule(dynamic, 2048) -+ for (int64_t node_ctr = 0; node_ctr < (int64_t)(visit_order.size()); node_ctr++) ++ for (int64_t node = 0; node < _nd; node++) + { -+ auto node = visit_order[node_ctr]; ++ std::vector node_nbrs(_raft_cagra_graph_degree); ++ uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; ++ uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; ++ std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); + -+ std::vector cagra_nbrs(_indexingRange); -+ uint32_t *nbr_start_ptr = host_cagra_graph.data() + node * _indexingRange; -+ uint32_t *nbr_end_ptr = nbr_start_ptr + _indexingRange; -+ std::copy(nbr_start_ptr, nbr_end_ptr, cagra_nbrs.data()); -+ -+ assert(cagra_nbrs.size() > 0); ++ assert(node_nbrs.size() > 0); + + { + LockGuard guard(_locks[node]); + -+ _graph_store->set_neighbours(node, cagra_nbrs); ++ _graph_store->set_neighbours(node, node_nbrs); + assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); + } -+ -+ if (node_ctr % 100000 == 0) -+ { -+ diskann::cout << "\r" << (100.0 * node_ctr) / (visit_order.size()) << "% of index build completed." -+ << std::flush; -+ } + } +} -+ - template - void Index::prune_all_neighbors(const uint32_t max_degree, const uint32_t max_occlusion_size, - const float alpha) -@@ -1448,8 +1538,6 @@ void Index::set_start_points(const T *data, size_t data_count) - if (data_count != _num_frozen_pts * _dim) - throw ANNException("Invalid number of points", -1, __FUNCSIG__, __FILE__, __LINE__); - -- // memcpy(_data + _aligned_dim * _max_points, data, _aligned_dim * -- // sizeof(T) * _num_frozen_pts); - for (location_t i = 0; i < _num_frozen_pts; i++) - { - _data_store->set_vector((location_t)(i + _max_points), data + i * _dim); -@@ -1505,6 +1593,24 @@ void Index::set_start_points_at_random(T radius, uint32_t rando - set_start_points(points_data.data(), points_data.size()); - } - -+template void Index::build_raft_cagra_index(const T *data) -+{ -+ raft::device_resources handle; -+ auto dataset_view = raft::make_host_matrix_view(data, int64_t(_nd), _dim); -+ auto raft_knn_index = raft::neighbors::cagra::build(handle, *_raft_cagra_index_params, dataset_view); -+ -+ auto stream = handle.get_stream(); -+ auto device_graph = raft_knn_index.graph(); -+ host_cagra_graph.resize(device_graph.extent(0) * device_graph.extent(1)); -+ -+ std::cout << "host_cagra_graph_size" << host_cagra_graph.size() << std::endl; -+ -+ thrust::copy(thrust::device_ptr(device_graph.data_handle()), -+ thrust::device_ptr(device_graph.data_handle() + device_graph.size()), -+ host_cagra_graph.data()); -+ handle.sync_stream(); -+} + template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1542,7 +1648,14 @@ void Index::build_with_data_populated(const std::vector & +@@ -1576,7 +1604,8 @@ void Index::_build(const DataType &data, const size_t num_point } - - generate_frozen_point(); -- link(); -+ if (_raft_cagra_index) -+ { -+ add_raft_cagra_nbrs(); -+ } -+ else -+ { -+ link(); -+ } - - size_t max = 0, min = SIZE_MAX, total = 0, cnt = 0; - for (size_t i = 0; i < _nd; i++) -@@ -1559,6 +1672,7 @@ void Index::build_with_data_populated(const std::vector & - - _has_built = true; } -+ template - void Index::_build(const DataType &data, const size_t num_points_to_load, TagVector &tags) +-void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags) ++void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, ++ const std::shared_ptr raft_cagra_graph_ptr) { -@@ -1597,6 +1711,8 @@ void Index::build(const T *data, const size_t num_points_to_loa - _data_store->populate_data(data, (location_t)num_points_to_load); - } - -+ build_raft_cagra_index(data); -+ - build_with_data_populated(tags); - } + if (num_points_to_load == 0) + { +@@ -1596,8 +1625,12 @@ void Index::build(const T *data, const size_t num_points_to_loa -@@ -1683,6 +1799,9 @@ void Index::build(const char *filename, const size_t num_points - std::unique_lock tl(_tag_lock); - _nd = num_points_to_load; + _data_store->populate_data(data, (location_t)num_points_to_load); } -+ -+ auto _in_mem_data_store = std::static_pointer_cast>(_data_store); -+ build_raft_cagra_index(_in_mem_data_store->_data); - build_with_data_populated(tags); +- +- build_with_data_populated(tags); ++ if (!_raft_cagra_graph) ++ build_with_data_populated(tags); ++ else ++ { ++ add_raft_cagra_neighbours(raft_cagra_graph_ptr); ++ } } -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 6af8405..a44caab 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -38,4 +38,3 @@ add_executable(${PROJECT_NAME}_unit_tests ${DISKANN_SOURCES} ${DISKANN_UNIT_TEST - target_link_libraries(${PROJECT_NAME}_unit_tests ${PROJECT_NAME} ${DISKANN_TOOLS_TCMALLOC_LINK_OPTIONS} Boost::unit_test_framework) - - add_test(NAME ${PROJECT_NAME}_unit_tests COMMAND ${PROJECT_NAME}_unit_tests) -- + template From 1c203e327c0d28d8063d6db7f9a6e73290abdbeb Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 29 Apr 2024 21:50:33 -0700 Subject: [PATCH 06/20] build working --- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 44 ++++++++++--------- cpp/cmake/patches/diskann.diff | 16 +++---- cpp/cmake/thirdparty/get_diskann.cmake | 3 -- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index 549e4c870b..7d3118d5f7 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -16,14 +16,16 @@ #pragma once #include "../common/ann_types.hpp" +#include "parameters.h" #include "raft/core/host_mdspan.hpp" -#include "raft/neighbors/cagra_types.hpp" #include "raft/neighbors/cagra.cuh" +#include "raft/neighbors/cagra_types.hpp" #include #include #include +#include #include #ifndef _WINDOWS @@ -82,8 +84,8 @@ class DiskANNMemory : public ANN { void save(const std::string& path_to_index) const override; void load(const std::string& path_to_index) override; - std::unique_ptr> copy() override { - return std::make_unique>(*this); }; + DiskANNMemory(const DiskANNMemory& other) = default; + std::unique_ptr> copy() override { return nullptr; } AlgoProperty get_preference() const override { @@ -113,20 +115,20 @@ DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) { assert(dim_ > 0); - this->diskann_index_write_params_ = std::make_shared( - diskann::IndexWriteParametersBuilder(param.L_build, param.R) - .with_filter_list_size(0) - .with_alpha(param.alpha) - .with_saturate_graph(false) - .with_num_threads(param.num_threads) - .build()); + diskann::IndexWriteParameters p = diskann::IndexWriteParametersBuilder(param.L_build, param.R) + .with_filter_list_size(0) + .with_alpha(param.alpha) + .with_saturate_graph(false) + .with_num_threads(param.num_threads) + .build(); + this->diskann_index_write_params_ = std::make_shared(p); } template void DiskANNMemory::build(const T* dataset, size_t nrow) { this->diskann_index_ = - std::make_shared>(diskann::Index(parse_metric_type(this->metric_), + std::make_shared>(parse_metric_type(this->metric_), this->dim_, nrow, this->diskann_index_write_params_, @@ -140,18 +142,18 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) false, false, this->use_cagra_graph_, - cagra_graph_degree_)); + cagra_graph_degree_); if (!this->use_cagra_graph_) { - auto intermediate_graph = raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_); - auto knn_graph = raft::make_host_matrix(nrow, cagra_graph_degree_); - auto dataset_view = raft::make_host_matrix_view(dataset, (int64_t)nrow, (int64_t)this->dim_); - raft::resources res; - raft::neighbors::cagra::build_knn_graph(res, - dataset_view, - intermediate_graph.view()); - raft::neighbors::cagra::optimize(res, intermediate_graph.view(), knn_graph.view()); - diskann_index_->build(dataset, nrow, std::vector(), std::shared_ptr(knn_graph.data_handle())); + auto intermediate_graph = raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_); + auto knn_graph = raft::make_host_matrix(nrow, cagra_graph_degree_); + auto dataset_view = + raft::make_host_matrix_view(dataset, (int64_t)nrow, (int64_t)this->dim_); + raft::resources res; + raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph.view()); + raft::neighbors::cagra::optimize(res, intermediate_graph.view(), knn_graph.view()); + diskann_index_->build( + dataset, nrow, std::vector(), std::shared_ptr(knn_graph.data_handle())); } diskann_index_->build(dataset, nrow, std::vector()); } diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 9e9cbc6e51..1278929294 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -106,7 +106,7 @@ index f3b1de2..c2f0728 100644 // Inner product returns negative values to indicate distance. // This will ensure that cosine is between -1 and 1. diff --git a/include/index.h b/include/index.h -index b9bf4f3..0691566 100644 +index b9bf4f3..d22460c 100644 --- a/include/index.h +++ b/include/index.h @@ -66,7 +66,8 @@ template clas @@ -129,19 +129,15 @@ index b9bf4f3..0691566 100644 // Based on filter params builds a filtered or unfiltered index DISKANN_DLLEXPORT void build(const std::string &data_file, const size_t num_points_to_load, -@@ -233,8 +235,10 @@ template clas - virtual void _set_universal_label(const LabelType universal_label) override; +@@ -236,6 +238,8 @@ template clas + Index(const Index &) = delete; + Index &operator=(const Index &) = delete; - // No copy/assign. -- Index(const Index &) = delete; -- Index &operator=(const Index &) = delete; -+ // Index(const Index &) = delete; -+ // Index &operator=(const Index &) = delete; -+ + void add_raft_cagra_neighbours(const std::shared_ptr raft_cagra_graph_ptr); - ++ // Use after _data and _nd have been populated // Acquire exclusive _update_lock before calling + void build_with_data_populated(const std::vector &tags); @@ -444,5 +448,8 @@ template clas std::vector _locks; diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index d1021a01ab..ce0f960c5f 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -32,13 +32,10 @@ function(find_and_configure_diskann) CPM_ARGS GIT_REPOSITORY ${PKG_REPOSITORY} GIT_TAG ${PKG_PINNED_TAG} - GIT_SHALLOW TRUE - DOWNLOAD_ONLY ON PATCH_COMMAND ${CMAKE_COMMAND} -P ${patch_script} ) if(NOT TARGET diskann::diskann) - add_library(diskann INTERFACE) target_include_directories(diskann INTERFACE "$") add_library(diskann::diskann ALIAS diskann) endif() From 2b3eadb1701502b82b40a66af9fe18f98cbc9ebb Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 30 Apr 2024 09:30:57 -0700 Subject: [PATCH 07/20] add cxx flags --- cpp/bench/ann/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 9a521f3397..ccf4d1cc6e 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -340,7 +340,7 @@ endif() if(RAFT_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( - NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cu LINKS diskann::diskann raft::compiled + NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cu LINKS diskann::diskann raft::compiled CXXFLAGS "-fno-finite-math-only -dynamic-linker /lib/ld-linux.so.2 -lc -lgcc -lgcc_s -lstdc++" ) endif() From 8a9d62beb652ac0f3858e31b17015558c0ae62ae Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 30 Apr 2024 11:25:56 -0700 Subject: [PATCH 08/20] building now --- cpp/bench/ann/CMakeLists.txt | 2 +- cpp/cmake/patches/diskann.diff | 19 +++++++++++++++++++ cpp/cmake/thirdparty/get_diskann.cmake | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index ccf4d1cc6e..9a521f3397 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -340,7 +340,7 @@ endif() if(RAFT_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( - NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cu LINKS diskann::diskann raft::compiled CXXFLAGS "-fno-finite-math-only -dynamic-linker /lib/ld-linux.so.2 -lc -lgcc -lgcc_s -lstdc++" + NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cu LINKS diskann::diskann raft::compiled ) endif() diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 1278929294..eb670aa57c 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,3 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d3d2b8..5a4280e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -300,10 +300,10 @@ else() + endif() + + add_subdirectory(src) +-if (NOT PYBIND) +- add_subdirectory(apps) +- add_subdirectory(apps/utils) +-endif() ++#if (NOT PYBIND) ++# add_subdirectory(apps) ++# add_subdirectory(apps/utils) ++#endif() + + if (UNIT_TEST) + enable_testing() diff --git a/include/distance.h b/include/distance.h index f3b1de2..c2f0728 100644 --- a/include/distance.h diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index ce0f960c5f..3c4574a586 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -33,6 +33,9 @@ function(find_and_configure_diskann) GIT_REPOSITORY ${PKG_REPOSITORY} GIT_TAG ${PKG_PINNED_TAG} PATCH_COMMAND ${CMAKE_COMMAND} -P ${patch_script} + OPTIONS + "PYBIND OFF" + "UNIT_TEST OFF" ) if(NOT TARGET diskann::diskann) From 551cfa017e4c0afbfff55e3ecaf20fc07fe5f5ea Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 30 Apr 2024 18:48:06 -0700 Subject: [PATCH 09/20] binary building without errors --- .../ann/src/diskann/diskann_benchmark.cu | 2 +- cpp/cmake/patches/diskann.diff | 20 ++++++++++++++++++- cpp/cmake/thirdparty/get_diskann.cmake | 2 ++ .../src/raft-ann-bench/run/algos.yaml | 3 +++ .../run/conf/algos/diskann.yaml | 14 +++++++++++++ 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cu index cd84af5070..39e7c8bffa 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cu +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cu @@ -38,7 +38,7 @@ void parse_build_param(const nlohmann::json& conf, param.L_build = conf.at("Lb"); param.alpha = conf.at("alpha"); if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } - param.use_cagra_graph = conf.at("use_raft_cagra"); + param.use_cagra_graph = conf.at("use_cagra_graph"); if (param.use_cagra_graph) { param.cagra_graph_degree = conf.at("cagra_graph_degree"); param.cagra_intermediate_graph_degree = diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index eb670aa57c..90f6a23b27 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,7 +1,25 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..5a4280e 100644 +index 3d3d2b8..2b97c06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt +@@ -188,7 +188,7 @@ else() + # compile flags and link libraries + add_compile_options(-m64 -Wl,--no-as-needed) + if (NOT PYBIND) +- link_libraries(mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl) ++ link_libraries(mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl aio) + else() + # static linking for python so as to minimize customer dependency issues + link_libraries( +@@ -286,7 +286,7 @@ if(MSVC) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/x64/Release) + else() + set(ENV{TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD} 500000000000) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -mfma -msse2 -ftree-vectorize -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -fopenmp -fopenmp-simd -funroll-loops -Wfatal-errors -DUSE_AVX2") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -mfma -msse2 -ftree-vectorize -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -fopenmp -fopenmp-simd -funroll-loops -Wfatal-errors -DUSE_AVX2 -fno-finite-math-only") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -DDEBUG") + if (NOT PYBIND) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -Ofast") @@ -300,10 +300,10 @@ else() endif() diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index 3c4574a586..f6a51cc683 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -36,6 +36,8 @@ function(find_and_configure_diskann) OPTIONS "PYBIND OFF" "UNIT_TEST OFF" + "RESTAPI OFF" + "PORTABLE OFF" ) if(NOT TARGET diskann::diskann) diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/algos.yaml b/python/raft-ann-bench/src/raft-ann-bench/run/algos.yaml index e382bdcba6..ca8e45b651 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/run/algos.yaml +++ b/python/raft-ann-bench/src/raft-ann-bench/run/algos.yaml @@ -40,3 +40,6 @@ hnswlib: raft_cagra_hnswlib: executable: RAFT_CAGRA_HNSWLIB_ANN_BENCH requires_gpu: true +diskann: + executable: DISKANN_ANN_BENCH + requires_gpu: true diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml new file mode 100644 index 0000000000..4bd637db49 --- /dev/null +++ b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml @@ -0,0 +1,14 @@ +name: diskann +groups: + base: + build: + R: [200] + Lb: [200] + alpha: [0] + pq_dim: [64, 32] + cagra_intermediate_graph_degree: [64, 128] + cagra_graph_degree: [32, 64] + use_cagra_graph: [True] + search: + L_search: [10, 20, 50, 100] + L_load: [100] \ No newline at end of file From 042eaf77f2a02509083dbf648db5affe844fa349 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 2 May 2024 15:14:33 -0700 Subject: [PATCH 10/20] debug --- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index 7d3118d5f7..c625dda523 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -18,6 +18,7 @@ #include "../common/ann_types.hpp" #include "parameters.h" #include "raft/core/host_mdspan.hpp" +#include "raft/core/resource/cuda_stream.hpp" #include "raft/neighbors/cagra.cuh" #include "raft/neighbors/cagra_types.hpp" @@ -97,13 +98,12 @@ class DiskANNMemory : public ANN { private: bool use_cagra_graph_; - bool use_pq_build_; - uint32_t build_pq_bytes_; + bool use_pq_build_ = true; + uint32_t build_pq_bytes_= 0; std::shared_ptr diskann_index_write_params_{nullptr}; std::shared_ptr diskann_index_search_params_{nullptr}; std::shared_ptr> diskann_index_{nullptr}; int num_threads_search_; - uint32_t L_build_; uint32_t L_search_; uint32_t cagra_graph_degree_; uint32_t cagra_intermediate_graph_degree_; @@ -114,14 +114,17 @@ DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) : ANN(metric, dim) { assert(dim_ > 0); - - diskann::IndexWriteParameters p = diskann::IndexWriteParametersBuilder(param.L_build, param.R) + diskann_index_write_params_ = std::make_shared(diskann::IndexWriteParametersBuilder(param.L_build, param.R) .with_filter_list_size(0) .with_alpha(param.alpha) .with_saturate_graph(false) .with_num_threads(param.num_threads) - .build(); - this->diskann_index_write_params_ = std::make_shared(p); + .build()); + use_cagra_graph_ = param.use_cagra_graph; + build_pq_bytes_ = 0; + cagra_graph_degree_ = param.cagra_graph_degree; + cagra_intermediate_graph_degree_ = param.cagra_intermediate_graph_degree; + std::cout << "intermediate_graph_degree" << cagra_intermediate_graph_degree_ << "cagra_graph_degree" << cagra_graph_degree_ << std::endl; } template @@ -144,18 +147,22 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) this->use_cagra_graph_, cagra_graph_degree_); - if (!this->use_cagra_graph_) { + if (use_cagra_graph_) { auto intermediate_graph = raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_); auto knn_graph = raft::make_host_matrix(nrow, cagra_graph_degree_); + std::cout << "nrow" << nrow << "intermediate_graph_degree" << cagra_intermediate_graph_degree_ << "cagra_graph_degree" << cagra_graph_degree_ << std::endl; auto dataset_view = - raft::make_host_matrix_view(dataset, (int64_t)nrow, (int64_t)this->dim_); + raft::make_host_matrix_view(dataset, static_cast(nrow), (int64_t)this->dim_); raft::resources res; raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph.view()); raft::neighbors::cagra::optimize(res, intermediate_graph.view(), knn_graph.view()); + resource::sync_stream(res); + std::cout << "built and optimized cagra graph" << std::endl; diskann_index_->build( dataset, nrow, std::vector(), std::shared_ptr(knn_graph.data_handle())); + } else { + // diskann_index_->build(dataset, nrow, std::vector()); } - diskann_index_->build(dataset, nrow, std::vector()); } template From 1f75e0ba8da33288f2260df3f76b716ba6e9aa86 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 6 May 2024 15:56:34 -0700 Subject: [PATCH 11/20] update diff --- cpp/cmake/patches/diskann.diff | 90 ++++++++++++++----- .../run/conf/algos/diskann.yaml | 10 +-- 2 files changed, 74 insertions(+), 26 deletions(-) diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 90f6a23b27..663a308c6c 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -35,6 +35,49 @@ index 3d3d2b8..2b97c06 100644 if (UNIT_TEST) enable_testing() +diff --git a/build.sh b/build.sh +new file mode 100755 +index 0000000..a5a12fe +--- /dev/null ++++ b/build.sh +@@ -0,0 +1,36 @@ ++#!/bin/bash ++ ++# NOTE: This file is temporary for the proof-of-concept branch and will be removed before this PR is merged ++ ++BUILD_TYPE=Release ++BUILD_DIR=build/ ++ ++RAFT_REPO_REL="" ++EXTRA_CMAKE_ARGS="" ++set -e ++ ++if [[ ${RAFT_REPO_REL} != "" ]]; then ++ RAFT_REPO_PATH="`readlink -f \"${RAFT_REPO_REL}\"`" ++ EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCPM_raft_SOURCE=${RAFT_REPO_PATH}" ++fi ++ ++if [ "$1" == "clean" ]; then ++ rm -rf build ++ rm -rf .cache ++ exit 0 ++fi ++ ++mkdir -p $BUILD_DIR ++cd $BUILD_DIR ++ ++cmake \ ++ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ ++ -DCMAKE_CUDA_ARCHITECTURES="NATIVE" \ ++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ ++ -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \ ++ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ ++ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ ++ ${EXTRA_CMAKE_ARGS} \ ++ ../ ++ ++make -j30 +\ No newline at end of file diff --git a/include/distance.h b/include/distance.h index f3b1de2..c2f0728 100644 --- a/include/distance.h @@ -143,7 +186,7 @@ index f3b1de2..c2f0728 100644 // Inner product returns negative values to indicate distance. // This will ensure that cosine is between -1 and 1. diff --git a/include/index.h b/include/index.h -index b9bf4f3..d22460c 100644 +index b9bf4f3..4890f00 100644 --- a/include/index.h +++ b/include/index.h @@ -66,7 +66,8 @@ template clas @@ -162,7 +205,7 @@ index b9bf4f3..d22460c 100644 // Batch build from a data array, which must pad vectors to aligned_dim - DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags); + DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags, -+ const std::shared_ptr raft_cagra_graph_ptr = nullptr); ++ const std::vector &raft_cagra_graph_vec = std::vector()); // Based on filter params builds a filtered or unfiltered index DISKANN_DLLEXPORT void build(const std::string &data_file, const size_t num_points_to_load, @@ -170,7 +213,7 @@ index b9bf4f3..d22460c 100644 Index(const Index &) = delete; Index &operator=(const Index &) = delete; -+ void add_raft_cagra_neighbours(const std::shared_ptr raft_cagra_graph_ptr); ++ void add_raft_cagra_neighbours(const std::vector& raft_cagra_graph_vec); + // Use after _data and _nd have been populated // Acquire exclusive _update_lock before calling @@ -286,7 +329,7 @@ index d3af5c3..417af31 100644 #ifdef EXEC_ENV_OLS #include "content_buf.h" diff --git a/src/index.cpp b/src/index.cpp -index bf93344..7c7eca7 100644 +index bf93344..3d9e2c4 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -37,8 +37,10 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -1505,6 +1510,29 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -1505,6 +1510,31 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } +template -+void Index::add_raft_cagra_neighbours(const std::shared_ptr raft_cagra_graph_ptr) ++void Index::add_raft_cagra_neighbours(const std::vector& raft_cagra_graph_vec) +{ -+ uint32_t *raw_ptr = raft_cagra_graph_ptr.get(); ++ std::cout << "inside add_raft_cagra_neighbours" << std::endl; ++ const uint32_t *raw_ptr = raft_cagra_graph_vec.data(); +#pragma omp parallel for schedule(dynamic, 2048) + for (int64_t node = 0; node < _nd; node++) + { -+ std::vector node_nbrs(_raft_cagra_graph_degree); -+ uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; -+ uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; -+ std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); ++ // std::vector node_nbrs(_raft_cagra_graph_degree); ++ // uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; ++ // uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; ++ // std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); + -+ assert(node_nbrs.size() > 0); ++ // assert(node_nbrs.size() > 0); + -+ { -+ LockGuard guard(_locks[node]); ++ // { ++ // LockGuard guard(_locks[node]); + -+ _graph_store->set_neighbours(node, node_nbrs); -+ assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); -+ } ++ // _graph_store->set_neighbours(node, node_nbrs); ++ // assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); ++ // } ++ // std::cout << "DEBUG: completed set_neighbors for node: " << node << std::endl; + } +} + template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1576,7 +1604,8 @@ void Index::_build(const DataType &data, const size_t num_point +@@ -1576,8 +1606,10 @@ void Index::_build(const DataType &data, const size_t num_point } } template -void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags) +void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, -+ const std::shared_ptr raft_cagra_graph_ptr) ++ const std::vector& raft_cagra_graph_vec) { ++ std::cout << "inside index build" << std::endl; if (num_points_to_load == 0) { -@@ -1596,8 +1625,12 @@ void Index::build(const T *data, const size_t num_points_to_loa + throw ANNException("Do not call build with 0 points", -1, __FUNCSIG__, __FILE__, __LINE__); +@@ -1596,8 +1628,13 @@ void Index::build(const T *data, const size_t num_points_to_loa _data_store->populate_data(data, (location_t)num_points_to_load); } - - build_with_data_populated(tags); ++ std::cout << "_raft_cagra_graph" << _raft_cagra_graph << std::endl; + if (!_raft_cagra_graph) + build_with_data_populated(tags); + else + { -+ add_raft_cagra_neighbours(raft_cagra_graph_ptr); ++ add_raft_cagra_neighbours(raft_cagra_graph_vec); + } } diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml index 4bd637db49..326521a34f 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml +++ b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml @@ -2,12 +2,12 @@ name: diskann groups: base: build: - R: [200] - Lb: [200] + R: [32] + Lb: [64] alpha: [0] - pq_dim: [64, 32] - cagra_intermediate_graph_degree: [64, 128] - cagra_graph_degree: [32, 64] + pq_dim: [64] + cagra_intermediate_graph_degree: [128] + cagra_graph_degree: [64] use_cagra_graph: [True] search: L_search: [10, 20, 50, 100] From 4426b95c186cf9c0766f8aa253421a90e9c8395a Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Sat, 11 May 2024 22:04:34 -0700 Subject: [PATCH 12/20] debugging changes --- cpp/bench/ann/src/common/benchmark.hpp | 4 + .../ann/src/diskann/diskann_benchmark.cu | 4 +- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 109 +++++++++------- cpp/cmake/patches/diskann.diff | 123 +++++++++++++++--- .../run/conf/algos/diskann.yaml | 4 +- 5 files changed, 173 insertions(+), 71 deletions(-) diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index d7bcd17a00..c52d4236fa 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -235,8 +235,11 @@ void bench_search(::benchmark::State& state, auto ualgo = ann::create_algo( index.algo, dataset->distance(), dataset->dim(), index.build_param, index.dev_list); algo = ualgo.get(); + std::cout << "now doing index loading" << std::endl; algo->load(index_file); + std::cout << "now done index loading" << std::endl; current_algo = std::move(ualgo); + std::cout << "move done" << std::endl; } search_param = ann::create_search_param(index.algo, sp_json); search_param->metric_objective = metric_objective; @@ -260,6 +263,7 @@ void bench_search(::benchmark::State& state, } } try { + std::cout << "now setting search params" << std::endl; algo->set_search_param(*search_param); } catch (const std::exception& ex) { state.SkipWithError("An error occurred setting search parameters: " + std::string(ex.what())); diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cu index 39e7c8bffa..a4ff4c5282 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cu +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cu @@ -50,8 +50,8 @@ template void parse_search_param(const nlohmann::json& conf, typename raft::bench::ann::DiskANNMemory::SearchParam& param) { - param.L_search = conf.at("Ls"); - if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } + param.L_search = conf.at("L_search"); + std::cout << "param.L_search" << param.L_search; } template class Algo> diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index c625dda523..cbd4c86774 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -60,6 +60,7 @@ class DiskANNMemory : public ANN { struct BuildParam { uint32_t R; uint32_t L_build; + // uint32_t L_load; float alpha; int num_threads = omp_get_num_procs(); bool use_cagra_graph; @@ -71,8 +72,6 @@ class DiskANNMemory : public ANN { using typename ANN::AnnSearchParam; struct SearchParam : public AnnSearchParam { uint32_t L_search; - uint32_t L_load; - int num_threads = omp_get_num_procs(); }; DiskANNMemory(Metric metric, int dim, const BuildParam& param); @@ -98,12 +97,13 @@ class DiskANNMemory : public ANN { private: bool use_cagra_graph_; - bool use_pq_build_ = true; - uint32_t build_pq_bytes_= 0; + bool use_pq_build_ = false; + uint32_t build_pq_bytes_ = 0; std::shared_ptr diskann_index_write_params_{nullptr}; std::shared_ptr diskann_index_search_params_{nullptr}; std::shared_ptr> diskann_index_{nullptr}; int num_threads_search_; + // uint32_t L_load_; uint32_t L_search_; uint32_t cagra_graph_degree_; uint32_t cagra_intermediate_graph_degree_; @@ -113,55 +113,54 @@ template DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) : ANN(metric, dim) { - assert(dim_ > 0); - diskann_index_write_params_ = std::make_shared(diskann::IndexWriteParametersBuilder(param.L_build, param.R) - .with_filter_list_size(0) - .with_alpha(param.alpha) - .with_saturate_graph(false) - .with_num_threads(param.num_threads) - .build()); - use_cagra_graph_ = param.use_cagra_graph; - build_pq_bytes_ = 0; - cagra_graph_degree_ = param.cagra_graph_degree; + assert(this->dim_ > 0); + diskann_index_write_params_ = std::make_shared( + diskann::IndexWriteParametersBuilder(param.L_build, param.R) + .with_filter_list_size(0) + .with_alpha(param.alpha) + .with_saturate_graph(false) + .with_num_threads(param.num_threads) + .build()); + use_cagra_graph_ = param.use_cagra_graph; + build_pq_bytes_ = 0; + cagra_graph_degree_ = param.cagra_graph_degree; cagra_intermediate_graph_degree_ = param.cagra_intermediate_graph_degree; - std::cout << "intermediate_graph_degree" << cagra_intermediate_graph_degree_ << "cagra_graph_degree" << cagra_graph_degree_ << std::endl; } template void DiskANNMemory::build(const T* dataset, size_t nrow) { - this->diskann_index_ = - std::make_shared>(parse_metric_type(this->metric_), - this->dim_, - nrow, - this->diskann_index_write_params_, - nullptr, - 0, - false, - false, - false, - this->use_pq_build_, - this->build_pq_bytes_, - false, - false, - this->use_cagra_graph_, - cagra_graph_degree_); + this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), + this->dim_, + nrow, + this->diskann_index_write_params_, + nullptr, + 0, + false, + false, + false, + this->use_pq_build_, + this->build_pq_bytes_, + false, + false, + this->use_cagra_graph_, + cagra_graph_degree_); if (use_cagra_graph_) { - auto intermediate_graph = raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_); - auto knn_graph = raft::make_host_matrix(nrow, cagra_graph_degree_); - std::cout << "nrow" << nrow << "intermediate_graph_degree" << cagra_intermediate_graph_degree_ << "cagra_graph_degree" << cagra_graph_degree_ << std::endl; - auto dataset_view = - raft::make_host_matrix_view(dataset, static_cast(nrow), (int64_t)this->dim_); + auto intermediate_graph = + raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_); + std::vector knn_graph(nrow * cagra_graph_degree_); + auto knn_graph_view = + raft::make_host_matrix_view(knn_graph.data(), nrow, cagra_graph_degree_); + auto dataset_view = raft::make_host_matrix_view( + dataset, static_cast(nrow), (int64_t)this->dim_); raft::resources res; raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph.view()); - raft::neighbors::cagra::optimize(res, intermediate_graph.view(), knn_graph.view()); + raft::neighbors::cagra::optimize(res, intermediate_graph.view(), knn_graph_view); resource::sync_stream(res); - std::cout << "built and optimized cagra graph" << std::endl; - diskann_index_->build( - dataset, nrow, std::vector(), std::shared_ptr(knn_graph.data_handle())); + diskann_index_->build(dataset, nrow, std::vector(), knn_graph); } else { - // diskann_index_->build(dataset, nrow, std::vector()); + diskann_index_->build(dataset, nrow, std::vector()); } } @@ -169,18 +168,19 @@ template void DiskANNMemory::set_search_param(const AnnSearchParam& param_) { auto param = dynamic_cast(param_); - this->num_threads_search_ = param.num_threads; - L_search_ = param.L_search; + std::cout << "inside set_search_param L_search" << param.L_search; + this->L_search_ = param.L_search; } template void DiskANNMemory::search( const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const { - omp_set_num_threads(num_threads_search_); + std::cout << "inside raft-ann-bench search function" << std::endl; + omp_set_num_threads(diskann_index_write_params_->num_threads); #pragma omp parallel for schedule(dynamic, 1) for (int64_t i = 0; i < (int64_t)batch_size; i++) { - diskann_index_->search(queries + i * this->dim_, k, L_search_, neighbors, distances); + diskann_index_->search(queries + i * this->dim_, static_cast(k), L_search_, reinterpret_cast(neighbors), distances); } } @@ -193,7 +193,24 @@ void DiskANNMemory::save(const std::string& path_to_index) const template void DiskANNMemory::load(const std::string& path_to_index) { - this->diskann_index_->load(path_to_index.c_str(), num_threads_search_, L_search_); + std::cout << "now loading index" << path_to_index << "num_threads_search_" << diskann_index_write_params_->num_threads << "L_search_" << L_search_ << std::endl; + this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), + this->dim_, + 100000, + this->diskann_index_write_params_, + nullptr, + 0, + false, + false, + false, + this->use_pq_build_, + this->build_pq_bytes_, + false, + false, + this->use_cagra_graph_, + cagra_graph_degree_); + diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 100); + std::cout << "success loading index" << path_to_index.c_str() << std::endl; } }; // namespace raft::bench::ann diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 663a308c6c..66dc86d01f 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -329,7 +329,7 @@ index d3af5c3..417af31 100644 #ifdef EXEC_ENV_OLS #include "content_buf.h" diff --git a/src/index.cpp b/src/index.cpp -index bf93344..3d9e2c4 100644 +index bf93344..d7dfc42 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -37,8 +37,10 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -1505,6 +1510,31 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -535,6 +540,7 @@ void Index::load(AlignedFileReader &reader, uint32_t num_thread + void Index::load(const char *filename, uint32_t num_threads, uint32_t search_l) + { + #endif ++ std::cout << "inside DiskANN load" << std::endl; + std::unique_lock ul(_update_lock); + std::unique_lock cl(_consolidate_lock); + std::unique_lock tl(_tag_lock); +@@ -549,8 +555,11 @@ void Index::load(const char *filename, uint32_t num_threads, ui + std::string labels_to_medoids = mem_index_file + "_labels_to_medoids.txt"; + std::string labels_map_file = mem_index_file + "_labels_map.txt"; + ++ std::cout << "set strings" << std::endl; ++ + if (!_save_as_one_file) + { ++ std::cout << "_save_as_one_file was false" << std::endl; + // For DLVS Store, we will not support saving the index in multiple + // files. + #ifndef EXEC_ENV_OLS +@@ -568,10 +577,12 @@ void Index::load(const char *filename, uint32_t num_threads, ui + tags_file_num_pts = load_tags(tags_file); + } + graph_num_pts = load_graph(graph_file, data_file_num_pts); ++ std::cout << "loaded everything in this if block" << std::endl; + #endif + } + else + { ++ std::cout << "inside else block" << std::endl; + diskann::cout << "Single index file saving/loading support not yet " + "enabled. Not loading the index." + << std::endl; +@@ -580,6 +591,7 @@ void Index::load(const char *filename, uint32_t num_threads, ui + + if (data_file_num_pts != graph_num_pts || (data_file_num_pts != tags_file_num_pts && _enable_tags)) + { ++ std::cout << "inside error block" << std::endl; + std::stringstream stream; + stream << "ERROR: When loading index, loaded " << data_file_num_pts << " points from datafile, " + << graph_num_pts << " from graph, and " << tags_file_num_pts +@@ -590,6 +602,7 @@ void Index::load(const char *filename, uint32_t num_threads, ui + + if (file_exists(labels_file)) + { ++ std::cout << "labels_file exists" << std::endl; + _label_map = load_label_map(labels_map_file); + parse_label_file(labels_file, label_num_pts); + assert(label_num_pts == data_file_num_pts - _num_frozen_pts); +@@ -632,6 +645,8 @@ void Index::load(const char *filename, uint32_t num_threads, ui + _use_universal_label = true; + universal_label_reader.close(); + } ++ } else { ++ std::cout << "labels_file does not exists" << std::endl; + } + + _nd = data_file_num_pts - _num_frozen_pts; +@@ -1505,6 +1520,29 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } +template +void Index::add_raft_cagra_neighbours(const std::vector& raft_cagra_graph_vec) +{ -+ std::cout << "inside add_raft_cagra_neighbours" << std::endl; + const uint32_t *raw_ptr = raft_cagra_graph_vec.data(); +#pragma omp parallel for schedule(dynamic, 2048) + for (int64_t node = 0; node < _nd; node++) + { -+ // std::vector node_nbrs(_raft_cagra_graph_degree); -+ // uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; -+ // uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; -+ // std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); ++ std::vector node_nbrs(_raft_cagra_graph_degree); ++ const uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; ++ const uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; ++ std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); + -+ // assert(node_nbrs.size() > 0); ++ assert(node_nbrs.size() > 0); + -+ // { -+ // LockGuard guard(_locks[node]); ++ { ++ LockGuard guard(_locks[node]); + -+ // _graph_store->set_neighbours(node, node_nbrs); -+ // assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); -+ // } -+ // std::cout << "DEBUG: completed set_neighbors for node: " << node << std::endl; ++ _graph_store->set_neighbours(node, node_nbrs); ++ assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); ++ } + } +} + template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1576,8 +1606,10 @@ void Index::_build(const DataType &data, const size_t num_point +@@ -1576,7 +1614,8 @@ void Index::_build(const DataType &data, const size_t num_point } } template @@ -404,17 +460,18 @@ index bf93344..3d9e2c4 100644 +void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, + const std::vector& raft_cagra_graph_vec) { -+ std::cout << "inside index build" << std::endl; if (num_points_to_load == 0) { - throw ANNException("Do not call build with 0 points", -1, __FUNCSIG__, __FILE__, __LINE__); -@@ -1596,8 +1628,13 @@ void Index::build(const T *data, const size_t num_points_to_loa - +@@ -1593,11 +1632,15 @@ void Index::build(const T *data, const size_t num_points_to_loa + { + std::unique_lock tl(_tag_lock); + _nd = num_points_to_load; +- _data_store->populate_data(data, (location_t)num_points_to_load); } - - build_with_data_populated(tags); -+ std::cout << "_raft_cagra_graph" << _raft_cagra_graph << std::endl; ++ std::cout << "raft_cagra_graph" << _raft_cagra_graph << std::endl; + if (!_raft_cagra_graph) + build_with_data_populated(tags); + else @@ -424,3 +481,29 @@ index bf93344..3d9e2c4 100644 } template +@@ -1960,6 +2003,7 @@ template + std::pair Index::search(const T *query, const size_t K, const uint32_t L, + IdType *indices, float *distances) + { ++ std::cout << "inside diskann search" << std::endl; + if (K > (uint64_t)L) + { + throw ANNException("Set L to a value of at least K", -1, __FUNCSIG__, __FILE__, __LINE__); +@@ -1976,6 +2020,8 @@ std::pair Index::search(const T *query, con + diskann::cout << "Resize completed. New scratch->L is " << scratch->get_L() << std::endl; + } + ++ std::cout << "created scratch space success" << std::endl; ++ + const std::vector unused_filter_label; + const std::vector init_ids = get_init_ids(); + +@@ -1987,6 +2033,8 @@ std::pair Index::search(const T *query, con + + NeighborPriorityQueue &best_L_nodes = scratch->best_l_nodes(); + ++ std::cout << "created NeighborPriorityQueue success" << std::endl; ++ + size_t pos = 0; + for (size_t i = 0; i < best_L_nodes.size(); ++i) + { diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml index 326521a34f..8d6c33d175 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml +++ b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml @@ -5,10 +5,8 @@ groups: R: [32] Lb: [64] alpha: [0] - pq_dim: [64] cagra_intermediate_graph_degree: [128] cagra_graph_degree: [64] use_cagra_graph: [True] search: - L_search: [10, 20, 50, 100] - L_load: [100] \ No newline at end of file + L_search: [10, 20, 50, 100] \ No newline at end of file From cf3e0a63e0c240bf5d2159c99385a4a30f59ebf7 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 20 May 2024 08:11:00 -0700 Subject: [PATCH 13/20] update diff, style --- cpp/bench/ann/src/common/benchmark.hpp | 5 +- .../ann/src/diskann/diskann_benchmark.cu | 15 +-- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 39 +++---- cpp/cmake/patches/diskann.diff | 102 ++---------------- .../run/conf/algos/diskann.yaml | 4 +- 5 files changed, 39 insertions(+), 126 deletions(-) diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index c52d4236fa..ae369af57d 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -235,11 +235,8 @@ void bench_search(::benchmark::State& state, auto ualgo = ann::create_algo( index.algo, dataset->distance(), dataset->dim(), index.build_param, index.dev_list); algo = ualgo.get(); - std::cout << "now doing index loading" << std::endl; algo->load(index_file); - std::cout << "now done index loading" << std::endl; current_algo = std::move(ualgo); - std::cout << "move done" << std::endl; } search_param = ann::create_search_param(index.algo, sp_json); search_param->metric_objective = metric_objective; @@ -263,7 +260,6 @@ void bench_search(::benchmark::State& state, } } try { - std::cout << "now setting search params" << std::endl; algo->set_search_param(*search_param); } catch (const std::exception& ex) { state.SkipWithError("An error occurred setting search parameters: " + std::string(ex.what())); @@ -299,6 +295,7 @@ void bench_search(::benchmark::State& state, state.SkipWithError("Algo::copy: " + std::string(e.what())); return; } + // Initialize with algo, so that the timer.lap() object can sync with algo::get_sync_stream() cuda_timer gpu_timer{algo}; auto start = std::chrono::high_resolution_clock::now(); diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cu index a4ff4c5282..cc39a14509 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cu +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cu @@ -34,15 +34,14 @@ template void parse_build_param(const nlohmann::json& conf, typename raft::bench::ann::DiskANNMemory::BuildParam& param) { - param.R = conf.at("R"); - param.L_build = conf.at("Lb"); - param.alpha = conf.at("alpha"); + param.R = conf.at("R"); + param.L_build = conf.at("Lb"); + param.alpha = conf.at("alpha"); if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } param.use_cagra_graph = conf.at("use_cagra_graph"); if (param.use_cagra_graph) { - param.cagra_graph_degree = conf.at("cagra_graph_degree"); - param.cagra_intermediate_graph_degree = - conf.at("cagra_intermediate_graph_degree"); + param.cagra_graph_degree = conf.at("cagra_graph_degree"); + param.cagra_intermediate_graph_degree = conf.at("cagra_intermediate_graph_degree"); } } @@ -92,7 +91,9 @@ std::unique_ptr> create_algo(const std::string& algo, if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) { - if (algo == "diskann") { ann = make_algo(metric, dim, conf); } + if (algo == "diskann") { + ann = make_algo(metric, dim, conf); + } } if (!ann) { throw std::runtime_error("invalid algo: '" + algo + "'"); } diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index cbd4c86774..6327ccbb50 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -16,11 +16,10 @@ #pragma once #include "../common/ann_types.hpp" -#include "parameters.h" -#include "raft/core/host_mdspan.hpp" -#include "raft/core/resource/cuda_stream.hpp" -#include "raft/neighbors/cagra.cuh" -#include "raft/neighbors/cagra_types.hpp" + +#include +#include +#include #include #include @@ -36,11 +35,6 @@ #include #endif -#include "ann_exception.h" -#include "memory_mapper.h" - -// #include - namespace raft::bench::ann { diskann::Metric parse_metric_type(raft::bench::ann::Metric metric) @@ -85,7 +79,7 @@ class DiskANNMemory : public ANN { void save(const std::string& path_to_index) const override; void load(const std::string& path_to_index) override; DiskANNMemory(const DiskANNMemory& other) = default; - std::unique_ptr> copy() override { return nullptr; } + std::unique_ptr> copy() override { return std::make_unique>(*this); } AlgoProperty get_preference() const override { @@ -102,11 +96,11 @@ class DiskANNMemory : public ANN { std::shared_ptr diskann_index_write_params_{nullptr}; std::shared_ptr diskann_index_search_params_{nullptr}; std::shared_ptr> diskann_index_{nullptr}; - int num_threads_search_; // uint32_t L_load_; uint32_t L_search_; uint32_t cagra_graph_degree_; uint32_t cagra_intermediate_graph_degree_; + uint32_t max_points_; }; template @@ -130,9 +124,10 @@ DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) template void DiskANNMemory::build(const T* dataset, size_t nrow) { + max_points_ = nrow; this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), this->dim_, - nrow, + max_points_, this->diskann_index_write_params_, nullptr, 0, @@ -167,20 +162,22 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) template void DiskANNMemory::set_search_param(const AnnSearchParam& param_) { - auto param = dynamic_cast(param_); - std::cout << "inside set_search_param L_search" << param.L_search; - this->L_search_ = param.L_search; + auto param = dynamic_cast(param_); + this->L_search_ = param.L_search; } template void DiskANNMemory::search( const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const { - std::cout << "inside raft-ann-bench search function" << std::endl; omp_set_num_threads(diskann_index_write_params_->num_threads); #pragma omp parallel for schedule(dynamic, 1) for (int64_t i = 0; i < (int64_t)batch_size; i++) { - diskann_index_->search(queries + i * this->dim_, static_cast(k), L_search_, reinterpret_cast(neighbors), distances); + diskann_index_->search(queries + i * this->dim_, + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k); } } @@ -193,10 +190,9 @@ void DiskANNMemory::save(const std::string& path_to_index) const template void DiskANNMemory::load(const std::string& path_to_index) { - std::cout << "now loading index" << path_to_index << "num_threads_search_" << diskann_index_write_params_->num_threads << "L_search_" << L_search_ << std::endl; this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), this->dim_, - 100000, + max_points_, this->diskann_index_write_params_, nullptr, 0, @@ -209,8 +205,7 @@ void DiskANNMemory::load(const std::string& path_to_index) false, this->use_cagra_graph_, cagra_graph_degree_); - diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 100); - std::cout << "success loading index" << path_to_index.c_str() << std::endl; + diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 0); } }; // namespace raft::bench::ann diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 66dc86d01f..dffd064d41 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -329,7 +329,7 @@ index d3af5c3..417af31 100644 #ifdef EXEC_ENV_OLS #include "content_buf.h" diff --git a/src/index.cpp b/src/index.cpp -index bf93344..d7dfc42 100644 +index bf93344..283e3a3 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -37,8 +37,10 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -535,6 +540,7 @@ void Index::load(AlignedFileReader &reader, uint32_t num_thread - void Index::load(const char *filename, uint32_t num_threads, uint32_t search_l) - { - #endif -+ std::cout << "inside DiskANN load" << std::endl; - std::unique_lock ul(_update_lock); - std::unique_lock cl(_consolidate_lock); - std::unique_lock tl(_tag_lock); -@@ -549,8 +555,11 @@ void Index::load(const char *filename, uint32_t num_threads, ui - std::string labels_to_medoids = mem_index_file + "_labels_to_medoids.txt"; - std::string labels_map_file = mem_index_file + "_labels_map.txt"; - -+ std::cout << "set strings" << std::endl; -+ - if (!_save_as_one_file) - { -+ std::cout << "_save_as_one_file was false" << std::endl; - // For DLVS Store, we will not support saving the index in multiple - // files. - #ifndef EXEC_ENV_OLS -@@ -568,10 +577,12 @@ void Index::load(const char *filename, uint32_t num_threads, ui - tags_file_num_pts = load_tags(tags_file); - } - graph_num_pts = load_graph(graph_file, data_file_num_pts); -+ std::cout << "loaded everything in this if block" << std::endl; - #endif - } - else - { -+ std::cout << "inside else block" << std::endl; - diskann::cout << "Single index file saving/loading support not yet " - "enabled. Not loading the index." - << std::endl; -@@ -580,6 +591,7 @@ void Index::load(const char *filename, uint32_t num_threads, ui - - if (data_file_num_pts != graph_num_pts || (data_file_num_pts != tags_file_num_pts && _enable_tags)) - { -+ std::cout << "inside error block" << std::endl; - std::stringstream stream; - stream << "ERROR: When loading index, loaded " << data_file_num_pts << " points from datafile, " - << graph_num_pts << " from graph, and " << tags_file_num_pts -@@ -590,6 +602,7 @@ void Index::load(const char *filename, uint32_t num_threads, ui - - if (file_exists(labels_file)) - { -+ std::cout << "labels_file exists" << std::endl; - _label_map = load_label_map(labels_map_file); - parse_label_file(labels_file, label_num_pts); - assert(label_num_pts == data_file_num_pts - _num_frozen_pts); -@@ -632,6 +645,8 @@ void Index::load(const char *filename, uint32_t num_threads, ui - _use_universal_label = true; - universal_label_reader.close(); - } -+ } else { -+ std::cout << "labels_file does not exists" << std::endl; - } - - _nd = data_file_num_pts - _num_frozen_pts; -@@ -1505,6 +1520,29 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -1505,6 +1510,30 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } +template -+void Index::add_raft_cagra_neighbours(const std::vector& raft_cagra_graph_vec) ++void Index::add_raft_cagra_neighbours(const std::vector &raft_cagra_graph_vec) +{ + const uint32_t *raw_ptr = raft_cagra_graph_vec.data(); +#pragma omp parallel for schedule(dynamic, 2048) @@ -447,22 +389,23 @@ index bf93344..d7dfc42 100644 + assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); + } + } ++ _has_built = true; +} + template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1576,7 +1614,8 @@ void Index::_build(const DataType &data, const size_t num_point +@@ -1576,7 +1605,8 @@ void Index::_build(const DataType &data, const size_t num_point } } template -void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags) +void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, -+ const std::vector& raft_cagra_graph_vec) ++ const std::vector &raft_cagra_graph_vec) { if (num_points_to_load == 0) { -@@ -1593,11 +1632,15 @@ void Index::build(const T *data, const size_t num_points_to_loa +@@ -1593,11 +1623,18 @@ void Index::build(const T *data, const size_t num_points_to_loa { std::unique_lock tl(_tag_lock); _nd = num_points_to_load; @@ -471,39 +414,16 @@ index bf93344..d7dfc42 100644 } - - build_with_data_populated(tags); -+ std::cout << "raft_cagra_graph" << _raft_cagra_graph << std::endl; + if (!_raft_cagra_graph) + build_with_data_populated(tags); + else + { ++ if (_num_frozen_pts > 0) ++ _start = (uint32_t)_max_points; ++ else ++ _start = calculate_entry_point(); + add_raft_cagra_neighbours(raft_cagra_graph_vec); + } } template -@@ -1960,6 +2003,7 @@ template - std::pair Index::search(const T *query, const size_t K, const uint32_t L, - IdType *indices, float *distances) - { -+ std::cout << "inside diskann search" << std::endl; - if (K > (uint64_t)L) - { - throw ANNException("Set L to a value of at least K", -1, __FUNCSIG__, __FILE__, __LINE__); -@@ -1976,6 +2020,8 @@ std::pair Index::search(const T *query, con - diskann::cout << "Resize completed. New scratch->L is " << scratch->get_L() << std::endl; - } - -+ std::cout << "created scratch space success" << std::endl; -+ - const std::vector unused_filter_label; - const std::vector init_ids = get_init_ids(); - -@@ -1987,6 +2033,8 @@ std::pair Index::search(const T *query, con - - NeighborPriorityQueue &best_L_nodes = scratch->best_l_nodes(); - -+ std::cout << "created NeighborPriorityQueue success" << std::endl; -+ - size_t pos = 0; - for (size_t i = 0; i < best_L_nodes.size(); ++i) - { diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml index 8d6c33d175..0db6b0d71c 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml +++ b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml @@ -2,8 +2,8 @@ name: diskann groups: base: build: - R: [32] - Lb: [64] + R: [64] + Lb: [128] alpha: [0] cagra_intermediate_graph_degree: [128] cagra_graph_degree: [64] From df8311d52486aee9107f6367e98023fd47b5d77f Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 20 May 2024 14:09:56 -0700 Subject: [PATCH 14/20] working benchmarks --- .../ann/src/diskann/diskann_benchmark.cu | 1 - cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 4 ++-- .../raft-ann-bench/constraints/__init__.py | 4 ++++ .../run/conf/algos/diskann.yaml | 20 ++++++++++++++----- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cu index cc39a14509..89963d4756 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cu +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cu @@ -50,7 +50,6 @@ void parse_search_param(const nlohmann::json& conf, typename raft::bench::ann::DiskANNMemory::SearchParam& param) { param.L_search = conf.at("L_search"); - std::cout << "param.L_search" << param.L_search; } template class Algo> diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index 6327ccbb50..4703a9cbcf 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -98,7 +98,7 @@ class DiskANNMemory : public ANN { std::shared_ptr> diskann_index_{nullptr}; // uint32_t L_load_; uint32_t L_search_; - uint32_t cagra_graph_degree_; + uint32_t cagra_graph_degree_ = 0; uint32_t cagra_intermediate_graph_degree_; uint32_t max_points_; }; @@ -205,7 +205,7 @@ void DiskANNMemory::load(const std::string& path_to_index) false, this->use_cagra_graph_, cagra_graph_degree_); - diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 0); + diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 500); } }; // namespace raft::bench::ann diff --git a/python/raft-ann-bench/src/raft-ann-bench/constraints/__init__.py b/python/raft-ann-bench/src/raft-ann-bench/constraints/__init__.py index 2b7b2728fe..aab7d61d8a 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/constraints/__init__.py +++ b/python/raft-ann-bench/src/raft-ann-bench/constraints/__init__.py @@ -51,3 +51,7 @@ def raft_cagra_search_constraints(params, build_params, k, batch_size): def hnswlib_search_constraints(params, build_params, k, batch_size): if "ef" in params: return params["ef"] >= k + + +def diskann_search_constraints(params, build_params, k, batch_size): + return params["L_search"] >= k \ No newline at end of file diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml index 0db6b0d71c..629e69679a 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml +++ b/python/raft-ann-bench/src/raft-ann-bench/run/conf/algos/diskann.yaml @@ -1,12 +1,22 @@ name: diskann +constraints: + search: raft-ann-bench.constraints.diskann_search_constraints groups: base: build: - R: [64] + R: [32, 64] + Lb: [64, 128] + alpha: [1.0, 1.2] + use_cagra_graph: [False] + search: + L_search: [10, 20, 50, 100, 200, 500] + basecagra: + build: + R: [32, 64] Lb: [128] - alpha: [0] - cagra_intermediate_graph_degree: [128] - cagra_graph_degree: [64] + alpha: [1.2] + cagra_intermediate_graph_degree: [64, 128] + cagra_graph_degree: [32, 64] use_cagra_graph: [True] search: - L_search: [10, 20, 50, 100] \ No newline at end of file + L_search: [10, 20, 50, 100, 200, 500] \ No newline at end of file From 54c0b50845af727183efdfb8fc74060b043df1b5 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 21 May 2024 10:45:36 -0700 Subject: [PATCH 15/20] remove stream sync; parallelized copy --- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 32 ++++--- cpp/cmake/patches/diskann.diff | 86 ++++++++++++++++--- 2 files changed, 94 insertions(+), 24 deletions(-) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index 4703a9cbcf..8b6e371b4d 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -16,6 +16,7 @@ #pragma once #include "../common/ann_types.hpp" +// #include "../common/thread_pool.hpp" #include #include @@ -25,6 +26,7 @@ #include #include +#include #include #include @@ -101,6 +103,8 @@ class DiskANNMemory : public ANN { uint32_t cagra_graph_degree_ = 0; uint32_t cagra_intermediate_graph_degree_; uint32_t max_points_; + // std::shared_ptr thread_pool_; + Objective metric_objective_; }; template @@ -142,17 +146,24 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) cagra_graph_degree_); if (use_cagra_graph_) { - auto intermediate_graph = - raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_); + std::optional> intermediate_graph( + raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_)); + std::vector knn_graph(nrow * cagra_graph_degree_); auto knn_graph_view = raft::make_host_matrix_view(knn_graph.data(), nrow, cagra_graph_degree_); auto dataset_view = raft::make_host_matrix_view( dataset, static_cast(nrow), (int64_t)this->dim_); raft::resources res; - raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph.view()); - raft::neighbors::cagra::optimize(res, intermediate_graph.view(), knn_graph_view); - resource::sync_stream(res); + auto start = std::chrono::high_resolution_clock::now(); + raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph->view()); + raft::neighbors::cagra::optimize(res, intermediate_graph->view(), knn_graph_view); + // free intermediate graph before trying to create the index + intermediate_graph.reset(); + // resource::sync_stream(res); + auto end = std::chrono::high_resolution_clock::now(); + auto duration = std::chrono::duration_cast>(end - start).count(); + std::cout << "cagra graph built in" << duration << " seconds" << std::endl; diskann_index_->build(dataset, nrow, std::vector(), knn_graph); } else { diskann_index_->build(dataset, nrow, std::vector()); @@ -162,16 +173,18 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) template void DiskANNMemory::set_search_param(const AnnSearchParam& param_) { - auto param = dynamic_cast(param_); - this->L_search_ = param.L_search; + auto param = dynamic_cast(param_); + this->L_search_ = param.L_search; + metric_objective_ = param.metric_objective; } template void DiskANNMemory::search( const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const { - omp_set_num_threads(diskann_index_write_params_->num_threads); -#pragma omp parallel for schedule(dynamic, 1) + if (this->metric_objective_ == Objective::LATENCY) + omp_set_num_threads(diskann_index_write_params_->num_threads); +#pragma omp parallel for for (int64_t i = 0; i < (int64_t)batch_size; i++) { diskann_index_->search(queries + i * this->dim_, static_cast(k), @@ -207,5 +220,4 @@ void DiskANNMemory::load(const std::string& path_to_index) cagra_graph_degree_); diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 500); } - }; // namespace raft::bench::ann diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index dffd064d41..afe8a6ffb8 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -78,6 +78,19 @@ index 0000000..a5a12fe + +make -j30 \ No newline at end of file +diff --git a/include/abstract_graph_store.h b/include/abstract_graph_store.h +index 4d6906c..80c8dc4 100644 +--- a/include/abstract_graph_store.h ++++ b/include/abstract_graph_store.h +@@ -48,6 +48,8 @@ class AbstractGraphStore + return _capacity; + } + ++ virtual std::vector>& graph() = 0; ++ + protected: + // Internal function, changes total points when resize_graph is called. + void set_total_points(size_t new_capacity) diff --git a/include/distance.h b/include/distance.h index f3b1de2..c2f0728 100644 --- a/include/distance.h @@ -185,6 +198,27 @@ index f3b1de2..c2f0728 100644 { // Inner product returns negative values to indicate distance. // This will ensure that cosine is between -1 and 1. +diff --git a/include/in_mem_graph_store.h b/include/in_mem_graph_store.h +index d0206a7..46cdee4 100644 +--- a/include/in_mem_graph_store.h ++++ b/include/in_mem_graph_store.h +@@ -32,6 +32,8 @@ class InMemGraphStore : public AbstractGraphStore + virtual size_t get_max_range_of_graph() override; + virtual uint32_t get_max_observed_degree() override; + ++ std::vector>& graph() override; ++ + protected: + virtual std::tuple load_impl(const std::string &filename, size_t expected_num_points); + #ifdef EXEC_ENV_OLS +@@ -45,6 +47,7 @@ class InMemGraphStore : public AbstractGraphStore + size_t _max_range_of_graph = 0; + uint32_t _max_observed_degree = 0; + ++ public: + std::vector> _graph; + }; + diff --git a/include/index.h b/include/index.h index b9bf4f3..4890f00 100644 --- a/include/index.h @@ -328,8 +362,21 @@ index d3af5c3..417af31 100644 #ifdef EXEC_ENV_OLS #include "content_buf.h" +diff --git a/src/in_mem_graph_store.cpp b/src/in_mem_graph_store.cpp +index c12b251..ea39001 100644 +--- a/src/in_mem_graph_store.cpp ++++ b/src/in_mem_graph_store.cpp +@@ -239,4 +239,8 @@ uint32_t InMemGraphStore::get_max_observed_degree() + return _max_observed_degree; + } + ++std::vector>& InMemGraphStore::graph() { ++ return _graph; ++} ++ + } // namespace diskann diff --git a/src/index.cpp b/src/index.cpp -index bf93344..283e3a3 100644 +index bf93344..08c275c 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -37,8 +37,10 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -1505,6 +1510,30 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -1505,6 +1510,41 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } @@ -372,21 +419,32 @@ index bf93344..283e3a3 100644 +void Index::add_raft_cagra_neighbours(const std::vector &raft_cagra_graph_vec) +{ + const uint32_t *raw_ptr = raft_cagra_graph_vec.data(); ++ std::vector> &graph = _graph_store->graph(); +#pragma omp parallel for schedule(dynamic, 2048) -+ for (int64_t node = 0; node < _nd; node++) ++ for (int i = 0; i < graph.size(); i++) + { -+ std::vector node_nbrs(_raft_cagra_graph_degree); -+ const uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; -+ const uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; -+ std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); ++ graph[i].resize(_raft_cagra_graph_degree); ++ } ++// for (int64_t node = 0; node < _nd; node++) ++// { ++// std::vector node_nbrs(_raft_cagra_graph_degree); ++// const uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; ++// const uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; ++// std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); + -+ assert(node_nbrs.size() > 0); ++// assert(node_nbrs.size() > 0); + ++// _graph_store->set_neighbours(node, node_nbrs); ++// assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); ++// } ++// } ++ std::cout << "_indexingThreads" << _indexingThreads << std::endl; ++#pragma omp parallel for num_threads(_indexingThreads) collapse(2) ++ for (int i = 0; i < graph.size(); i++) ++ { ++ for (int j = 0; j < _raft_cagra_graph_degree; j++) + { -+ LockGuard guard(_locks[node]); -+ -+ _graph_store->set_neighbours(node, node_nbrs); -+ assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); ++ graph[i][j] = raft_cagra_graph_vec[i * _raft_cagra_graph_degree + j]; + } + } + _has_built = true; @@ -395,7 +453,7 @@ index bf93344..283e3a3 100644 template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1576,7 +1605,8 @@ void Index::_build(const DataType &data, const size_t num_point +@@ -1576,7 +1616,8 @@ void Index::_build(const DataType &data, const size_t num_point } } template @@ -405,7 +463,7 @@ index bf93344..283e3a3 100644 { if (num_points_to_load == 0) { -@@ -1593,11 +1623,18 @@ void Index::build(const T *data, const size_t num_points_to_loa +@@ -1593,11 +1634,18 @@ void Index::build(const T *data, const size_t num_points_to_loa { std::unique_lock tl(_tag_lock); _nd = num_points_to_load; From 8c630528475b7dde937494af158689b504e22d6c Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 22 May 2024 17:46:11 -0700 Subject: [PATCH 16/20] change to nn_descent --- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index 8b6e371b4d..db86c0dbfa 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -156,7 +156,11 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) dataset, static_cast(nrow), (int64_t)this->dim_); raft::resources res; auto start = std::chrono::high_resolution_clock::now(); - raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph->view()); + auto nn_descent_params = raft::neighbors::experimental::nn_descent::index_params(); + nn_descent_params.graph_degree = cagra_intermediate_graph_degree_; + nn_descent_params.intermediate_graph_degree = 1.5 * cagra_intermediate_graph_degree_; + nn_descent_params.max_iterations = 20; + raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph->view(), nn_descent_params); raft::neighbors::cagra::optimize(res, intermediate_graph->view(), knn_graph_view); // free intermediate graph before trying to create the index intermediate_graph.reset(); From b179c4e468465c4f1ca12b1737af0c9471b4cd1b Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 22 May 2024 18:24:29 -0700 Subject: [PATCH 17/20] merge 24.06 --- cpp/bench/ann/CMakeLists.txt | 115 +++++++++---------------- cpp/bench/ann/src/common/benchmark.hpp | 1 - cpp/bench/prims/CMakeLists.txt | 2 +- rapids_config.cmake | 6 +- 4 files changed, 44 insertions(+), 80 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 9a521f3397..11657f273e 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -12,6 +12,8 @@ # the License. # ============================================================================= +list(APPEND CMAKE_MODULE_PATH "${RAFT_SOURCE_DIR}") + # ################################################################################################## # * benchmark options ------------------------------------------------------------------------------ @@ -41,16 +43,17 @@ option(RAFT_ANN_BENCH_SINGLE_EXE find_package(Threads REQUIRED) +set(RAFT_ANN_BENCH_USE_FAISS ON) +set(RAFT_FAISS_ENABLE_GPU ON) +set(RAFT_USE_FAISS_STATIC ON) + if(BUILD_CPU_ONLY) # Include necessary logging dependencies - include(cmake/thirdparty/get_fmt.cmake) - include(cmake/thirdparty/get_spdlog.cmake) + include(cmake/thirdparty/get_fmt) + include(cmake/thirdparty/get_spdlog) set(RAFT_FAISS_ENABLE_GPU OFF) - set(RAFT_ANN_BENCH_USE_FAISS_GPU_FLAT OFF) - set(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_FLAT OFF) - set(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_PQ OFF) set(RAFT_ANN_BENCH_USE_RAFT_IVF_FLAT OFF) set(RAFT_ANN_BENCH_USE_RAFT_IVF_PQ OFF) set(RAFT_ANN_BENCH_USE_RAFT_CAGRA OFF) @@ -58,32 +61,10 @@ if(BUILD_CPU_ONLY) set(RAFT_ANN_BENCH_USE_RAFT_CAGRA_HNSWLIB OFF) set(RAFT_ANN_BENCH_USE_GGNN OFF) set(RAFT_ANN_BENCH_USE_DISKANN OFF) -else() +elseif(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 12.0.0) # Disable faiss benchmarks on CUDA 12 since faiss is not yet CUDA 12-enabled. # https://github.com/rapidsai/raft/issues/1627 - if(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 12.0.0) - set(RAFT_FAISS_ENABLE_GPU OFF) - set(RAFT_ANN_BENCH_USE_FAISS_GPU_FLAT OFF) - set(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_FLAT OFF) - set(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_PQ OFF) - set(RAFT_ANN_BENCH_USE_FAISS_CPU_FLAT OFF) - set(RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_PQ OFF) - set(RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_FLAT OFF) - else() - set(RAFT_FAISS_ENABLE_GPU ON) - endif() -endif() - -set(RAFT_ANN_BENCH_USE_FAISS OFF) -if(RAFT_ANN_BENCH_USE_FAISS_GPU_FLAT - OR RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_PQ - OR RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_FLAT - OR RAFT_ANN_BENCH_USE_FAISS_CPU_FLAT - OR RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_PQ - OR RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_FLAT -) - set(RAFT_ANN_BENCH_USE_FAISS ON) - set(RAFT_USE_FAISS_STATIC ON) + set(RAFT_FAISS_ENABLE_GPU OFF) endif() set(RAFT_ANN_BENCH_USE_RAFT OFF) @@ -100,25 +81,21 @@ endif() # * Fetch requirements ------------------------------------------------------------- if(RAFT_ANN_BENCH_USE_HNSWLIB OR RAFT_ANN_BENCH_USE_RAFT_CAGRA_HNSWLIB) - include(cmake/thirdparty/get_hnswlib.cmake) + include(cmake/thirdparty/get_hnswlib) endif() -include(cmake/thirdparty/get_nlohmann_json.cmake) +include(cmake/thirdparty/get_nlohmann_json) if(RAFT_ANN_BENCH_USE_GGNN) - include(cmake/thirdparty/get_ggnn.cmake) + include(cmake/thirdparty/get_ggnn) endif() if(RAFT_ANN_BENCH_USE_FAISS) - # We need to ensure that faiss has all the conda information. So we currently use the very ugly - # hammer of `link_libraries` to ensure that all targets in this directory and the faiss directory - # will have the conda includes/link dirs - link_libraries($) - include(cmake/thirdparty/get_faiss.cmake) + include(cmake/thirdparty/get_faiss) endif() if(RAFT_ANN_BENCH_USE_DISKANN) - include(cmake/thirdparty/get_diskann.cmake) + include(cmake/thirdparty/get_diskann) endif() # ################################################################################################## @@ -231,7 +208,7 @@ endfunction() if(RAFT_ANN_BENCH_USE_HNSWLIB) ConfigureAnnBench( - NAME HNSWLIB PATH bench/ann/src/hnswlib/hnswlib_benchmark.cpp LINKS hnswlib::hnswlib + NAME HNSWLIB PATH src/hnswlib/hnswlib_benchmark.cpp LINKS hnswlib::hnswlib ) endif() @@ -241,8 +218,8 @@ if(RAFT_ANN_BENCH_USE_RAFT_IVF_PQ) NAME RAFT_IVF_PQ PATH - bench/ann/src/raft/raft_benchmark.cu - $<$:bench/ann/src/raft/raft_ivf_pq.cu> + src/raft/raft_benchmark.cu + src/raft/raft_ivf_pq.cu LINKS raft::compiled ) @@ -253,8 +230,8 @@ if(RAFT_ANN_BENCH_USE_RAFT_IVF_FLAT) NAME RAFT_IVF_FLAT PATH - bench/ann/src/raft/raft_benchmark.cu - $<$:bench/ann/src/raft/raft_ivf_flat.cu> + src/raft/raft_benchmark.cu + src/raft/raft_ivf_flat.cu LINKS raft::compiled ) @@ -262,7 +239,7 @@ endif() if(RAFT_ANN_BENCH_USE_RAFT_BRUTE_FORCE) ConfigureAnnBench( - NAME RAFT_BRUTE_FORCE PATH bench/ann/src/raft/raft_benchmark.cu LINKS raft::compiled + NAME RAFT_BRUTE_FORCE PATH src/raft/raft_benchmark.cu LINKS raft::compiled ) endif() @@ -271,8 +248,11 @@ if(RAFT_ANN_BENCH_USE_RAFT_CAGRA) NAME RAFT_CAGRA PATH - bench/ann/src/raft/raft_benchmark.cu - $<$:bench/ann/src/raft/raft_cagra.cu> + src/raft/raft_benchmark.cu + src/raft/raft_cagra_float.cu + src/raft/raft_cagra_half.cu + src/raft/raft_cagra_int8_t.cu + src/raft/raft_cagra_uint8_t.cu LINKS raft::compiled ) @@ -280,82 +260,69 @@ endif() if(RAFT_ANN_BENCH_USE_RAFT_CAGRA_HNSWLIB) ConfigureAnnBench( - NAME RAFT_CAGRA_HNSWLIB PATH bench/ann/src/raft/raft_cagra_hnswlib.cu LINKS raft::compiled + NAME RAFT_CAGRA_HNSWLIB PATH src/raft/raft_cagra_hnswlib.cu LINKS raft::compiled hnswlib::hnswlib ) endif() -set(RAFT_FAISS_TARGETS faiss::faiss) -if(TARGET faiss::faiss_avx2) - set(RAFT_FAISS_TARGETS faiss::faiss_avx2) -endif() - message("RAFT_FAISS_TARGETS: ${RAFT_FAISS_TARGETS}") message("CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}") if(RAFT_ANN_BENCH_USE_FAISS_CPU_FLAT) ConfigureAnnBench( - NAME FAISS_CPU_FLAT PATH bench/ann/src/faiss/faiss_cpu_benchmark.cpp LINKS + NAME FAISS_CPU_FLAT PATH src/faiss/faiss_cpu_benchmark.cpp LINKS ${RAFT_FAISS_TARGETS} ) endif() if(RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_FLAT) ConfigureAnnBench( - NAME FAISS_CPU_IVF_FLAT PATH bench/ann/src/faiss/faiss_cpu_benchmark.cpp LINKS + NAME FAISS_CPU_IVF_FLAT PATH src/faiss/faiss_cpu_benchmark.cpp LINKS ${RAFT_FAISS_TARGETS} ) endif() if(RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_PQ) ConfigureAnnBench( - NAME FAISS_CPU_IVF_PQ PATH bench/ann/src/faiss/faiss_cpu_benchmark.cpp LINKS + NAME FAISS_CPU_IVF_PQ PATH src/faiss/faiss_cpu_benchmark.cpp LINKS ${RAFT_FAISS_TARGETS} ) endif() -if(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_FLAT) +if(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_FLAT AND RAFT_FAISS_ENABLE_GPU) ConfigureAnnBench( - NAME FAISS_GPU_IVF_FLAT PATH bench/ann/src/faiss/faiss_gpu_benchmark.cu LINKS + NAME FAISS_GPU_IVF_FLAT PATH src/faiss/faiss_gpu_benchmark.cu LINKS ${RAFT_FAISS_TARGETS} ) endif() -if(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_PQ) +if(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_PQ AND RAFT_FAISS_ENABLE_GPU) ConfigureAnnBench( - NAME FAISS_GPU_IVF_PQ PATH bench/ann/src/faiss/faiss_gpu_benchmark.cu LINKS + NAME FAISS_GPU_IVF_PQ PATH src/faiss/faiss_gpu_benchmark.cu LINKS ${RAFT_FAISS_TARGETS} ) endif() -if(RAFT_ANN_BENCH_USE_FAISS_GPU_FLAT) +if(RAFT_ANN_BENCH_USE_FAISS_GPU_FLAT AND RAFT_FAISS_ENABLE_GPU) ConfigureAnnBench( - NAME FAISS_GPU_FLAT PATH bench/ann/src/faiss/faiss_gpu_benchmark.cu LINKS ${RAFT_FAISS_TARGETS} + NAME FAISS_GPU_FLAT PATH src/faiss/faiss_gpu_benchmark.cu LINKS ${RAFT_FAISS_TARGETS} ) endif() if(RAFT_ANN_BENCH_USE_GGNN) - include(cmake/thirdparty/get_glog.cmake) - ConfigureAnnBench(NAME GGNN PATH bench/ann/src/ggnn/ggnn_benchmark.cu LINKS glog::glog ggnn::ggnn) + include(cmake/thirdparty/get_glog) + ConfigureAnnBench(NAME GGNN PATH src/ggnn/ggnn_benchmark.cu LINKS glog::glog ggnn::ggnn) endif() if(RAFT_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( - NAME DISKANN PATH bench/ann/src/diskann/diskann_benchmark.cu LINKS diskann::diskann raft::compiled + NAME DISKANN PATH src/diskann/diskann_benchmark.cu LINKS diskann::diskann ) endif() # ################################################################################################## # * Dynamically-loading ANN_BENCH executable ------------------------------------------------------- if(RAFT_ANN_BENCH_SINGLE_EXE) - add_executable(ANN_BENCH bench/ann/src/common/benchmark.cpp) - - # Build and link static version of the GBench to keep ANN_BENCH self-contained. - get_target_property(TMP_PROP benchmark::benchmark SOURCES) - add_library(benchmark_static STATIC ${TMP_PROP}) - get_target_property(TMP_PROP benchmark::benchmark INCLUDE_DIRECTORIES) - target_include_directories(benchmark_static PUBLIC ${TMP_PROP}) - get_target_property(TMP_PROP benchmark::benchmark LINK_LIBRARIES) - target_link_libraries(benchmark_static PUBLIC ${TMP_PROP}) + add_executable(ANN_BENCH src/common/benchmark.cpp) target_include_directories(ANN_BENCH PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) @@ -363,7 +330,7 @@ if(RAFT_ANN_BENCH_SINGLE_EXE) ANN_BENCH PRIVATE raft::raft nlohmann_json::nlohmann_json - benchmark_static + benchmark::benchmark dl -static-libgcc fmt::fmt-header-only diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 6f09d26375..8762ccd1fe 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -301,7 +301,6 @@ void bench_search(::benchmark::State& state, state.SkipWithError("Algo::copy: " + std::string(e.what())); return; } - // Initialize with algo, so that the timer.lap() object can sync with algo::get_sync_stream() cuda_timer gpu_timer{algo}; auto start = std::chrono::high_resolution_clock::now(); diff --git a/cpp/bench/prims/CMakeLists.txt b/cpp/bench/prims/CMakeLists.txt index 72e2faa014..0771a60e58 100644 --- a/cpp/bench/prims/CMakeLists.txt +++ b/cpp/bench/prims/CMakeLists.txt @@ -172,4 +172,4 @@ if(BUILD_PRIMS_BENCH) EXPLICIT_INSTANTIATE_ONLY ) -endif() \ No newline at end of file +endif() diff --git a/rapids_config.cmake b/rapids_config.cmake index a40d7130c0..c8077f7f4b 100644 --- a/rapids_config.cmake +++ b/rapids_config.cmake @@ -22,15 +22,13 @@ else() string(REPLACE "\n" "\n " _rapids_version_formatted " ${_rapids_version}") message( FATAL_ERROR - "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}" - ) + "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}") endif() if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") file( DOWNLOAD "https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION_MAJOR_MINOR}/RAPIDS.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake" - ) + "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") endif() include("${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") From 6a57e4831fb8258fbfe990db1a248a628bde57e7 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 27 May 2024 18:25:23 -0700 Subject: [PATCH 18/20] update cmake, benchmark configs --- cpp/bench/ann/CMakeLists.txt | 42 +++--------- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 23 +++---- cpp/bench/prims/CMakeLists.txt | 27 +++----- cpp/cmake/modules/ConfigureCUDA.cmake | 4 +- cpp/cmake/patches/diskann.diff | 43 ------------ cpp/cmake/patches/diskann_override.json | 16 +++++ cpp/cmake/thirdparty/get_diskann.cmake | 66 ++++++++----------- cpp/test/CMakeLists.txt | 35 +++------- .../run/conf/algos/diskann.yaml | 6 +- rapids_config.cmake | 6 +- 10 files changed, 96 insertions(+), 172 deletions(-) create mode 100644 cpp/cmake/patches/diskann_override.json diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 11657f273e..5cabc63870 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -207,40 +207,25 @@ endfunction() # * Configure tests------------------------------------------------------------- if(RAFT_ANN_BENCH_USE_HNSWLIB) - ConfigureAnnBench( - NAME HNSWLIB PATH src/hnswlib/hnswlib_benchmark.cpp LINKS hnswlib::hnswlib - ) + ConfigureAnnBench(NAME HNSWLIB PATH src/hnswlib/hnswlib_benchmark.cpp LINKS hnswlib::hnswlib) endif() if(RAFT_ANN_BENCH_USE_RAFT_IVF_PQ) ConfigureAnnBench( - NAME - RAFT_IVF_PQ - PATH - src/raft/raft_benchmark.cu - src/raft/raft_ivf_pq.cu - LINKS - raft::compiled + NAME RAFT_IVF_PQ PATH src/raft/raft_benchmark.cu src/raft/raft_ivf_pq.cu LINKS raft::compiled ) endif() if(RAFT_ANN_BENCH_USE_RAFT_IVF_FLAT) ConfigureAnnBench( - NAME - RAFT_IVF_FLAT - PATH - src/raft/raft_benchmark.cu - src/raft/raft_ivf_flat.cu - LINKS + NAME RAFT_IVF_FLAT PATH src/raft/raft_benchmark.cu src/raft/raft_ivf_flat.cu LINKS raft::compiled ) endif() if(RAFT_ANN_BENCH_USE_RAFT_BRUTE_FORCE) - ConfigureAnnBench( - NAME RAFT_BRUTE_FORCE PATH src/raft/raft_benchmark.cu LINKS raft::compiled - ) + ConfigureAnnBench(NAME RAFT_BRUTE_FORCE PATH src/raft/raft_benchmark.cu LINKS raft::compiled) endif() if(RAFT_ANN_BENCH_USE_RAFT_CAGRA) @@ -269,36 +254,31 @@ message("RAFT_FAISS_TARGETS: ${RAFT_FAISS_TARGETS}") message("CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}") if(RAFT_ANN_BENCH_USE_FAISS_CPU_FLAT) ConfigureAnnBench( - NAME FAISS_CPU_FLAT PATH src/faiss/faiss_cpu_benchmark.cpp LINKS - ${RAFT_FAISS_TARGETS} + NAME FAISS_CPU_FLAT PATH src/faiss/faiss_cpu_benchmark.cpp LINKS ${RAFT_FAISS_TARGETS} ) endif() if(RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_FLAT) ConfigureAnnBench( - NAME FAISS_CPU_IVF_FLAT PATH src/faiss/faiss_cpu_benchmark.cpp LINKS - ${RAFT_FAISS_TARGETS} + NAME FAISS_CPU_IVF_FLAT PATH src/faiss/faiss_cpu_benchmark.cpp LINKS ${RAFT_FAISS_TARGETS} ) endif() if(RAFT_ANN_BENCH_USE_FAISS_CPU_IVF_PQ) ConfigureAnnBench( - NAME FAISS_CPU_IVF_PQ PATH src/faiss/faiss_cpu_benchmark.cpp LINKS - ${RAFT_FAISS_TARGETS} + NAME FAISS_CPU_IVF_PQ PATH src/faiss/faiss_cpu_benchmark.cpp LINKS ${RAFT_FAISS_TARGETS} ) endif() if(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_FLAT AND RAFT_FAISS_ENABLE_GPU) ConfigureAnnBench( - NAME FAISS_GPU_IVF_FLAT PATH src/faiss/faiss_gpu_benchmark.cu LINKS - ${RAFT_FAISS_TARGETS} + NAME FAISS_GPU_IVF_FLAT PATH src/faiss/faiss_gpu_benchmark.cu LINKS ${RAFT_FAISS_TARGETS} ) endif() if(RAFT_ANN_BENCH_USE_FAISS_GPU_IVF_PQ AND RAFT_FAISS_ENABLE_GPU) ConfigureAnnBench( - NAME FAISS_GPU_IVF_PQ PATH src/faiss/faiss_gpu_benchmark.cu LINKS - ${RAFT_FAISS_TARGETS} + NAME FAISS_GPU_IVF_PQ PATH src/faiss/faiss_gpu_benchmark.cu LINKS ${RAFT_FAISS_TARGETS} ) endif() @@ -314,9 +294,7 @@ if(RAFT_ANN_BENCH_USE_GGNN) endif() if(RAFT_ANN_BENCH_USE_DISKANN) - ConfigureAnnBench( - NAME DISKANN PATH src/diskann/diskann_benchmark.cu LINKS diskann::diskann - ) + ConfigureAnnBench(NAME DISKANN PATH src/diskann/diskann_benchmark.cu LINKS diskann::diskann) endif() # ################################################################################################## diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index db86c0dbfa..5ba1426c3c 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -16,7 +16,6 @@ #pragma once #include "../common/ann_types.hpp" -// #include "../common/thread_pool.hpp" #include #include @@ -128,7 +127,8 @@ DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) template void DiskANNMemory::build(const T* dataset, size_t nrow) { - max_points_ = nrow; + max_points_ = nrow; + std::cout << "num_threads" << this->diskann_index_write_params_->num_threads << std::endl; this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), this->dim_, max_points_, @@ -147,7 +147,7 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) if (use_cagra_graph_) { std::optional> intermediate_graph( - raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_)); + raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_)); std::vector knn_graph(nrow * cagra_graph_degree_); auto knn_graph_view = @@ -155,16 +155,17 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) auto dataset_view = raft::make_host_matrix_view( dataset, static_cast(nrow), (int64_t)this->dim_); raft::resources res; - auto start = std::chrono::high_resolution_clock::now(); - auto nn_descent_params = raft::neighbors::experimental::nn_descent::index_params(); - nn_descent_params.graph_degree = cagra_intermediate_graph_degree_; - nn_descent_params.intermediate_graph_degree = 1.5 * cagra_intermediate_graph_degree_; - nn_descent_params.max_iterations = 20; - raft::neighbors::cagra::build_knn_graph(res, dataset_view, intermediate_graph->view(), nn_descent_params); + auto start = std::chrono::high_resolution_clock::now(); + auto nn_descent_params = raft::neighbors::experimental::nn_descent::index_params(); + nn_descent_params.graph_degree = cagra_intermediate_graph_degree_; + nn_descent_params.intermediate_graph_degree = 1.5 * cagra_intermediate_graph_degree_; + nn_descent_params.max_iterations = 20; + raft::neighbors::cagra::build_knn_graph( + res, dataset_view, intermediate_graph->view(), nn_descent_params); raft::neighbors::cagra::optimize(res, intermediate_graph->view(), knn_graph_view); // free intermediate graph before trying to create the index intermediate_graph.reset(); - // resource::sync_stream(res); + auto end = std::chrono::high_resolution_clock::now(); auto duration = std::chrono::duration_cast>(end - start).count(); std::cout << "cagra graph built in" << duration << " seconds" << std::endl; @@ -222,6 +223,6 @@ void DiskANNMemory::load(const std::string& path_to_index) false, this->use_cagra_graph_, cagra_graph_degree_); - diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 500); + diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 100); } }; // namespace raft::bench::ann diff --git a/cpp/bench/prims/CMakeLists.txt b/cpp/bench/prims/CMakeLists.txt index 0771a60e58..c4c5b53a9d 100644 --- a/cpp/bench/prims/CMakeLists.txt +++ b/cpp/bench/prims/CMakeLists.txt @@ -74,18 +74,16 @@ function(ConfigureBench) endfunction() if(BUILD_PRIMS_BENCH) - ConfigureBench( - NAME CORE_BENCH PATH core/bitset.cu core/copy.cu main.cpp - ) + ConfigureBench(NAME CORE_BENCH PATH core/bitset.cu core/copy.cu main.cpp) ConfigureBench( - NAME CLUSTER_BENCH PATH cluster/kmeans_balanced.cu cluster/kmeans.cu - main.cpp OPTIONAL LIB EXPLICIT_INSTANTIATE_ONLY + NAME CLUSTER_BENCH PATH cluster/kmeans_balanced.cu cluster/kmeans.cu main.cpp OPTIONAL LIB + EXPLICIT_INSTANTIATE_ONLY ) ConfigureBench( - NAME TUNE_DISTANCE PATH distance/tune_pairwise/kernel.cu - distance/tune_pairwise/bench.cu main.cpp + NAME TUNE_DISTANCE PATH distance/tune_pairwise/kernel.cu distance/tune_pairwise/bench.cu + main.cpp ) ConfigureBench( @@ -122,22 +120,17 @@ if(BUILD_PRIMS_BENCH) ) ConfigureBench( - NAME MATRIX_BENCH PATH matrix/argmin.cu matrix/gather.cu - matrix/select_k.cu main.cpp OPTIONAL LIB EXPLICIT_INSTANTIATE_ONLY + NAME MATRIX_BENCH PATH matrix/argmin.cu matrix/gather.cu matrix/select_k.cu main.cpp OPTIONAL + LIB EXPLICIT_INSTANTIATE_ONLY ) ConfigureBench( - NAME RANDOM_BENCH PATH random/make_blobs.cu random/permute.cu - random/rng.cu random/subsample.cu main.cpp + NAME RANDOM_BENCH PATH random/make_blobs.cu random/permute.cu random/rng.cu random/subsample.cu + main.cpp ) ConfigureBench( - NAME - SPARSE_BENCH - PATH - sparse/bitmap_to_csr.cu - sparse/convert_csr.cu - sparse/select_k_csr.cu + NAME SPARSE_BENCH PATH sparse/bitmap_to_csr.cu sparse/convert_csr.cu sparse/select_k_csr.cu main.cpp ) diff --git a/cpp/cmake/modules/ConfigureCUDA.cmake b/cpp/cmake/modules/ConfigureCUDA.cmake index b364d8418d..25b9b0ddf8 100644 --- a/cpp/cmake/modules/ConfigureCUDA.cmake +++ b/cpp/cmake/modules/ConfigureCUDA.cmake @@ -14,7 +14,9 @@ if(DISABLE_DEPRECATION_WARNINGS) list(APPEND RAFT_CXX_FLAGS -Wno-deprecated-declarations -DRAFT_HIDE_DEPRECATION_WARNINGS) - list(APPEND RAFT_CUDA_FLAGS -Xcompiler=-Wno-deprecated-declarations -DRAFT_HIDE_DEPRECATION_WARNINGS) + list(APPEND RAFT_CUDA_FLAGS -Xcompiler=-Wno-deprecated-declarations + -DRAFT_HIDE_DEPRECATION_WARNINGS + ) endif() # Be very strict when compiling with GCC as host compiler (and thus more lenient when compiling with diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index afe8a6ffb8..dba3070d4f 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -35,49 +35,6 @@ index 3d3d2b8..2b97c06 100644 if (UNIT_TEST) enable_testing() -diff --git a/build.sh b/build.sh -new file mode 100755 -index 0000000..a5a12fe ---- /dev/null -+++ b/build.sh -@@ -0,0 +1,36 @@ -+#!/bin/bash -+ -+# NOTE: This file is temporary for the proof-of-concept branch and will be removed before this PR is merged -+ -+BUILD_TYPE=Release -+BUILD_DIR=build/ -+ -+RAFT_REPO_REL="" -+EXTRA_CMAKE_ARGS="" -+set -e -+ -+if [[ ${RAFT_REPO_REL} != "" ]]; then -+ RAFT_REPO_PATH="`readlink -f \"${RAFT_REPO_REL}\"`" -+ EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCPM_raft_SOURCE=${RAFT_REPO_PATH}" -+fi -+ -+if [ "$1" == "clean" ]; then -+ rm -rf build -+ rm -rf .cache -+ exit 0 -+fi -+ -+mkdir -p $BUILD_DIR -+cd $BUILD_DIR -+ -+cmake \ -+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -+ -DCMAKE_CUDA_ARCHITECTURES="NATIVE" \ -+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -+ -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \ -+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -+ ${EXTRA_CMAKE_ARGS} \ -+ ../ -+ -+make -j30 -\ No newline at end of file diff --git a/include/abstract_graph_store.h b/include/abstract_graph_store.h index 4d6906c..80c8dc4 100644 --- a/include/abstract_graph_store.h diff --git a/cpp/cmake/patches/diskann_override.json b/cpp/cmake/patches/diskann_override.json new file mode 100644 index 0000000000..c83898548f --- /dev/null +++ b/cpp/cmake/patches/diskann_override.json @@ -0,0 +1,16 @@ +{ + "packages" : { + "diskann" : { + "version": "0.7.0", + "git_url": "https://github.com/microsoft/DiskANN.git", + "git_tag": "main", + "patches" : [ + { + "file" : "${current_json_dir}/diskann.diff", + "issue" : "Correct compilation issues", + "fixed_in" : "" + } + ] + } + } +} diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index f6a51cc683..b19fcabe2d 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -15,45 +15,35 @@ #============================================================================= function(find_and_configure_diskann) - set(oneValueArgs VERSION REPOSITORY PINNED_TAG) - cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN} ) - - set(patch_files_to_run "${CMAKE_CURRENT_SOURCE_DIR}/cmake/patches/diskann.diff") - set(patch_issues_to_ref "fix compile issues") - set(patch_script "${CMAKE_BINARY_DIR}/rapids-cmake/patches/diskann/patch.cmake") - set(log_file "${CMAKE_BINARY_DIR}/rapids-cmake/patches/diskann/log") - string(TIMESTAMP current_year "%Y" UTC) - configure_file(${rapids-cmake-dir}/cpm/patches/command_template.cmake.in "${patch_script}" - @ONLY) + include(${rapids-cmake-dir}/cpm/package_override.cmake) + set(patch_dir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../patches") + rapids_cpm_package_override("${patch_dir}/diskann_override.json") - rapids_cpm_find(diskann ${PKG_VERSION} - GLOBAL_TARGETS diskann::diskann - CPM_ARGS - GIT_REPOSITORY ${PKG_REPOSITORY} - GIT_TAG ${PKG_PINNED_TAG} - PATCH_COMMAND ${CMAKE_COMMAND} -P ${patch_script} - OPTIONS - "PYBIND OFF" - "UNIT_TEST OFF" - "RESTAPI OFF" - "PORTABLE OFF" - ) - - if(NOT TARGET diskann::diskann) - target_include_directories(diskann INTERFACE "$") - add_library(diskann::diskann ALIAS diskann) - endif() -endfunction() + include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") + rapids_cpm_package_details(diskann version repository tag shallow exclude) -if(NOT RAFT_DISKANN_GIT_TAG) - set(RAFT_DISKANN_GIT_TAG main) -endif() + include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake") + rapids_cpm_generate_patch_command(diskann ${version} patch_command) -if(NOT RAFT_DISKANN_GIT_REPOSITORY) - set(RAFT_DISKANN_GIT_REPOSITORY https://github.com/microsoft/DiskANN.git) -endif() + rapids_cpm_find(diskann ${version} + GLOBAL_TARGETS diskann::diskann + CPM_ARGS + GIT_REPOSITORY ${repository} + GIT_TAG ${tag} + GIT_SHALLOW ${patch_command} + OPTIONS + "PYBIND OFF" + "UNIT_TEST OFF" + "RESTAPI OFF" + "PORTABLE OFF" + ) -find_and_configure_diskann(VERSION 0.7.0 - REPOSITORY ${RAFT_DISKANN_GIT_REPOSITORY} - PINNED_TAG ${RAFT_DISKANN_GIT_TAG}) + include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") + rapids_cpm_display_patch_status(diskann) + + if(NOT TARGET diskann::diskann) + target_include_directories(diskann INTERFACE "$") + add_library(diskann::diskann ALIAS diskann) + endif() +endfunction() +find_and_configure_diskann() \ No newline at end of file diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index ff0518a4d0..e30c5646c8 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -96,17 +96,8 @@ endfunction() if(BUILD_TESTS) ConfigureTest( - NAME - CLUSTER_TEST - PATH - cluster/kmeans.cu - cluster/kmeans_balanced.cu - cluster/kmeans_find_k.cu - cluster/cluster_solvers.cu - cluster/linkage.cu - cluster/spectral.cu - LIB - EXPLICIT_INSTANTIATE_ONLY + NAME CLUSTER_TEST PATH cluster/kmeans.cu cluster/kmeans_balanced.cu cluster/kmeans_find_k.cu + cluster/cluster_solvers.cu cluster/linkage.cu cluster/spectral.cu LIB EXPLICIT_INSTANTIATE_ONLY ) ConfigureTest( @@ -143,8 +134,8 @@ if(BUILD_TESTS) ) ConfigureTest( - NAME CORE_TEST PATH core/stream_view.cpp core/mdspan_copy.cpp LIB - EXPLICIT_INSTANTIATE_ONLY NOCUDA + NAME CORE_TEST PATH core/stream_view.cpp core/mdspan_copy.cpp LIB EXPLICIT_INSTANTIATE_ONLY + NOCUDA ) ConfigureTest( @@ -299,8 +290,8 @@ if(BUILD_TESTS) ) ConfigureTest( - NAME SOLVERS_TEST PATH cluster/cluster_solvers_deprecated.cu linalg/eigen_solvers.cu - lap/lap.cu sparse/mst.cu LIB EXPLICIT_INSTANTIATE_ONLY + NAME SOLVERS_TEST PATH cluster/cluster_solvers_deprecated.cu linalg/eigen_solvers.cu lap/lap.cu + sparse/mst.cu LIB EXPLICIT_INSTANTIATE_ONLY ) ConfigureTest( @@ -328,19 +319,13 @@ if(BUILD_TESTS) ) ConfigureTest( - NAME SPARSE_DIST_TEST PATH sparse/dist_coo_spmv.cu sparse/distance.cu - sparse/gram.cu LIB EXPLICIT_INSTANTIATE_ONLY + NAME SPARSE_DIST_TEST PATH sparse/dist_coo_spmv.cu sparse/distance.cu sparse/gram.cu LIB + EXPLICIT_INSTANTIATE_ONLY ) ConfigureTest( - NAME - SPARSE_NEIGHBORS_TEST - PATH - sparse/neighbors/cross_component_nn.cu - sparse/neighbors/brute_force.cu - sparse/neighbors/knn_graph.cu - LIB - EXPLICIT_INSTANTIATE_ONLY + NAME SPARSE_NEIGHBORS_TEST PATH sparse/neighbors/cross_component_nn.cu + sparse/neighbors/brute_force.cu sparse/neighbors/knn_graph.cu LIB EXPLICIT_INSTANTIATE_ONLY ) ConfigureTest( diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml b/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml index 629e69679a..77c4bc3296 100644 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml +++ b/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml @@ -9,8 +9,8 @@ groups: alpha: [1.0, 1.2] use_cagra_graph: [False] search: - L_search: [10, 20, 50, 100, 200, 500] - basecagra: + L_search: [10, 20, 50, 100, 200, 300] + cagra: build: R: [32, 64] Lb: [128] @@ -19,4 +19,4 @@ groups: cagra_graph_degree: [32, 64] use_cagra_graph: [True] search: - L_search: [10, 20, 50, 100, 200, 500] \ No newline at end of file + L_search: [10, 20, 50, 100, 200, 300] \ No newline at end of file diff --git a/rapids_config.cmake b/rapids_config.cmake index c8077f7f4b..a40d7130c0 100644 --- a/rapids_config.cmake +++ b/rapids_config.cmake @@ -22,13 +22,15 @@ else() string(REPLACE "\n" "\n " _rapids_version_formatted " ${_rapids_version}") message( FATAL_ERROR - "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}") + "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}" + ) endif() if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") file( DOWNLOAD "https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION_MAJOR_MINOR}/RAPIDS.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") + "${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake" + ) endif() include("${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") From 8c1ad318066a68325ed06303c6b0fbcffe666702 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 6 Jun 2024 08:35:10 -0700 Subject: [PATCH 19/20] updates --- CHANGELOG.md | 54 +++--- README.md | 4 +- build.sh | 4 +- ci/build_python.sh | 4 +- conda/recipes/raft-ann-bench-cpu/meta.yaml | 2 +- conda/recipes/raft-ann-bench/meta.yaml | 2 +- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 7 +- cpp/cmake/patches/diskann.diff | 161 ++++++++++++------ cpp/cmake/thirdparty/get_diskann.cmake | 2 + dependencies.yaml | 4 +- docs/source/ann_benchmarks_low_level.md | 14 +- docs/source/build.md | 4 +- docs/source/raft_ann_benchmarks.md | 40 ++--- docs/source/wiki_all_dataset.md | 2 +- python/raft-ann-bench/pyproject.toml | 2 +- .../run/conf/algos/diskann.yaml | 2 +- 16 files changed, 188 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0599dae8a..5ba07107fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,22 @@ ## 🚨 Breaking Changes -- Rename raft-ann-bench module to raft_ann_bench ([#2333](https://github.com/rapidsai/raft/pull/2333)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Rename raft_ann_bench module to raft_ann_bench ([#2333](https://github.com/rapidsai/raft/pull/2333)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) - Scaling workspace resources ([#2322](https://github.com/rapidsai/raft/pull/2322)) [@achirkin](https://github.com/achirkin) - [REVIEW] Adjust UCX dependencies ([#2304](https://github.com/rapidsai/raft/pull/2304)) [@pentschev](https://github.com/pentschev) - Convert device_memory_resource* to device_async_resource_ref ([#2269](https://github.com/rapidsai/raft/pull/2269)) [@harrism](https://github.com/harrism) ## 🐛 Bug Fixes -- Fix import of VERSION file in raft-ann-bench ([#2338](https://github.com/rapidsai/raft/pull/2338)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) -- Rename raft-ann-bench module to raft_ann_bench ([#2333](https://github.com/rapidsai/raft/pull/2333)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Fix import of VERSION file in raft_ann_bench ([#2338](https://github.com/rapidsai/raft/pull/2338)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Rename raft_ann_bench module to raft_ann_bench ([#2333](https://github.com/rapidsai/raft/pull/2333)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) - Support building faiss main statically ([#2323](https://github.com/rapidsai/raft/pull/2323)) [@robertmaynard](https://github.com/robertmaynard) - Refactor spectral scale_obs to use existing normalization function ([#2319](https://github.com/rapidsai/raft/pull/2319)) [@ChuckHastings](https://github.com/ChuckHastings) - Correct initializer list order found by cuvs ([#2317](https://github.com/rapidsai/raft/pull/2317)) [@robertmaynard](https://github.com/robertmaynard) - ANN_BENCH: enable move semantics for configured_raft_resources ([#2311](https://github.com/rapidsai/raft/pull/2311)) [@achirkin](https://github.com/achirkin) - Revert "Build C++ wheel ([#2264)" (#2305](https://github.com/rapidsai/raft/pull/2264)" (#2305)) [@vyasr](https://github.com/vyasr) - Revert "Add `compile-library` by default on pylibraft build" ([#2300](https://github.com/rapidsai/raft/pull/2300)) [@vyasr](https://github.com/vyasr) -- Add VERSION to raft-ann-bench package ([#2299](https://github.com/rapidsai/raft/pull/2299)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Add VERSION to raft_ann_bench package ([#2299](https://github.com/rapidsai/raft/pull/2299)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) - Remove nonexistent job from workflow ([#2298](https://github.com/rapidsai/raft/pull/2298)) [@vyasr](https://github.com/vyasr) - `libucx` should be run dependency of `raft-dask` ([#2296](https://github.com/rapidsai/raft/pull/2296)) [@divyegala](https://github.com/divyegala) - Fix clang intrinsic warning ([#2292](https://github.com/rapidsai/raft/pull/2292)) [@aaronmondal](https://github.com/aaronmondal) @@ -56,7 +56,7 @@ - InnerProduct testing for CAGRA+HNSW ([#2297](https://github.com/rapidsai/raft/pull/2297)) [@divyegala](https://github.com/divyegala) - Enable warnings as errors for Python tests ([#2288](https://github.com/rapidsai/raft/pull/2288)) [@mroeschke](https://github.com/mroeschke) - Normalize dataset vectors in the CAGRA InnerProduct tests ([#2287](https://github.com/rapidsai/raft/pull/2287)) [@enp1s0](https://github.com/enp1s0) -- Use dynamic version for raft-ann-bench ([#2285](https://github.com/rapidsai/raft/pull/2285)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Use dynamic version for raft_ann_bench ([#2285](https://github.com/rapidsai/raft/pull/2285)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) - Make 'librmm' a 'host' dependency for conda packages ([#2284](https://github.com/rapidsai/raft/pull/2284)) [@jameslamb](https://github.com/jameslamb) - Fix comments in cpp/include/raft/neighbors/cagra_serialize.cuh ([#2283](https://github.com/rapidsai/raft/pull/2283)) [@jiangyinzuo](https://github.com/jiangyinzuo) - Only use functions in the limited API ([#2282](https://github.com/rapidsai/raft/pull/2282)) [@vyasr](https://github.com/vyasr) @@ -145,7 +145,7 @@ - Switch to scikit-build-core ([#2051](https://github.com/rapidsai/raft/pull/2051)) [@vyasr](https://github.com/vyasr) - Update to CCCL 2.2.0. ([#2049](https://github.com/rapidsai/raft/pull/2049)) [@bdice](https://github.com/bdice) -- Update `raft-ann-bench` output filenames and add features to plotting ([#2043](https://github.com/rapidsai/raft/pull/2043)) [@divyegala](https://github.com/divyegala) +- Update `raft_ann_bench` output filenames and add features to plotting ([#2043](https://github.com/rapidsai/raft/pull/2043)) [@divyegala](https://github.com/divyegala) - Remove selection_faiss ([#2027](https://github.com/rapidsai/raft/pull/2027)) [@benfred](https://github.com/benfred) ## 🐛 Bug Fixes @@ -166,7 +166,7 @@ - Fix compile failure on RTX 4090 ([#2076](https://github.com/rapidsai/raft/pull/2076)) [@JieFengWang](https://github.com/JieFengWang) - Fix a crash in FAISS benchmark wrapper introduced in #2021 ([#2062](https://github.com/rapidsai/raft/pull/2062)) [@achirkin](https://github.com/achirkin) - Correct function that wasn't returning a value ([#2045](https://github.com/rapidsai/raft/pull/2045)) [@robertmaynard](https://github.com/robertmaynard) -- Fixing small bug in raft-ann-bench ([#2041](https://github.com/rapidsai/raft/pull/2041)) [@cjnolet](https://github.com/cjnolet) +- Fixing small bug in raft_ann_bench ([#2041](https://github.com/rapidsai/raft/pull/2041)) [@cjnolet](https://github.com/cjnolet) - Make device_resources accessed from device_resources_manager thread-safe ([#2030](https://github.com/rapidsai/raft/pull/2030)) [@wphicks](https://github.com/wphicks) - Fix ann-bench multithreading ([#2021](https://github.com/rapidsai/raft/pull/2021)) [@achirkin](https://github.com/achirkin) - Fix `ci/checks/copyright.py` to mirror RAPIDS reference ([#2008](https://github.com/rapidsai/raft/pull/2008)) [@divyegala](https://github.com/divyegala) @@ -187,11 +187,11 @@ - Add IVF-PQ example into the template project ([#2091](https://github.com/rapidsai/raft/pull/2091)) [@achirkin](https://github.com/achirkin) - Support for fp16 in CAGRA and IVF-PQ ([#2085](https://github.com/rapidsai/raft/pull/2085)) [@achirkin](https://github.com/achirkin) - Add random subsampling for IVF methods ([#2077](https://github.com/rapidsai/raft/pull/2077)) [@tfeher](https://github.com/tfeher) -- Update `raft-ann-bench` output filenames and add features to plotting ([#2043](https://github.com/rapidsai/raft/pull/2043)) [@divyegala](https://github.com/divyegala) +- Update `raft_ann_bench` output filenames and add features to plotting ([#2043](https://github.com/rapidsai/raft/pull/2043)) [@divyegala](https://github.com/divyegala) - Add brute_force index serialization ([#2036](https://github.com/rapidsai/raft/pull/2036)) [@wphicks](https://github.com/wphicks) - Add eps-neighbor search via RBC ([#2028](https://github.com/rapidsai/raft/pull/2028)) [@mfoerste4](https://github.com/mfoerste4) - `libraft` and `pylibraft` API for CAGRA build and HNSW search ([#2022](https://github.com/rapidsai/raft/pull/2022)) [@divyegala](https://github.com/divyegala) -- Export Pareto frontier in `raft-ann-bench.data_export` ([#2009](https://github.com/rapidsai/raft/pull/2009)) [@divyegala](https://github.com/divyegala) +- Export Pareto frontier in `raft_ann_bench.data_export` ([#2009](https://github.com/rapidsai/raft/pull/2009)) [@divyegala](https://github.com/divyegala) - Implement maybe-owning multi-dimensional container (mdbuffer) ([#1999](https://github.com/rapidsai/raft/pull/1999)) [@wphicks](https://github.com/wphicks) - Add support for 1024+ dim vectors in CAGRA search ([#1994](https://github.com/rapidsai/raft/pull/1994)) [@enp1s0](https://github.com/enp1s0) - Replace GEMM backend: cublas.gemm -> cublaslt.matmul ([#1736](https://github.com/rapidsai/raft/pull/1736)) [@achirkin](https://github.com/achirkin) @@ -222,7 +222,7 @@ - [REVIEW] Fix typos in parameter tuning guide ([#2034](https://github.com/rapidsai/raft/pull/2034)) [@abc99lr](https://github.com/abc99lr) - Add AIR-Top-k reference ([#2031](https://github.com/rapidsai/raft/pull/2031)) [@tfeher](https://github.com/tfeher) - Remove selection_faiss ([#2027](https://github.com/rapidsai/raft/pull/2027)) [@benfred](https://github.com/benfred) -- Fixing json parse error in `raft-ann-bench.data_export` ([#2025](https://github.com/rapidsai/raft/pull/2025)) [@cjnolet](https://github.com/cjnolet) +- Fixing json parse error in `raft_ann_bench.data_export` ([#2025](https://github.com/rapidsai/raft/pull/2025)) [@cjnolet](https://github.com/cjnolet) - Updating cagra build constraint ([#2016](https://github.com/rapidsai/raft/pull/2016)) [@cjnolet](https://github.com/cjnolet) - Update to fmt 10.1.1 and spdlog 1.12.0. ([#1957](https://github.com/rapidsai/raft/pull/1957)) [@bdice](https://github.com/bdice) - Enable host dataset for IVF-Flat ([#1635](https://github.com/rapidsai/raft/pull/1635)) [@tfeher](https://github.com/tfeher) @@ -238,16 +238,16 @@ - Adjusting end-to-end start time so it doesn't include stream creation time ([#1989](https://github.com/rapidsai/raft/pull/1989)) [@cjnolet](https://github.com/cjnolet) - CAGRA graph optimizer: clamp rev_graph_count ([#1987](https://github.com/rapidsai/raft/pull/1987)) [@tfeher](https://github.com/tfeher) - Catching conversion errors in data_export instead of fully failing ([#1979](https://github.com/rapidsai/raft/pull/1979)) [@cjnolet](https://github.com/cjnolet) -- Fix syncing mechanism in `raft-ann-bench` C++ search ([#1961](https://github.com/rapidsai/raft/pull/1961)) [@divyegala](https://github.com/divyegala) +- Fix syncing mechanism in `raft_ann_bench` C++ search ([#1961](https://github.com/rapidsai/raft/pull/1961)) [@divyegala](https://github.com/divyegala) - Fixing hnswlib in latency mode ([#1959](https://github.com/rapidsai/raft/pull/1959)) [@cjnolet](https://github.com/cjnolet) - Fix `ucx-py` alpha version update for `raft-dask` ([#1953](https://github.com/rapidsai/raft/pull/1953)) [@divyegala](https://github.com/divyegala) - Reduce NN Descent test threshold ([#1946](https://github.com/rapidsai/raft/pull/1946)) [@divyegala](https://github.com/divyegala) - Fixes to new YAML config `raft-bench-ann` ([#1945](https://github.com/rapidsai/raft/pull/1945)) [@divyegala](https://github.com/divyegala) - Set RNG seeds in NN Descent to diagnose flaky tests ([#1931](https://github.com/rapidsai/raft/pull/1931)) [@divyegala](https://github.com/divyegala) -- Fix FAISS CPU algorithm names in `raft-ann-bench` ([#1916](https://github.com/rapidsai/raft/pull/1916)) [@divyegala](https://github.com/divyegala) +- Fix FAISS CPU algorithm names in `raft_ann_bench` ([#1916](https://github.com/rapidsai/raft/pull/1916)) [@divyegala](https://github.com/divyegala) - Increase iterations in NN Descent tests to avoid flakiness ([#1915](https://github.com/rapidsai/raft/pull/1915)) [@divyegala](https://github.com/divyegala) -- Fix filepath in `raft-ann-bench/split_groundtruth` module ([#1911](https://github.com/rapidsai/raft/pull/1911)) [@divyegala](https://github.com/divyegala) -- Remove dynamic entry-points from raft-ann-bench ([#1910](https://github.com/rapidsai/raft/pull/1910)) [@benfred](https://github.com/benfred) +- Fix filepath in `raft_ann_bench/split_groundtruth` module ([#1911](https://github.com/rapidsai/raft/pull/1911)) [@divyegala](https://github.com/divyegala) +- Remove dynamic entry-points from raft_ann_bench ([#1910](https://github.com/rapidsai/raft/pull/1910)) [@benfred](https://github.com/benfred) - Remove unnecessary dataset path check in ANN bench ([#1908](https://github.com/rapidsai/raft/pull/1908)) [@tfeher](https://github.com/tfeher) - Fixing Googletests and re-enabling in CI ([#1904](https://github.com/rapidsai/raft/pull/1904)) [@cjnolet](https://github.com/cjnolet) - Fix NN Descent overflows ([#1875](https://github.com/rapidsai/raft/pull/1875)) [@divyegala](https://github.com/divyegala) @@ -258,12 +258,12 @@ - Brute Force Index documentation fix ([#1944](https://github.com/rapidsai/raft/pull/1944)) [@lowener](https://github.com/lowener) - Add `wiki_all` dataset config and documentation. ([#1918](https://github.com/rapidsai/raft/pull/1918)) [@cjnolet](https://github.com/cjnolet) -- Updates to raft-ann-bench docs ([#1905](https://github.com/rapidsai/raft/pull/1905)) [@cjnolet](https://github.com/cjnolet) +- Updates to raft_ann_bench docs ([#1905](https://github.com/rapidsai/raft/pull/1905)) [@cjnolet](https://github.com/cjnolet) - End-to-end vector search tutorial in docs ([#1776](https://github.com/rapidsai/raft/pull/1776)) [@cjnolet](https://github.com/cjnolet) ## 🚀 New Features -- Adding `dry-run` option to `raft-ann-bench` ([#1970](https://github.com/rapidsai/raft/pull/1970)) [@cjnolet](https://github.com/cjnolet) +- Adding `dry-run` option to `raft_ann_bench` ([#1970](https://github.com/rapidsai/raft/pull/1970)) [@cjnolet](https://github.com/cjnolet) - Add ANN bench scripts to generate ground truth ([#1967](https://github.com/rapidsai/raft/pull/1967)) [@tfeher](https://github.com/tfeher) - CAGRA build + HNSW search ([#1956](https://github.com/rapidsai/raft/pull/1956)) [@divyegala](https://github.com/divyegala) - Verify conda-cpp-post-build-checks ([#1935](https://github.com/rapidsai/raft/pull/1935)) [@robertmaynard](https://github.com/robertmaynard) @@ -275,15 +275,15 @@ ## 🛠️ Improvements -- Pinning fmt and spdlog for raft-ann-bench-cpu ([#2018](https://github.com/rapidsai/raft/pull/2018)) [@cjnolet](https://github.com/cjnolet) +- Pinning fmt and spdlog for raft_ann_bench-cpu ([#2018](https://github.com/rapidsai/raft/pull/2018)) [@cjnolet](https://github.com/cjnolet) - Build concurrency for nightly and merge triggers ([#2011](https://github.com/rapidsai/raft/pull/2011)) [@bdice](https://github.com/bdice) - Using `EXPORT_SET` in `rapids_find_package_root` ([#2006](https://github.com/rapidsai/raft/pull/2006)) [@cjnolet](https://github.com/cjnolet) - Remove static checks for serialization size ([#1997](https://github.com/rapidsai/raft/pull/1997)) [@cjnolet](https://github.com/cjnolet) - Skipping bad json parse ([#1990](https://github.com/rapidsai/raft/pull/1990)) [@cjnolet](https://github.com/cjnolet) - Update select-k heuristic ([#1985](https://github.com/rapidsai/raft/pull/1985)) [@benfred](https://github.com/benfred) - ANN bench: use different offset for each thread ([#1981](https://github.com/rapidsai/raft/pull/1981)) [@tfeher](https://github.com/tfeher) -- Allow `raft-ann-bench/run` to continue after encountering bad YAML configs ([#1980](https://github.com/rapidsai/raft/pull/1980)) [@divyegala](https://github.com/divyegala) -- Add build and search params to `raft-ann-bench.data_export` CSVs ([#1971](https://github.com/rapidsai/raft/pull/1971)) [@divyegala](https://github.com/divyegala) +- Allow `raft_ann_bench/run` to continue after encountering bad YAML configs ([#1980](https://github.com/rapidsai/raft/pull/1980)) [@divyegala](https://github.com/divyegala) +- Add build and search params to `raft_ann_bench.data_export` CSVs ([#1971](https://github.com/rapidsai/raft/pull/1971)) [@divyegala](https://github.com/divyegala) - Use new `rapids-dask-dependency` metapackage for managing dask versions ([#1968](https://github.com/rapidsai/raft/pull/1968)) [@galipremsagar](https://github.com/galipremsagar) - Remove unused header ([#1960](https://github.com/rapidsai/raft/pull/1960)) [@wphicks](https://github.com/wphicks) - Adding pool back in and fixing cagra benchmark params ([#1951](https://github.com/rapidsai/raft/pull/1951)) [@cjnolet](https://github.com/cjnolet) @@ -294,12 +294,12 @@ - Relax ucx pinning ([#1927](https://github.com/rapidsai/raft/pull/1927)) [@vyasr](https://github.com/vyasr) - Try using contiguous rank to fix cuda_visible_devices ([#1926](https://github.com/rapidsai/raft/pull/1926)) [@VibhuJawa](https://github.com/VibhuJawa) - Unpin `dask` and `distributed` for `23.12` development ([#1925](https://github.com/rapidsai/raft/pull/1925)) [@galipremsagar](https://github.com/galipremsagar) -- Adding `throughput` and `latency` modes to `raft-ann-bench` ([#1920](https://github.com/rapidsai/raft/pull/1920)) [@cjnolet](https://github.com/cjnolet) +- Adding `throughput` and `latency` modes to `raft_ann_bench` ([#1920](https://github.com/rapidsai/raft/pull/1920)) [@cjnolet](https://github.com/cjnolet) - Providing `aarch64` yaml environment files ([#1914](https://github.com/rapidsai/raft/pull/1914)) [@cjnolet](https://github.com/cjnolet) - CAGRA ANN bench: parse build options for IVF-PQ build algo ([#1912](https://github.com/rapidsai/raft/pull/1912)) [@tfeher](https://github.com/tfeher) - Fix python script location in ANN bench description ([#1906](https://github.com/rapidsai/raft/pull/1906)) [@tfeher](https://github.com/tfeher) - Refactor install/build guide. ([#1899](https://github.com/rapidsai/raft/pull/1899)) [@cjnolet](https://github.com/cjnolet) -- Check return values of raft-ann-bench subprocess calls ([#1897](https://github.com/rapidsai/raft/pull/1897)) [@benfred](https://github.com/benfred) +- Check return values of raft_ann_bench subprocess calls ([#1897](https://github.com/rapidsai/raft/pull/1897)) [@benfred](https://github.com/benfred) - ANN bench options to specify CAGRA graph and dataset locations ([#1896](https://github.com/rapidsai/raft/pull/1896)) [@cjnolet](https://github.com/cjnolet) - Add check-json to pre-commit linters, and fix invalid ann-bench JSON config ([#1894](https://github.com/rapidsai/raft/pull/1894)) [@benfred](https://github.com/benfred) - Use branch-23.12 workflows. ([#1886](https://github.com/rapidsai/raft/pull/1886)) [@bdice](https://github.com/bdice) @@ -313,7 +313,7 @@ - Documentation for raft ANN benchmark containers. ([#1833](https://github.com/rapidsai/raft/pull/1833)) [@dantegd](https://github.com/dantegd) - [FEA] Support vector deletion in ANN IVF ([#1831](https://github.com/rapidsai/raft/pull/1831)) [@lowener](https://github.com/lowener) - Provide a raft::copy overload for mdspan-to-mdspan copies ([#1818](https://github.com/rapidsai/raft/pull/1818)) [@wphicks](https://github.com/wphicks) -- Adding FAISS cpu to `raft-ann-bench` ([#1814](https://github.com/rapidsai/raft/pull/1814)) [@cjnolet](https://github.com/cjnolet) +- Adding FAISS cpu to `raft_ann_bench` ([#1814](https://github.com/rapidsai/raft/pull/1814)) [@cjnolet](https://github.com/cjnolet) # raft 23.10.00 (11 Oct 2023) @@ -329,11 +329,11 @@ - [BUG] Fix a bug in the filtering operation in CAGRA multi-kernel ([#1862](https://github.com/rapidsai/raft/pull/1862)) [@enp1s0](https://github.com/enp1s0) - Fix conf file for benchmarking glove datasets ([#1846](https://github.com/rapidsai/raft/pull/1846)) [@dantegd](https://github.com/dantegd) -- raft-ann-bench package fixes for plotting and conf files ([#1844](https://github.com/rapidsai/raft/pull/1844)) [@dantegd](https://github.com/dantegd) +- raft_ann_bench package fixes for plotting and conf files ([#1844](https://github.com/rapidsai/raft/pull/1844)) [@dantegd](https://github.com/dantegd) - Fix update-version.sh for all pyproject.toml files ([#1839](https://github.com/rapidsai/raft/pull/1839)) [@raydouglass](https://github.com/raydouglass) -- Make RMM a run dependency of the raft-ann-bench conda package ([#1838](https://github.com/rapidsai/raft/pull/1838)) [@dantegd](https://github.com/dantegd) +- Make RMM a run dependency of the raft_ann_bench conda package ([#1838](https://github.com/rapidsai/raft/pull/1838)) [@dantegd](https://github.com/dantegd) - Printing actual exception in `require base set` ([#1816](https://github.com/rapidsai/raft/pull/1816)) [@cjnolet](https://github.com/cjnolet) -- Adding rmm to `raft-ann-bench` dependencies ([#1815](https://github.com/rapidsai/raft/pull/1815)) [@cjnolet](https://github.com/cjnolet) +- Adding rmm to `raft_ann_bench` dependencies ([#1815](https://github.com/rapidsai/raft/pull/1815)) [@cjnolet](https://github.com/cjnolet) - Use `conda mambabuild` not `mamba mambabuild` ([#1812](https://github.com/rapidsai/raft/pull/1812)) [@bdice](https://github.com/bdice) - Fix `raft-dask` naming in wheel builds ([#1805](https://github.com/rapidsai/raft/pull/1805)) [@divyegala](https://github.com/divyegala) - neighbors::refine_host: check the dataset bounds ([#1793](https://github.com/rapidsai/raft/pull/1793)) [@achirkin](https://github.com/achirkin) @@ -378,7 +378,7 @@ - [FEA] Add pre-filtering to CAGRA ([#1811](https://github.com/rapidsai/raft/pull/1811)) [@enp1s0](https://github.com/enp1s0) - More updates to ann-bench docs ([#1810](https://github.com/rapidsai/raft/pull/1810)) [@cjnolet](https://github.com/cjnolet) - Add best deep-100M configs for IVF-PQ to ANN benchmarks ([#1807](https://github.com/rapidsai/raft/pull/1807)) [@tfeher](https://github.com/tfeher) -- A few fixes to `raft-ann-bench` recipe and docs ([#1806](https://github.com/rapidsai/raft/pull/1806)) [@cjnolet](https://github.com/cjnolet) +- A few fixes to `raft_ann_bench` recipe and docs ([#1806](https://github.com/rapidsai/raft/pull/1806)) [@cjnolet](https://github.com/cjnolet) - Simplify wheel build scripts and allow alphas of RAPIDS dependencies ([#1804](https://github.com/rapidsai/raft/pull/1804)) [@divyegala](https://github.com/divyegala) - Various fixes to reproducible benchmarks ([#1800](https://github.com/rapidsai/raft/pull/1800)) [@cjnolet](https://github.com/cjnolet) - ANN-bench: more flexible cuda_stub.hpp ([#1792](https://github.com/rapidsai/raft/pull/1792)) [@achirkin](https://github.com/achirkin) @@ -388,7 +388,7 @@ - Don't serialize dataset with CAGRA bench ([#1781](https://github.com/rapidsai/raft/pull/1781)) [@benfred](https://github.com/benfred) - Use `copy-pr-bot` ([#1774](https://github.com/rapidsai/raft/pull/1774)) [@ajschmidt8](https://github.com/ajschmidt8) - Add GPU and CPU packages for ANN benchmarks ([#1773](https://github.com/rapidsai/raft/pull/1773)) [@dantegd](https://github.com/dantegd) -- Improvements to raft-ann-bench scripts, docs, and benchmarking implementations. ([#1769](https://github.com/rapidsai/raft/pull/1769)) [@cjnolet](https://github.com/cjnolet) +- Improvements to raft_ann_bench scripts, docs, and benchmarking implementations. ([#1769](https://github.com/rapidsai/raft/pull/1769)) [@cjnolet](https://github.com/cjnolet) - [REVIEW] Introducing host API for PCG ([#1767](https://github.com/rapidsai/raft/pull/1767)) [@vinaydes](https://github.com/vinaydes) - Unpin `dask` and `distributed` for `23.10` development ([#1760](https://github.com/rapidsai/raft/pull/1760)) [@galipremsagar](https://github.com/galipremsagar) - Add ivf-flat notebook ([#1758](https://github.com/rapidsai/raft/pull/1758)) [@tfeher](https://github.com/tfeher) diff --git a/README.md b/README.md index f25ad89b0b..516b0e8e45 100755 --- a/README.md +++ b/README.md @@ -271,8 +271,8 @@ The easiest way to install RAFT is through conda and several packages are provid - `libraft` (optional) C++ shared library containing pre-compiled template instantiations and runtime API. - `pylibraft` (optional) Python library - `raft-dask` (optional) Python library for deployment of multi-node multi-GPU algorithms that use the RAFT `raft::comms` abstraction layer in Dask clusters. -- `raft-ann-bench` (optional) Benchmarking tool for easily producing benchmarks that compare RAFT's vector search algorithms against other state-of-the-art implementations. -- `raft-ann-bench-cpu` (optional) Reproducible benchmarking tool similar to above, but doesn't require CUDA to be installed on the machine. Can be used to test in environments with competitive CPUs. +- `raft_ann_bench` (optional) Benchmarking tool for easily producing benchmarks that compare RAFT's vector search algorithms against other state-of-the-art implementations. +- `raft_ann_bench-cpu` (optional) Reproducible benchmarking tool similar to above, but doesn't require CUDA to be installed on the machine. Can be used to test in environments with competitive CPUs. Use the following command, depending on your CUDA version, to install all of the RAFT packages with conda (replace `rapidsai` with `rapidsai-nightly` to install more up-to-date but less stable nightly packages). `mamba` is preferred over the `conda` command. ```bash diff --git a/build.sh b/build.sh index a77dd188f4..f303b6c034 100755 --- a/build.sh +++ b/build.sh @@ -505,9 +505,9 @@ if (( ${NUMARGS} == 0 )) || hasArg raft-dask; then python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true ${REPODIR}/python/raft-dask fi -# Build and (optionally) install the raft-ann-bench Python package +# Build and (optionally) install the raft_ann_bench Python package if (( ${NUMARGS} == 0 )) || hasArg bench-ann; then - python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true ${REPODIR}/python/raft-ann-bench -vvv + python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true ${REPODIR}/python/raft_ann_bench -vvv fi if hasArg docs; then diff --git a/ci/build_python.sh b/ci/build_python.sh index 80d37b5ae3..62248fe143 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -40,7 +40,7 @@ rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ - conda/recipes/raft-ann-bench + conda/recipes/raft_ann_bench # Build ann-bench-cpu only in CUDA 11 jobs since it only depends on python # version @@ -50,7 +50,7 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ - conda/recipes/raft-ann-bench-cpu + conda/recipes/raft_ann_bench-cpu fi rapids-upload-conda-to-s3 python diff --git a/conda/recipes/raft-ann-bench-cpu/meta.yaml b/conda/recipes/raft-ann-bench-cpu/meta.yaml index 94f7102726..eed528a979 100644 --- a/conda/recipes/raft-ann-bench-cpu/meta.yaml +++ b/conda/recipes/raft-ann-bench-cpu/meta.yaml @@ -9,7 +9,7 @@ {% set date_string = environ['RAPIDS_DATE_STRING'] %} package: - name: raft-ann-bench-cpu + name: raft_ann_bench-cpu version: {{ version }} script: build.sh diff --git a/conda/recipes/raft-ann-bench/meta.yaml b/conda/recipes/raft-ann-bench/meta.yaml index d6aeb5f860..9ef920e563 100644 --- a/conda/recipes/raft-ann-bench/meta.yaml +++ b/conda/recipes/raft-ann-bench/meta.yaml @@ -10,7 +10,7 @@ {% set date_string = environ['RAPIDS_DATE_STRING'] %} package: - name: raft-ann-bench + name: raft_ann_bench version: {{ version }} script: build.sh diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index 5ba1426c3c..d1a21941f4 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -129,6 +129,7 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) { max_points_ = nrow; std::cout << "num_threads" << this->diskann_index_write_params_->num_threads << std::endl; + this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), this->dim_, max_points_, @@ -149,9 +150,9 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) std::optional> intermediate_graph( raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_)); - std::vector knn_graph(nrow * cagra_graph_degree_); - auto knn_graph_view = - raft::make_host_matrix_view(knn_graph.data(), nrow, cagra_graph_degree_); + std::vector> knn_graph(nrow, std::vector(cagra_graph_degree_)); + auto knn_graph_view = raft::make_host_matrix_view( + knn_graph[0].data(), nrow, cagra_graph_degree_); auto dataset_view = raft::make_host_matrix_view( dataset, static_cast(nrow), (int64_t)this->dim_); raft::resources res; diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index dba3070d4f..03e72a8f22 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,7 +1,25 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..2b97c06 100644 +index 3d3d2b8..1f6ca4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt +@@ -145,7 +145,7 @@ if (MSVC) + "${DISKANN_MKL_LIB_PATH}/mkl_intel_thread.lib") + else() + # expected path for manual intel mkl installs +- set(POSSIBLE_OMP_PATHS "/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin/libiomp5.so;/usr/lib/x86_64-linux-gnu/libiomp5.so;/opt/intel/lib/intel64_lin/libiomp5.so") ++ set(POSSIBLE_OMP_PATHS "/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin/libiomp5.so;/usr/lib/x86_64-linux-gnu/libiomp5.so;/opt/intel/lib/intel64_lin/libiomp5.so;/raid/tarangj/miniconda3/envs/all_cuda-122_arch-x86_64/lib/libiomp5.so") + foreach(POSSIBLE_OMP_PATH ${POSSIBLE_OMP_PATHS}) + if (EXISTS ${POSSIBLE_OMP_PATH}) + get_filename_component(OMP_PATH ${POSSIBLE_OMP_PATH} DIRECTORY) +@@ -157,7 +157,7 @@ else() + endif() + link_directories(${OMP_PATH}) + +- set(POSSIBLE_MKL_LIB_PATHS "/opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/opt/intel/mkl/lib/intel64/libmkl_core.so") ++ set(POSSIBLE_MKL_LIB_PATHS "/opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/opt/intel/mkl/lib/intel64/libmkl_core.so;/raid/tarangj/miniconda3/envs/all_cuda-122_arch-x86_64/lib/libmkl_core.so") + foreach(POSSIBLE_MKL_LIB_PATH ${POSSIBLE_MKL_LIB_PATHS}) + if (EXISTS ${POSSIBLE_MKL_LIB_PATH}) + get_filename_component(MKL_PATH ${POSSIBLE_MKL_LIB_PATH} DIRECTORY) @@ -188,7 +188,7 @@ else() # compile flags and link libraries add_compile_options(-m64 -Wl,--no-as-needed) @@ -35,6 +53,49 @@ index 3d3d2b8..2b97c06 100644 if (UNIT_TEST) enable_testing() +diff --git a/build.sh b/build.sh +new file mode 100755 +index 0000000..a5a12fe +--- /dev/null ++++ b/build.sh +@@ -0,0 +1,36 @@ ++#!/bin/bash ++ ++# NOTE: This file is temporary for the proof-of-concept branch and will be removed before this PR is merged ++ ++BUILD_TYPE=Release ++BUILD_DIR=build/ ++ ++RAFT_REPO_REL="" ++EXTRA_CMAKE_ARGS="" ++set -e ++ ++if [[ ${RAFT_REPO_REL} != "" ]]; then ++ RAFT_REPO_PATH="`readlink -f \"${RAFT_REPO_REL}\"`" ++ EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCPM_raft_SOURCE=${RAFT_REPO_PATH}" ++fi ++ ++if [ "$1" == "clean" ]; then ++ rm -rf build ++ rm -rf .cache ++ exit 0 ++fi ++ ++mkdir -p $BUILD_DIR ++cd $BUILD_DIR ++ ++cmake \ ++ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ ++ -DCMAKE_CUDA_ARCHITECTURES="NATIVE" \ ++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ ++ -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \ ++ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ ++ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ ++ ${EXTRA_CMAKE_ARGS} \ ++ ../ ++ ++make -j30 +\ No newline at end of file diff --git a/include/abstract_graph_store.h b/include/abstract_graph_store.h index 4d6906c..80c8dc4 100644 --- a/include/abstract_graph_store.h @@ -177,7 +238,7 @@ index d0206a7..46cdee4 100644 }; diff --git a/include/index.h b/include/index.h -index b9bf4f3..4890f00 100644 +index b9bf4f3..88939a9 100644 --- a/include/index.h +++ b/include/index.h @@ -66,7 +66,8 @@ template clas @@ -190,26 +251,27 @@ index b9bf4f3..4890f00 100644 DISKANN_DLLEXPORT ~Index(); -@@ -98,7 +99,8 @@ template clas - DISKANN_DLLEXPORT void build(const char *filename, const size_t num_points_to_load, const char *tag_filename); - +@@ -100,6 +101,10 @@ template clas // Batch build from a data array, which must pad vectors to aligned_dim -- DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags); -+ DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags, -+ const std::vector &raft_cagra_graph_vec = std::vector()); + DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags); ++ // Batch build from a data array, which must pad vectors to aligned_dim ++ DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags, ++ std::vector> &raft_cagra_graph_vec); ++ // Based on filter params builds a filtered or unfiltered index DISKANN_DLLEXPORT void build(const std::string &data_file, const size_t num_points_to_load, -@@ -236,6 +238,8 @@ template clas + IndexFilterParams &filter_params); +@@ -236,6 +241,8 @@ template clas Index(const Index &) = delete; Index &operator=(const Index &) = delete; -+ void add_raft_cagra_neighbours(const std::vector& raft_cagra_graph_vec); ++ void add_raft_cagra_neighbours(std::vector>& raft_cagra_graph_vec); + // Use after _data and _nd have been populated // Acquire exclusive _update_lock before calling void build_with_data_populated(const std::vector &tags); -@@ -444,5 +448,8 @@ template clas +@@ -444,5 +451,8 @@ template clas std::vector _locks; static const float INDEX_GROWTH_FACTOR; @@ -333,7 +395,7 @@ index c12b251..ea39001 100644 + } // namespace diskann diff --git a/src/index.cpp b/src/index.cpp -index bf93344..08c275c 100644 +index bf93344..014ed66 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -37,8 +37,10 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -1505,6 +1510,41 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -1505,6 +1510,21 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } +template -+void Index::add_raft_cagra_neighbours(const std::vector &raft_cagra_graph_vec) ++void Index::add_raft_cagra_neighbours(std::vector> &raft_cagra_graph_vec) +{ -+ const uint32_t *raw_ptr = raft_cagra_graph_vec.data(); + std::vector> &graph = _graph_store->graph(); -+#pragma omp parallel for schedule(dynamic, 2048) ++#pragma omp parallel for num_threads(_indexingThreads) + for (int i = 0; i < graph.size(); i++) + { -+ graph[i].resize(_raft_cagra_graph_degree); ++ _graph_store->set_neighbours(i, raft_cagra_graph_vec[i]); ++ assert(_graph_store->get_neighbours((location_t)i).size() <= _indexingRange); ++ raft_cagra_graph_vec[i].clear(); + } -+// for (int64_t node = 0; node < _nd; node++) -+// { -+// std::vector node_nbrs(_raft_cagra_graph_degree); -+// const uint32_t *nbr_start_ptr = raw_ptr + node * _raft_cagra_graph_degree; -+// const uint32_t *nbr_end_ptr = nbr_start_ptr + _raft_cagra_graph_degree; -+// std::copy(nbr_start_ptr, nbr_end_ptr, node_nbrs.data()); -+ -+// assert(node_nbrs.size() > 0); -+ -+// _graph_store->set_neighbours(node, node_nbrs); -+// assert(_graph_store->get_neighbours((location_t)node).size() <= _indexingRange); -+// } -+// } + std::cout << "_indexingThreads" << _indexingThreads << std::endl; -+#pragma omp parallel for num_threads(_indexingThreads) collapse(2) -+ for (int i = 0; i < graph.size(); i++) -+ { -+ for (int j = 0; j < _raft_cagra_graph_degree; j++) -+ { -+ graph[i][j] = raft_cagra_graph_vec[i * _raft_cagra_graph_degree + j]; -+ } -+ } + _has_built = true; +} + template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1576,7 +1616,8 @@ void Index::_build(const DataType &data, const size_t num_point +@@ -1575,6 +1595,7 @@ void Index::_build(const DataType &data, const size_t num_point + throw ANNException("Error" + std::string(e.what()), -1); } } ++ template --void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags) -+void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, -+ const std::vector &raft_cagra_graph_vec) + void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags) { - if (num_points_to_load == 0) - { -@@ -1593,11 +1634,18 @@ void Index::build(const T *data, const size_t num_points_to_loa +@@ -1593,13 +1614,44 @@ void Index::build(const T *data, const size_t num_points_to_loa { std::unique_lock tl(_tag_lock); _nd = num_points_to_load; @@ -428,7 +468,30 @@ index bf93344..08c275c 100644 _data_store->populate_data(data, (location_t)num_points_to_load); } - -- build_with_data_populated(tags); + build_with_data_populated(tags); + } + ++template ++void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, ++ std::vector> &raft_cagra_graph_vec) ++{ ++ if (num_points_to_load == 0) ++ { ++ throw ANNException("Do not call build with 0 points", -1, __FUNCSIG__, __FILE__, __LINE__); ++ } ++ if (_pq_dist) ++ { ++ throw ANNException("ERROR: DO not use this build interface with PQ distance", -1, __FUNCSIG__, __FILE__, ++ __LINE__); ++ } ++ ++ std::unique_lock ul(_update_lock); ++ ++ { ++ std::unique_lock tl(_tag_lock); ++ _nd = num_points_to_load; ++ _data_store->populate_data(data, (location_t)num_points_to_load); ++ } + if (!_raft_cagra_graph) + build_with_data_populated(tags); + else @@ -439,6 +502,8 @@ index bf93344..08c275c 100644 + _start = calculate_entry_point(); + add_raft_cagra_neighbours(raft_cagra_graph_vec); + } - } - ++} ++ template + void Index::build(const char *filename, const size_t num_points_to_load, const std::vector &tags) + { diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index b19fcabe2d..40313e4b36 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -36,6 +36,8 @@ function(find_and_configure_diskann) "UNIT_TEST OFF" "RESTAPI OFF" "PORTABLE OFF" + "-DOMP_PATH /raid/tarangj/miniconda3/envs/all_cuda-122_arch-x86_64/lib/libiomp5.so" + "-DMKL_PATH /raid/tarangj/miniconda3/envs/all_cuda-122_arch-x86_64/lib" ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") diff --git a/dependencies.yaml b/dependencies.yaml index 3d5de9bdc2..f096d42905 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -128,14 +128,14 @@ files: - test_python_common py_build_raft_ann_bench: output: pyproject - pyproject_dir: python/raft-ann-bench + pyproject_dir: python/raft_ann_bench extras: table: build-system includes: - build_wheels py_run_raft_ann_bench: output: pyproject - pyproject_dir: python/raft-ann-bench + pyproject_dir: python/raft_ann_bench extras: table: project includes: diff --git a/docs/source/ann_benchmarks_low_level.md b/docs/source/ann_benchmarks_low_level.md index 7ba13dec8d..4b7f5e385f 100644 --- a/docs/source/ann_benchmarks_low_level.md +++ b/docs/source/ann_benchmarks_low_level.md @@ -7,7 +7,7 @@ git clone https://github.com/rapidsai/raft.git cd raft # (1) prepare a dataset -export PYTHONPATH=python/raft-ann-bench/src:$PYTHONPATH +export PYTHONPATH=python/raft_ann_bench/src:$PYTHONPATH python -m raft_ann_bench.get_dataset --dataset glove-100-angular --normalize # option --normalize is used here to normalize vectors so cosine distance is converted @@ -18,7 +18,7 @@ $CONDA_PREFIX/bin/ann/RAFT_IVF_FLAT_ANN_BENCH \ --data_prefix=datasets \ --build \ --benchmark_filter="raft_ivf_flat\..*" \ - python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-inner.json + python/raft_ann_bench/src/raft_ann_bench/run/conf/glove-100-inner.json # (3) search $CONDA_PREFIX/bin/ann/RAFT_IVF_FLAT_ANN_BENCH\ @@ -29,7 +29,7 @@ $CONDA_PREFIX/bin/ann/RAFT_IVF_FLAT_ANN_BENCH\ --benchmark_counters_tabular \ --search \ --benchmark_filter="raft_ivf_flat\..*" \ - python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-inner.json + python/raft_ann_bench/src/raft_ann_bench/run/conf/glove-100-inner.json # optional step: plot QPS-Recall figure using data in ivf_flat_search.csv with your favorite tool @@ -43,12 +43,12 @@ A dataset usually has 4 binary files containing database vectors, query vectors, The file suffixes `.fbin`, `.f16bin`, `.ibin`, `.u8bin`, and `.i8bin` denote that the data type of vectors stored in the file are `float32`, `float16`(a.k.a `half`), `int`, `uint8`, and `int8`, respectively. These binary files are little-endian and the format is: the first 8 bytes are `num_vectors` (`uint32_t`) and `num_dimensions` (`uint32_t`), and the following `num_vectors * num_dimensions * sizeof(type)` bytes are vectors stored in row-major order. -Some implementation can take `float16` database and query vectors as inputs and will have better performance. Use `python/raft-ann-bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py` to transform dataset from `float32` to `float16` type. +Some implementation can take `float16` database and query vectors as inputs and will have better performance. Use `python/raft_ann_bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py` to transform dataset from `float32` to `float16` type. Commonly used datasets can be downloaded from two websites: 1. Million-scale datasets can be found at the [Data sets](https://github.com/erikbern/ann-benchmarks#data-sets) section of [`ann-benchmarks`](https://github.com/erikbern/ann-benchmarks). - However, these datasets are in HDF5 format. Use `python/raft-ann-bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py/hdf5_to_fbin.py` to transform the format. A few Python packages are required to run it: + However, these datasets are in HDF5 format. Use `python/raft_ann_bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py/hdf5_to_fbin.py` to transform the format. A few Python packages are required to run it: ```bash pip3 install numpy h5py ``` @@ -68,7 +68,7 @@ Commonly used datasets can be downloaded from two websites: 2. Billion-scale datasets can be found at [`big-ann-benchmarks`](http://big-ann-benchmarks.com). The ground truth file contains both neighbors and distances, thus should be split. A script is provided for this: ```bash - $ python/raft-ann-bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl + $ python/raft_ann_bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl usage: split_groundtruth.pl input output_prefix ``` Take Deep-1B dataset as an example: @@ -78,7 +78,7 @@ Commonly used datasets can be downloaded from two websites: mkdir -p data/deep-1B && cd data/deep-1B # download manually "Ground Truth" file of "Yandex DEEP" # suppose the file name is deep_new_groundtruth.public.10K.bin - /path/to/raft/python/raft-ann-bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl deep_new_groundtruth.public.10K.bin groundtruth + /path/to/raft/python/raft_ann_bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl deep_new_groundtruth.public.10K.bin groundtruth # two files 'groundtruth.neighbors.ibin' and 'groundtruth.distances.fbin' should be produced popd ``` diff --git a/docs/source/build.md b/docs/source/build.md index 357d460669..6d5d6fd4eb 100644 --- a/docs/source/build.md +++ b/docs/source/build.md @@ -34,8 +34,8 @@ The easiest way to install RAFT is through conda and several packages are provid - `libraft` (optional) C++ shared library containing pre-compiled template instantiations and runtime API. - `pylibraft` (optional) Python library - `raft-dask` (optional) Python library for deployment of multi-node multi-GPU algorithms that use the RAFT `raft::comms` abstraction layer in Dask clusters. -- `raft-ann-bench` (optional) Benchmarking tool for easily producing benchmarks that compare RAFT's vector search algorithms against other state-of-the-art implementations. -- `raft-ann-bench-cpu` (optional) Reproducible benchmarking tool similar to above, but doesn't require CUDA to be installed on the machine. Can be used to test in environments with competitive CPUs. +- `raft_ann_bench` (optional) Benchmarking tool for easily producing benchmarks that compare RAFT's vector search algorithms against other state-of-the-art implementations. +- `raft_ann_bench-cpu` (optional) Reproducible benchmarking tool similar to above, but doesn't require CUDA to be installed on the machine. Can be used to test in environments with competitive CPUs. Use the following command, depending on your CUDA version, to install all of the RAFT packages with conda (replace `rapidsai` with `rapidsai-nightly` to install more up-to-date but less stable nightly packages). `mamba` is preferred over the `conda` command. ```bash diff --git a/docs/source/raft_ann_benchmarks.md b/docs/source/raft_ann_benchmarks.md index 21a8404212..7cba76b8b9 100644 --- a/docs/source/raft_ann_benchmarks.md +++ b/docs/source/raft_ann_benchmarks.md @@ -39,10 +39,10 @@ mamba create --name raft_ann_benchmarks conda activate raft_ann_benchmarks # to install GPU package: -mamba install -c rapidsai -c conda-forge -c nvidia raft-ann-bench= cuda-version=11.8* +mamba install -c rapidsai -c conda-forge -c nvidia raft_ann_bench= cuda-version=11.8* # to install CPU package for usage in CPU-only systems: -mamba install -c rapidsai -c conda-forge raft-ann-bench-cpu +mamba install -c rapidsai -c conda-forge raft_ann_bench-cpu ``` The channel `rapidsai` can easily be substituted `rapidsai-nightly` if nightly benchmarks are desired. The CPU package currently allows to run the HNSW benchmarks. @@ -53,16 +53,16 @@ Please see the [build instructions](ann_benchmarks_build.md) to build the benchm We provide images for GPU enabled systems, as well as systems without a GPU. The following images are available: -- `raft-ann-bench`: Contains GPU and CPU benchmarks, can run all algorithms supported. Will download million-scale datasets as required. Best suited for users that prefer a smaller container size for GPU based systems. Requires the NVIDIA Container Toolkit to run GPU algorithms, can run CPU algorithms without it. -- `raft-ann-bench-datasets`: Contains the GPU and CPU benchmarks with million-scale datasets already included in the container. Best suited for users that want to run multiple million scale datasets already included in the image. -- `raft-ann-bench-cpu`: Contains only CPU benchmarks with minimal size. Best suited for users that want the smallest containers to reproduce benchmarks on systems without a GPU. +- `raft_ann_bench`: Contains GPU and CPU benchmarks, can run all algorithms supported. Will download million-scale datasets as required. Best suited for users that prefer a smaller container size for GPU based systems. Requires the NVIDIA Container Toolkit to run GPU algorithms, can run CPU algorithms without it. +- `raft_ann_bench-datasets`: Contains the GPU and CPU benchmarks with million-scale datasets already included in the container. Best suited for users that want to run multiple million scale datasets already included in the image. +- `raft_ann_bench-cpu`: Contains only CPU benchmarks with minimal size. Best suited for users that want the smallest containers to reproduce benchmarks on systems without a GPU. -Nightly images are located in [dockerhub](https://hub.docker.com/r/rapidsai/raft-ann-bench/tags), meanwhile release (stable) versions are located in [NGC](https://hub.docker.com/r/rapidsai/raft-ann-bench), starting with release 23.12. +Nightly images are located in [dockerhub](https://hub.docker.com/r/rapidsai/raft_ann_bench/tags), meanwhile release (stable) versions are located in [NGC](https://hub.docker.com/r/rapidsai/raft_ann_bench), starting with release 23.12. - The following command pulls the nightly container for python version 10, cuda version 12, and RAFT version 23.10: ```bash -docker pull rapidsai/raft-ann-bench:24.08a-cuda12.0-py3.10 #substitute raft-ann-bench for the exact desired container. +docker pull rapidsai/raft_ann_bench:24.08a-cuda12.0-py3.10 #substitute raft_ann_bench for the exact desired container. ``` The CUDA and python versions can be changed for the supported values: @@ -72,9 +72,9 @@ Supported Python versions: 3.9 and 3.10. You can see the exact versions as well in the dockerhub site: -- [RAFT ANN Benchmark images](https://hub.docker.com/r/rapidsai/raft-ann-bench/tags) -- [RAFT ANN Benchmark with datasets preloaded images](https://hub.docker.com/r/rapidsai/raft-ann-bench-cpu/tags) -- [RAFT ANN Benchmark CPU only images](https://hub.docker.com/r/rapidsai/raft-ann-bench-datasets/tags) +- [RAFT ANN Benchmark images](https://hub.docker.com/r/rapidsai/raft_ann_bench/tags) +- [RAFT ANN Benchmark with datasets preloaded images](https://hub.docker.com/r/rapidsai/raft_ann_bench-cpu/tags) +- [RAFT ANN Benchmark CPU only images](https://hub.docker.com/r/rapidsai/raft_ann_bench-datasets/tags) **Note:** GPU containers use the CUDA toolkit from inside the container, the only requirement is a driver installed on the host machine that supports that version. So, for example, CUDA 11.8 containers can run in systems with a CUDA 12.x capable driver. Please also note that the Nvidia-Docker runtime from the [Nvidia Container Toolkit](https://github.com/NVIDIA/nvidia-docker) is required to use GPUs inside docker containers. @@ -83,7 +83,7 @@ You can see the exact versions as well in the dockerhub site: [//]: # () [//]: # (```bash) -[//]: # (docker pull nvcr.io/nvidia/rapidsai/raft-ann-bench:24.08-cuda11.8-py3.10 #substitute raft-ann-bench for the exact desired container.) +[//]: # (docker pull nvcr.io/nvidia/rapidsai/raft_ann_bench:24.08-cuda11.8-py3.10 #substitute raft_ann_bench for the exact desired container.) [//]: # (```) @@ -344,7 +344,7 @@ For GPU-enabled systems, the `DATA_FOLDER` variable should be a local folder whe export DATA_FOLDER=path/to/store/datasets/and/results docker run --gpus all --rm -it -u $(id -u) \ -v $DATA_FOLDER:/data/benchmarks \ - rapidsai/raft-ann-bench:24.08a-cuda11.8-py3.10 \ + rapidsai/raft_ann_bench:24.08a-cuda11.8-py3.10 \ "--dataset deep-image-96-angular" \ "--normalize" \ "--algorithms raft_cagra,raft_ivf_pq --batch-size 10 -k 10" \ @@ -355,7 +355,7 @@ Usage of the above command is as follows: | Argument | Description | |-----------------------------------------------------------|----------------------------------------------------------------------------------------------------| -| `rapidsai/raft-ann-bench:24.08a-cuda11.8-py3.10` | Image to use. Can be either `raft-ann-bench` or `raft-ann-bench-datasets` | +| `rapidsai/raft_ann_bench:24.08a-cuda11.8-py3.10` | Image to use. Can be either `raft_ann_bench` or `raft_ann_bench-datasets` | | `"--dataset deep-image-96-angular"` | Dataset name | | `"--normalize"` | Whether to normalize the dataset | | `"--algorithms raft_cagra,hnswlib --batch-size 10 -k 10"` | Arguments passed to the `run` script, such as the algorithms to benchmark, the batch size, and `k` | @@ -367,12 +367,12 @@ Usage of the above command is as follows: The container arguments in the above section also be used for the CPU-only container, which can be used on systems that don't have a GPU installed. -***Note:*** the image changes to `raft-ann-bench-cpu` container and the `--gpus all` argument is no longer used: +***Note:*** the image changes to `raft_ann_bench-cpu` container and the `--gpus all` argument is no longer used: ```bash export DATA_FOLDER=path/to/store/datasets/and/results docker run --rm -it -u $(id -u) \ -v $DATA_FOLDER:/data/benchmarks \ - rapidsai/raft-ann-bench-cpu:24.08a-py3.10 \ + rapidsai/raft_ann_bench-cpu:24.08a-py3.10 \ "--dataset deep-image-96-angular" \ "--normalize" \ "--algorithms hnswlib --batch-size 10 -k 10" \ @@ -381,7 +381,7 @@ docker run --rm -it -u $(id -u) \ #### Manually run the scripts inside the container -All of the `raft-ann-bench` images contain the Conda packages, so they can be used directly by logging directly into the container itself: +All of the `raft_ann_bench` images contain the Conda packages, so they can be used directly by logging directly into the container itself: ```bash export DATA_FOLDER=path/to/store/datasets/and/results @@ -389,10 +389,10 @@ docker run --gpus all --rm -it -u $(id -u) \ --entrypoint /bin/bash \ --workdir /data/benchmarks \ -v $DATA_FOLDER:/data/benchmarks \ - rapidsai/raft-ann-bench:24.08a-cuda11.8-py3.10 + rapidsai/raft_ann_bench:24.08a-cuda11.8-py3.10 ``` -This will drop you into a command line in the container, with the `raft-ann-bench` python package ready to use, as described in the [Running the benchmarks](#running-the-benchmarks) section above: +This will drop you into a command line in the container, with the `raft_ann_bench` python package ready to use, as described in the [Running the benchmarks](#running-the-benchmarks) section above: ``` (base) root@00b068fbb862:/data/benchmarks# python -m raft_ann_bench.get_dataset --dataset deep-image-96-angular --normalize @@ -441,7 +441,7 @@ Note the following: A single configuration will often define a set of algorithms, with associated index and search parameters, that can be generalize across datasets. We use YAML to define dataset specific and algorithm specific configurations. -A default `datasets.yaml` is provided by RAFT in `${RAFT_HOME}/python/raft-ann-bench/src/raft_ann_bench/run/conf` with configurations available for several datasets. Here's a simple example entry for the `sift-128-euclidean` dataset: +A default `datasets.yaml` is provided by RAFT in `${RAFT_HOME}/python/raft_ann_bench/src/raft_ann_bench/run/conf` with configurations available for several datasets. Here's a simple example entry for the `sift-128-euclidean` dataset: ```yaml - name: sift-128-euclidean @@ -452,7 +452,7 @@ A single configuration will often define a set of algorithms, with associated in distance: euclidean ``` -Configuration files for ANN algorithms supported by `raft-ann-bench` are provided in `${RAFT_HOME}/python/raft-ann-bench/src/raft_ann_bench/run/conf`. `raft_cagra` algorithm configuration looks like: +Configuration files for ANN algorithms supported by `raft_ann_bench` are provided in `${RAFT_HOME}/python/raft_ann_bench/src/raft_ann_bench/run/conf`. `raft_cagra` algorithm configuration looks like: ```yaml name: raft_cagra groups: diff --git a/docs/source/wiki_all_dataset.md b/docs/source/wiki_all_dataset.md index c001bdc409..9e27b1d90d 100644 --- a/docs/source/wiki_all_dataset.md +++ b/docs/source/wiki_all_dataset.md @@ -12,7 +12,7 @@ To form the final dataset, the Wiki texts were chunked into 85 million 128-token ### Full dataset -A version of the dataset is made available in the binary format that can be used directly by the [raft-ann-bench](https://docs.rapids.ai/api/raft/nightly/raft_ann_benchmarks/) tool. The full 88M dataset is ~251GB and the download link below contains tarballs that have been split into multiple parts. +A version of the dataset is made available in the binary format that can be used directly by the [raft_ann_bench](https://docs.rapids.ai/api/raft/nightly/raft_ann_benchmarks/) tool. The full 88M dataset is ~251GB and the download link below contains tarballs that have been split into multiple parts. The following will download all 10 the parts and untar them to a `wiki_all_88M` directory: ```bash diff --git a/python/raft-ann-bench/pyproject.toml b/python/raft-ann-bench/pyproject.toml index 226dc41e40..d55e72fb7a 100644 --- a/python/raft-ann-bench/pyproject.toml +++ b/python/raft-ann-bench/pyproject.toml @@ -9,7 +9,7 @@ requires = [ ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project] -name = "raft-ann-bench" +name = "raft_ann_bench" dynamic = ["version"] description = "RAFT ANN benchmarks" authors = [ diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml b/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml index 77c4bc3296..79ca9bf0d9 100644 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml +++ b/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml @@ -1,6 +1,6 @@ name: diskann constraints: - search: raft-ann-bench.constraints.diskann_search_constraints + search: raft_ann_bench.constraints.diskann_search_constraints groups: base: build: From b4eaaccc64cea31921322896f4fd5206ca61d9b3 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 28 Jun 2024 15:25:03 -0700 Subject: [PATCH 20/20] add-latest-changes --- cpp/bench/ann/CMakeLists.txt | 4 +- cpp/bench/ann/src/diskann/diskann_wrapper.cuh | 85 +- cpp/cmake/patches/diskann.diff | 83 +- .../raft_ann_bench/run/conf/deep-100M.json | 458 ------ .../src/raft_ann_bench/run/conf/deep-1B.json | 34 - .../run/conf/deep-image-96-inner.json | 1013 ------------ .../run/conf/fashion-mnist-784-euclidean.json | 1352 ----------------- .../run/conf/gist-960-euclidean.json | 1351 ---------------- .../run/conf/glove-100-angular.json | 1351 ---------------- .../run/conf/glove-100-inner.json | 1314 ---------------- .../run/conf/glove-50-angular.json | 1351 ---------------- .../run/conf/glove-50-inner.json | 1351 ---------------- .../run/conf/lastfm-65-angular.json | 1351 ---------------- .../run/conf/mnist-784-euclidean.json | 1352 ----------------- .../run/conf/nytimes-256-angular.json | 1352 ----------------- .../run/conf/nytimes-256-inner.json | 1352 ----------------- .../run/conf/sift-128-euclidean.json | 498 ------ .../raft_ann_bench/run/conf/wiki_all_10M.json | 200 --- .../raft_ann_bench/run/conf/wiki_all_1M.json | 216 --- .../raft_ann_bench/run/conf/wiki_all_88M.json | 200 --- .../LICENSE | 0 .../pyproject.toml | 0 .../src/raft_ann_bench/VERSION | 0 .../src/raft_ann_bench/__init__.py | 0 .../src/raft_ann_bench/_version.py | 0 .../raft_ann_bench/constraints/__init__.py | 62 + .../raft_ann_bench/data_export/__main__.py | 0 .../generate_groundtruth/__main__.py | 0 .../generate_groundtruth/utils.py | 0 .../raft_ann_bench/get_dataset/__main__.py | 0 .../get_dataset/fbin_to_f16bin.py | 0 .../get_dataset/hdf5_to_fbin.py | 0 .../src/raft_ann_bench/plot/__main__.py | 7 + .../src/raft_ann_bench/run/__main__.py | 0 .../src/raft_ann_bench/run/algos.yaml | 0 .../run/conf/algos/diskann.yaml | 13 +- .../run/conf/algos/faiss_cpu_flat.yaml | 0 .../run/conf/algos/faiss_gpu_flat.yaml | 0 .../run/conf/algos/faiss_gpu_ivf_flat.yaml | 0 .../run/conf/algos/faiss_gpu_ivf_pq.yaml | 0 .../run/conf/algos/hnswlib.yaml | 0 .../run/conf/algos/raft_brute_force.yaml | 0 .../run/conf/algos/raft_cagra.yaml | 0 .../run/conf/algos/raft_cagra_hnswlib.yaml | 0 .../run/conf/algos/raft_ivf_flat.yaml | 0 .../run/conf/algos/raft_ivf_pq.yaml | 0 .../raft_ann_bench/run/conf/bigann-100M.json | 0 .../src/raft_ann_bench/run/conf/datasets.yaml | 0 .../split_groundtruth/__main__.py | 0 .../split_groundtruth/split_groundtruth.pl | 0 50 files changed, 155 insertions(+), 16195 deletions(-) delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-100M.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-1B.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-image-96-inner.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/fashion-mnist-784-euclidean.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/gist-960-euclidean.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-angular.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-inner.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-angular.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-inner.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/lastfm-65-angular.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/mnist-784-euclidean.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-angular.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-inner.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/sift-128-euclidean.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_10M.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_1M.json delete mode 100644 python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_88M.json rename python/{raft-ann-bench => raft_ann_bench}/LICENSE (100%) rename python/{raft-ann-bench => raft_ann_bench}/pyproject.toml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/VERSION (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/__init__.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/_version.py (100%) create mode 100644 python/raft_ann_bench/src/raft_ann_bench/constraints/__init__.py rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/data_export/__main__.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/generate_groundtruth/__main__.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/generate_groundtruth/utils.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/get_dataset/__main__.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/get_dataset/hdf5_to_fbin.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/plot/__main__.py (98%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/__main__.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/algos.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/diskann.yaml (57%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/faiss_cpu_flat.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/faiss_gpu_flat.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_flat.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_pq.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/hnswlib.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/raft_brute_force.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/raft_cagra.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/raft_cagra_hnswlib.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/raft_ivf_flat.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/algos/raft_ivf_pq.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/bigann-100M.json (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/run/conf/datasets.yaml (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/split_groundtruth/__main__.py (100%) rename python/{raft-ann-bench => raft_ann_bench}/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl (100%) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 5cabc63870..8336a64da6 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -31,8 +31,8 @@ option(RAFT_ANN_BENCH_USE_RAFT_IVF_PQ "Include raft's ivf pq algorithm in benchm option(RAFT_ANN_BENCH_USE_RAFT_CAGRA "Include raft's CAGRA in benchmark" ON) option(RAFT_ANN_BENCH_USE_RAFT_BRUTE_FORCE "Include raft's brute force knn in benchmark" ON) option(RAFT_ANN_BENCH_USE_RAFT_CAGRA_HNSWLIB "Include raft's CAGRA in benchmark" ON) -option(RAFT_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) -option(RAFT_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" ON) +option(RAFT_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" OFF) +option(RAFT_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) option(RAFT_ANN_BENCH_USE_DISKANN "Include diskann algorithm in benchmark" ON) option(RAFT_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh index d1a21941f4..aac6641c16 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.cuh +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.cuh @@ -94,7 +94,7 @@ class DiskANNMemory : public ANN { bool use_cagra_graph_; bool use_pq_build_ = false; uint32_t build_pq_bytes_ = 0; - std::shared_ptr diskann_index_write_params_{nullptr}; + // std::shared_ptr diskann_index_write_params_{nullptr}; std::shared_ptr diskann_index_search_params_{nullptr}; std::shared_ptr> diskann_index_{nullptr}; // uint32_t L_load_; @@ -111,7 +111,7 @@ DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) : ANN(metric, dim) { assert(this->dim_ > 0); - diskann_index_write_params_ = std::make_shared( + auto diskann_index_write_params = std::make_shared( diskann::IndexWriteParametersBuilder(param.L_build, param.R) .with_filter_list_size(0) .with_alpha(param.alpha) @@ -122,37 +122,37 @@ DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) build_pq_bytes_ = 0; cagra_graph_degree_ = param.cagra_graph_degree; cagra_intermediate_graph_degree_ = param.cagra_intermediate_graph_degree; -} - -template -void DiskANNMemory::build(const T* dataset, size_t nrow) -{ - max_points_ = nrow; - std::cout << "num_threads" << this->diskann_index_write_params_->num_threads << std::endl; - this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), - this->dim_, - max_points_, - this->diskann_index_write_params_, + this->diskann_index_ = std::make_shared>(parse_metric_type(metric), + dim, + 10000000, + diskann_index_write_params, nullptr, 0, false, false, false, - this->use_pq_build_, + false, this->build_pq_bytes_, false, false, - this->use_cagra_graph_, - cagra_graph_degree_); + param.use_cagra_graph, + param.cagra_graph_degree); +} + +template +void DiskANNMemory::build(const T* dataset, size_t nrow) +{ + max_points_ = nrow; + // std::cout << "num_threads" << this->diskann_index_write_params_->num_threads << std::endl; if (use_cagra_graph_) { std::optional> intermediate_graph( raft::make_host_matrix(nrow, cagra_intermediate_graph_degree_)); - std::vector> knn_graph(nrow, std::vector(cagra_graph_degree_)); - auto knn_graph_view = raft::make_host_matrix_view( - knn_graph[0].data(), nrow, cagra_graph_degree_); + std::vector knn_graph(nrow * cagra_graph_degree_); + auto knn_graph_view = + raft::make_host_matrix_view(knn_graph.data(), nrow, cagra_graph_degree_); auto dataset_view = raft::make_host_matrix_view( dataset, static_cast(nrow), (int64_t)this->dim_); raft::resources res; @@ -161,6 +161,10 @@ void DiskANNMemory::build(const T* dataset, size_t nrow) nn_descent_params.graph_degree = cagra_intermediate_graph_degree_; nn_descent_params.intermediate_graph_degree = 1.5 * cagra_intermediate_graph_degree_; nn_descent_params.max_iterations = 20; + // auto ivf_pq_params = + // raft::neighbors::ivf_pq::index_params::from_dataset(dataset_view); ivf_pq_params.n_lists = + // static_cast(nrow / 2500); + raft::neighbors::cagra::build_knn_graph( res, dataset_view, intermediate_graph->view(), nn_descent_params); raft::neighbors::cagra::optimize(res, intermediate_graph->view(), knn_graph_view); @@ -188,15 +192,25 @@ template void DiskANNMemory::search( const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const { - if (this->metric_objective_ == Objective::LATENCY) - omp_set_num_threads(diskann_index_write_params_->num_threads); + // std::cout << "num_search_threads" << diskann_index_write_params_->num_threads << std::endl; + if (this->metric_objective_ == Objective::LATENCY) { + omp_set_num_threads(omp_get_num_procs()); #pragma omp parallel for - for (int64_t i = 0; i < (int64_t)batch_size; i++) { - diskann_index_->search(queries + i * this->dim_, - static_cast(k), - L_search_, - neighbors + i * k, - distances + i * k); + for (int64_t i = 0; i < (int64_t)batch_size; i++) { + diskann_index_->search(queries + i * this->dim_, + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k); + } + } else { + for (int64_t i = 0; i < (int64_t)batch_size; i++) { + diskann_index_->search(queries + i * this->dim_, + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k); + } } } @@ -209,21 +223,6 @@ void DiskANNMemory::save(const std::string& path_to_index) const template void DiskANNMemory::load(const std::string& path_to_index) { - this->diskann_index_ = std::make_shared>(parse_metric_type(this->metric_), - this->dim_, - max_points_, - this->diskann_index_write_params_, - nullptr, - 0, - false, - false, - false, - this->use_pq_build_, - this->build_pq_bytes_, - false, - false, - this->use_cagra_graph_, - cagra_graph_degree_); - diskann_index_->load(path_to_index.c_str(), diskann_index_write_params_->num_threads, 100); + diskann_index_->load(path_to_index.c_str(), 80, 100); } }; // namespace raft::bench::ann diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 03e72a8f22..cfed837070 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -238,7 +238,7 @@ index d0206a7..46cdee4 100644 }; diff --git a/include/index.h b/include/index.h -index b9bf4f3..88939a9 100644 +index b9bf4f3..4890f00 100644 --- a/include/index.h +++ b/include/index.h @@ -66,7 +66,8 @@ template clas @@ -251,27 +251,26 @@ index b9bf4f3..88939a9 100644 DISKANN_DLLEXPORT ~Index(); -@@ -100,6 +101,10 @@ template clas - // Batch build from a data array, which must pad vectors to aligned_dim - DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags); +@@ -98,7 +99,8 @@ template clas + DISKANN_DLLEXPORT void build(const char *filename, const size_t num_points_to_load, const char *tag_filename); -+ // Batch build from a data array, which must pad vectors to aligned_dim + // Batch build from a data array, which must pad vectors to aligned_dim +- DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags); + DISKANN_DLLEXPORT void build(const T *data, const size_t num_points_to_load, const std::vector &tags, -+ std::vector> &raft_cagra_graph_vec); -+ ++ const std::vector &raft_cagra_graph_vec = std::vector()); + // Based on filter params builds a filtered or unfiltered index DISKANN_DLLEXPORT void build(const std::string &data_file, const size_t num_points_to_load, - IndexFilterParams &filter_params); -@@ -236,6 +241,8 @@ template clas +@@ -236,6 +238,8 @@ template clas Index(const Index &) = delete; Index &operator=(const Index &) = delete; -+ void add_raft_cagra_neighbours(std::vector>& raft_cagra_graph_vec); ++ void add_raft_cagra_neighbours(const std::vector& raft_cagra_graph_vec); + // Use after _data and _nd have been populated // Acquire exclusive _update_lock before calling void build_with_data_populated(const std::vector &tags); -@@ -444,5 +451,8 @@ template clas +@@ -444,5 +448,8 @@ template clas std::vector _locks; static const float INDEX_GROWTH_FACTOR; @@ -395,7 +394,7 @@ index c12b251..ea39001 100644 + } // namespace diskann diff --git a/src/index.cpp b/src/index.cpp -index bf93344..014ed66 100644 +index bf93344..665f45a 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -37,8 +37,10 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -1505,6 +1510,21 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -1505,6 +1510,30 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } +template -+void Index::add_raft_cagra_neighbours(std::vector> &raft_cagra_graph_vec) ++void Index::add_raft_cagra_neighbours(const std::vector &raft_cagra_graph_vec) +{ ++ std::cout << "inside add_raft_cagra_neighbours" << std::endl; + std::vector> &graph = _graph_store->graph(); ++ std::cout << "accessed graph" << std::endl; ++ std::cout << "graph size " << graph.size() << std::endl; ++ +#pragma omp parallel for num_threads(_indexingThreads) + for (int i = 0; i < graph.size(); i++) + { -+ _graph_store->set_neighbours(i, raft_cagra_graph_vec[i]); -+ assert(_graph_store->get_neighbours((location_t)i).size() <= _indexingRange); -+ raft_cagra_graph_vec[i].clear(); ++ graph[i].resize(_raft_cagra_graph_degree); ++ for (int j = 0; j < _raft_cagra_graph_degree; j++) ++ { ++ graph[i][j] = raft_cagra_graph_vec[i * _raft_cagra_graph_degree + j]; ++ } ++ // if (i % 100000 == 0) { ++ // std::cout << "resized " << i << " rows" << std::endl; ++ // } + } + std::cout << "_indexingThreads" << _indexingThreads << std::endl; + _has_built = true; @@ -452,15 +460,19 @@ index bf93344..014ed66 100644 template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1575,6 +1595,7 @@ void Index::_build(const DataType &data, const size_t num_point +@@ -1575,8 +1604,10 @@ void Index::_build(const DataType &data, const size_t num_point throw ANNException("Error" + std::string(e.what()), -1); } } + template - void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags) +-void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags) ++void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, ++ const std::vector &raft_cagra_graph_vec) { -@@ -1593,13 +1614,44 @@ void Index::build(const T *data, const size_t num_points_to_loa + if (num_points_to_load == 0) + { +@@ -1593,11 +1624,18 @@ void Index::build(const T *data, const size_t num_points_to_loa { std::unique_lock tl(_tag_lock); _nd = num_points_to_load; @@ -468,30 +480,7 @@ index bf93344..014ed66 100644 _data_store->populate_data(data, (location_t)num_points_to_load); } - - build_with_data_populated(tags); - } - -+template -+void Index::build(const T *data, const size_t num_points_to_load, const std::vector &tags, -+ std::vector> &raft_cagra_graph_vec) -+{ -+ if (num_points_to_load == 0) -+ { -+ throw ANNException("Do not call build with 0 points", -1, __FUNCSIG__, __FILE__, __LINE__); -+ } -+ if (_pq_dist) -+ { -+ throw ANNException("ERROR: DO not use this build interface with PQ distance", -1, __FUNCSIG__, __FILE__, -+ __LINE__); -+ } -+ -+ std::unique_lock ul(_update_lock); -+ -+ { -+ std::unique_lock tl(_tag_lock); -+ _nd = num_points_to_load; -+ _data_store->populate_data(data, (location_t)num_points_to_load); -+ } +- build_with_data_populated(tags); + if (!_raft_cagra_graph) + build_with_data_populated(tags); + else @@ -502,8 +491,6 @@ index bf93344..014ed66 100644 + _start = calculate_entry_point(); + add_raft_cagra_neighbours(raft_cagra_graph_vec); + } -+} -+ + } + template - void Index::build(const char *filename, const size_t num_points_to_load, const std::vector &tags) - { diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-100M.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-100M.json deleted file mode 100644 index ea92a0de18..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-100M.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "dataset": { - "name": "deep-100M", - "base_file": "deep-100M/base.1B.fbin", - "subset_size": 100000000, - "query_file": "deep-100M/query.public.10K.fbin", - "groundtruth_neighbors_file": "deep-100M/groundtruth.neighbors.ibin", - "distance": "euclidean" - }, - - "search_basic_param": { - "batch_size": 10000, - "k": 10 - }, - - "index": [ - { - "name": "hnswlib.M12", - "algo": "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file": "deep-100M/hnswlib/M12", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "hnswlib.M16", - "algo": "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file": "deep-100M/hnswlib/M16", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "hnswlib.M24", - "algo": "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file": "deep-100M/hnswlib/M24", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "hnswlib.M36", - "algo": "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file": "deep-100M/hnswlib/M36", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "faiss_gpu_ivf_flat.nlist50K", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist":50000}, - "file": "deep-100M/faiss_gpu_ivf_flat/nlist50K", - "search_params": [ - {"nprobe":20}, - {"nprobe":30}, - {"nprobe":40}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500}, - {"nprobe":1000} - ] - }, - { - "name": "faiss_gpu_ivf_flat.nlist100K", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist":100000}, - "file": "deep-100M/faiss_gpu_ivf_flat/nlist100K", - "search_params": [ - {"nprobe":20}, - {"nprobe":30}, - {"nprobe":40}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500}, - {"nprobe":1000} - ] - }, - { - "name": "faiss_gpu_ivf_flat.nlist200K", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist":200000}, - "file": "deep-100M/faiss_gpu_ivf_flat/nlist200K", - "search_params": [ - {"nprobe":20}, - {"nprobe":30}, - {"nprobe":40}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500}, - {"nprobe":1000} - ] - }, - { - "name": "faiss_gpu_ivf_pq.M48-nlist16K", - "algo": "faiss_gpu_ivf_pq", - "build_param": {"nlist":16384, "M":48}, - "file": "deep-100M/faiss_gpu_ivf_pq/M48-nlist16K", - "search_params": [ - {"nprobe":10}, - {"nprobe":20}, - {"nprobe":30}, - {"nprobe":40}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500} - ] - }, - { - "name": "faiss_gpu_ivf_pq.M48-nlist50K", - "algo": "faiss_gpu_ivf_pq", - "build_param": {"nlist":50000, "M":48}, - "file": "deep-100M/faiss_gpu_ivf_pq/M48-nlist50K", - "search_params": [ - {"nprobe":20}, - {"nprobe":30}, - {"nprobe":40}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500}, - {"nprobe":1000} - ] - }, - { - "name": "faiss_gpu_ivf_pq.M48-nlist100K", - "algo": "faiss_gpu_ivf_pq", - "build_param": {"nlist":100000, "M":48}, - "file": "deep-100M/faiss_gpu_ivf_pq/M48-nlist100K", - "search_params": [ - {"nprobe":20}, - {"nprobe":30}, - {"nprobe":40}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500}, - {"nprobe":1000} - ] - }, - { - "name": "faiss_gpu_ivf_pq.M48-nlist200K", - "algo": "faiss_gpu_ivf_pq", - "build_param": {"nlist":200000, "M":48}, - "file": "deep-100M/faiss_gpu_ivf_pq/M48-nlist200K", - "search_params": [ - {"nprobe":20}, - {"nprobe":30}, - {"nprobe":40}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500}, - {"nprobe":1000} - ] - }, - - - { - "name": "raft_ivf_flat.nlist50K", - "algo": "raft_ivf_flat", - "build_param": {"nlist": 50000, "niter": 25, "ratio": 5}, - "file": "deep-100M/raft_ivf_flat/nlist50K", - "search_params": [ - {"max_batch":10000, "max_k":10, "nprobe":20}, - {"max_batch":10000, "max_k":10, "nprobe":30}, - {"max_batch":10000, "max_k":10, "nprobe":40}, - {"max_batch":10000, "max_k":10, "nprobe":50}, - {"max_batch":10000, "max_k":10, "nprobe":100}, - {"max_batch":10000, "max_k":10, "nprobe":200}, - {"max_batch":10000, "max_k":10, "nprobe":500}, - {"max_batch":10000, "max_k":10, "nprobe":1000} - ] - }, - { - "name": "raft_ivf_flat.nlist100K", - "algo": "raft_ivf_flat", - "build_param": {"nlist": 100000, "niter": 25, "ratio": 5}, - "file": "deep-100M/raft_ivf_flat/nlist100K", - "search_params": [ - {"max_batch":10000, "max_k":10, "nprobe":20}, - {"max_batch":10000, "max_k":10, "nprobe":30}, - {"max_batch":10000, "max_k":10, "nprobe":40}, - {"max_batch":10000, "max_k":10, "nprobe":50}, - {"max_batch":10000, "max_k":10, "nprobe":100}, - {"max_batch":10000, "max_k":10, "nprobe":200}, - {"max_batch":10000, "max_k":10, "nprobe":500}, - {"max_batch":10000, "max_k":10, "nprobe":1000} - ] - }, - { - "name": "raft_ivf_flat.nlist200K", - "algo": "raft_ivf_flat", - "build_param": {"nlist": 200000, "niter": 25, "ratio": 5}, - "file": "deep-100M/raft_ivf_flat/nlist200K", - "search_params": [ - {"max_batch":10000, "max_k":10, "nprobe":20}, - {"max_batch":10000, "max_k":10, "nprobe":30}, - {"max_batch":10000, "max_k":10, "nprobe":40}, - {"max_batch":10000, "max_k":10, "nprobe":50}, - {"max_batch":10000, "max_k":10, "nprobe":100}, - {"max_batch":10000, "max_k":10, "nprobe":200}, - {"max_batch":10000, "max_k":10, "nprobe":500}, - {"max_batch":10000, "max_k":10, "nprobe":1000} - ] - }, -{ - "name": "raft_ivf_pq.d96b5n50K", - "algo": "raft_ivf_pq", - "build_param": {"nlist": 50000, "pq_dim": 96, "pq_bits": 5, "ratio": 10, "niter": 25}, - "file": "deep-100M/raft_ivf_pq/d96b5n50K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 2000, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 5000, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 2 }, - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 2000, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 5000, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 2000, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 5000, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 1000, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 2000, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 5000, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 2 }, - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 1000, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 2000, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 }, - { "nprobe": 5000, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 2 } - ] - }, - { - "name": "raft_ivf_pq.d64b5n50K", - "algo": "raft_ivf_pq", - "build_param": {"nlist": 50000, "pq_dim": 64, "pq_bits": 5, "ratio": 10, "niter": 25}, - "file": "deep-100M/raft_ivf_pq/d64b5n50K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 2000, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 5000, "internalDistanceDtype": "float", "smemLutDtype": "float", "refine_ratio": 4 }, - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 2000, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 5000, "internalDistanceDtype": "float", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 2000, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 5000, "internalDistanceDtype": "float", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 1000, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 2000, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 5000, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 1000, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 2000, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 }, - { "nprobe": 5000, "internalDistanceDtype": "half", "smemLutDtype": "fp8", "refine_ratio": 4 } - ] - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-angular/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "float"} - ], - "search_result_file": "result/deep-image-96-angular/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_cagra.dim32", - "algo": "raft_cagra", - "build_param": {"graph_degree": 32, "intermediate_graph_degree": 48}, - "file": "deep-100M/raft_cagra/dim32", - "search_params": [ - {"itopk": 32, "search_width": 1, "max_iterations": 0, "algo": "single_cta"}, - {"itopk": 32, "search_width": 1, "max_iterations": 32, "algo": "single_cta"}, - {"itopk": 64, "search_width": 4, "max_iterations": 16, "algo": "single_cta"}, - {"itopk": 64, "search_width": 1, "max_iterations": 64, "algo": "single_cta"}, - {"itopk": 96, "search_width": 2, "max_iterations": 48, "algo": "single_cta"}, - {"itopk": 128, "search_width": 8, "max_iterations": 16, "algo": "single_cta"}, - {"itopk": 128, "search_width": 2, "max_iterations": 64, "algo": "single_cta"}, - {"itopk": 192, "search_width": 8, "max_iterations": 24, "algo": "single_cta"}, - {"itopk": 192, "search_width": 2, "max_iterations": 96, "algo": "single_cta"}, - {"itopk": 256, "search_width": 8, "max_iterations": 32, "algo": "single_cta"}, - {"itopk": 384, "search_width": 8, "max_iterations": 48, "algo": "single_cta"}, - {"itopk": 512, "search_width": 8, "max_iterations": 64, "algo": "single_cta"} - ] - }, - { - "name": "raft_cagra.dim32.multi_cta", - "algo": "raft_cagra", - "build_param": {"graph_degree": 32, "intermediate_graph_degree": 48}, - "file": "deep-100M/raft_cagra/dim32", - "search_params": [ - {"itopk": 32, "search_width": 1, "max_iterations": 0, "algo": "multi_cta"}, - {"itopk": 32, "search_width": 1, "max_iterations": 32, "algo": "multi_cta"}, - {"itopk": 64, "search_width": 4, "max_iterations": 16, "algo": "multi_cta"}, - {"itopk": 64, "search_width": 1, "max_iterations": 64, "algo": "multi_cta"}, - {"itopk": 96, "search_width": 2, "max_iterations": 48, "algo": "multi_cta"}, - {"itopk": 128, "search_width": 8, "max_iterations": 16, "algo": "multi_cta"}, - {"itopk": 128, "search_width": 2, "max_iterations": 64, "algo": "multi_cta"}, - {"itopk": 192, "search_width": 8, "max_iterations": 24, "algo": "multi_cta"}, - {"itopk": 192, "search_width": 2, "max_iterations": 96, "algo": "multi_cta"}, - {"itopk": 256, "search_width": 8, "max_iterations": 32, "algo": "multi_cta"}, - {"itopk": 384, "search_width": 8, "max_iterations": 48, "algo": "multi_cta"}, - {"itopk": 512, "search_width": 8, "max_iterations": 64, "algo": "multi_cta"} - ] - }, - { - "name": "raft_cagra.dim32.multi_kernel", - "algo": "raft_cagra", - "build_param": {"graph_degree": 32, "intermediate_graph_degree": 48}, - "file": "deep-100M/raft_cagra/dim32", - "search_params": [ - {"itopk": 32, "search_width": 1, "max_iterations": 0, "algo": "multi_kernel"}, - {"itopk": 32, "search_width": 1, "max_iterations": 32, "algo": "multi_kernel"}, - {"itopk": 64, "search_width": 4, "max_iterations": 16, "algo": "multi_kernel"}, - {"itopk": 64, "search_width": 1, "max_iterations": 64, "algo": "multi_kernel"}, - {"itopk": 96, "search_width": 2, "max_iterations": 48, "algo": "multi_kernel"}, - {"itopk": 128, "search_width": 8, "max_iterations": 16, "algo": "multi_kernel"}, - {"itopk": 128, "search_width": 2, "max_iterations": 64, "algo": "multi_kernel"}, - {"itopk": 192, "search_width": 8, "max_iterations": 24, "algo": "multi_kernel"}, - {"itopk": 192, "search_width": 2, "max_iterations": 96, "algo": "multi_kernel"}, - {"itopk": 256, "search_width": 8, "max_iterations": 32, "algo": "multi_kernel"}, - {"itopk": 384, "search_width": 8, "max_iterations": 48, "algo": "multi_kernel"}, - {"itopk": 512, "search_width": 8, "max_iterations": 64, "algo": "multi_kernel"} - ] - }, - { - "name": "raft_cagra.dim64", - "algo": "raft_cagra", - "build_param": {"graph_degree": 64}, - "file": "deep-100M/raft_cagra/dim64", - "search_params": [ - {"itopk": 32, "search_width": 1, "max_iterations": 0}, - {"itopk": 32, "search_width": 1, "max_iterations": 32}, - {"itopk": 64, "search_width": 4, "max_iterations": 16}, - {"itopk": 64, "search_width": 1, "max_iterations": 64}, - {"itopk": 96, "search_width": 2, "max_iterations": 48}, - {"itopk": 128, "search_width": 8, "max_iterations": 16}, - {"itopk": 128, "search_width": 2, "max_iterations": 64}, - {"itopk": 192, "search_width": 8, "max_iterations": 24}, - {"itopk": 192, "search_width": 2, "max_iterations": 96}, - {"itopk": 256, "search_width": 8, "max_iterations": 32}, - {"itopk": 384, "search_width": 8, "max_iterations": 48}, - {"itopk": 512, "search_width": 8, "max_iterations": 64} - ] - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-1B.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-1B.json deleted file mode 100644 index e5190e073e..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-1B.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "dataset": { - "name": "deep-1B", - "base_file": "deep-1B/base.1B.fbin", - "query_file": "deep-1B/query.public.10K.fbin", - "groundtruth_neighbors_file": "deep-1B/groundtruth.neighbors.ibin", - "distance": "inner_product" - }, - - "search_basic_param": { - "batch_size": 10000, - "k": 10 - }, - - "index": [ - { - "name": "faiss_gpu_ivf_pq.M48-nlist50K", - "algo": "faiss_gpu_ivf_pq", - "build_param": {"nlist":50000, "M":48}, - "file": "deep-1B/faiss_gpu_ivf_pq/M48-nlist50K", - "search_params": [ - {"nprobe":1}, - {"nprobe":5}, - {"nprobe":10}, - {"nprobe":50}, - {"nprobe":100}, - {"nprobe":200}, - {"nprobe":500}, - {"nprobe":1000}, - {"nprobe":2000} - ] - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-image-96-inner.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-image-96-inner.json deleted file mode 100644 index 3d69e775a1..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/deep-image-96-inner.json +++ /dev/null @@ -1,1013 +0,0 @@ -{ - "dataset": { - "name": "deep-image-96-inner", - "base_file": "deep-image-96-inner/base.fbin", - "query_file": "deep-image-96-inner/query.fbin", - "groundtruth_neighbors_file": "deep-image-96-inner/groundtruth.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/deep-image-96-inner/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/deep-image-96-inner/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/deep-image-96-inner/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/deep-image-96-inner/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/deep-image-96-inner/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/deep-image-96-inner/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/deep-image-96-inner/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/deep-image-96-inner/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - - "build_param": {}, - "file": "index/deep-image-96-inner/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/deep-image-96-inner/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/deep-image-96-inner/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/deep-image-96-inner/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/deep-image-96-inner/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - - "build_param": {"nlist": 1024, "pq_dim": 128, "ratio": 1, "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "half", "smemLutDtype": "half"}, - {"nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half"}, - {"nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half"}, - {"nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half"}, - {"nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half"}, - {"nprobe": 1024, "internalDistanceDtype": "half", "smemLutDtype": "half"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - {"nprobe": 1, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 5, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "float"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "half"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "fp8"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "fp8"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "half"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "half"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "fp8"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "fp8"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "fp8"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "half", "smemLutDtype": "float"}, - {"nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "float"}, - {"nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "float"}, - {"nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "float"}, - {"nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "float"}, - {"nprobe": 1024, "internalDistanceDtype": "half", "smemLutDtype": "float"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - {"nprobe": 10, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "float"}, - {"nprobe": 1024, "internalDistanceDtype": "float", "smemLutDtype": "float"} - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/deep-image-96-inner/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/deep-image-96-inner/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/deep-image-96-inner/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/deep-image-96-inner/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/deep-image-96-inner/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/deep-image-96-inner/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/deep-image-96-inner/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/fashion-mnist-784-euclidean.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/fashion-mnist-784-euclidean.json deleted file mode 100644 index 2c86b0c4ee..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/fashion-mnist-784-euclidean.json +++ /dev/null @@ -1,1352 +0,0 @@ -{ - "dataset": { - "name": "fashion-mnist-784-euclidean", - "base_file": "fashion-mnist-784-euclidean/base.fbin", - "query_file": "fashion-mnist-784-euclidean/query.fbin", - "groundtruth_neighbors_file": "fashion-mnist-784-euclidean/groundtruth.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/fashion-mnist-784-euclidean/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/fashion-mnist-784-euclidean/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/fashion-mnist-784-euclidean/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/fashion-mnist-784-euclidean/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/fashion-mnist-784-euclidean/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/fashion-mnist-784-euclidean/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/fashion-mnist-784-euclidean/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/fashion-mnist-784-euclidean/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/fashion-mnist-784-euclidean/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/fashion-mnist-784-euclidean/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/fashion-mnist-784-euclidean/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/fashion-mnist-784-euclidean/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/fashion-mnist-784-euclidean/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/fashion-mnist-784-euclidean/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/fashion-mnist-784-euclidean/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/fashion-mnist-784-euclidean/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/fashion-mnist-784-euclidean/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/gist-960-euclidean.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/gist-960-euclidean.json deleted file mode 100644 index c5480900a7..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/gist-960-euclidean.json +++ /dev/null @@ -1,1351 +0,0 @@ -{ - "dataset": { - "name": "gist-960-euclidean", - "base_file": "gist-960-euclidean/base.fbin", - "query_file": "gist-960-euclidean/query.fbin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/gist-960-euclidean/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/gist-960-euclidean/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/gist-960-euclidean/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/gist-960-euclidean/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/gist-960-euclidean/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/gist-960-euclidean/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/gist-960-euclidean/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/gist-960-euclidean/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/gist-960-euclidean/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/gist-960-euclidean/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/gist-960-euclidean/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/gist-960-euclidean/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/gist-960-euclidean/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/gist-960-euclidean/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/gist-960-euclidean/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/gist-960-euclidean/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/gist-960-euclidean/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/gist-960-euclidean/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/gist-960-euclidean/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/gist-960-euclidean/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-angular.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-angular.json deleted file mode 100644 index 2074ef13a3..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-angular.json +++ /dev/null @@ -1,1351 +0,0 @@ -{ - "dataset": { - "name": "glove-100-angular", - "base_file": "glove-100-angular/base.fbin", - "query_file": "glove-100-angular/query.fbin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-angular/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-angular/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-angular/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-angular/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-angular/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-angular/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-angular/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-angular/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/glove-100-angular/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/glove-100-angular/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/glove-100-angular/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/glove-100-angular/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/glove-100-angular/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-angular/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/glove-100-angular/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-angular/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/glove-100-angular/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-100-angular/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/glove-100-angular/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-100-angular/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-inner.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-inner.json deleted file mode 100644 index 5da3fa18d3..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-100-inner.json +++ /dev/null @@ -1,1314 +0,0 @@ -{ - "dataset": { - "name": "glove-100-inner", - "base_file": "glove-100-inner/base.fbin", - "query_file": "glove-100-inner/query.fbin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-inner/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-inner/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-inner/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-inner/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-inner/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-inner/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-100-inner/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-100-inner/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/glove-100-inner/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/glove-100-inner/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist":1024}, - "file": "glove-100-inner/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist":2048}, - "file": "glove-100-inner/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist":4096}, - "file": "glove-100-inner/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist":8192}, - "file": "glove-100-inner/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/glove-100-inner/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/glove-100-inner/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/glove-100-inner/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/glove-100-inner/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":2048, "quantizer_type":"fp16"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":4096, "quantizer_type":"fp16"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":8192, "quantizer_type":"fp16"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":16384, "quantizer_type":"fp16"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":1024, "quantizer_type":"int8"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":2048, "quantizer_type":"int8"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":4096, "quantizer_type":"int8"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":8192, "quantizer_type":"int8"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist":16384, "quantizer_type":"int8"}, - "file": "glove-100-inner/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-inner/faiss_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "glove-100-inner/faiss_gpu_flat/flat", - "search_params": [{}], - "search_result_file": "result/glove-100-inner/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-100-inner/raft_gpu_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-100-inner/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/glove-100-inner/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-100-inner/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/glove-100-inner/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-100-inner/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/glove-100-inner/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-100-inner/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-angular.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-angular.json deleted file mode 100644 index 11fa07c5c9..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-angular.json +++ /dev/null @@ -1,1351 +0,0 @@ -{ - "dataset": { - "name": "glove-50-angular", - "base_file": "glove-50-angular/base.fbin", - "query_file": "glove-50-angular/query.fbin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-angular/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-angular/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-angular/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-angular/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-angular/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-angular/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-angular/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-angular/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/glove-50-angular/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/glove-50-angular/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/glove-50-angular/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/glove-50-angular/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/glove-50-angular/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-angular/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/glove-50-angular/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-angular/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/glove-50-angular/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-50-angular/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/glove-50-angular/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-50-angular/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-inner.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-inner.json deleted file mode 100644 index 32613b7c16..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/glove-50-inner.json +++ /dev/null @@ -1,1351 +0,0 @@ -{ - "dataset": { - "name": "glove-50-inner", - "base_file": "glove-50-inner/base.fbin", - "query_file": "glove-50-inner/query.fbin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-inner/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-inner/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-inner/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-inner/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-inner/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-inner/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/glove-50-inner/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/glove-50-inner/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/glove-50-inner/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/glove-50-inner/raft_bfknn/bfknn" - }, - { - "name": "faiss_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/glove-50-inner/faiss_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_flat/nlist1024" - }, - { - "name": "faiss_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/glove-50-inner/faiss_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_flat/nlist2048" - }, - { - "name": "faiss_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/glove-50-inner/faiss_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_flat/nlist4096" - }, - { - "name": "faiss_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/glove-50-inner/faiss_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_flat/nlist8192" - }, - { - "name": "faiss_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/glove-50-inner/faiss_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_flat/nlist16384" - }, - { - "name": "faiss_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/glove-50-inner/faiss_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/glove-50-inner/faiss_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/glove-50-inner/faiss_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-inner/faiss_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/glove-50-inner/faiss_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/glove-50-inner/faiss_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "nprobe": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "nprobe": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/glove-50-inner/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/glove-50-inner/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/glove-50-inner/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/glove-50-inner/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-50-inner/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/glove-50-inner/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/glove-50-inner/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/lastfm-65-angular.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/lastfm-65-angular.json deleted file mode 100644 index 943d09231a..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/lastfm-65-angular.json +++ /dev/null @@ -1,1351 +0,0 @@ -{ - "dataset": { - "name": "lastfm-65-angular", - "base_file": "lastfm-65-angular/base.fbin", - "query_file": "lastfm-65-angular/query.fbin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/lastfm-65-angular/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/lastfm-65-angular/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/lastfm-65-angular/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/lastfm-65-angular/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/lastfm-65-angular/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/lastfm-65-angular/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/lastfm-65-angular/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/lastfm-65-angular/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/lastfm-65-angular/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/lastfm-65-angular/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/lastfm-65-angular/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/lastfm-65-angular/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/lastfm-65-angular/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/lastfm-65-angular/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/lastfm-65-angular/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/lastfm-65-angular/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/lastfm-65-angular/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/lastfm-65-angular/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/lastfm-65-angular/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/lastfm-65-angular/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/mnist-784-euclidean.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/mnist-784-euclidean.json deleted file mode 100644 index 04e7ecb469..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/mnist-784-euclidean.json +++ /dev/null @@ -1,1352 +0,0 @@ -{ - "dataset": { - "name": "mnist-784-euclidean", - "base_file": "mnist-784-euclidean/base.fbin", - "query_file": "mnist-784-euclidean/query.fbin", - "groundtruth_neighbors_file": "mnist-784-euclidean/groundtruth.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/mnist-784-euclidean/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/mnist-784-euclidean/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/mnist-784-euclidean/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/mnist-784-euclidean/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/mnist-784-euclidean/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/mnist-784-euclidean/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/mnist-784-euclidean/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/mnist-784-euclidean/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/mnist-784-euclidean/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/mnist-784-euclidean/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/mnist-784-euclidean/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/mnist-784-euclidean/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/mnist-784-euclidean/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/mnist-784-euclidean/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/mnist-784-euclidean/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/mnist-784-euclidean/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/mnist-784-euclidean/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/mnist-784-euclidean/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-angular.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-angular.json deleted file mode 100644 index df2a16f1f8..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-angular.json +++ /dev/null @@ -1,1352 +0,0 @@ -{ - "dataset": { - "name": "nytimes-256-angular", - "base_file": "nytimes-256-angular/base.fbin", - "query_file": "nytimes-256-angular/query.fbin", - "groundtruth_neighbors_file": "nytimes-256-angular/groundtruth.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-angular/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-angular/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-angular/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-angular/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-angular/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-angular/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-angular/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-angular/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/nytimes-256-angular/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/nytimes-256-angular/raft_bfknn/bfknn" - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_flat/nlist1024" - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_flat/nlist2048" - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_flat/nlist4096" - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_flat/nlist8192" - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_flat/nlist16384" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-angular/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/nytimes-256-angular/faiss_gpu_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/nytimes-256-angular/faiss_gpu_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-angular/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/nytimes-256-angular/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-angular/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/nytimes-256-angular/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/nytimes-256-angular/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/nytimes-256-angular/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/nytimes-256-angular/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-inner.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-inner.json deleted file mode 100644 index 18942a95c3..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/nytimes-256-inner.json +++ /dev/null @@ -1,1352 +0,0 @@ -{ - "dataset": { - "name": "nytimes-256-inner", - "base_file": "nytimes-256-inner/base.fbin", - "query_file": "nytimes-256-inner/query.fbin", - "groundtruth_neighbors_file": "nytimes-256-inner/groundtruth.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 5000, - "k": 10, - "run_count": 3 - }, - "index": [ - { - "name" : "hnswlib.M12", - "algo" : "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-inner/hnswlib/M12", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-inner/hnswlib/M12" - }, - { - "name" : "hnswlib.M16", - "algo" : "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-inner/hnswlib/M16", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-inner/hnswlib/M16" - }, - { - "name" : "hnswlib.M24", - "algo" : "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-inner/hnswlib/M24", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-inner/hnswlib/M24" - }, - { - "name" : "hnswlib.M36", - "algo" : "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file" : "index/nytimes-256-inner/hnswlib/M36", - "search_params" : [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ], - "search_result_file" : "result/nytimes-256-inner/hnswlib/M36" - }, - - - - - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "index/nytimes-256-inner/raft_bfknn/bfknn", - "search_params": [ - { - "probe": 1 - } - ], - "search_result_file": "result/nytimes-256-inner/raft_bfknn/bfknn" - }, - { - "name": "faiss_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 1024 - }, - "file": "index/nytimes-256-inner/faiss_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_flat/nlist1024" - }, - { - "name": "faiss_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 2048 - }, - "file": "index/nytimes-256-inner/faiss_ivf_flat/nlist2048", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_flat/nlist2048" - }, - { - "name": "faiss_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 4096 - }, - "file": "index/nytimes-256-inner/faiss_ivf_flat/nlist4096", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_flat/nlist4096" - }, - { - "name": "faiss_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 8192 - }, - "file": "index/nytimes-256-inner/faiss_ivf_flat/nlist8192", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_flat/nlist8192" - }, - { - "name": "faiss_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": { - "nlist": 16384 - }, - "file": "index/nytimes-256-inner/faiss_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_flat/nlist16384" - }, - { - "name": "faiss_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": true - }, - "file": "index/nytimes-256-inner/faiss_ivf_pq/M64-nlist1024", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "index/nytimes-256-inner/faiss_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_pq/M64-nlist1024" - }, - { - "name": "faiss_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist1024-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist1024-fp16" - }, - { - "name": "faiss_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist2048-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist2048-fp16" - }, - { - "name": "faiss_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist4096-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist4096-fp16" - }, - { - "name": "faiss_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist8192-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist8192-fp16" - }, - { - "name": "faiss_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "fp16" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist16384-fp16", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist16384-fp16" - }, - { - "name": "faiss_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 1024, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist1024-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist1024-int8" - }, - { - "name": "faiss_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 2048, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist2048-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist2048-int8" - }, - { - "name": "faiss_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 4096, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist4096-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist4096-int8" - }, - { - "name": "faiss_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 8192, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist8192-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist8192-int8" - }, - { - "name": "faiss_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": { - "nlist": 16384, - "quantizer_type": "int8" - }, - "file": "index/nytimes-256-inner/faiss_ivf_sq/nlist16384-int8", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-inner/faiss_ivf_sq/nlist16384-int8" - }, - { - "name": "faiss_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "index/nytimes-256-inner/faiss_flat/flat", - "search_params": [ - {} - ], - "search_result_file": "result/nytimes-256-inner/faiss_flat/flat" - }, - - { - "name": "raft_ivf_pq.dimpq128-cluster1024", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 5, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-float-float" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq64-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq64-cluster1024-float-half", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 64, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq64-cluster1024-float-half", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "half" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq64-cluster1024-float-half" - }, - { - "name": "raft_ivf_pq.dimpq32-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 32, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq32-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq16-cluster1024-float-fp8", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 16, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "fp8" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq16-cluster1024-float-fp8" - }, - { - "name": "raft_ivf_pq.dimpq128-cluster1024-half-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 128, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-half-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "half", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq128-cluster1024-half-float" - }, - { - "name": "raft_ivf_pq.dimpq512-cluster1024-float-float", - "algo": "raft_ivf_pq", - "build_param": { - "nlist": 1024, - "pq_dim": 512, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_pq/dimpq512-cluster1024-float-float", - "search_params": [ - { - "k": 10, - "numProbes": 10, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 50, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 100, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 200, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 500, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - }, - { - "k": 10, - "numProbes": 1024, - "internalDistanceDtype": "float", - "smemLutDtype": "float" - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_pq/dimpq512-cluster1024-float-float" - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 1024, - "ratio": 1, - "niter": 25 - }, - "file": "index/nytimes-256-inner/raft_ivf_flat/nlist1024", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_flat/nlist1024" - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": { - "nlist": 16384, - "ratio": 2, - "niter": 20 - }, - "file": "index/nytimes-256-inner/raft_ivf_flat/nlist16384", - "search_params": [ - { - "nprobe": 1 - }, - { - "nprobe": 5 - }, - { - "nprobe": 10 - }, - { - "nprobe": 50 - }, - { - "nprobe": 100 - }, - { - "nprobe": 200 - }, - { - "nprobe": 500 - }, - { - "nprobe": 1000 - }, - { - "nprobe": 2000 - } - ], - "search_result_file": "result/nytimes-256-inner/raft_ivf_flat/nlist16384" - }, - - { - "name" : "raft_cagra.dim32", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 32 - }, - "file" : "index/nytimes-256-inner/raft_cagra/dim32", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/nytimes-256-inner/raft_cagra/dim32" - }, - - { - "name" : "raft_cagra.dim64", - "algo" : "raft_cagra", - "build_param": { - "graph_degree" : 64 - }, - "file" : "index/nytimes-256-inner/raft_cagra/dim64", - "search_params" : [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ], - "search_result_file" : "result/nytimes-256-inner/raft_cagra/dim64" - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/sift-128-euclidean.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/sift-128-euclidean.json deleted file mode 100644 index 791261251a..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/sift-128-euclidean.json +++ /dev/null @@ -1,498 +0,0 @@ -{ - "dataset": { - "name": "sift-128-euclidean", - "base_file": "sift-128-euclidean/base.fbin", - "query_file": "sift-128-euclidean/query.fbin", - "groundtruth_neighbors_file": "sift-128-euclidean/groundtruth.neighbors.ibin", - "distance": "euclidean" - }, - - "search_basic_param": { - "batch_size": 5000, - "k": 10 - }, - - "index": [ - { - "name": "hnswlib.M12", - "algo": "hnswlib", - "build_param": {"M":12, "efConstruction":500, "numThreads":32}, - "file": "sift-128-euclidean/hnswlib/M12", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "hnswlib.M16", - "algo": "hnswlib", - "build_param": {"M":16, "efConstruction":500, "numThreads":32}, - "file": "sift-128-euclidean/hnswlib/M16", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "hnswlib.M24", - "algo": "hnswlib", - "build_param": {"M":24, "efConstruction":500, "numThreads":32}, - "file": "sift-128-euclidean/hnswlib/M24", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "hnswlib.M36", - "algo": "hnswlib", - "build_param": {"M":36, "efConstruction":500, "numThreads":32}, - "file": "sift-128-euclidean/hnswlib/M36", - "search_params": [ - {"ef":10}, - {"ef":20}, - {"ef":40}, - {"ef":60}, - {"ef":80}, - {"ef":120}, - {"ef":200}, - {"ef":400}, - {"ef":600}, - {"ef":800} - ] - }, - { - "name": "raft_bfknn", - "algo": "raft_bfknn", - "build_param": {}, - "file": "sift-128-euclidean/raft_bfknn/bfknn", - "search_params": [{"probe": 1}] - }, - { - "name": "faiss_gpu_ivf_flat.nlist1024", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist": 1024}, - "file": "sift-128-euclidean/faiss_gpu_ivf_flat/nlist1024", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_flat.nlist2048", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist": 2048}, - "file": "sift-128-euclidean/faiss_gpu_ivf_flat/nlist2048", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_flat.nlist4096", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist": 4096}, - "file": "sift-128-euclidean/faiss_gpu_ivf_flat/nlist4096", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_flat.nlist8192", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist": 8192}, - "file": "sift-128-euclidean/faiss_gpu_ivf_flat/nlist8192", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_flat.nlist16384", - "algo": "faiss_gpu_ivf_flat", - "build_param": {"nlist": 16384}, - "file": "sift-128-euclidean/faiss_gpu_ivf_flat/nlist16384", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000}, - {"nprobe": 2000} - ] - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024", - "algo": "faiss_gpu_ivf_pq", - "build_param": {"nlist": 1024, "M": 64, "useFloat16": true, "usePrecomputed": true}, - "file": "sift-128-euclidean/faiss_gpu_ivf_pq/M64-nlist1024", - "search_params": [ - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_pq.M64-nlist1024.noprecomp", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "nlist": 1024, - "M": 64, - "useFloat16": true, - "usePrecomputed": false - }, - "file": "sift-128-euclidean/faiss_gpu_ivf_pq/M64-nlist1024.noprecomp", - "search_params": [ - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 1024, "quantizer_type": "fp16"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist1024-fp16", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 2048, "quantizer_type": "fp16"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist2048-fp16", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 4096, "quantizer_type": "fp16"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist4096-fp16", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 8192, "quantizer_type": "fp16"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist8192-fp16", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-fp16", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 16384, "quantizer_type": "fp16"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist16384-fp16", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000}, - {"nprobe": 2000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist1024-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 1024, "quantizer_type": "int8"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist1024-int8", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist2048-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 2048,"quantizer_type": "int8"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist2048-int8", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist4096-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 4096, "quantizer_type": "int8"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist4096-int8", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist8192-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 8192, "quantizer_type": "int8"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist8192-int8", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "faiss_gpu_ivf_sq.nlist16384-int8", - "algo": "faiss_gpu_ivf_sq", - "build_param": {"nlist": 16384, "quantizer_type": "int8"}, - "file": "sift-128-euclidean/faiss_gpu_ivf_sq/nlist16384-int8", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000}, - {"nprobe": 2000} - ] - }, - { - "name": "faiss_gpu_flat", - "algo": "faiss_gpu_flat", - "build_param": {}, - "file": "sift-128-euclidean/faiss_gpu_flat/flat", - "search_params": [{}] - }, - { - "name": "raft_ivf_pq.dimpq64-bitpq8-cluster1K", - "algo": "raft_ivf_pq", - "build_param": {"niter": 25, "nlist": 1000, "pq_dim": 64, "pq_bits": 8, "ratio": 1}, - "file": "sift-128-euclidean/raft_ivf_pq/dimpq64-bitpq8-cluster1K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 1000, "internalDistanceDtype": "half", "smemLutDtype": "half" } - ] - }, - { - "name": "raft_ivf_pq.dimpq128-bitpq6-cluster1K", - "algo": "raft_ivf_pq", - "build_param": {"niter": 25, "nlist": 1000, "pq_dim": 128, "pq_bits": 6, "ratio": 1}, - "file": "sift-128-euclidean/raft_ivf_pq/dimpq128-bitpq6-cluster1K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "float" }, - { "nprobe": 20, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 30, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 40, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 50, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 100, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 200, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 500, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 1000, "internalDistanceDtype": "float", "smemLutDtype": "fp8" }, - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half" }, - { "nprobe": 1000, "internalDistanceDtype": "half", "smemLutDtype": "half" } - ] - }, - { - "name": "raft_ivf_flat.nlist1024", - "algo": "raft_ivf_flat", - "build_param": {"nlist": 1024, "ratio": 1, "niter": 25}, - "file": "sift-128-euclidean/raft_ivf_flat/nlist1024", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000} - ] - }, - { - "name": "raft_ivf_flat.nlist16384", - "algo": "raft_ivf_flat", - "build_param": {"nlist": 16384, "ratio": 2, "niter": 20}, - "file": "sift-128-euclidean/raft_ivf_flat/nlist16384", - "search_params": [ - {"nprobe": 1}, - {"nprobe": 5}, - {"nprobe": 10}, - {"nprobe": 50}, - {"nprobe": 100}, - {"nprobe": 200}, - {"nprobe": 500}, - {"nprobe": 1000}, - {"nprobe": 2000} - ] - }, - { - "name": "raft_cagra.dim32", - "algo": "raft_cagra", - "build_param": {"graph_degree": 32}, - "file": "sift-128-euclidean/raft_cagra/dim32", - "search_params": [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ] - }, - { - "name": "raft_cagra.dim64", - "algo": "raft_cagra", - "build_param": {"graph_degree": 64}, - "file": "sift-128-euclidean/raft_cagra/dim64", - "search_params": [ - {"itopk": 32}, - {"itopk": 64}, - {"itopk": 128} - ] - } - ] -} diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_10M.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_10M.json deleted file mode 100644 index e5f77e7858..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_10M.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "dataset": { - "name": "wiki_all_10M", - "base_file": "wiki_all_10M/base.88M.fbin", - "query_file": "wiki_all_10M/queries.fbin", - "groundtruth_neighbors_file": "wiki_all_10M/groundtruth.88M.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 10000, - "k": 10 - }, - "index": [ - { - "name": "hnswlib.M16.ef50", - "algo": "hnswlib", - "build_param": { "M": 16, "efConstruction": 50, "numThreads": 56 }, - "file": "wiki_all_10M/hnswlib/M16.ef50", - "search_params": [ - { "ef": 10, "numThreads": 56 }, - { "ef": 20, "numThreads": 56 }, - { "ef": 40, "numThreads": 56 }, - { "ef": 60, "numThreads": 56 }, - { "ef": 80, "numThreads": 56 }, - { "ef": 120, "numThreads": 56 }, - { "ef": 200, "numThreads": 56 }, - { "ef": 400, "numThreads": 56 }, - { "ef": 600, "numThreads": 56 }, - { "ef": 800, "numThreads": 56 } - ] - }, - { - "name": "faiss_ivf_pq.M32-nlist16K", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "M": 32, - "nlist": 16384, - "ratio": 2 - }, - "file": "wiki_all_10M/faiss_ivf_pq/M32-nlist16K_ratio2", - "search_params": [ - { "nprobe": 10 }, - { "nprobe": 20 }, - { "nprobe": 30 }, - { "nprobe": 40 }, - { "nprobe": 50 }, - { "nprobe": 100 }, - { "nprobe": 200 }, - { "nprobe": 500 } - ] - }, - { - "name": "faiss_ivf_pq.M64-nlist16K", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "M": 64, - "nlist": 16384, - "ratio": 2 - }, - "file": "wiki_all_10M/faiss_ivf_pq/M64-nlist16K_ratio2", - "search_params": [ - { "nprobe": 10 }, - { "nprobe": 20 }, - { "nprobe": 30 }, - { "nprobe": 40 }, - { "nprobe": 50 }, - { "nprobe": 100 }, - { "nprobe": 200 }, - { "nprobe": 500 } - ] - }, - { - "name": "raft_ivf_pq.d128-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 128, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_10M/raft_ivf_pq/d128-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 } - ] - }, - { - "name": "raft_ivf_pq.d64-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 64, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_10M/raft_ivf_pq/d64-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 } - ] - }, - { - "name": "raft_ivf_pq.d32-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 32, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_10M/raft_ivf_pq/d32-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 } - ] - }, - { - "name": "raft_ivf_pq.d32X-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 32, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_10M/raft_ivf_pq/d32-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 } - - ] - }, - { - "name": "raft_cagra.dim32.multi_cta", - "algo": "raft_cagra", - "build_param": { "graph_degree": 32, "intermediate_graph_degree": 48 }, - "file": "wiki_all_10M/raft_cagra/dim32.ibin", - "search_params": [ - { "itopk": 32, "search_width": 1, "max_iterations": 0, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 36, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 40, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 44, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 24, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 26, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 64, "search_width": 4, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 64, "search_width": 1, "max_iterations": 64, "algo": "multi_cta" }, - { "itopk": 96, "search_width": 2, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 128, "search_width": 8, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 128, "search_width": 2, "max_iterations": 64, "algo": "multi_cta" }, - { "itopk": 192, "search_width": 8, "max_iterations": 24, "algo": "multi_cta" }, - { "itopk": 192, "search_width": 2, "max_iterations": 96, "algo": "multi_cta" }, - { "itopk": 256, "search_width": 8, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 384, "search_width": 8, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 512, "search_width": 8, "max_iterations": 64, "algo": "multi_cta" } - ] - } - - ] -} - diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_1M.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_1M.json deleted file mode 100644 index 2d1ec1e322..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_1M.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "dataset": { - "name": "wiki_all_1M", - "base_file": "wiki_all_1M/base.1M.fbin", - "subset_size": 1000000, - "query_file": "wiki_all_1M/queries.fbin", - "groundtruth_neighbors_file": "wiki_all_1M/groundtruth.1M.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 10000, - "k": 10 - }, - "index": [ - { - "name": "hnswlib.M16.ef50", - "algo": "hnswlib", - "build_param": { "M": 16, "efConstruction": 50, "numThreads": 56 }, - "file": "wiki_all_1M/hnswlib/M16.ef50", - "search_params": [ - { "ef": 10, "numThreads": 56 }, - { "ef": 20, "numThreads": 56 }, - { "ef": 40, "numThreads": 56 }, - { "ef": 60, "numThreads": 56 }, - { "ef": 80, "numThreads": 56 }, - { "ef": 120, "numThreads": 56 }, - { "ef": 200, "numThreads": 56 }, - { "ef": 400, "numThreads": 56 }, - { "ef": 600, "numThreads": 56 }, - { "ef": 800, "numThreads": 56 } - ] - }, - { - "name": "faiss_ivf_pq.M32-nlist16K", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "M": 32, - "nlist": 16384, - "ratio": 2 - }, - "file": "wiki_all_1M/faiss_ivf_pq/M32-nlist16K_ratio2", - "search_params": [ - { "nprobe": 10 }, - { "nprobe": 20 }, - { "nprobe": 30 }, - { "nprobe": 40 }, - { "nprobe": 50 }, - { "nprobe": 100 }, - { "nprobe": 200 }, - { "nprobe": 500 } - ] - }, - { - "name": "faiss_ivf_pq.M64-nlist16K", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "M": 64, - "nlist": 16384, - "ratio": 2 - }, - "file": "wiki_all_1M/faiss_ivf_pq/M64-nlist16K_ratio2", - "search_params": [ - { "nprobe": 10 }, - { "nprobe": 20 }, - { "nprobe": 30 }, - { "nprobe": 40 }, - { "nprobe": 50 }, - { "nprobe": 100 }, - { "nprobe": 200 }, - { "nprobe": 500 } - ] - }, - { - "name": "raft_ivf_pq.d128-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 128, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_1M/raft_ivf_pq/d128-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 } - ] - }, - { - "name": "raft_ivf_pq.d64-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 64, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_1M/raft_ivf_pq/d64-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 } - ] - }, - { - "name": "raft_ivf_pq.d32-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 32, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_1M/raft_ivf_pq/d32-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 } - ] - }, - { - "name": "raft_ivf_pq.d32X-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 32, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_1M/raft_ivf_pq/d32-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 } - - ] - }, - { - "name": "raft_cagra.dim32.multi_cta", - "algo": "raft_cagra", - "build_param": { "graph_degree": 32, - "intermediate_graph_degree": 48, - "graph_build_algo": "NN_DESCENT", - "ivf_pq_build_pq_dim": 32, - "ivf_pq_build_pq_bits": 8, - "ivf_pq_build_nlist": 16384, - "ivf_pq_build_niter": 10, - "ivf_pq_build_ratio": 10, - "ivf_pq_search_nprobe": 30, - "ivf_pq_search_internalDistanceDtype": "half", - "ivf_pq_search_smemLutDtype": "half", - "ivf_pq_search_refine_ratio": 8, - "nn_descent_max_iterations": 10, - "nn_descent_intermediate_graph_degree": 72, - "nn_descent_termination_threshold": 0.001 - }, - "file": "wiki_all_1M/raft_cagra/dim32.ibin", - "search_params": [ - { "itopk": 32, "search_width": 1, "max_iterations": 0, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 36, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 40, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 44, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 24, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 26, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 64, "search_width": 4, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 64, "search_width": 1, "max_iterations": 64, "algo": "multi_cta" }, - { "itopk": 96, "search_width": 2, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 128, "search_width": 8, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 128, "search_width": 2, "max_iterations": 64, "algo": "multi_cta" }, - { "itopk": 192, "search_width": 8, "max_iterations": 24, "algo": "multi_cta" }, - { "itopk": 192, "search_width": 2, "max_iterations": 96, "algo": "multi_cta" }, - { "itopk": 256, "search_width": 8, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 384, "search_width": 8, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 512, "search_width": 8, "max_iterations": 64, "algo": "multi_cta" } - ] - } - - ] -} - diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_88M.json b/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_88M.json deleted file mode 100644 index e50b40f554..0000000000 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/wiki_all_88M.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "dataset": { - "name": "wiki_all_88M", - "base_file": "wiki_all_88M/base.88M.fbin", - "query_file": "wiki_all_88M/queries.fbin", - "groundtruth_neighbors_file": "wiki_all_88M/groundtruth.88M.neighbors.ibin", - "distance": "euclidean" - }, - "search_basic_param": { - "batch_size": 10000, - "k": 10 - }, - "index": [ - { - "name": "hnswlib.M16.ef50", - "algo": "hnswlib", - "build_param": { "M": 16, "efConstruction": 50, "numThreads": 56 }, - "file": "wiki_all_88M/hnswlib/M16.ef50", - "search_params": [ - { "ef": 10, "numThreads": 56 }, - { "ef": 20, "numThreads": 56 }, - { "ef": 40, "numThreads": 56 }, - { "ef": 60, "numThreads": 56 }, - { "ef": 80, "numThreads": 56 }, - { "ef": 120, "numThreads": 56 }, - { "ef": 200, "numThreads": 56 }, - { "ef": 400, "numThreads": 56 }, - { "ef": 600, "numThreads": 56 }, - { "ef": 800, "numThreads": 56 } - ] - }, - { - "name": "faiss_ivf_pq.M32-nlist16K", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "M": 32, - "nlist": 16384, - "ratio": 2 - }, - "file": "wiki_all_88M/faiss_ivf_pq/M32-nlist16K_ratio2", - "search_params": [ - { "nprobe": 10 }, - { "nprobe": 20 }, - { "nprobe": 30 }, - { "nprobe": 40 }, - { "nprobe": 50 }, - { "nprobe": 100 }, - { "nprobe": 200 }, - { "nprobe": 500 } - ] - }, - { - "name": "faiss_ivf_pq.M64-nlist16K", - "algo": "faiss_gpu_ivf_pq", - "build_param": { - "M": 64, - "nlist": 16384, - "ratio": 2 - }, - "file": "wiki_all_88M/faiss_ivf_pq/M64-nlist16K_ratio2", - "search_params": [ - { "nprobe": 10 }, - { "nprobe": 20 }, - { "nprobe": 30 }, - { "nprobe": 40 }, - { "nprobe": 50 }, - { "nprobe": 100 }, - { "nprobe": 200 }, - { "nprobe": 500 } - ] - }, - { - "name": "raft_ivf_pq.d128-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 128, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_88M/raft_ivf_pq/d128-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 1 } - ] - }, - { - "name": "raft_ivf_pq.d64-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 64, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_88M/raft_ivf_pq/d64-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 } - ] - }, - { - "name": "raft_ivf_pq.d32-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 32, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_88M/raft_ivf_pq/d32-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 32 } - ] - }, - { - "name": "raft_ivf_pq.d32X-nlist16K", - "algo": "raft_ivf_pq", - "build_param": { - "pq_dim": 32, - "pq_bits": 8, - "nlist": 16384, - "niter": 10, - "ratio": 10 - }, - "file": "wiki_all_88M/raft_ivf_pq/d32-nlist16K", - "search_params": [ - { "nprobe": 20, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 16 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 8 }, - { "nprobe": 30, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 40, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 50, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 100, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 200, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 }, - { "nprobe": 500, "internalDistanceDtype": "half", "smemLutDtype": "half", "refine_ratio": 4 } - - ] - }, - { - "name": "raft_cagra.dim32.multi_cta", - "algo": "raft_cagra", - "build_param": { "graph_degree": 32, "intermediate_graph_degree": 48 }, - "file": "wiki_all_88M/raft_cagra/dim32.ibin", - "search_params": [ - { "itopk": 32, "search_width": 1, "max_iterations": 0, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 36, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 40, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 44, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 1, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 24, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 26, "algo": "multi_cta" }, - { "itopk": 32, "search_width": 2, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 64, "search_width": 4, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 64, "search_width": 1, "max_iterations": 64, "algo": "multi_cta" }, - { "itopk": 96, "search_width": 2, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 128, "search_width": 8, "max_iterations": 16, "algo": "multi_cta" }, - { "itopk": 128, "search_width": 2, "max_iterations": 64, "algo": "multi_cta" }, - { "itopk": 192, "search_width": 8, "max_iterations": 24, "algo": "multi_cta" }, - { "itopk": 192, "search_width": 2, "max_iterations": 96, "algo": "multi_cta" }, - { "itopk": 256, "search_width": 8, "max_iterations": 32, "algo": "multi_cta" }, - { "itopk": 384, "search_width": 8, "max_iterations": 48, "algo": "multi_cta" }, - { "itopk": 512, "search_width": 8, "max_iterations": 64, "algo": "multi_cta" } - ] - } - - ] -} - diff --git a/python/raft-ann-bench/LICENSE b/python/raft_ann_bench/LICENSE similarity index 100% rename from python/raft-ann-bench/LICENSE rename to python/raft_ann_bench/LICENSE diff --git a/python/raft-ann-bench/pyproject.toml b/python/raft_ann_bench/pyproject.toml similarity index 100% rename from python/raft-ann-bench/pyproject.toml rename to python/raft_ann_bench/pyproject.toml diff --git a/python/raft-ann-bench/src/raft_ann_bench/VERSION b/python/raft_ann_bench/src/raft_ann_bench/VERSION similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/VERSION rename to python/raft_ann_bench/src/raft_ann_bench/VERSION diff --git a/python/raft-ann-bench/src/raft_ann_bench/__init__.py b/python/raft_ann_bench/src/raft_ann_bench/__init__.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/__init__.py rename to python/raft_ann_bench/src/raft_ann_bench/__init__.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/_version.py b/python/raft_ann_bench/src/raft_ann_bench/_version.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/_version.py rename to python/raft_ann_bench/src/raft_ann_bench/_version.py diff --git a/python/raft_ann_bench/src/raft_ann_bench/constraints/__init__.py b/python/raft_ann_bench/src/raft_ann_bench/constraints/__init__.py new file mode 100644 index 0000000000..4be5dfcfc3 --- /dev/null +++ b/python/raft_ann_bench/src/raft_ann_bench/constraints/__init__.py @@ -0,0 +1,62 @@ +# +# Copyright (c) 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. + +DTYPE_SIZES = {"float": 4, "half": 2, "fp8": 1} + + +def raft_cagra_build_constraints(params, dims): + if "graph_degree" in params and "intermediate_graph_degree" in params: + return params["graph_degree"] <= params["intermediate_graph_degree"] + return True + + +def raft_ivf_pq_build_constraints(params, dims): + if "pq_dim" in params: + return params["pq_dim"] <= dims + return True + +def diskann_build_constraints(params, dims): + ret = True + if "cagra_graph_degree" in params: + ret = params["R"] <= params["cagra_graph_degree"] and params["cagra_graph_degree"] <= params["cagra_intermediate_graph_degree"] + return ret + +def raft_ivf_pq_search_constraints(params, build_params, k, batch_size): + ret = True + if "internalDistanceDtype" in params and "smemLutDtype" in params: + ret = ( + DTYPE_SIZES[params["smemLutDtype"]] + <= DTYPE_SIZES[params["internalDistanceDtype"]] + ) + + if "nlist" in build_params and "nprobe" in params: + ret = ret and build_params["nlist"] >= params["nprobe"] + return ret + + +def raft_cagra_search_constraints(params, build_params, k, batch_size): + ret = True + if "itopk" in params: + ret = ret and params["itopk"] >= k + return ret + + +def hnswlib_search_constraints(params, build_params, k, batch_size): + if "ef" in params: + return params["ef"] >= k + + +def diskann_search_constraints(params, build_params, k, batch_size): + return params["L_search"] >= k \ No newline at end of file diff --git a/python/raft-ann-bench/src/raft_ann_bench/data_export/__main__.py b/python/raft_ann_bench/src/raft_ann_bench/data_export/__main__.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/data_export/__main__.py rename to python/raft_ann_bench/src/raft_ann_bench/data_export/__main__.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/generate_groundtruth/__main__.py b/python/raft_ann_bench/src/raft_ann_bench/generate_groundtruth/__main__.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/generate_groundtruth/__main__.py rename to python/raft_ann_bench/src/raft_ann_bench/generate_groundtruth/__main__.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/generate_groundtruth/utils.py b/python/raft_ann_bench/src/raft_ann_bench/generate_groundtruth/utils.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/generate_groundtruth/utils.py rename to python/raft_ann_bench/src/raft_ann_bench/generate_groundtruth/utils.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/get_dataset/__main__.py b/python/raft_ann_bench/src/raft_ann_bench/get_dataset/__main__.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/get_dataset/__main__.py rename to python/raft_ann_bench/src/raft_ann_bench/get_dataset/__main__.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py b/python/raft_ann_bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py rename to python/raft_ann_bench/src/raft_ann_bench/get_dataset/fbin_to_f16bin.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/get_dataset/hdf5_to_fbin.py b/python/raft_ann_bench/src/raft_ann_bench/get_dataset/hdf5_to_fbin.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/get_dataset/hdf5_to_fbin.py rename to python/raft_ann_bench/src/raft_ann_bench/get_dataset/hdf5_to_fbin.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/plot/__main__.py b/python/raft_ann_bench/src/raft_ann_bench/plot/__main__.py similarity index 98% rename from python/raft-ann-bench/src/raft_ann_bench/plot/__main__.py rename to python/raft_ann_bench/src/raft_ann_bench/plot/__main__.py index 86fd527f5f..d367fcda79 100644 --- a/python/raft-ann-bench/src/raft_ann_bench/plot/__main__.py +++ b/python/raft_ann_bench/src/raft_ann_bench/plot/__main__.py @@ -228,6 +228,13 @@ def inv_fun(x): def create_plot_build( build_results, search_results, linestyles, fn_out, dataset, k, batch_size ): + for key in list(build_results.keys()): + if key[0].endswith(".json"): + new_key = (key[0][:-5], key[1]) + build_results[new_key] = build_results.pop(key) + + print(build_results.keys()) + bt_80 = [0] * len(linestyles) bt_90 = [0] * len(linestyles) diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/__main__.py b/python/raft_ann_bench/src/raft_ann_bench/run/__main__.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/__main__.py rename to python/raft_ann_bench/src/raft_ann_bench/run/__main__.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/algos.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/algos.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/algos.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/algos.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/diskann.yaml similarity index 57% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/diskann.yaml index 79ca9bf0d9..3a93d4b7a6 100644 --- a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/diskann.yaml +++ b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/diskann.yaml @@ -1,22 +1,23 @@ name: diskann constraints: + build: raft_ann_bench.constraints.diskann_build_constraints search: raft_ann_bench.constraints.diskann_search_constraints groups: base: build: - R: [32, 64] - Lb: [64, 128] + R: [16, 24, 32, 64] + Lb: [24, 32, 64, 128] alpha: [1.0, 1.2] use_cagra_graph: [False] search: L_search: [10, 20, 50, 100, 200, 300] cagra: build: - R: [32, 64] - Lb: [128] + R: [16, 24, 32, 64] + Lb: [32] alpha: [1.2] - cagra_intermediate_graph_degree: [64, 128] - cagra_graph_degree: [32, 64] + cagra_intermediate_graph_degree: [24, 32, 64, 128] + cagra_graph_degree: [16, 24, 32, 64] use_cagra_graph: [True] search: L_search: [10, 20, 50, 100, 200, 300] \ No newline at end of file diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_cpu_flat.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_cpu_flat.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_cpu_flat.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_cpu_flat.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_flat.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_flat.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_flat.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_flat.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_flat.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_flat.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_flat.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_flat.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_pq.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_pq.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_pq.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/faiss_gpu_ivf_pq.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/hnswlib.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/hnswlib.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/hnswlib.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/hnswlib.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_brute_force.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_brute_force.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_brute_force.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_brute_force.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_cagra.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_cagra.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_cagra.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_cagra.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_cagra_hnswlib.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_cagra_hnswlib.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_cagra_hnswlib.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_cagra_hnswlib.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_ivf_flat.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_ivf_flat.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_ivf_flat.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_ivf_flat.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_ivf_pq.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_ivf_pq.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/algos/raft_ivf_pq.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/algos/raft_ivf_pq.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/bigann-100M.json b/python/raft_ann_bench/src/raft_ann_bench/run/conf/bigann-100M.json similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/bigann-100M.json rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/bigann-100M.json diff --git a/python/raft-ann-bench/src/raft_ann_bench/run/conf/datasets.yaml b/python/raft_ann_bench/src/raft_ann_bench/run/conf/datasets.yaml similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/run/conf/datasets.yaml rename to python/raft_ann_bench/src/raft_ann_bench/run/conf/datasets.yaml diff --git a/python/raft-ann-bench/src/raft_ann_bench/split_groundtruth/__main__.py b/python/raft_ann_bench/src/raft_ann_bench/split_groundtruth/__main__.py similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/split_groundtruth/__main__.py rename to python/raft_ann_bench/src/raft_ann_bench/split_groundtruth/__main__.py diff --git a/python/raft-ann-bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl b/python/raft_ann_bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl similarity index 100% rename from python/raft-ann-bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl rename to python/raft_ann_bench/src/raft_ann_bench/split_groundtruth/split_groundtruth.pl