From 8e8d3c1ae44b56c384c33599b9aa21994d67269c Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 29 Jul 2024 08:41:08 -0700 Subject: [PATCH 01/58] initial commit --- cpp/bench/ann/CMakeLists.txt | 10 + cpp/bench/ann/src/cuvs/cuvs_cagra_diskann.cu | 218 ++++++++ .../ann/src/cuvs/cuvs_cagra_diskann_wrapper.h | 504 ++++++++++++++++++ 3 files changed, 732 insertions(+) create mode 100644 cpp/bench/ann/src/cuvs/cuvs_cagra_diskann.cu create mode 100644 cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 6e9e66fad..38eab5f3d 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -30,6 +30,7 @@ option(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benc option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" ON) option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) +option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN "Include cuVS CAGRA with DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF ) @@ -50,6 +51,7 @@ if(BUILD_CPU_ONLY) set(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE OFF) set(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB OFF) set(CUVS_ANN_BENCH_USE_GGNN OFF) + set(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN OFF) else() set(CUVS_FAISS_ENABLE_GPU ON) endif() @@ -97,6 +99,10 @@ if(CUVS_ANN_BENCH_USE_FAISS) include(cmake/thirdparty/get_faiss.cmake) endif() +if(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN) + include(cmake/thirdparty/get_diskann.cmake) +endif() + # ################################################################################################## # * Enable NVTX if available @@ -310,6 +316,10 @@ if(CUVS_ANN_BENCH_USE_GGNN) ) endif() +if(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN) + ConfigureAnnBench(NAME DISKANN PATH src/diskann/cuvs_cagra_diskann.cu LINKS cuvs diskann::diskann) +endif() + # ################################################################################################## # * Dynamically-loading ANN_BENCH executable ------------------------------------------------------- if(CUVS_ANN_BENCH_SINGLE_EXE) diff --git a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann.cu b/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann.cu new file mode 100644 index 000000000..45751732c --- /dev/null +++ b/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann.cu @@ -0,0 +1,218 @@ +/* + * 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. + */ +#pragma once + +#include "../common/ann_types.hpp" + +#include +#include + +#include +#include +#include + +#include +#include +#include + +namespace cuvs::bench { + +diskann::Metric parse_metric_type(cuvs::bench::Metric metric) +{ + if (metric == cuvs::bench::Metric::kInnerProduct) { + return diskann::Metric::INNER_PRODUCT; + } else if (metric == cuvs::bench::Metric::kEuclidean) { + return diskann::Metric::L2; + } else { + throw std::runtime_error("currently only inner product and L2 supported for benchmarking"); + } +} + +template +class diskann_memory : public algo, public algo_gpu { + public: + struct BuildParam { + uint32_t R; + uint32_t L_build; + float alpha; + int num_threads = omp_get_num_procs(); + bool use_cuvs_cagra_graph; + uint32_t cagra_graph_degree; + uint32_t cagra_intermediate_graph_degree; + }; + + using typename ANN::AnnSearchParam; + struct SearchParam : public AnnSearchParam { + uint32_t L_search; + }; + + diskann_memory(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; + DiskANNMemory(const DiskANNMemory& other) = default; + std::unique_ptr> copy() override { return std::make_unique>(*this); } + + AlgoProperty get_preference() const override + { + AlgoProperty property; + property.dataset_memory_type = MemoryType::Host; + property.query_memory_type = MemoryType::Host; + return property; + } + + private: + 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_search_params_{nullptr}; + std::shared_ptr> diskann_index_{nullptr}; + // uint32_t L_load_; + uint32_t L_search_; + 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 +DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) + : ANN(metric, dim) +{ + assert(this->dim_ > 0); + auto 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; + + this->diskann_index_ = std::make_shared>(parse_metric_type(metric), + dim, + 10000000, + diskann_index_write_params, + nullptr, + 0, + false, + false, + false, + false, + this->build_pq_bytes_, + false, + false, + 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 * 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; + 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; + // 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); + // free intermediate graph before trying to create the index + intermediate_graph.reset(); + + 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()); + } +} + +template +void DiskANNMemory::set_search_param(const AnnSearchParam& param_) +{ + 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 +{ + // 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); + } + } 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); + } + } +} + +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) +{ + diskann_index_->load(path_to_index.c_str(), 80, 100); +} +}; // namespace raft::bench::ann \ No newline at end of file diff --git a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h new file mode 100644 index 000000000..4fc8889c8 --- /dev/null +++ b/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h @@ -0,0 +1,504 @@ +/* + * 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. + */ +#pragma once + +#include "../common/ann_types.hpp" + +#include +#include + +#include +#include +#include + +#include +#include +#include + +namespace cuvs::bench { + +diskann::Metric parse_metric_to_diskann(cuvs::bench::Metric metric) +{ + if (metric == cuvs::bench::Metric::kInnerProduct) { + return diskann::Metric::INNER_PRODUCT; + } else if (metric == cuvs::bench::Metric::kEuclidean) { + return diskann::Metric::L2; + } else { + throw std::runtime_error("currently only inner product and L2 supported for benchmarking"); + } +} + +template +class diskann_memory : public algo, public algo_gpu { + public: + struct build_param { + uint32_t R; + int num_threads = omp_get_num_procs(); + bool use_cuvs_cagra_graph; + uint32_t cagra_graph_degree; + uint32_t cagra_intermediate_graph_degree; + }; + + using typename algo::AnnSearchParam; + struct SearchParam : public AnnSearchParam { + uint32_t L_search; + }; + + diskann_memory(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; + diskann_memory(const diskann_memory& other) = default; + std::unique_ptr> copy() override + { + return std::make_unique>(*this); + } + + [[nodiscard]] auto get_preference() const -> algo_property override + { + algo_property property; + property.dataset_memory_type = MemoryType::kHost; + property.query_memory_type = MemoryType::kHost; + return property; + } + + private: + bool use_cagra_graph_; + bool use_pq_build_ = false; + uint32_t build_pq_bytes_ = 0; + std::shared_ptr> diskann_index_{nullptr}; + uint32_t L_search_; + uint32_t cagra_graph_degree_ = 64; + uint32_t cagra_intermediate_graph_degree_ = 128; + uint32_t max_points_; + // std::shared_ptr thread_pool_; + Mode metric_objective_; +}; + +template +diskann_memory::diskann_memory(Metric metric, int dim, const BuildParam& param) + : algo(metric, dim) +{ + assert(this->dim_ > 0); + auto 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; + cuvs::neighbors::cagra::index_params cuvs_cagra_index_params; + cuvs_cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; + cuvs_cagra_index_params.graph_degree = param.cagra_graph_degree; + + + this->diskann_index_ = std::make_shared>(parse_metric_to_diskann(metric), + dim, + 10000000, + diskann_index_write_params, + nullptr, + 0, + false, + false, + false, + false, + this->build_pq_bytes_, + false, + false, + param.use_cagra_graph, + param.cagra_graph_degree); +} + +template +void diskann_memory::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 * 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; + 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; + // 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); + // free intermediate graph before trying to create the index + intermediate_graph.reset(); + + 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()); + } +} + +template +void diskann_memory::set_search_param(const AnnSearchParam& param_) +{ + auto param = dynamic_cast(param_); + this->L_search_ = param.L_search; + metric_objective_ = param.metric_objective; +} + +template +void diskann_memory::search( + const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const +{ + // 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); + } + } 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); + } + } +} + +template +void diskann_memory::save(const std::string& path_to_index) const +{ + this->diskann_index_->save(path_to_index.c_str()); +} + +template +void diskann_memory::load(const std::string& path_to_index) +{ + diskann_index_->load(path_to_index.c_str(), 80, 100); +} + + +/******************************************************************* +*/ + +template +class DiskANNSSD : public ANN { + public: + struct BuildParam { + uint32_t R; + uint32_t L_build; + float alpha; + int num_threads = omp_get_num_procs(); + bool use_cagra_graph; + bool filtered_index; + uint32_t cagra_graph_degree; + uint32_t cagra_intermediate_graph_degree; + }; + + using typename ANN::AnnSearchParam; + struct SearchParam : public AnnSearchParam { + uint32_t L_search; + }; + + DiskANNSSD(Metric metric, int dim, const BuildParam& param); + + void build(const char* dataset_path, 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; + DiskANNSSD(const DiskANNSSD& other) = default; + std::unique_ptr> copy() override { return std::make_unique>(*this); } + + AlgoProperty get_preference() const override + { + AlgoProperty property; + property.dataset_memory_type = MemoryType::Host; + property.query_memory_type = MemoryType::Host; + return property; + } + + private: + 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_search_params_{nullptr}; + std::shared_ptr> diskann_index_{nullptr}; + // uint32_t L_load_; + uint32_t L_search_; + uint32_t cagra_graph_degree_ = 0; + uint32_t cagra_intermediate_graph_degree_; + // uint32_t max_points_; + // std::shared_ptr thread_pool_; + Objective metric_objective_; + uint32_t num_nodes_to_cache_; + std::unique_ptr> _pFlashIndex; +}; + +template +void diskann_ssd::build(std::string dataset_file, size_t nrow) +{ + this->diskann_index_.resize(nrow); + diskann_index_->build(dataset_file.c_str(), nrow); +} + +template +void diskann_ssd::set_search_param(const AnnSearchParam& param_) +{ + auto param = dynamic_cast(param_); + this->L_search_ = param.L_search; + metric_objective_ = param.metric_objective; +} + +template +void diskann_ssd::search( + const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const +{ + std::vector node_list; + _pFlashIndex->cache_bfs_levels(num_nodes_to_cache_, node_list); + _pFlashIndex->load_cache_list(node_list); + node_list.clear(); + node_list.shrink_to_fit(); + + 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++) { + _pFlashIndex->cached_beam_search(queries + (i * this->dim_), + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k, + 2); + } + } else { + for (int64_t i = 0; i < (int64_t)batch_size; i++) { + _pFlashIndex->cached_beam_search(queries + (i * this->dim_), + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k, + 2); + } + } +} + +template +void diskann_ssd::save(const std::string& path_to_index) const +{ + this->diskann_index_->save(path_to_index.c_str()); +} + +template +void diskann_ssd::load(const std::string& path_to_index) +{ + std::shared_ptr reader = nullptr; + reader.reset(new LinuxAlignedFileReader()); + int result = _pFlashIndex->load(omp_get_num_procs(), path_to_index.c_str()); +} + + +}; // namespace raft::bench::ann + +template +class DiskANNSSD : public ANN { + public: + struct BuildParam { + uint32_t R; + uint32_t L_build; + float alpha; + int num_threads = omp_get_num_procs(); + bool use_cagra_graph; + bool filtered_index; + uint32_t cagra_graph_degree; + uint32_t cagra_intermediate_graph_degree; + }; + + using typename ANN::AnnSearchParam; + struct SearchParam : public AnnSearchParam { + uint32_t L_search; + }; + + DiskANNSSD(Metric metric, int dim, const BuildParam& param); + + void build(const char* dataset_path, 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; + DiskANNSSD(const DiskANNSSD& other) = default; + std::unique_ptr> copy() override { return std::make_unique>(*this); } + + AlgoProperty get_preference() const override + { + AlgoProperty property; + property.dataset_memory_type = MemoryType::Host; + property.query_memory_type = MemoryType::Host; + return property; + } + + private: + 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_search_params_{nullptr}; + std::shared_ptr> diskann_index_{nullptr}; + // uint32_t L_load_; + uint32_t L_search_; + uint32_t cagra_graph_degree_ = 0; + uint32_t cagra_intermediate_graph_degree_; + // uint32_t max_points_; + // std::shared_ptr thread_pool_; + Objective metric_objective_; + uint32_t num_nodes_to_cache_; + std::unique_ptr> _pFlashIndex; +}; + +template +DiskANNSSD::DiskANNSSD(Metric metric, int dim, const BuildParam& param) : ANN(metric, dim) +{ + assert(this->dim_ > 0); + auto diskann_index_write_params = std::make_shared( + diskann::IndexWriteParametersBuilder(param.R, param.R) + .with_filter_list_size(0) + .with_alpha(1.2) + .with_saturate_graph(false) + .with_num_threads(param.num_threads) + .build()); + use_cagra_graph_ = param.use_cagra_graph; + build_pq_bytes_ = param.build_pq_bytes; + cuvs::neighbors::cagra::index_params cagra_index_params; + cagra_index_params.graph_degree = param.cagra_graph_degree; + cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; + cuvs::neighbors::cagra::graph_build_params::ivf_pq_params graph_build_params(raft::matrix_extents(n_row, this->dim_)); + cagra_index_params.graph_build_params graph_build_params = cuvs::neighbors::ivf_pq::index_params; + graph_build_params.pq_bits = 8; + graph_build_params.pq_dim = build_pq_bytes_; + + this->diskann_index_ = std::make_shared>(parse_metric_type(metric), + dim, + 0, + diskann_index_write_params, + nullptr, + 0, + false, + false, + false, + this->pq_dist_build_, + this->build_pq_bytes_, + false, + false, + param.use_cagra_graph, + cagra_index_params); +} + +template +void DiskANNSSD::build(std::string dataset_file, size_t nrow) +{ + this->diskann_index_.resize(nrow); + diskann_index_->build(dataset_file.c_str(), nrow); +} + +template +void DiskANNSSD::set_search_param(const AnnSearchParam& param_) +{ + auto param = dynamic_cast(param_); + this->L_search_ = param.L_search; + metric_objective_ = param.metric_objective; +} + +template +void DiskANNSSD::search( + const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const +{ + std::vector node_list; + _pFlashIndex->cache_bfs_levels(num_nodes_to_cache_, node_list); + _pFlashIndex->load_cache_list(node_list); + node_list.clear(); + node_list.shrink_to_fit(); + + 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++) { + _pFlashIndex->cached_beam_search(queries + (i * this->dim_), + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k, + 2); + } + } else { + for (int64_t i = 0; i < (int64_t)batch_size; i++) { + _pFlashIndex->cached_beam_search(queries + (i * this->dim_), + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k, + 2); + } + } +} + +template +void DiskANNSSD::save(const std::string& path_to_index) const +{ + this->diskann_index_->save(path_to_index.c_str()); +} + +template +void DiskANNSSD::load(const std::string& path_to_index) +{ + std::shared_ptr reader = nullptr; + reader.reset(new LinuxAlignedFileReader()); + int result = _pFlashIndex->load(omp_get_num_procs(), path_to_index.c_str()); +} \ No newline at end of file From 0bbbf0d66d5a5c491855f23bef933a5977790959 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 29 Jul 2024 15:52:26 -0700 Subject: [PATCH 02/58] make build --- cpp/bench/ann/CMakeLists.txt | 8 +- cpp/bench/ann/src/common/ann_types.hpp | 2 + cpp/bench/ann/src/common/benchmark.hpp | 14 +- cpp/bench/ann/src/common/dataset.hpp | 11 + .../diskann_benchmark.cu} | 0 .../diskann_wrapper.h} | 267 +--- cpp/cmake/patches/diskann.diff | 1163 +++++++++++++++++ cpp/cmake/patches/diskann_override.json | 9 + cpp/cmake/thirdparty/get_diskann.cmake | 51 + 9 files changed, 1315 insertions(+), 210 deletions(-) rename cpp/bench/ann/src/{cuvs/cuvs_cagra_diskann.cu => diskann/diskann_benchmark.cu} (100%) rename cpp/bench/ann/src/{cuvs/cuvs_cagra_diskann_wrapper.h => diskann/diskann_wrapper.h} (60%) create mode 100644 cpp/cmake/patches/diskann.diff create mode 100644 cpp/cmake/patches/diskann_override.json create mode 100644 cpp/cmake/thirdparty/get_diskann.cmake diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 236065b27..679a866e2 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -32,7 +32,7 @@ option(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benc option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" ON) option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) -option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN "Include cuVS CAGRA with DISKANN search in benchmark" ON) +option(CUVS_ANN_BENCH_USE_DISKANN "Include cuVS CAGRA with DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF ) @@ -83,7 +83,7 @@ if(CUVS_ANN_BENCH_USE_FAISS) include(cmake/thirdparty/get_faiss) endif() -if(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN) +if(CUVS_ANN_BENCH_USE_DISKANN) include(cmake/thirdparty/get_diskann) endif() @@ -300,8 +300,8 @@ if(CUVS_ANN_BENCH_USE_GGNN) ) endif() -if(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN) - ConfigureAnnBench(NAME DISKANN PATH src/diskann/cuvs_cagra_diskann.cu LINKS cuvs diskann::diskann) +if(CUVS_ANN_BENCH_USE_DISKANN) + ConfigureAnnBench(NAME DISKANN PATH src/diskann/diskann_benchmark.cu LINKS cuvs diskann::diskann) endif() # ################################################################################################## diff --git a/cpp/bench/ann/src/common/ann_types.hpp b/cpp/bench/ann/src/common/ann_types.hpp index 4b17885c0..22a4cc11e 100644 --- a/cpp/bench/ann/src/common/ann_types.hpp +++ b/cpp/bench/ann/src/common/ann_types.hpp @@ -127,6 +127,8 @@ class algo : public algo_base { virtual void build(const T* dataset, size_t nrow) = 0; + virtual void build(std::string dataset_file, size_t nrow); + virtual void set_search_param(const search_param& param) = 0; // TODO(snanditale): this assumes that an algorithm can always return k results. // This is not always possible. diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 5d7b8934f..2f12761d5 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -143,7 +143,10 @@ void bench_build(::benchmark::State& state, const auto algo_property = parse_algo_property(algo->get_preference(), index.build_param); - const T* base_set = dataset->base_set(algo_property.dataset_memory_type); + bool parse_base_file = (index.algo == "diskann_memory" || index.algo == "diskann_ssd"); + + const T* base_set; + if (parse_base_file) base_set = dataset->base_set(algo_property.dataset_memory_type); std::size_t index_size = dataset->base_set_size(); cuda_timer gpu_timer{algo}; @@ -153,7 +156,11 @@ void bench_build(::benchmark::State& state, [[maybe_unused]] auto ntx_lap = nvtx.lap(); [[maybe_unused]] auto gpu_lap = gpu_timer.lap(); try { - algo->build(base_set, index_size); + if (!parse_base_file) + algo->build(base_set, index_size); + else { + algo->build(dataset->base_filename(), index_size); + } } catch (const std::exception& e) { state.SkipWithError(std::string(e.what())); } @@ -416,7 +423,8 @@ inline void printf_usage() template void register_build(std::shared_ptr> dataset, std::vector indices, - bool force_overwrite) + bool force_overwrite, + bool disk_index) { for (auto index : indices) { auto suf = static_cast(index.build_param["override_suffix"]); diff --git a/cpp/bench/ann/src/common/dataset.hpp b/cpp/bench/ann/src/common/dataset.hpp index 95f1a82a2..9433b5574 100644 --- a/cpp/bench/ann/src/common/dataset.hpp +++ b/cpp/bench/ann/src/common/dataset.hpp @@ -114,6 +114,11 @@ class bin_file { } } + std::string file() const + { + return file_; + } + private: void check_suffix(); void open_file() const; @@ -378,6 +383,7 @@ class bin_dataset : public dataset { auto max_k() const -> uint32_t override; auto base_set_size() const -> size_t override; auto query_set_size() const -> size_t override; + std::string base_filename() const; private: void load_base_set() const; @@ -495,4 +501,9 @@ void bin_dataset::map_base_set() const this->mapped_base_set_ = base_file_.map(); } +template +std::string bin_dataset::base_filename() const { + return base_file_.file(); +} + } // namespace cuvs::bench diff --git a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cu similarity index 100% rename from cpp/bench/ann/src/cuvs/cuvs_cagra_diskann.cu rename to cpp/bench/ann/src/diskann/diskann_benchmark.cu diff --git a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h similarity index 60% rename from cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h rename to cpp/bench/ann/src/diskann/diskann_wrapper.h index 4fc8889c8..5b3a1deab 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -16,9 +16,10 @@ #pragma once #include "../common/ann_types.hpp" +#include "cuvs_ann_bench_utils.h" -#include #include +#include #include #include @@ -52,26 +53,23 @@ class diskann_memory : public algo, public algo_gpu { uint32_t cagra_intermediate_graph_degree; }; - using typename algo::AnnSearchParam; - struct SearchParam : public AnnSearchParam { + using search_param_base = typename algo::search_param; + struct search_param : public search_param_base { uint32_t L_search; }; - diskann_memory(Metric metric, int dim, const BuildParam& param); + diskann_memory(Metric metric, int dim, const build_param& param); void build(const T* dataset, size_t nrow) override; - void set_search_param(const AnnSearchParam& param) override; + void set_search_param(const search_param_base& 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; diskann_memory(const diskann_memory& other) = default; - std::unique_ptr> copy() override - { - return std::make_unique>(*this); - } + std::unique_ptr> copy() override { return std::make_unique>(*this); } [[nodiscard]] auto get_preference() const -> algo_property override { @@ -87,7 +85,7 @@ class diskann_memory : public algo, public algo_gpu { uint32_t build_pq_bytes_ = 0; std::shared_ptr> diskann_index_{nullptr}; uint32_t L_search_; - uint32_t cagra_graph_degree_ = 64; + uint32_t cagra_graph_degree_ = 64; uint32_t cagra_intermediate_graph_degree_ = 128; uint32_t max_points_; // std::shared_ptr thread_pool_; @@ -95,7 +93,7 @@ class diskann_memory : public algo, public algo_gpu { }; template -diskann_memory::diskann_memory(Metric metric, int dim, const BuildParam& param) +diskann_memory::diskann_memory(Metric metric, int dim, const build_param& param) : algo(metric, dim) { assert(this->dim_ > 0); @@ -112,8 +110,7 @@ diskann_memory::diskann_memory(Metric metric, int dim, const BuildParam& para cagra_intermediate_graph_degree_ = param.cagra_intermediate_graph_degree; cuvs::neighbors::cagra::index_params cuvs_cagra_index_params; cuvs_cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; - cuvs_cagra_index_params.graph_degree = param.cagra_graph_degree; - + cuvs_cagra_index_params.graph_degree = param.cagra_graph_degree; this->diskann_index_ = std::make_shared>(parse_metric_to_diskann(metric), dim, @@ -173,9 +170,9 @@ void diskann_memory::build(const T* dataset, size_t nrow) } template -void diskann_memory::set_search_param(const AnnSearchParam& param_) +void diskann_memory::set_search_param(const search_param_base& param_) { - auto param = dynamic_cast(param_); + auto param = dynamic_cast(param_); this->L_search_ = param.L_search; metric_objective_ = param.metric_objective; } @@ -185,7 +182,7 @@ void diskann_memory::search( const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const { // std::cout << "num_search_threads" << diskann_index_write_params_->num_threads << std::endl; - if (this->metric_objective_ == Objective::LATENCY) { + if (this->metric_objective_ == Mode::kLatency) { omp_set_num_threads(omp_get_num_procs()); #pragma omp parallel for for (int64_t i = 0; i < (int64_t)batch_size; i++) { @@ -218,14 +215,13 @@ void diskann_memory::load(const std::string& path_to_index) diskann_index_->load(path_to_index.c_str(), 80, 100); } - /******************************************************************* -*/ + */ template -class DiskANNSSD : public ANN { +class diskann_ssd : public algo { public: - struct BuildParam { + struct build_param { uint32_t R; uint32_t L_build; float alpha; @@ -236,12 +232,12 @@ class DiskANNSSD : public ANN { uint32_t cagra_intermediate_graph_degree; }; - using typename ANN::AnnSearchParam; + using typename algo::AnnSearchParam; struct SearchParam : public AnnSearchParam { uint32_t L_search; }; - DiskANNSSD(Metric metric, int dim, const BuildParam& param); + diskann_ssd(Metric metric, int dim, const build_param& param); void build(const char* dataset_path, size_t nrow) override; @@ -251,205 +247,68 @@ class DiskANNSSD : public ANN { void save(const std::string& path_to_index) const override; void load(const std::string& path_to_index) override; - DiskANNSSD(const DiskANNSSD& other) = default; - std::unique_ptr> copy() override { return std::make_unique>(*this); } + diskann_ssd(const diskann_ssd& other) = default; + std::unique_ptr> copy() override { return std::make_unique>(*this); } - AlgoProperty get_preference() const override + algo_property get_preference() const override { - AlgoProperty property; - property.dataset_memory_type = MemoryType::Host; - property.query_memory_type = MemoryType::Host; + algo_property property; + property.dataset_memory_type = MemoryType::kHost; + property.query_memory_type = MemoryType::kHost; return property; } private: - 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_search_params_{nullptr}; - std::shared_ptr> diskann_index_{nullptr}; - // uint32_t L_load_; - uint32_t L_search_; - uint32_t cagra_graph_degree_ = 0; + bool use_cagra_graph_; + std::shared_ptr diskann_index_write_params_{nullptr}; + uint32_t max_points_; + std::shared_ptr> mem_index_{nullptr}; + std::unique_ptr> p_flash_index_; + uint32_t cagra_graph_degree_; uint32_t cagra_intermediate_graph_degree_; - // uint32_t max_points_; + // std::shared_ptr thread_pool_; - Objective metric_objective_; + uint32_t L_search_; + Mode metric_objective_; uint32_t num_nodes_to_cache_; - std::unique_ptr> _pFlashIndex; }; template void diskann_ssd::build(std::string dataset_file, size_t nrow) { - this->diskann_index_.resize(nrow); - diskann_index_->build(dataset_file.c_str(), nrow); -} - -template -void diskann_ssd::set_search_param(const AnnSearchParam& param_) -{ - auto param = dynamic_cast(param_); - this->L_search_ = param.L_search; - metric_objective_ = param.metric_objective; -} - -template -void diskann_ssd::search( - const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const -{ - std::vector node_list; - _pFlashIndex->cache_bfs_levels(num_nodes_to_cache_, node_list); - _pFlashIndex->load_cache_list(node_list); - node_list.clear(); - node_list.shrink_to_fit(); - - 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++) { - _pFlashIndex->cached_beam_search(queries + (i * this->dim_), - static_cast(k), - L_search_, - neighbors + i * k, - distances + i * k, - 2); - } - } else { - for (int64_t i = 0; i < (int64_t)batch_size; i++) { - _pFlashIndex->cached_beam_search(queries + (i * this->dim_), - static_cast(k), - L_search_, - neighbors + i * k, - distances + i * k, - 2); - } - } -} - -template -void diskann_ssd::save(const std::string& path_to_index) const -{ - this->diskann_index_->save(path_to_index.c_str()); -} - -template -void diskann_ssd::load(const std::string& path_to_index) -{ - std::shared_ptr reader = nullptr; - reader.reset(new LinuxAlignedFileReader()); - int result = _pFlashIndex->load(omp_get_num_procs(), path_to_index.c_str()); -} - - -}; // namespace raft::bench::ann - -template -class DiskANNSSD : public ANN { - public: - struct BuildParam { - uint32_t R; - uint32_t L_build; - float alpha; - int num_threads = omp_get_num_procs(); - bool use_cagra_graph; - bool filtered_index; - uint32_t cagra_graph_degree; - uint32_t cagra_intermediate_graph_degree; - }; - - using typename ANN::AnnSearchParam; - struct SearchParam : public AnnSearchParam { - uint32_t L_search; - }; - - DiskANNSSD(Metric metric, int dim, const BuildParam& param); - - void build(const char* dataset_path, 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; - DiskANNSSD(const DiskANNSSD& other) = default; - std::unique_ptr> copy() override { return std::make_unique>(*this); } - - AlgoProperty get_preference() const override - { - AlgoProperty property; - property.dataset_memory_type = MemoryType::Host; - property.query_memory_type = MemoryType::Host; - return property; + std::shared_ptr cagra_index_params_ptr{nullptr}; + if (use_cagra_graph_) { + cuvs::neighbors::cagra::index_params cagra_index_params; + cagra_index_params.graph_degree = cagra_graph_degree_; + cagra_index_params.intermediate_graph_degree = cagra_intermediate_graph_degree_; + auto ivf_pq_params = cuvs::neighbors::cagra::graph_build_params::ivf_pq_params( + raft::matrix_extent(nrow, this->dim_), parse_metric_type(this->metric_)); + if (build_pq_bytes_ > 0) ivf_pq_params.build_params.pq_dim = build_pq_bytes_; + ivf_pq_params.build_params.pq_bits = 8; + cagra_index_params.graph_build_params = ivf_pq_params; + cagra_index_params_ptr.reset(&cagra_index_params); } - - private: - 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_search_params_{nullptr}; - std::shared_ptr> diskann_index_{nullptr}; - // uint32_t L_load_; - uint32_t L_search_; - uint32_t cagra_graph_degree_ = 0; - uint32_t cagra_intermediate_graph_degree_; - // uint32_t max_points_; - // std::shared_ptr thread_pool_; - Objective metric_objective_; - uint32_t num_nodes_to_cache_; - std::unique_ptr> _pFlashIndex; -}; - -template -DiskANNSSD::DiskANNSSD(Metric metric, int dim, const BuildParam& param) : ANN(metric, dim) -{ - assert(this->dim_ > 0); - auto diskann_index_write_params = std::make_shared( - diskann::IndexWriteParametersBuilder(param.R, param.R) - .with_filter_list_size(0) - .with_alpha(1.2) - .with_saturate_graph(false) - .with_num_threads(param.num_threads) - .build()); - use_cagra_graph_ = param.use_cagra_graph; - build_pq_bytes_ = param.build_pq_bytes; - cuvs::neighbors::cagra::index_params cagra_index_params; - cagra_index_params.graph_degree = param.cagra_graph_degree; - cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; - cuvs::neighbors::cagra::graph_build_params::ivf_pq_params graph_build_params(raft::matrix_extents(n_row, this->dim_)); - cagra_index_params.graph_build_params graph_build_params = cuvs::neighbors::ivf_pq::index_params; - graph_build_params.pq_bits = 8; - graph_build_params.pq_dim = build_pq_bytes_; - - this->diskann_index_ = std::make_shared>(parse_metric_type(metric), - dim, - 0, - diskann_index_write_params, + this->mem_index_ = std::make_shared>(parse_metric_to_diskann(this->metric_), + this->dim_, + nrow, + diskann_index_write_params_, nullptr, 0, false, false, false, - this->pq_dist_build_, + build_pq_bytes_ > 0, this->build_pq_bytes_, false, false, - param.use_cagra_graph, - cagra_index_params); + use_cagra_graph_, + cagra_index_params_ptr); + this->mem_index_->build(dataset_file.c_str(), nrow); } template -void DiskANNSSD::build(std::string dataset_file, size_t nrow) -{ - this->diskann_index_.resize(nrow); - diskann_index_->build(dataset_file.c_str(), nrow); -} - -template -void DiskANNSSD::set_search_param(const AnnSearchParam& param_) +void diskann_ssd::set_search_param(const AnnSearchParam& param_) { auto param = dynamic_cast(param_); this->L_search_ = param.L_search; @@ -457,12 +316,12 @@ void DiskANNSSD::set_search_param(const AnnSearchParam& param_) } template -void DiskANNSSD::search( +void diskann_ssd::search( const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const { std::vector node_list; - _pFlashIndex->cache_bfs_levels(num_nodes_to_cache_, node_list); - _pFlashIndex->load_cache_list(node_list); + p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); + p_flash_index_->load_cache_list(node_list); node_list.clear(); node_list.shrink_to_fit(); @@ -470,7 +329,7 @@ void DiskANNSSD::search( omp_set_num_threads(omp_get_num_procs()); #pragma omp parallel for for (int64_t i = 0; i < (int64_t)batch_size; i++) { - _pFlashIndex->cached_beam_search(queries + (i * this->dim_), + p_flash_index_->cached_beam_search(queries + (i * this->dim_), static_cast(k), L_search_, neighbors + i * k, @@ -479,7 +338,7 @@ void DiskANNSSD::search( } } else { for (int64_t i = 0; i < (int64_t)batch_size; i++) { - _pFlashIndex->cached_beam_search(queries + (i * this->dim_), + p_flash_index_->cached_beam_search(queries + (i * this->dim_), static_cast(k), L_search_, neighbors + i * k, @@ -490,15 +349,17 @@ void DiskANNSSD::search( } template -void DiskANNSSD::save(const std::string& path_to_index) const +void diskann_ssd::save(const std::string& path_to_index) const { this->diskann_index_->save(path_to_index.c_str()); } template -void DiskANNSSD::load(const std::string& path_to_index) +void diskann_ssd::load(const std::string& path_to_index) { std::shared_ptr reader = nullptr; reader.reset(new LinuxAlignedFileReader()); - int result = _pFlashIndex->load(omp_get_num_procs(), path_to_index.c_str()); -} \ No newline at end of file + int result = p_flash_index_->load(omp_get_num_procs(), path_to_index.c_str()); +} + +}; // namespace cuvs::bench diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff new file mode 100644 index 000000000..5ed5eb659 --- /dev/null +++ b/cpp/cmake/patches/diskann.diff @@ -0,0 +1,1163 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d3d2b8..6496b15 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,6 +23,25 @@ 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) ++ ++rapids_cpm_init() ++ + if(NOT MSVC) + set(CMAKE_CXX_COMPILER g++) + endif() +@@ -286,7 +305,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 +319,6 @@ else() + endif() + + add_subdirectory(src) +-if (NOT PYBIND) +- add_subdirectory(apps) +- add_subdirectory(apps/utils) +-endif() + + if (UNIT_TEST) + enable_testing() +@@ -331,3 +346,7 @@ include(clang-format.cmake) + if(PYBIND) + add_subdirectory(python) + endif() ++ ++if(NOT TARGET cuvs::cuvs) ++ find_package(cuvs) ++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/build_memory_index.cpp b/apps/build_memory_index.cpp +index 544e42d..eedb04e 100644 +--- a/apps/build_memory_index.cpp ++++ b/apps/build_memory_index.cpp +@@ -1,6 +1,7 @@ + // Copyright (c) Microsoft Corporation. All rights reserved. + // Licensed under the MIT license. + ++#include + #include + #include + #include +@@ -27,7 +28,7 @@ int main(int argc, char **argv) + std::string data_type, dist_fn, data_path, index_path_prefix, label_file, universal_label, label_type; + uint32_t num_threads, R, L, Lf, build_PQ_bytes; + float alpha; +- bool use_pq_build, use_opq; ++ bool use_pq_build, use_opq, cuvs_cagra_index; + + po::options_description desc{ + program_options_utils::make_program_description("build_memory_index", "Build a memory-based DiskANN index.")}; +@@ -70,6 +71,8 @@ int main(int argc, char **argv) + program_options_utils::FILTERED_LBUILD); + optional_configs.add_options()("label_type", po::value(&label_type)->default_value("uint"), + program_options_utils::LABEL_TYPE_DESCRIPTION); ++ optional_configs.add_options()("cuvs_cagra_index", po::value(&cuvs_cagra_index)->default_value(true), ++ program_options_utils::cuvs_cagra_INDEX); + + // Merge required and optional parameters + desc.add(required_configs).add(optional_configs); +@@ -146,6 +149,7 @@ int main(int argc, char **argv) + .is_use_opq(use_opq) + .is_pq_dist_build(use_pq_build) + .with_num_pq_chunks(build_PQ_bytes) ++ .is_cuvs_cagra_index(cuvs_cagra_index) + .build(); + + auto index_factory = diskann::IndexFactory(config); +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/apps/search_disk_index.cpp b/apps/search_disk_index.cpp +index 7e2a7ac..538b55a 100644 +--- a/apps/search_disk_index.cpp ++++ b/apps/search_disk_index.cpp +@@ -179,7 +179,7 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre + std::string recall_string = "Recall@" + std::to_string(recall_at); + diskann::cout << std::setw(6) << "L" << std::setw(12) << "Beamwidth" << std::setw(16) << "QPS" << std::setw(16) + << "Mean Latency" << std::setw(16) << "99.9 Latency" << std::setw(16) << "Mean IOs" << std::setw(16) +- << "CPU (s)"; ++ << "CPU (s)" << std::setw(16) << "n_hops" << std::setw(16) << "n_cmps"; + if (calc_recall_flag) + { + diskann::cout << std::setw(16) << recall_string << std::endl; +@@ -269,6 +269,12 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre + + auto mean_cpuus = diskann::get_mean_stats(stats, query_num, + [](const diskann::QueryStats &stats) { return stats.cpu_us; }); ++ ++ auto mean_n_hops = diskann::get_mean_stats(stats, query_num, ++ [](const diskann::QueryStats &stats) { return stats.n_hops; }); ++ ++ auto mean_n_cmps = diskann::get_mean_stats(stats, query_num, ++ [](const diskann::QueryStats &stats) { return stats.n_cmps; }); + + double recall = 0; + if (calc_recall_flag) +@@ -280,7 +286,7 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre + + diskann::cout << std::setw(6) << L << std::setw(12) << optimized_beamwidth << std::setw(16) << qps + << std::setw(16) << mean_latency << std::setw(16) << latency_999 << std::setw(16) << mean_ios +- << std::setw(16) << mean_cpuus; ++ << std::setw(16) << mean_cpuus << std::setw(16) << mean_n_hops << std::setw(16) << mean_n_cmps; + if (calc_recall_flag) + { + diskann::cout << std::setw(16) << recall << std::endl; +diff --git a/cmake/thirdparty/fetch_rapids.cmake b/cmake/thirdparty/fetch_rapids.cmake +new file mode 100644 +index 0000000..2703ec4 +--- /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.08") ++ ++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/grid_search_disk_index_build.py b/grid_search_disk_index_build.py +new file mode 100644 +index 0000000..5c76f9f +--- /dev/null ++++ b/grid_search_disk_index_build.py +@@ -0,0 +1,120 @@ ++import subprocess ++import os ++import itertools ++ ++params = { ++ 'R': [64, 96], ++ 'Lb': [64, 128, 256, 384], ++ 'use_cagra_graph': [False], ++ 'QD' : [192] ++} ++ ++params_cagra = { ++ 'R': [64, 96], ++ 'use_cagra_graph': [True], ++ 'cagra_graph_degree': [32, 64, 96], ++ 'cagra_intermediate_graph_degree': [64, 96, 128], ++ 'QD' : [192] ++} ++ ++# Define the constraints ++constraints = [ ++ lambda x: x['R'] <= x['Lb'], ++ # lambda x: x['R'] == 96 or (x['R'] == 64 and x['Lb'] == 384) ++] ++ ++cagra_constraints = [ ++ lambda x: x['cagra_graph_degree'] <= x['R'] and x['cagra_graph_degree'] <= x['cagra_intermediate_graph_degree'] ++] ++ ++output_dir = '/datasets/tarangj/datasets/wiki_all_1M/DiskANNSSD' ++ssd_builder_path = os.path.join("/home/nfs/tarangj/DiskANN/build", "apps", "build_disk_index") ++vectors_bin_path = '/datasets/tarangj/datasets/wiki_all_1M/base.1M.fbin' ++ ++# Define a function to generate the output file name ++def generate_output_file(dir, params): ++ if not params['use_cagra_graph']: ++ print("here in generate_output_file") ++ output_file = f"diskann.R{params['R']}.Lb{params['Lb']}.QD{params['QD']}.use_cagra_graphFalse" ++ else: ++ output_file = f"diskann.R{params['R']}.QD{params['QD']}.use_cagra_graphTrue.cagra_graph_degree{params['cagra_graph_degree']}.cagra_intermediate_graph_degree{params['cagra_intermediate_graph_degree']}" ++ print("output_file", output_file) ++ return os.path.join(dir, output_file) ++ ++count = 0 ++# Run the grid search ++for combo in itertools.product(*params.values()): ++ # if count > 0: ++ # continue ++ # Create a dictionary from the combination ++ combo_dict = dict(zip(params.keys(), combo)) ++ ++ # Check the constraints ++ if all(constraint(combo_dict) for constraint in constraints): ++ # Generate the output file name ++ output_file = generate_output_file(output_dir, combo_dict) ++ ++ args = [ ++ ssd_builder_path, ++ "--data_type", "float", ++ "--dist_fn", "l2", ++ "--data_path", vectors_bin_path, ++ "--index_path_prefix", output_file, ++ "-R", str(combo_dict["R"]), ++ "-L", str(combo_dict["Lb"]), ++ "--QD", str(combo_dict["QD"]), ++ "--search_DRAM_budget", "100", ++ "--build_DRAM_budget", "100", ++ "--num_threads", "80", ++ "--build_PQ_bytes", str(combo_dict["QD"]), ++ # "--use_cuvs_cagra_graph", "false" ++ ] ++ ++ completed = subprocess.run(args, timeout=3600) ++ ++ output_file ++ ++ if completed.returncode != 0: ++ command_run = " ".join(args) ++ raise Exception(f"Unable to build a disk index with the command: '{command_run}'\ncompleted_process: {completed}\nstdout: {completed.stdout}\nstderr: {completed.stderr}") ++ # count += 1 ++ ++# Run the grid search ++count = 0 ++for combo in itertools.product(*params_cagra.values()): ++ # if count > 0: ++ # continue ++ print("here") ++ # Create a dictionary from the combination ++ combo_dict = dict(zip(params_cagra.keys(), combo)) ++ ++ # Check the constraints ++ if all(constraint(combo_dict) for constraint in cagra_constraints): ++ # Generate the output file name ++ output_file = generate_output_file(output_dir, combo_dict) ++ ++ args = [ ++ ssd_builder_path, ++ "--data_type", "float", ++ "--dist_fn", "l2", ++ "--data_path", vectors_bin_path, ++ "--index_path_prefix", output_file, ++ "-R", str(combo_dict["R"]), ++ "-L", "128", ++ "--QD", str(combo_dict["QD"]), ++ "--search_DRAM_budget", "100", ++ "--build_DRAM_budget", "100", ++ "--num_threads", "80", ++ "--build_PQ_bytes", str(combo_dict["QD"]), ++ "--use_cuvs_cagra_graph", "true" ++ ] ++ ++ completed = subprocess.run(args, timeout=3600) ++ ++ output_file ++ ++ if completed.returncode != 0: ++ command_run = " ".join(args) ++ raise Exception(f"Unable to build a disk index with the command: '{command_run}'\ncompleted_process: {completed}\nstdout: {completed.stdout}\nstderr: {completed.stderr}") ++ ++ # count += 1 +\ No newline at end of file +diff --git a/include/disk_utils.h b/include/disk_utils.h +index 08f046d..dc468d6 100644 +--- a/include/disk_utils.h ++++ b/include/disk_utils.h +@@ -82,7 +82,7 @@ DISKANN_DLLEXPORT int build_merged_vamana_index(std::string base_file, diskann:: + uint32_t num_threads, bool use_filters = false, + const std::string &label_file = std::string(""), + const std::string &labels_to_medoids_file = std::string(""), +- const std::string &universal_label = "", const uint32_t Lf = 0); ++ const std::string &universal_label = "", const uint32_t Lf = 0, bool use_cuvs_cagra_graph = false); + + template + DISKANN_DLLEXPORT uint32_t optimize_beamwidth(std::unique_ptr> &_pFlashIndex, +@@ -98,7 +98,8 @@ DISKANN_DLLEXPORT int build_disk_index( + bool use_filters = false, + const std::string &label_file = std::string(""), // default is empty string for no label_file + const std::string &universal_label = "", const uint32_t filter_threshold = 0, +- const uint32_t Lf = 0); // default is empty string for no universal label ++ const uint32_t Lf = 0, ++ bool use_cuvs_cagra_graph = false); // default is empty string for no universal label + + template + DISKANN_DLLEXPORT void create_disk_layout(const std::string base_file, const std::string mem_index_file, +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/in_mem_data_store.h b/include/in_mem_data_store.h +index d1ad795..e04f744 100644 +--- a/include/in_mem_data_store.h ++++ b/include/in_mem_data_store.h +@@ -70,9 +70,10 @@ template class InMemDataStore : public AbstractDataStore class InMemDataStore : public AbstractDataStore _pre_computed_norms; + }; + +-} // namespace diskann +\ No newline at end of file ++} // namespace diskann +diff --git a/include/index.h b/include/index.h +index b9bf4f3..e365fdc 100644 +--- a/include/index.h ++++ b/include/index.h +@@ -29,6 +29,11 @@ + #define EXPAND_IF_FULL 0 + #define DEFAULT_MAXC 750 + ++// namespace cuvs::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 cuvs_cagra_index = false, const std::shared_ptr cuvs_cagra_index_params = nullptr); + + DISKANN_DLLEXPORT ~Index(); + +@@ -236,6 +241,11 @@ template clas + Index(const Index &) = delete; + Index &operator=(const Index &) = delete; + ++ // Build the raft CAGRA index ++ void build_cuvs_cagra_index(const T* data); ++ ++ void build_cuvs_cagra_index_quantized(const uint8_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 +296,8 @@ template clas + // Acquire exclusive _update_lock before calling + void link(); + ++ void add_cuvs_cagra_nbrs(); ++ + // Acquire exclusive _tag_lock and _delete_lock before calling + int reserve_location(); + +@@ -444,5 +456,9 @@ template clas + std::vector _locks; + + static const float INDEX_GROWTH_FACTOR; ++ ++ bool _cuvs_cagra_index = true; ++ std::shared_ptr _cuvs_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..3393747 100644 +--- a/include/index_config.h ++++ b/include/index_config.h +@@ -1,5 +1,8 @@ + #include "common_includes.h" + #include "parameters.h" ++#include ++ ++#include + + namespace diskann + { +@@ -41,18 +44,23 @@ struct IndexConfig + // Params for searching index + std::shared_ptr index_search_params; + ++ bool cuvs_cagra_index; ++ std::shared_ptr cuvs_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 cuvs_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 cuvs_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), cuvs_cagra_index(cuvs_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), cuvs_cagra_index_params{cuvs_cagra_index_params} + { + } + +@@ -194,6 +202,18 @@ class IndexConfigBuilder + return *this; + } + ++ IndexConfigBuilder &is_cuvs_cagra_index(bool is_cuvs_cagra_index) ++ { ++ this->_cuvs_cagra_index = is_cuvs_cagra_index; ++ return *this; ++ } ++ ++ IndexConfigBuilder &with_cuvs_cagra_index_params(std::shared_ptr cuvs_cagra_index_params_ptr) ++ { ++ this->_cuvs_cagra_index_params = cuvs_cagra_index_params_ptr; ++ return *this; ++ } ++ + IndexConfig build() + { + if (_data_type == "" || _data_type.empty()) +@@ -219,8 +239,8 @@ 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, +- _use_opq, _filtered_index, _data_type, _tag_type, _label_type, _index_write_params, +- _index_search_params); ++ _use_opq, _filtered_index, _cuvs_cagra_index, _data_type, _tag_type, _label_type, _index_write_params, ++ _index_search_params, _cuvs_cagra_index_params); + } + + IndexConfigBuilder(const IndexConfigBuilder &) = delete; +@@ -240,6 +260,7 @@ class IndexConfigBuilder + bool _concurrent_consolidate = false; + bool _use_opq = false; + bool _filtered_index{defaults::HAS_LABELS}; ++ bool _cuvs_cagra_index = true; + + size_t _num_pq_chunks = 0; + size_t _num_frozen_pts{defaults::NUM_FROZEN_POINTS_STATIC}; +@@ -250,5 +271,6 @@ class IndexConfigBuilder + + std::shared_ptr _index_write_params; + std::shared_ptr _index_search_params; ++ std::shared_ptr _cuvs_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/program_options_utils.hpp b/include/program_options_utils.hpp +index 2be6059..fb6be55 100644 +--- a/include/program_options_utils.hpp ++++ b/include/program_options_utils.hpp +@@ -77,5 +77,6 @@ const char *UNIVERSAL_LABEL = + "in the labels file instead of listing all labels for a node. DiskANN will not automatically assign a " + "universal label to a node."; + const char *FILTERED_LBUILD = "Build complexity for filtered points, higher value results in better graphs"; ++const char *RAFT_CAGRA_INDEX = "Use the raft CAGRA graph instead of the Vamana graph"; + + } // namespace program_options_utils +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..2278b27 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 cuvs) ++ target_link_libraries(${PROJECT_NAME}_s PRIVATE cuvs) + endif() + + if (NOT MSVC) +diff --git a/src/disk_utils.cpp b/src/disk_utils.cpp +index 0165602..dee8675 100644 +--- a/src/disk_utils.cpp ++++ b/src/disk_utils.cpp +@@ -2,6 +2,7 @@ + // Licensed under the MIT license. + + #include "common_includes.h" ++#include "pq_common.h" + + #if defined(DISKANN_RELEASE_UNUSED_TCMALLOC_MEMORY_AT_CHECKPOINTS) && defined(DISKANN_BUILD) + #include "gperftools/malloc_extension.h" +@@ -127,6 +128,7 @@ size_t calculate_num_pq_chunks(double final_index_ram_limit, size_t points_num, + num_pq_chunks = num_pq_chunks > dim ? dim : num_pq_chunks; + num_pq_chunks = num_pq_chunks > MAX_PQ_CHUNKS ? MAX_PQ_CHUNKS : num_pq_chunks; + ++ std::cout << "num_pq_chunks" << num_pq_chunks << "MAX_PQ_CHUNKS" << MAX_PQ_CHUNKS << std::endl; + diskann::cout << "Compressing " << dim << "-dimensional data into " << num_pq_chunks << " bytes per vector." + << std::endl; + return num_pq_chunks; +@@ -630,8 +632,9 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr + std::string medoids_file, std::string centroids_file, size_t build_pq_bytes, bool use_opq, + uint32_t num_threads, bool use_filters, const std::string &label_file, + const std::string &labels_to_medoids_file, const std::string &universal_label, +- const uint32_t Lf) ++ const uint32_t Lf, bool use_cuvs_cagra_graph) + { ++ std::cout << "inside build_merged_vamana_index" << std::endl; + size_t base_num, base_dim; + diskann::get_bin_metadata(base_file, base_num, base_dim); + +@@ -652,7 +655,7 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr + diskann::Index _index(compareMetric, base_dim, base_num, + std::make_shared(paras), nullptr, + defaults::NUM_FROZEN_POINTS_STATIC, false, false, false, +- build_pq_bytes > 0, build_pq_bytes, use_opq, use_filters); ++ build_pq_bytes > 0, build_pq_bytes, use_opq, use_filters, use_cuvs_cagra_graph); + if (!use_filters) + _index.build(base_file.c_str(), base_num); + else +@@ -723,7 +726,7 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr + diskann::Index _index(compareMetric, shard_base_dim, shard_base_pts, + std::make_shared(low_degree_params), nullptr, + defaults::NUM_FROZEN_POINTS_STATIC, false, false, false, build_pq_bytes > 0, +- build_pq_bytes, use_opq); ++ build_pq_bytes, use_opq, use_cuvs_cagra_graph); + if (!use_filters) + { + _index.build(shard_base_file.c_str(), shard_base_pts); +@@ -1101,8 +1104,9 @@ template + int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, + diskann::Metric compareMetric, bool use_opq, const std::string &codebook_prefix, bool use_filters, + const std::string &label_file, const std::string &universal_label, const uint32_t filter_threshold, +- const uint32_t Lf) ++ const uint32_t Lf, bool use_cuvs_cagra_graph) + { ++ std::cout << "inside build_disk_index: use_cuvs_cagra_graph: " << use_cuvs_cagra_graph << std::endl; + std::stringstream parser; + parser << std::string(indexBuildParameters); + std::string cur_param; +@@ -1289,7 +1293,9 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const + Timer timer; + diskann::get_bin_metadata(data_file_to_use.c_str(), points_num, dim); + const double p_val = ((double)MAX_PQ_TRAINING_SET_SIZE / (double)points_num); +- ++ ++ if (!use_cuvs_cagra_graph) { ++ std::cout << "entered !use_cuvs_cagra_graph if block" << std::endl; + if (use_disk_pq) + { + generate_disk_quantized_data(data_file_to_use, disk_pq_pivots_path, disk_pq_compressed_vectors_path, +@@ -1309,12 +1315,14 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const + num_pq_chunks = atoi(param_list[8].c_str()); + } + ++ std::cout << "line 1318" << "num_pq_chunks" << num_pq_chunks << "MAX_PQ_CHUNKS" << MAX_PQ_CHUNKS << std::endl; + diskann::cout << "Compressing " << dim << "-dimensional data into " << num_pq_chunks << " bytes per vector." + << std::endl; + + generate_quantized_data(data_file_to_use, pq_pivots_path, pq_compressed_vectors_path, compareMetric, p_val, + num_pq_chunks, use_opq, codebook_prefix); + diskann::cout << timer.elapsed_seconds_for_step("generating quantized data") << std::endl; ++} + + // Gopal. Splitting diskann_dll into separate DLLs for search and build. + // This code should only be available in the "build" DLL. +@@ -1323,10 +1331,11 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const + #endif + // Whether it is cosine or inner product, we still L2 metric due to the pre-processing. + timer.reset(); ++ std::cout << "now running build_merged_vamana_index" << std::endl; + diskann::build_merged_vamana_index(data_file_to_use.c_str(), diskann::Metric::L2, L, R, p_val, + indexing_ram_budget, mem_index_path, medoids_path, centroids_path, + build_pq_bytes, use_opq, num_threads, use_filters, labels_file_to_use, +- labels_to_medoids_path, universal_label, Lf); ++ labels_to_medoids_path, universal_label, Lf, use_cuvs_cagra_graph); + diskann::cout << timer.elapsed_seconds_for_step("building merged vamana index") << std::endl; + + timer.reset(); +@@ -1432,21 +1441,21 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da + const std::string &codebook_prefix, bool use_filters, + const std::string &label_file, + const std::string &universal_label, +- const uint32_t filter_threshold, const uint32_t Lf); ++ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, + const char *indexBuildParameters, + diskann::Metric compareMetric, bool use_opq, + const std::string &codebook_prefix, bool use_filters, + const std::string &label_file, + const std::string &universal_label, +- const uint32_t filter_threshold, const uint32_t Lf); ++ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, + const char *indexBuildParameters, + diskann::Metric compareMetric, bool use_opq, + const std::string &codebook_prefix, bool use_filters, + const std::string &label_file, + const std::string &universal_label, +- const uint32_t filter_threshold, const uint32_t Lf); ++ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); + // LabelT = uint16 + template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, + const char *indexBuildParameters, +@@ -1454,51 +1463,51 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da + const std::string &codebook_prefix, bool use_filters, + const std::string &label_file, + const std::string &universal_label, +- const uint32_t filter_threshold, const uint32_t Lf); ++ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, + const char *indexBuildParameters, + diskann::Metric compareMetric, bool use_opq, + const std::string &codebook_prefix, bool use_filters, + const std::string &label_file, + const std::string &universal_label, +- const uint32_t filter_threshold, const uint32_t Lf); ++ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, + const char *indexBuildParameters, + diskann::Metric compareMetric, bool use_opq, + const std::string &codebook_prefix, bool use_filters, + const std::string &label_file, + const std::string &universal_label, +- const uint32_t filter_threshold, const uint32_t Lf); ++ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); + + template DISKANN_DLLEXPORT int build_merged_vamana_index( + std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, + double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, + size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, +- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_merged_vamana_index( + std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, + double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, + size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, +- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_merged_vamana_index( + std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, + double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, + size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, +- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); + // Label=16_t + template DISKANN_DLLEXPORT int build_merged_vamana_index( + std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, + double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, + size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, +- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_merged_vamana_index( + std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, + double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, + size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, +- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); + template DISKANN_DLLEXPORT int build_merged_vamana_index( + std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, + double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, + size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, +- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); + }; // namespace diskann +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.cpp +index bf93344..c7a3c96 100644 +--- a/src/index.cpp ++++ b/src/index.cpp +@@ -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 + { ++ ++cuvs::distance::DistanceType parse_metric_to_cuvs(diskann::Metric m) ++{ ++ switch (m) ++ { ++ case diskann::Metric::L2: ++ return cuvs::distance::DistanceType::L2Expanded; ++ case diskann::Metric::INNER_PRODUCT: ++ return cuvs::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,8 +55,11 @@ 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), ++ _cuvs_cagra_index(index_config.cuvs_cagra_index) + { ++ std::cout << "inside params function index_config.cuvs_cagra_index" << index_config.cuvs_cagra_index ++ << " _cuvs_cagra_index " << _cuvs_cagra_index << std::endl; + if (_dynamic_index && !_enable_tags) + { + throw ANNException("ERROR: Dynamic Indexing must have tags enabled.", -1, __FUNCSIG__, __FILE__, __LINE__); +@@ -109,6 +129,21 @@ Index::Index(const IndexConfig &index_config, std::shared_ptrget_dims()); + } + } ++ ++ if (_cuvs_cagra_index) ++ { ++ if (index_config.cuvs_cagra_index_params != nullptr) ++ { ++ assert(parse_metric_to_cuvs(dist_metric) == cuvs_cagra_index_params->metric); ++ _cuvs_cagra_index_params = index_config.cuvs_cagra_index_params; ++ } ++ else ++ { ++ cuvs::neighbors::cagra::index_params cuvs_cagra_index_params; ++ cuvs_cagra_index_params.metric = parse_metric_to_cuvs(_dist_metric); ++ _cuvs_cagra_index_params = std::make_shared(cuvs_cagra_index_params); ++ } ++ } + } + + template +@@ -117,7 +152,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 cuvs_cagra_index, ++ const std::shared_ptr cuvs_cagra_index_params) + : Index( + IndexConfigBuilder() + .with_metric(m) +@@ -134,6 +170,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_cuvs_cagra_index(cuvs_cagra_index) ++ .with_cuvs_cagra_index_params(cuvs_cagra_index_params) + .build(), + IndexFactory::construct_datastore(DataStoreStrategy::MEMORY, + (max_points == 0 ? (size_t)1 : max_points) + +@@ -145,7 +183,9 @@ Index::Index(Metric m, const size_t dim, const size_t max_point + (size_t)((index_parameters == nullptr ? 0 : index_parameters->max_degree) * + defaults::GRAPH_SLACK_FACTOR * 1.05))) + { +- if (_pq_dist) ++ std::cout << "inside index build cuvs_cagra_index: " << cuvs_cagra_index ++ << " _cuvs_cagra_index: " << _cuvs_cagra_index << std::endl; ++ if (_pq_dist && !cuvs_cagra_index) + { + _pq_data_store = IndexFactory::construct_pq_datastore(DataStoreStrategy::MEMORY, max_points + num_frozen_pts, + dim, m, num_pq_chunks, use_opq); +@@ -732,6 +772,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 +780,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 +881,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) + { +@@ -1270,6 +1314,7 @@ void Index::inter_insert(uint32_t n, std::vector &pru + + template void Index::link() + { ++ std::cout << "inside link()" << std::endl; + uint32_t num_threads = _indexingThreads; + if (num_threads != 0) + omp_set_num_threads(num_threads); +@@ -1371,6 +1416,57 @@ template void Index void Index::add_cuvs_cagra_nbrs() ++{ ++ std::cout << "add_cuvs_cagra_neighbors" << std::endl; ++ 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 +1544,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 +1599,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::build_cuvs_cagra_index(const T *data) ++{ ++ raft::device_resources handle; ++ auto dataset_view = raft::make_host_matrix_view(data, int64_t(_nd), _dim); ++ auto cuvs_index = cuvs::neighbors::cagra::build(handle, *_cuvs_cagra_index_params, dataset_view); ++ auto stream = handle.get_stream(); ++ auto device_graph = cuvs_index.graph(); ++ host_cagra_graph.resize(device_graph.extent(0) * device_graph.extent(1)); ++ ++ thrust::copy(handle.get_thrust_policy(), 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 +1651,14 @@ void Index::build_with_data_populated(const std::vector & + } + + generate_frozen_point(); +- link(); ++ if (_cuvs_cagra_index) ++ { ++ add_cuvs_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 +1675,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,7 +1714,12 @@ 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); ++ if (_cuvs_cagra_index) ++ build_cuvs_cagra_index(data); ++ else ++ { ++ build_with_data_populated(tags); ++ } + } + + template +@@ -1657,7 +1779,7 @@ void Index::build(const char *filename, const size_t num_points + + // REFACTOR PQ TODO: We can remove this if and add a check in the InMemDataStore + // to not populate_data if it has been called once. +- if (_pq_dist) ++ if (_pq_dist && !_cuvs_cagra_index) + { + #ifdef EXEC_ENV_OLS + std::stringstream ss; +@@ -1683,6 +1805,13 @@ void Index::build(const char *filename, const size_t num_points + std::unique_lock tl(_tag_lock); + _nd = num_points_to_load; + } ++ ++ if (_cuvs_cagra_index) ++ { ++ auto _in_mem_data_store = std::static_pointer_cast>(_data_store); ++ build_cuvs_cagra_index(_in_mem_data_store->_data); ++ } ++ // else + 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/patches/diskann_override.json b/cpp/cmake/patches/diskann_override.json new file mode 100644 index 000000000..ed1283870 --- /dev/null +++ b/cpp/cmake/patches/diskann_override.json @@ -0,0 +1,9 @@ +{ + "packages" : { + "faiss" : { + "version": "0.7.0", + "git_url": "https://github.com/microsoft/DiskANN.git", + "git_tag": "main" + } + } + } \ No newline at end of file diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake new file mode 100644 index 000000000..40313e4b3 --- /dev/null +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -0,0 +1,51 @@ +#============================================================================= +# 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) + 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") + + include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") + rapids_cpm_package_details(diskann version repository tag shallow exclude) + + include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake") + rapids_cpm_generate_patch_command(diskann ${version} patch_command) + + 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" + "-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") + 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 From 706f22e033d6f1d9d4ff0a88d9f72d1f247ca45b Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 31 Jul 2024 15:42:31 -0700 Subject: [PATCH 03/58] update wrapper --- cpp/bench/ann/src/common/benchmark.hpp | 3 +- cpp/bench/ann/src/common/dataset.hpp | 3 +- .../ann/src/cuvs/cuvs_cagra_diskann_wrapper.h | 108 +++++ .../ann/src/diskann/diskann_benchmark.cu | 250 ++++------ cpp/bench/ann/src/diskann/diskann_wrapper.h | 436 +++++++++--------- cpp/cmake/modules/ConfigureCUDA.cmake | 10 +- cpp/cmake/patches/diskann.diff | 405 +++++----------- cpp/cmake/patches/diskann_override.json | 21 +- cpp/cmake/thirdparty/get_diskann.cmake | 4 +- 9 files changed, 540 insertions(+), 700 deletions(-) create mode 100644 cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 2f12761d5..16d87f4e1 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -423,8 +423,7 @@ inline void printf_usage() template void register_build(std::shared_ptr> dataset, std::vector indices, - bool force_overwrite, - bool disk_index) + bool force_overwrite) { for (auto index : indices) { auto suf = static_cast(index.build_param["override_suffix"]); diff --git a/cpp/bench/ann/src/common/dataset.hpp b/cpp/bench/ann/src/common/dataset.hpp index 9433b5574..a0a7a5f5f 100644 --- a/cpp/bench/ann/src/common/dataset.hpp +++ b/cpp/bench/ann/src/common/dataset.hpp @@ -262,6 +262,7 @@ class dataset { virtual auto max_k() const -> uint32_t = 0; virtual auto base_set_size() const -> size_t = 0; virtual auto query_set_size() const -> size_t = 0; + std::string base_filename() const = 0; // load data lazily, so don't pay the overhead of reading unneeded set // e.g. don't load base set when searching @@ -383,7 +384,7 @@ class bin_dataset : public dataset { auto max_k() const -> uint32_t override; auto base_set_size() const -> size_t override; auto query_set_size() const -> size_t override; - std::string base_filename() const; + std::string base_filename() const override; private: void load_base_set() const; diff --git a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h new file mode 100644 index 000000000..566d35897 --- /dev/null +++ b/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h @@ -0,0 +1,108 @@ +/* + * 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 "../hnswlib/hnswlib_wrapper.h" +#include "cuvs_cagra_wrapper.h" + +#include + +namespace cuvs::bench { + +template +class cuvs_cagra_diskann : public algo, public algo_gpu { + public: + using search_param_base = typename algo::search_param; + using build_param = typename cuvs_cagra::build_param; + using search_param = typename diskann_mem::search_param; + + cuvs_cagra_diskann(Metric metric, int dim, const build_param& param) + : algo(metric, dim), + cagra_build_{metric, dim, param}, + // hnsw_lib param values don't matter since we don't build with hnsw_lib + diskann_mem_search_{metric, dim, typename diskann_mem::build_param{50, 100}} + { + } + + void build(const T* dataset, size_t nrow) final; + + void set_search_param(const search_param_base& param) override; + + void search(const T* queries, + int batch_size, + int k, + algo_base::index_type* neighbors, + float* distances) const override; + + [[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override + { + return cagra_build_.get_sync_stream(); + } + + // to enable dataset access from GPU memory + [[nodiscard]] auto get_preference() const -> algo_property override + { + algo_property property; + property.dataset_memory_type = MemoryType::kHostMmap; + property.query_memory_type = MemoryType::kHost; + return property; + } + + void save(const std::string& file) const override; + void load(const std::string&) override; + std::unique_ptr> copy() override + { + return std::make_unique>(*this); + } + + private: + cuvs_cagra cagra_build_; + hnsw_lib hnswlib_search_; +}; + +template +void cuvs_cagra_hnswlib::build(const T* dataset, size_t nrow) +{ + cagra_build_.build(dataset, nrow); +} + +template +void cuvs_cagra_hnswlib::set_search_param(const search_param_base& param_) +{ + hnswlib_search_.set_search_param(param_); +} + +template +void cuvs_cagra_hnswlib::save(const std::string& file) const +{ + cagra_build_.save_to_hnswlib(file); +} + +template +void cuvs_cagra_hnswlib::load(const std::string& file) +{ + hnswlib_search_.load(file); + hnswlib_search_.set_base_layer_only(); +} + +template +void cuvs_cagra_hnswlib::search( + const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const +{ + hnswlib_search_.search(queries, batch_size, k, neighbors, distances); +} + +} // namespace cuvs::bench diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cu index 45751732c..6810b00a2 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cu +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cu @@ -13,206 +13,112 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#pragma once #include "../common/ann_types.hpp" +#include "diskann_wrapper.h" -#include -#include +#define JSON_DIAGNOSTICS 1 +#include -#include -#include -#include - -#include +#include +#include #include -#include +#include +#include +#include +#include namespace cuvs::bench { -diskann::Metric parse_metric_type(cuvs::bench::Metric metric) +template +void parse_build_param(const nlohmann::json& conf, + typename cuvs::bench::diskann_memory::build_param& param) { - if (metric == cuvs::bench::Metric::kInnerProduct) { - return diskann::Metric::INNER_PRODUCT; - } else if (metric == cuvs::bench::Metric::kEuclidean) { - return diskann::Metric::L2; - } else { - throw std::runtime_error("currently only inner product and L2 supported for benchmarking"); + param.R = conf.at("R"); + if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } + if (conf.contains("alpha")) { param.num_threads = 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) { + if (conf.contains("cagra_graph_degree")) { + param.cagra_graph_degree = conf.at("cagra_graph_degree"); + } else { + param.cagra_graph_degree = param.R; + } + param.cagra_intermediate_graph_degree = conf.at("cagra_intermediate_graph_degree"); } } template -class diskann_memory : public algo, public algo_gpu { - public: - struct BuildParam { - uint32_t R; - uint32_t L_build; - float alpha; - int num_threads = omp_get_num_procs(); - bool use_cuvs_cagra_graph; - uint32_t cagra_graph_degree; - uint32_t cagra_intermediate_graph_degree; - }; - - using typename ANN::AnnSearchParam; - struct SearchParam : public AnnSearchParam { - uint32_t L_search; - }; - - diskann_memory(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; - DiskANNMemory(const DiskANNMemory& other) = default; - std::unique_ptr> copy() override { return std::make_unique>(*this); } - - AlgoProperty get_preference() const override - { - AlgoProperty property; - property.dataset_memory_type = MemoryType::Host; - property.query_memory_type = MemoryType::Host; - return property; - } - - private: - 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_search_params_{nullptr}; - std::shared_ptr> diskann_index_{nullptr}; - // uint32_t L_load_; - uint32_t L_search_; - 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 -DiskANNMemory::DiskANNMemory(Metric metric, int dim, const BuildParam& param) - : ANN(metric, dim) +void parse_search_param(const nlohmann::json& conf, + typename cuvs::bench::diskann_memory::search_param& param) { - assert(this->dim_ > 0); - auto 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; - - this->diskann_index_ = std::make_shared>(parse_metric_type(metric), - dim, - 10000000, - diskann_index_write_params, - nullptr, - 0, - false, - false, - false, - false, - this->build_pq_bytes_, - false, - false, - param.use_cagra_graph, - param.cagra_graph_degree); + param.L_search = conf.at("L_search"); + param.num_threads = conf.at("num_threads"); } -template -void DiskANNMemory::build(const T* dataset, size_t nrow) +template class Algo> +std::unique_ptr> make_algo(cuvs::bench::Metric metric, + int dim, + const nlohmann::json& conf) { - 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 * 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; - 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; - // 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); - // free intermediate graph before trying to create the index - intermediate_graph.reset(); - - 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()); - } + typename Algo::BuildParam param; + parse_build_param(conf, param); + return std::make_unique>(metric, dim, param); } -template -void DiskANNMemory::set_search_param(const AnnSearchParam& param_) +template class Algo> +std::unique_ptr> make_algo(cuvs::bench::Metric metric, + int dim, + const nlohmann::json& conf, + const std::vector& dev_list) { - auto param = dynamic_cast(param_); - this->L_search_ = param.L_search; - metric_objective_ = param.metric_objective; + typename Algo::BuildParam param; + parse_build_param(conf, param); + + (void)dev_list; + return std::make_unique>(metric, dim, param); } template -void DiskANNMemory::search( - const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const +std::unique_ptr> create_algo(const std::string& algo_name, + const std::string& distance, + int dim, + const nlohmann::json& conf, + const std::vector& dev_list) { - // 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); - } - } 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); - } + // stop compiler warning; not all algorithms support multi-GPU so it may not be used + (void)dev_list; + + cuvs::bench::Metric metric = parse_metric(distance); + std::unique_ptr> a; + + if constexpr (std::is_same_v || std::is_same_v || + std::is_same_v) { + if (algo_name == "diskann_memory") { a = make_algo(metric, dim, conf); } } -} + if (!a) { throw std::runtime_error("invalid algo: '" + algo_name + "'"); } -template -void DiskANNMemory::save(const std::string& path_to_index) const -{ - this->diskann_index_->save(path_to_index.c_str()); + return a; } template -void DiskANNMemory::load(const std::string& path_to_index) +std::unique_ptr::search_param> create_search_param( + const std::string& algo_name, const nlohmann::json& conf) { - diskann_index_->load(path_to_index.c_str(), 80, 100); + if (algo_name == "diskann_memory") { + auto param = std::make_unique::search_param>(); + parse_search_param(conf, *param); + return param; + } + throw std::runtime_error("invalid algo: '" + algo_name + "'"); } -}; // namespace raft::bench::ann \ No newline at end of file + +}; // namespace cuvs::bench + +REGISTER_ALGO_INSTANCE(float); + +#ifdef ANN_BENCH_BUILD_MAIN +#include "../common/benchmark.hpp" +int main(int argc, char** argv) { return cuvs::bench::run_main(argc, argv); } +#endif \ No newline at end of file diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 5b3a1deab..4b1e274f8 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -16,12 +16,12 @@ #pragma once #include "../common/ann_types.hpp" -#include "cuvs_ann_bench_utils.h" #include #include #include +#include #include #include @@ -43,12 +43,14 @@ diskann::Metric parse_metric_to_diskann(cuvs::bench::Metric metric) } template -class diskann_memory : public algo, public algo_gpu { +class diskann_memory : public algo { public: struct build_param { uint32_t R; + uint32_t L_build; + float alpha = 1.2; int num_threads = omp_get_num_procs(); - bool use_cuvs_cagra_graph; + bool use_cagra_graph; uint32_t cagra_graph_degree; uint32_t cagra_intermediate_graph_degree; }; @@ -56,6 +58,7 @@ class diskann_memory : public algo, public algo_gpu { using search_param_base = typename algo::search_param; struct search_param : public search_param_base { uint32_t L_search; + uint32_t num_threads = omp_get_num_procs(); }; diskann_memory(Metric metric, int dim, const build_param& param); @@ -81,15 +84,16 @@ class diskann_memory : public algo, public algo_gpu { private: bool use_cagra_graph_; - bool use_pq_build_ = false; - uint32_t build_pq_bytes_ = 0; - std::shared_ptr> diskann_index_{nullptr}; - uint32_t L_search_; - uint32_t cagra_graph_degree_ = 64; - uint32_t cagra_intermediate_graph_degree_ = 128; + std::shared_ptr diskann_index_write_params_{nullptr}; uint32_t max_points_; + std::shared_ptr> mem_index_{nullptr}; + std::shared_ptr cagra_index_params_{nullptr}; + int num_threads_; + // std::shared_ptr thread_pool_; + uint32_t L_search_; Mode metric_objective_; + int num_search_threads_; }; template @@ -97,76 +101,47 @@ diskann_memory::diskann_memory(Metric metric, int dim, const build_param& par : algo(metric, dim) { assert(this->dim_ > 0); - auto diskann_index_write_params = std::make_shared( + num_threads_ = param.num_threads; + 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) + .with_num_threads(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; - cuvs::neighbors::cagra::index_params cuvs_cagra_index_params; - cuvs_cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; - cuvs_cagra_index_params.graph_degree = param.cagra_graph_degree; - - this->diskann_index_ = std::make_shared>(parse_metric_to_diskann(metric), - dim, - 10000000, - diskann_index_write_params, - nullptr, - 0, - false, - false, - false, - false, - this->build_pq_bytes_, - false, - false, - param.use_cagra_graph, - param.cagra_graph_degree); + use_cagra_graph_ = param.use_cagra_graph; + if (use_cagra_graph_) { + cuvs::neighbors::cagra::index_params cagra_index_params; + cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; + cagra_index_params.graph_degree = param.cagra_graph_degree; + cagra_index_params.graph_build_params.nn_descent_params.graph_degree = + cagra_index_params.intermediate_graph_degree; + cagra_index_params.graph_build_params.nn_descent_params.intermediate_graph_degree = + 1.5 * cagra_index_params.intermediate_graph_degree; + cagra_index_params_ = + std::make_shared(cagra_index_params); + } } template void diskann_memory::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 * 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; - 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; - // 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); - // free intermediate graph before trying to create the index - intermediate_graph.reset(); - - 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()); - } + max_points_ = nrow; + this->mem_index_ = std::make_shared>(parse_metric_to_diskann(this->metric_), + this->dim_, + max_points_, + diskann_index_write_params_, + nullptr, + 0, + false, + false, + false, + false, + 0, + false, + false, + use_cagra_graph_, + cagra_index_params_); } template @@ -175,30 +150,30 @@ void diskann_memory::set_search_param(const search_param_base& param_) auto param = dynamic_cast(param_); this->L_search_ = param.L_search; metric_objective_ = param.metric_objective; + num_search_threads_ = param.num_threads; } template void diskann_memory::search( const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const { - // std::cout << "num_search_threads" << diskann_index_write_params_->num_threads << std::endl; if (this->metric_objective_ == Mode::kLatency) { - omp_set_num_threads(omp_get_num_procs()); + omp_set_num_threads(num_search_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), - L_search_, - neighbors + i * k, - distances + i * k); + mem_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); + mem_index_->search(queries + i * this->dim_, + static_cast(k), + L_search_, + neighbors + i * k, + distances + i * k); } } } @@ -206,160 +181,163 @@ void diskann_memory::search( template void diskann_memory::save(const std::string& path_to_index) const { - this->diskann_index_->save(path_to_index.c_str()); + this->mem_index_->save(path_to_index.c_str()); } template void diskann_memory::load(const std::string& path_to_index) { - diskann_index_->load(path_to_index.c_str(), 80, 100); -} - -/******************************************************************* - */ - -template -class diskann_ssd : public algo { - public: - struct build_param { - uint32_t R; - uint32_t L_build; - float alpha; - int num_threads = omp_get_num_procs(); - bool use_cagra_graph; - bool filtered_index; - uint32_t cagra_graph_degree; - uint32_t cagra_intermediate_graph_degree; - }; - - using typename algo::AnnSearchParam; - struct SearchParam : public AnnSearchParam { - uint32_t L_search; - }; - - diskann_ssd(Metric metric, int dim, const build_param& param); - - void build(const char* dataset_path, 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; - diskann_ssd(const diskann_ssd& other) = default; - std::unique_ptr> copy() override { return std::make_unique>(*this); } - - algo_property get_preference() const override - { - algo_property property; - property.dataset_memory_type = MemoryType::kHost; - property.query_memory_type = MemoryType::kHost; - return property; - } - - private: - uint32_t build_pq_bytes_ = 0; - bool use_cagra_graph_; - std::shared_ptr diskann_index_write_params_{nullptr}; - uint32_t max_points_; - std::shared_ptr> mem_index_{nullptr}; - std::unique_ptr> p_flash_index_; - uint32_t cagra_graph_degree_; - uint32_t cagra_intermediate_graph_degree_; - - // std::shared_ptr thread_pool_; - uint32_t L_search_; - Mode metric_objective_; - uint32_t num_nodes_to_cache_; -}; - -template -void diskann_ssd::build(std::string dataset_file, size_t nrow) -{ - std::shared_ptr cagra_index_params_ptr{nullptr}; - if (use_cagra_graph_) { - cuvs::neighbors::cagra::index_params cagra_index_params; - cagra_index_params.graph_degree = cagra_graph_degree_; - cagra_index_params.intermediate_graph_degree = cagra_intermediate_graph_degree_; - auto ivf_pq_params = cuvs::neighbors::cagra::graph_build_params::ivf_pq_params( - raft::matrix_extent(nrow, this->dim_), parse_metric_type(this->metric_)); - if (build_pq_bytes_ > 0) ivf_pq_params.build_params.pq_dim = build_pq_bytes_; - ivf_pq_params.build_params.pq_bits = 8; - cagra_index_params.graph_build_params = ivf_pq_params; - cagra_index_params_ptr.reset(&cagra_index_params); - } - this->mem_index_ = std::make_shared>(parse_metric_to_diskann(this->metric_), - this->dim_, - nrow, - diskann_index_write_params_, - nullptr, - 0, - false, - false, - false, - build_pq_bytes_ > 0, - this->build_pq_bytes_, - false, - false, - use_cagra_graph_, - cagra_index_params_ptr); - this->mem_index_->build(dataset_file.c_str(), nrow); + this->mem_index_->load(path_to_index.c_str(), num_threads_, 100); } -template -void diskann_ssd::set_search_param(const AnnSearchParam& param_) -{ - auto param = dynamic_cast(param_); - this->L_search_ = param.L_search; - metric_objective_ = param.metric_objective; -} - -template -void diskann_ssd::search( - const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const -{ - std::vector node_list; - p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); - p_flash_index_->load_cache_list(node_list); - node_list.clear(); - node_list.shrink_to_fit(); - - 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++) { - p_flash_index_->cached_beam_search(queries + (i * this->dim_), - static_cast(k), - L_search_, - neighbors + i * k, - distances + i * k, - 2); - } - } else { - for (int64_t i = 0; i < (int64_t)batch_size; i++) { - p_flash_index_->cached_beam_search(queries + (i * this->dim_), - static_cast(k), - L_search_, - neighbors + i * k, - distances + i * k, - 2); - } - } -} - -template -void diskann_ssd::save(const std::string& path_to_index) const -{ - this->diskann_index_->save(path_to_index.c_str()); -} - -template -void diskann_ssd::load(const std::string& path_to_index) -{ - std::shared_ptr reader = nullptr; - reader.reset(new LinuxAlignedFileReader()); - int result = p_flash_index_->load(omp_get_num_procs(), path_to_index.c_str()); -} +// template +// class diskann_ssd : public diskann_memory { +// public: +// struct build_param : public diskann_memory::build_param { +// uint32_t build_pq_bytes; +// }; + +// diskann_ssd(Metric metric, int dim, const build_param& param); + +// void build(const char* dataset_path, size_t nrow); + +// 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; +// diskann_ssd(const diskann_ssd& other) = default; +// std::unique_ptr> copy() override { return std::make_unique>(*this); } + +// algo_property get_preference() const override +// { +// algo_property property; +// property.dataset_memory_type = MemoryType::kHost; +// property.query_memory_type = MemoryType::kHost; +// return property; +// } + +// protected: +// uint32_t build_pq_bytes_ = 0; +// std::unique_ptr> p_flash_index_; + +// // std::shared_ptr thread_pool_; +// uint32_t num_nodes_to_cache_; +// }; + +// template +// diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) +// : algo(metric, dim) +// { +// assert(this->dim_ > 0); +// this->num_threads_ = param.num_threads; +// 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(num_threads_) +// .build()); +// use_cagra_graph_ = param.use_cagra_graph; +// if (use_cagra_graph_) { +// cuvs::neighbors::cagra::index_params cagra_index_params; +// cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; +// cagra_index_params.graph_degree = param.cagra_graph_degree; +// cagra_index_params.graph_build_params.nn_descent_params.graph_degree = +// cagra_index_params.intermediate_graph_degree; +// cagra_index_params.graph_build_params.nn_descent_params.intermediate_graph_degree = +// 1.5 * cagra_index_params.intermediate_graph_degree; +// cagra_index_params_ = +// std::make_shared(cagra_index_params); +// } +// } + +// template +// void diskann_ssd::build(std::string dataset_path, size_t nrow) +// { +// std::shared_ptr cagra_index_params_ptr{nullptr}; +// if (use_cagra_graph_) { +// cuvs::neighbors::cagra::index_params cagra_index_params; +// cagra_index_params.graph_degree = cagra_graph_degree_; +// cagra_index_params.intermediate_graph_degree = cagra_intermediate_graph_degree_; +// auto ivf_pq_params = cuvs::neighbors::cagra::graph_build_params::ivf_pq_params( +// raft::matrix_extent(nrow, this->dim_), parse_metric_type(this->metric_)); +// if (build_pq_bytes_ > 0) ivf_pq_params.build_params.pq_dim = build_pq_bytes_; +// ivf_pq_params.build_params.pq_bits = 8; +// cagra_index_params.graph_build_params = ivf_pq_params; +// cagra_index_params_ptr.reset(&cagra_index_params); +// } +// this->mem_index_ = std::make_shared>(parse_metric_to_diskann(this->metric_), +// this->dim_, +// nrow, +// diskann_index_write_params_, +// nullptr, +// 0, +// false, +// false, +// false, +// build_pq_bytes_ > 0, +// this->build_pq_bytes_, +// false, +// false, +// use_cagra_graph_, +// cagra_index_params_ptr); +// this->mem_index_->build(dataset_file.c_str(), nrow); +// } + +// template +// void diskann_ssd::set_search_param(const AnnSearchParam& param_) +// { +// auto param = dynamic_cast(param_); +// this->L_search_ = param.L_search; +// metric_objective_ = param.metric_objective; +// } + +// template +// void diskann_ssd::search( +// const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const +// { +// std::vector node_list; +// p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); +// p_flash_index_->load_cache_list(node_list); +// node_list.clear(); +// node_list.shrink_to_fit(); + +// if (this->metric_objective_ == Mode::kLatency) { +// omp_set_num_threads(num_search_threads_); +// #pragma omp parallel for +// for (int64_t i = 0; i < (int64_t)batch_size; i++) { +// p_flash_index_->cached_beam_search(queries + (i * this->dim_), +// static_cast(k), +// L_search_, +// neighbors + i * k, +// distances + i * k, +// 2); +// } +// } else { +// for (int64_t i = 0; i < (int64_t)batch_size; i++) { +// p_flash_index_->cached_beam_search(queries + (i * this->dim_), +// static_cast(k), +// L_search_, +// neighbors + i * k, +// distances + i * k, +// 2); +// } +// } +// } + +// template +// void diskann_ssd::save(const std::string& path_to_index) const +// { +// this->diskann_index_->save(path_to_index.c_str()); +// } + +// template +// void diskann_ssd::load(const std::string& path_to_index) +// { +// std::shared_ptr reader = nullptr; +// reader.reset(new LinuxAlignedFileReader()); +// int result = p_flash_index_->load(omp_get_num_procs(), path_to_index.c_str()); +// } }; // namespace cuvs::bench diff --git a/cpp/cmake/modules/ConfigureCUDA.cmake b/cpp/cmake/modules/ConfigureCUDA.cmake index e2dd829da..8cc40d1da 100644 --- a/cpp/cmake/modules/ConfigureCUDA.cmake +++ b/cpp/cmake/modules/ConfigureCUDA.cmake @@ -20,13 +20,13 @@ endif() # Be very strict when compiling with GCC as host compiler (and thus more lenient when compiling with # clang) if(CMAKE_COMPILER_IS_GNUCXX) - list(APPEND CUVS_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations) - list(APPEND CUVS_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations) + list(APPEND CUVS_CXX_FLAGS -Wall -Wno-unknown-pragmas -Wno-error=deprecated-declarations) + list(APPEND CUVS_CUDA_FLAGS -Xcompiler=-Wall,-Wno-error=deprecated-declarations) # set warnings as errors - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2.0) - list(APPEND CUVS_CUDA_FLAGS -Werror=all-warnings) - endif() + #if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2.0) + # list(APPEND CUVS_CUDA_FLAGS -Werror=all-warnings) + #endif() endif() if(CUDA_LOG_COMPILE_TIME) diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 5ed5eb659..f485262a2 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..6496b15 100644 +index 3d3d2b8..55633bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,25 @@ set(CMAKE_STANDARD 17) @@ -28,7 +28,26 @@ index 3d3d2b8..6496b15 100644 if(NOT MSVC) set(CMAKE_CXX_COMPILER g++) endif() -@@ -286,7 +305,7 @@ if(MSVC) +@@ -145,18 +164,6 @@ 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") +- foreach(POSSIBLE_OMP_PATH ${POSSIBLE_OMP_PATHS}) +- if (EXISTS ${POSSIBLE_OMP_PATH}) +- get_filename_component(OMP_PATH ${POSSIBLE_OMP_PATH} DIRECTORY) +- endif() +- endforeach() +- +- if(NOT OMP_PATH) +- message(FATAL_ERROR "Could not find Intel OMP in standard locations; use -DOMP_PATH to specify the install location for your environment") +- 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") + foreach(POSSIBLE_MKL_LIB_PATH ${POSSIBLE_MKL_LIB_PATHS}) + if (EXISTS ${POSSIBLE_MKL_LIB_PATH}) +@@ -286,7 +293,7 @@ if(MSVC) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/x64/Release) else() set(ENV{TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD} 500000000000) @@ -37,7 +56,7 @@ index 3d3d2b8..6496b15 100644 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 +319,6 @@ else() +@@ -300,10 +307,6 @@ else() endif() add_subdirectory(src) @@ -48,7 +67,7 @@ index 3d3d2b8..6496b15 100644 if (UNIT_TEST) enable_testing() -@@ -331,3 +346,7 @@ include(clang-format.cmake) +@@ -331,3 +334,7 @@ include(clang-format.cmake) if(PYBIND) add_subdirectory(python) endif() @@ -180,133 +199,6 @@ index 0000000..2703ec4 + ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) +endif() +include(${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) -diff --git a/grid_search_disk_index_build.py b/grid_search_disk_index_build.py -new file mode 100644 -index 0000000..5c76f9f ---- /dev/null -+++ b/grid_search_disk_index_build.py -@@ -0,0 +1,120 @@ -+import subprocess -+import os -+import itertools -+ -+params = { -+ 'R': [64, 96], -+ 'Lb': [64, 128, 256, 384], -+ 'use_cagra_graph': [False], -+ 'QD' : [192] -+} -+ -+params_cagra = { -+ 'R': [64, 96], -+ 'use_cagra_graph': [True], -+ 'cagra_graph_degree': [32, 64, 96], -+ 'cagra_intermediate_graph_degree': [64, 96, 128], -+ 'QD' : [192] -+} -+ -+# Define the constraints -+constraints = [ -+ lambda x: x['R'] <= x['Lb'], -+ # lambda x: x['R'] == 96 or (x['R'] == 64 and x['Lb'] == 384) -+] -+ -+cagra_constraints = [ -+ lambda x: x['cagra_graph_degree'] <= x['R'] and x['cagra_graph_degree'] <= x['cagra_intermediate_graph_degree'] -+] -+ -+output_dir = '/datasets/tarangj/datasets/wiki_all_1M/DiskANNSSD' -+ssd_builder_path = os.path.join("/home/nfs/tarangj/DiskANN/build", "apps", "build_disk_index") -+vectors_bin_path = '/datasets/tarangj/datasets/wiki_all_1M/base.1M.fbin' -+ -+# Define a function to generate the output file name -+def generate_output_file(dir, params): -+ if not params['use_cagra_graph']: -+ print("here in generate_output_file") -+ output_file = f"diskann.R{params['R']}.Lb{params['Lb']}.QD{params['QD']}.use_cagra_graphFalse" -+ else: -+ output_file = f"diskann.R{params['R']}.QD{params['QD']}.use_cagra_graphTrue.cagra_graph_degree{params['cagra_graph_degree']}.cagra_intermediate_graph_degree{params['cagra_intermediate_graph_degree']}" -+ print("output_file", output_file) -+ return os.path.join(dir, output_file) -+ -+count = 0 -+# Run the grid search -+for combo in itertools.product(*params.values()): -+ # if count > 0: -+ # continue -+ # Create a dictionary from the combination -+ combo_dict = dict(zip(params.keys(), combo)) -+ -+ # Check the constraints -+ if all(constraint(combo_dict) for constraint in constraints): -+ # Generate the output file name -+ output_file = generate_output_file(output_dir, combo_dict) -+ -+ args = [ -+ ssd_builder_path, -+ "--data_type", "float", -+ "--dist_fn", "l2", -+ "--data_path", vectors_bin_path, -+ "--index_path_prefix", output_file, -+ "-R", str(combo_dict["R"]), -+ "-L", str(combo_dict["Lb"]), -+ "--QD", str(combo_dict["QD"]), -+ "--search_DRAM_budget", "100", -+ "--build_DRAM_budget", "100", -+ "--num_threads", "80", -+ "--build_PQ_bytes", str(combo_dict["QD"]), -+ # "--use_cuvs_cagra_graph", "false" -+ ] -+ -+ completed = subprocess.run(args, timeout=3600) -+ -+ output_file -+ -+ if completed.returncode != 0: -+ command_run = " ".join(args) -+ raise Exception(f"Unable to build a disk index with the command: '{command_run}'\ncompleted_process: {completed}\nstdout: {completed.stdout}\nstderr: {completed.stderr}") -+ # count += 1 -+ -+# Run the grid search -+count = 0 -+for combo in itertools.product(*params_cagra.values()): -+ # if count > 0: -+ # continue -+ print("here") -+ # Create a dictionary from the combination -+ combo_dict = dict(zip(params_cagra.keys(), combo)) -+ -+ # Check the constraints -+ if all(constraint(combo_dict) for constraint in cagra_constraints): -+ # Generate the output file name -+ output_file = generate_output_file(output_dir, combo_dict) -+ -+ args = [ -+ ssd_builder_path, -+ "--data_type", "float", -+ "--dist_fn", "l2", -+ "--data_path", vectors_bin_path, -+ "--index_path_prefix", output_file, -+ "-R", str(combo_dict["R"]), -+ "-L", "128", -+ "--QD", str(combo_dict["QD"]), -+ "--search_DRAM_budget", "100", -+ "--build_DRAM_budget", "100", -+ "--num_threads", "80", -+ "--build_PQ_bytes", str(combo_dict["QD"]), -+ "--use_cuvs_cagra_graph", "true" -+ ] -+ -+ completed = subprocess.run(args, timeout=3600) -+ -+ output_file -+ -+ if completed.returncode != 0: -+ command_run = " ".join(args) -+ raise Exception(f"Unable to build a disk index with the command: '{command_run}'\ncompleted_process: {completed}\nstdout: {completed.stdout}\nstderr: {completed.stderr}") -+ -+ # count += 1 -\ No newline at end of file diff --git a/include/disk_utils.h b/include/disk_utils.h index 08f046d..dc468d6 100644 --- a/include/disk_utils.h @@ -424,10 +316,10 @@ index f3b1de2..4e92738 100644 { // Inner product returns negative values to indicate distance. diff --git a/include/in_mem_data_store.h b/include/in_mem_data_store.h -index d1ad795..e04f744 100644 +index 0a0a617..c4ee71d 100644 --- a/include/in_mem_data_store.h +++ b/include/in_mem_data_store.h -@@ -70,9 +70,10 @@ template class InMemDataStore : public AbstractDataStore class InMemDataStore : public AbstractDataStore class InMemDataStore : public AbstractDataStore class InMemDataStore : public AbstractDataStore _pre_computed_norms; }; @@ -503,10 +395,11 @@ index b9bf4f3..e365fdc 100644 }; } // namespace diskann diff --git a/include/index_config.h b/include/index_config.h -index 452498b..3393747 100644 +index a8e64d0..7fbc1bb 100644 --- a/include/index_config.h +++ b/include/index_config.h -@@ -1,5 +1,8 @@ +@@ -2,6 +2,9 @@ + #include "common_includes.h" #include "parameters.h" +#include @@ -515,7 +408,7 @@ index 452498b..3393747 100644 namespace diskann { -@@ -41,18 +44,23 @@ struct IndexConfig +@@ -43,18 +46,23 @@ struct IndexConfig // Params for searching index std::shared_ptr index_search_params; @@ -525,25 +418,26 @@ index 452498b..3393747 100644 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 cuvs_cagra_index, - std::string &data_type, const std::string &tag_type, const std::string &label_type, - std::shared_ptr index_write_params, + bool pq_dist_build, bool concurrent_consolidate, bool use_opq, bool filtered_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) ++ bool cuvs_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 cuvs_cagra_index_params -+ ) ++ std::shared_ptr cuvs_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), cuvs_cagra_index(cuvs_cagra_index), - num_pq_chunks(num_pq_chunks), num_frozen_pts(num_frozen_points), label_type(label_type), tag_type(tag_type), + 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), - 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), cuvs_cagra_index_params{cuvs_cagra_index_params} ++ cuvs_cagra_index(cuvs_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), cuvs_cagra_index_params{cuvs_cagra_index_params} { } -@@ -194,6 +202,18 @@ class IndexConfigBuilder +@@ -196,6 +204,19 @@ class IndexConfigBuilder return *this; } @@ -553,7 +447,8 @@ index 452498b..3393747 100644 + return *this; + } + -+ IndexConfigBuilder &with_cuvs_cagra_index_params(std::shared_ptr cuvs_cagra_index_params_ptr) ++ IndexConfigBuilder &with_cuvs_cagra_index_params( ++ std::shared_ptr cuvs_cagra_index_params_ptr) + { + this->_cuvs_cagra_index_params = cuvs_cagra_index_params_ptr; + return *this; @@ -562,18 +457,18 @@ index 452498b..3393747 100644 IndexConfig build() { if (_data_type == "" || _data_type.empty()) -@@ -219,8 +239,8 @@ class IndexConfigBuilder +@@ -221,8 +242,8 @@ 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, - _use_opq, _filtered_index, _data_type, _tag_type, _label_type, _index_write_params, - _index_search_params); -+ _use_opq, _filtered_index, _cuvs_cagra_index, _data_type, _tag_type, _label_type, _index_write_params, -+ _index_search_params, _cuvs_cagra_index_params); ++ _use_opq, _filtered_index, _cuvs_cagra_index, _data_type, _tag_type, _label_type, ++ _index_write_params, _index_search_params, _cuvs_cagra_index_params); } IndexConfigBuilder(const IndexConfigBuilder &) = delete; -@@ -240,6 +260,7 @@ class IndexConfigBuilder +@@ -242,6 +263,7 @@ class IndexConfigBuilder bool _concurrent_consolidate = false; bool _use_opq = false; bool _filtered_index{defaults::HAS_LABELS}; @@ -581,7 +476,7 @@ index 452498b..3393747 100644 size_t _num_pq_chunks = 0; size_t _num_frozen_pts{defaults::NUM_FROZEN_POINTS_STATIC}; -@@ -250,5 +271,6 @@ class IndexConfigBuilder +@@ -252,5 +274,6 @@ class IndexConfigBuilder std::shared_ptr _index_write_params; std::shared_ptr _index_search_params; @@ -589,10 +484,10 @@ index 452498b..3393747 100644 }; } // namespace diskann diff --git a/include/index_factory.h b/include/index_factory.h -index 80bc40d..138adcb 100644 +index 76fb0b9..f672bc6 100644 --- a/include/index_factory.h +++ b/include/index_factory.h -@@ -46,4 +46,4 @@ class IndexFactory +@@ -48,4 +48,4 @@ class IndexFactory std::unique_ptr _config; }; @@ -629,10 +524,10 @@ index d3af5c3..2cb2181 100644 #ifdef EXEC_ENV_OLS #include "content_buf.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index cbca264..2278b27 100644 +index cbca264..de3dadd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -2,14 +2,14 @@ +@@ -2,7 +2,7 @@ #Licensed under the MIT license. set(CMAKE_CXX_STANDARD 17) @@ -641,14 +536,6 @@ index cbca264..2278b27 100644 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}) @@ -845,18 +732,9 @@ index 0165602..dee8675 100644 + const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); }; // namespace diskann diff --git a/src/dll/CMakeLists.txt b/src/dll/CMakeLists.txt -index 096d1b7..e36fe7c 100644 +index 096d1b7..6d01516 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 @@ -865,7 +743,7 @@ index 096d1b7..e36fe7c 100644 \ No newline at end of file +endforeach() diff --git a/src/index.cpp b/src/index.cpp -index bf93344..c7a3c96 100644 +index bf93344..269f314 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1,6 +1,7 @@ @@ -876,7 +754,16 @@ index bf93344..c7a3c96 100644 #include #include -@@ -22,11 +23,27 @@ +@@ -13,6 +14,8 @@ + #include "tsl/robin_set.h" + #include "windows_customizations.h" + #include "tag_uint128.h" ++#include ++#include + #if defined(DISKANN_RELEASE_UNUSED_TCMALLOC_MEMORY_AT_CHECKPOINTS) && defined(DISKANN_BUILD) + #include "gperftools/malloc_extension.h" + #endif +@@ -22,11 +25,27 @@ #endif #include "index.h" @@ -904,7 +791,7 @@ index bf93344..c7a3c96 100644 // Initialize an index with metric m, load the data of type T with filename // (bin), and initialize max_points template -@@ -38,8 +55,11 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr::Index(const IndexConfig &index_config, std::shared_ptr::Index(const IndexConfig &index_config, std::shared_ptr::Index(const IndexConfig &index_config, std::shared_ptrget_dims()); } } @@ -939,7 +826,7 @@ index bf93344..c7a3c96 100644 } template -@@ -117,7 +152,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -117,7 +154,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, @@ -949,7 +836,7 @@ index bf93344..c7a3c96 100644 : Index( IndexConfigBuilder() .with_metric(m) -@@ -134,6 +170,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -134,6 +172,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()) @@ -958,7 +845,7 @@ index bf93344..c7a3c96 100644 .build(), IndexFactory::construct_datastore(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -145,7 +183,9 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -145,7 +185,9 @@ Index::Index(Metric m, const size_t dim, const size_t max_point (size_t)((index_parameters == nullptr ? 0 : index_parameters->max_degree) * defaults::GRAPH_SLACK_FACTOR * 1.05))) { @@ -969,7 +856,45 @@ index bf93344..c7a3c96 100644 { _pq_data_store = IndexFactory::construct_pq_datastore(DataStoreStrategy::MEMORY, max_points + num_frozen_pts, dim, m, num_pq_chunks, use_opq); -@@ -732,6 +772,7 @@ template int Index +@@ -372,7 +414,36 @@ void Index::save(const char *filename, bool compact_before_save + // the error code for delete_file, but will ignore now because + // delete should succeed if save will succeed. + delete_file(graph_file); +- save_graph(graph_file); ++ if (!_cuvs_cagra_index) ++ save_graph(graph_file); ++ else ++ { ++ std::ofstream out; ++ open_file_to_write(out, graph_file); ++ ++ size_t file_offset = 0; ++ out.seekp(file_offset, out.beg); ++ size_t index_size = 24; ++ uint32_t max_degree = _indexingRange; ++ out.write((char *)&index_size, sizeof(uint64_t)); ++ out.write((char *)&max_degree, sizeof(uint32_t)); ++ uint32_t ep_u32 = _start; ++ out.write((char *)&ep_u32, sizeof(uint32_t)); ++ out.write((char *)&_num_frozen_pts, sizeof(size_t)); ++ ++ uint32_t GK = (uint32_t)_indexingRange; ++ for (uint32_t i = 0; i < _nd + _num_frozen_pts; i++) ++ { ++ ++ out.write((char *)&GK, sizeof(uint32_t)); ++ out.write((char *)(host_cagra_graph.data() + _indexingRange * i), GK * sizeof(uint32_t)); ++ index_size += (size_t)(sizeof(uint32_t) * (GK + 1)); ++ } ++ out.seekp(file_offset, out.beg); ++ out.write((char *)&index_size, sizeof(uint64_t)); ++ out.write((char *)&max_degree, sizeof(uint32_t)); ++ out.close(); ++ } + delete_file(data_file); + save_data(data_file); + delete_file(tags_file); +@@ -732,6 +803,7 @@ template int Index template uint32_t Index::calculate_entry_point() { @@ -977,7 +902,7 @@ index bf93344..c7a3c96 100644 // 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 +780,7 @@ template uint32_t Index uint32_t Index std::vector Index::get_init_ids() { @@ -985,7 +910,7 @@ index bf93344..c7a3c96 100644 std::vector init_ids; init_ids.reserve(1 + _num_frozen_pts); -@@ -839,6 +881,8 @@ std::pair Index::iterate_to_fixed_point( +@@ -839,6 +912,8 @@ std::pair Index::iterate_to_fixed_point( _pq_data_store->get_distance(scratch->aligned_query(), ids, dists_out, scratch); }; @@ -994,7 +919,7 @@ index bf93344..c7a3c96 100644 // Initialize the candidate pool with starting points for (auto id : init_ids) { -@@ -1270,6 +1314,7 @@ void Index::inter_insert(uint32_t n, std::vector &pru +@@ -1270,6 +1345,7 @@ void Index::inter_insert(uint32_t n, std::vector &pru template void Index::link() { @@ -1002,65 +927,7 @@ index bf93344..c7a3c96 100644 uint32_t num_threads = _indexingThreads; if (num_threads != 0) omp_set_num_threads(num_threads); -@@ -1371,6 +1416,57 @@ template void Index void Index::add_cuvs_cagra_nbrs() -+{ -+ std::cout << "add_cuvs_cagra_neighbors" << std::endl; -+ 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 +1544,6 @@ void Index::set_start_points(const T *data, size_t data_count) +@@ -1448,8 +1524,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__); @@ -1069,7 +936,7 @@ index bf93344..c7a3c96 100644 for (location_t i = 0; i < _num_frozen_pts; i++) { _data_store->set_vector((location_t)(i + _max_points), data + i * _dim); -@@ -1505,6 +1599,21 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -1505,6 +1579,20 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } @@ -1077,37 +944,20 @@ index bf93344..c7a3c96 100644 +{ + raft::device_resources handle; + auto dataset_view = raft::make_host_matrix_view(data, int64_t(_nd), _dim); -+ auto cuvs_index = cuvs::neighbors::cagra::build(handle, *_cuvs_cagra_index_params, dataset_view); ++ auto cuvs_index = cuvs::neighbors::cagra::build(handle, *_cuvs_cagra_index_params, dataset_view); + auto stream = handle.get_stream(); + auto device_graph = cuvs_index.graph(); + host_cagra_graph.resize(device_graph.extent(0) * device_graph.extent(1)); + -+ thrust::copy(handle.get_thrust_policy(), thrust::device_ptr(device_graph.data_handle()), -+ thrust::device_ptr(device_graph.data_handle() + device_graph.size()), -+ host_cagra_graph.data()); ++ raft::copy(host_cagra_graph.data(), device_graph.data_handle(), device_graph.extent(0) * device_graph.extent(1), ++ stream); + handle.sync_stream(); +} + template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1542,7 +1651,14 @@ void Index::build_with_data_populated(const std::vector & - } - - generate_frozen_point(); -- link(); -+ if (_cuvs_cagra_index) -+ { -+ add_cuvs_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 +1675,7 @@ void Index::build_with_data_populated(const std::vector & +@@ -1559,6 +1647,7 @@ void Index::build_with_data_populated(const std::vector & _has_built = true; } @@ -1115,7 +965,7 @@ index bf93344..c7a3c96 100644 template void Index::_build(const DataType &data, const size_t num_points_to_load, TagVector &tags) { -@@ -1597,7 +1714,12 @@ void Index::build(const T *data, const size_t num_points_to_loa +@@ -1597,7 +1686,12 @@ void Index::build(const T *data, const size_t num_points_to_loa _data_store->populate_data(data, (location_t)num_points_to_load); } @@ -1129,29 +979,22 @@ index bf93344..c7a3c96 100644 } template -@@ -1657,7 +1779,7 @@ void Index::build(const char *filename, const size_t num_points - - // REFACTOR PQ TODO: We can remove this if and add a check in the InMemDataStore - // to not populate_data if it has been called once. -- if (_pq_dist) -+ if (_pq_dist && !_cuvs_cagra_index) - { - #ifdef EXEC_ENV_OLS - std::stringstream ss; -@@ -1683,6 +1805,13 @@ void Index::build(const char *filename, const size_t num_points +@@ -1683,7 +1777,14 @@ void Index::build(const char *filename, const size_t num_points std::unique_lock tl(_tag_lock); _nd = num_points_to_load; } +- build_with_data_populated(tags); + + if (_cuvs_cagra_index) + { + auto _in_mem_data_store = std::static_pointer_cast>(_data_store); + build_cuvs_cagra_index(_in_mem_data_store->_data); + } -+ // else - build_with_data_populated(tags); ++ else ++ build_with_data_populated(tags); } + template diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6af8405..a44caab 100644 --- a/tests/CMakeLists.txt diff --git a/cpp/cmake/patches/diskann_override.json b/cpp/cmake/patches/diskann_override.json index ed1283870..c83898548 100644 --- a/cpp/cmake/patches/diskann_override.json +++ b/cpp/cmake/patches/diskann_override.json @@ -1,9 +1,16 @@ { - "packages" : { - "faiss" : { - "version": "0.7.0", - "git_url": "https://github.com/microsoft/DiskANN.git", - "git_tag": "main" - } + "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" : "" + } + ] } - } \ No newline at end of file + } +} diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index 40313e4b3..51535e944 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -36,9 +36,7 @@ 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" - ) + "-DMKL_PATH /raid/tarangj/miniconda3/envs/all_cuda-125_arch-x86_64/lib") include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(diskann) From e0aab8f48f007536822a7ac22d49d69698fbc953 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 1 Aug 2024 12:31:26 -0700 Subject: [PATCH 04/58] diskann_memory working --- cpp/bench/ann/src/common/dataset.hpp | 18 +++---- .../ann/src/diskann/diskann_benchmark.cu | 16 +++--- cpp/bench/ann/src/diskann/diskann_wrapper.h | 51 +++++++++++-------- cpp/cmake/patches/diskann.diff | 8 ++- .../config/algos/diskann_memory.yaml | 20 ++++++++ .../cuvs_bench/config/constraints.py | 9 ++++ 6 files changed, 76 insertions(+), 46 deletions(-) create mode 100644 python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml diff --git a/cpp/bench/ann/src/common/dataset.hpp b/cpp/bench/ann/src/common/dataset.hpp index a0a7a5f5f..80b1590a3 100644 --- a/cpp/bench/ann/src/common/dataset.hpp +++ b/cpp/bench/ann/src/common/dataset.hpp @@ -114,10 +114,7 @@ class bin_file { } } - std::string file() const - { - return file_; - } + std::string file() const { return file_; } private: void check_suffix(); @@ -258,11 +255,11 @@ class dataset { auto name() const -> std::string { return name_; } auto distance() const -> std::string { return distance_; } - virtual auto dim() const -> int = 0; - virtual auto max_k() const -> uint32_t = 0; - virtual auto base_set_size() const -> size_t = 0; - virtual auto query_set_size() const -> size_t = 0; - std::string base_filename() const = 0; + virtual auto dim() const -> int = 0; + virtual auto max_k() const -> uint32_t = 0; + virtual auto base_set_size() const -> size_t = 0; + virtual auto query_set_size() const -> size_t = 0; + virtual auto base_filename() const -> std::string = 0; // load data lazily, so don't pay the overhead of reading unneeded set // e.g. don't load base set when searching @@ -503,7 +500,8 @@ void bin_dataset::map_base_set() const } template -std::string bin_dataset::base_filename() const { +std::string bin_dataset::base_filename() const +{ return base_file_.file(); } diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cu index 6810b00a2..92b390205 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cu +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cu @@ -62,7 +62,7 @@ std::unique_ptr> make_algo(cuvs::bench::Metric metric, int dim, const nlohmann::json& conf) { - typename Algo::BuildParam param; + typename Algo::build_param param; parse_build_param(conf, param); return std::make_unique>(metric, dim, param); } @@ -73,7 +73,7 @@ std::unique_ptr> make_algo(cuvs::bench::Metric metric, const nlohmann::json& conf, const std::vector& dev_list) { - typename Algo::BuildParam param; + typename Algo::build_param param; parse_build_param(conf, param); (void)dev_list; @@ -81,15 +81,11 @@ std::unique_ptr> make_algo(cuvs::bench::Metric metric, } template -std::unique_ptr> create_algo(const std::string& algo_name, - const std::string& distance, - int dim, - const nlohmann::json& conf, - const std::vector& dev_list) +auto create_algo(const std::string& algo_name, + const std::string& distance, + int dim, + const nlohmann::json& conf) -> std::unique_ptr> { - // stop compiler warning; not all algorithms support multi-GPU so it may not be used - (void)dev_list; - cuvs::bench::Metric metric = parse_metric(distance); std::unique_ptr> a; diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 4b1e274f8..63f6533cb 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -16,13 +16,14 @@ #pragma once #include "../common/ann_types.hpp" +#include "cuvs/neighbors/nn_descent.hpp" #include #include #include -#include #include +#include #include #include @@ -48,8 +49,9 @@ class diskann_memory : public algo { struct build_param { uint32_t R; uint32_t L_build; - float alpha = 1.2; - int num_threads = omp_get_num_procs(); + uint32_t build_pq_bytes = 0; + float alpha = 1.2; + int num_threads = omp_get_num_procs(); bool use_cagra_graph; uint32_t cagra_graph_degree; uint32_t cagra_intermediate_graph_degree; @@ -59,6 +61,7 @@ class diskann_memory : public algo { struct search_param : public search_param_base { uint32_t L_search; uint32_t num_threads = omp_get_num_procs(); + Mode metric_objective; }; diskann_memory(Metric metric, int dim, const build_param& param); @@ -66,8 +69,12 @@ class diskann_memory : public algo { void build(const T* dataset, size_t nrow) override; void set_search_param(const search_param_base& param) override; - void search( - const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const override; + + void search(const T* queries, + int batch_size, + int k, + algo_base::index_type* indices, + float* distances) const override; void save(const std::string& path_to_index) const override; void load(const std::string& path_to_index) override; @@ -84,13 +91,13 @@ class diskann_memory : public algo { private: bool use_cagra_graph_; - std::shared_ptr diskann_index_write_params_{nullptr}; + std::shared_ptr diskann_index_write_params_{nullptr}; uint32_t max_points_; + uint32_t build_pq_bytes_; std::shared_ptr> mem_index_{nullptr}; std::shared_ptr cagra_index_params_{nullptr}; int num_threads_; - // std::shared_ptr thread_pool_; uint32_t L_search_; Mode metric_objective_; int num_search_threads_; @@ -101,7 +108,7 @@ diskann_memory::diskann_memory(Metric metric, int dim, const build_param& par : algo(metric, dim) { assert(this->dim_ > 0); - num_threads_ = param.num_threads; + num_threads_ = param.num_threads; diskann_index_write_params_ = std::make_shared( diskann::IndexWriteParametersBuilder(param.L_build, param.R) .with_filter_list_size(0) @@ -114,10 +121,9 @@ diskann_memory::diskann_memory(Metric metric, int dim, const build_param& par cuvs::neighbors::cagra::index_params cagra_index_params; cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; cagra_index_params.graph_degree = param.cagra_graph_degree; - cagra_index_params.graph_build_params.nn_descent_params.graph_degree = - cagra_index_params.intermediate_graph_degree; - cagra_index_params.graph_build_params.nn_descent_params.intermediate_graph_degree = - 1.5 * cagra_index_params.intermediate_graph_degree; + auto nn_descent_params = cuvs::neighbors::nn_descent::index_params( + cagra_index_params.intermediate_graph_degree); + cagra_index_params.graph_build_params = nn_descent_params; cagra_index_params_ = std::make_shared(cagra_index_params); } @@ -136,8 +142,8 @@ void diskann_memory::build(const T* dataset, size_t nrow) false, false, false, - false, - 0, + !use_cagra_graph_ && build_pq_bytes_ > 0, + use_cagra_graph_ ? 0 : build_pq_bytes_, false, false, use_cagra_graph_, @@ -147,15 +153,18 @@ void diskann_memory::build(const T* dataset, size_t nrow) template void diskann_memory::set_search_param(const search_param_base& param_) { - auto param = dynamic_cast(param_); - this->L_search_ = param.L_search; - metric_objective_ = param.metric_objective; + auto param = dynamic_cast(param_); + this->L_search_ = param.L_search; + metric_objective_ = param.metric_objective; num_search_threads_ = param.num_threads; } template -void diskann_memory::search( - const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const +void diskann_memory::search(const T* queries, + int batch_size, + int k, + algo_base::index_type* indices, + float* distances) const { if (this->metric_objective_ == Mode::kLatency) { omp_set_num_threads(num_search_threads_); @@ -164,7 +173,7 @@ void diskann_memory::search( mem_index_->search(queries + i * this->dim_, static_cast(k), L_search_, - neighbors + i * k, + indices + i * k, distances + i * k); } } else { @@ -172,7 +181,7 @@ void diskann_memory::search( mem_index_->search(queries + i * this->dim_, static_cast(k), L_search_, - neighbors + i * k, + indices + i * k, distances + i * k); } } diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index f485262a2..c1e4f16de 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -743,7 +743,7 @@ index 096d1b7..6d01516 100644 \ No newline at end of file +endforeach() diff --git a/src/index.cpp b/src/index.cpp -index bf93344..269f314 100644 +index bf93344..531cd75 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1,6 +1,7 @@ @@ -845,17 +845,15 @@ index bf93344..269f314 100644 .build(), IndexFactory::construct_datastore(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -145,7 +185,9 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -145,6 +185,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point (size_t)((index_parameters == nullptr ? 0 : index_parameters->max_degree) * defaults::GRAPH_SLACK_FACTOR * 1.05))) { -- if (_pq_dist) + std::cout << "inside index build cuvs_cagra_index: " << cuvs_cagra_index + << " _cuvs_cagra_index: " << _cuvs_cagra_index << std::endl; -+ if (_pq_dist && !cuvs_cagra_index) + if (_pq_dist) { _pq_data_store = IndexFactory::construct_pq_datastore(DataStoreStrategy::MEMORY, max_points + num_frozen_pts, - dim, m, num_pq_chunks, use_opq); @@ -372,7 +414,36 @@ void Index::save(const char *filename, bool compact_before_save // the error code for delete_file, but will ignore now because // delete should succeed if save will succeed. diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml new file mode 100644 index 000000000..347257c2c --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml @@ -0,0 +1,20 @@ +name: diskann_memory +constraints: + build: cuvs_bench.constraints.diskann_memory_build_constraints + # search: cuvs_bench.constraints.diskann_memory_search_constraints +groups: + base: + build: + R: [64, 96] + L_build: [64, 128, 256, 384] + alpha: [1.0, 1.2] + use_cagra_graph: [False] + search: + L_search: [10, 20, 30, 40, 50, 100, 200, 300] + cagra: + build: + cagra_graph_degree: [32, 64, 96] + cagra_intermediate_graph_degree: [64, 96, 128] + use_cagra_graph: [True] + search: + L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file diff --git a/python/cuvs_bench/cuvs_bench/config/constraints.py b/python/cuvs_bench/cuvs_bench/config/constraints.py index ff451c056..e15092dfa 100644 --- a/python/cuvs_bench/cuvs_bench/config/constraints.py +++ b/python/cuvs_bench/cuvs_bench/config/constraints.py @@ -99,3 +99,12 @@ def faiss_gpu_ivf_pq_search(params, build_params, k, batch_size): def hnswlib_search(params, build_params, k, batch_size): if "ef" in params: return params["ef"] >= k + + +def diskann_memory_build(params, build_params, k, batch_size): + ret = True + if "cagra_graph_degree" in params: + ret = params["cagra_graph_degree"] <= params["cagra_intermediate_graph_degree"] + if "R" in params and "L_build" in params: + ret = params["R"] <= params["L_build"] + return ret \ No newline at end of file From a7bdd33eedeabe7804240eead38c12c01605ba97 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 2 Aug 2024 17:23:12 -0700 Subject: [PATCH 05/58] make compile --- cpp/bench/ann/CMakeLists.txt | 6 +- cpp/bench/ann/src/common/ann_types.hpp | 3 +- cpp/bench/ann/src/common/benchmark.hpp | 5 +- ...ann_benchmark.cu => diskann_benchmark.cpp} | 24 ++ cpp/bench/ann/src/diskann/diskann_wrapper.h | 330 +++++++++--------- cpp/cmake/patches/diskann.diff | 80 +++-- .../config/algos/diskann_memory.yaml | 2 +- .../cuvs_bench/config/algos/diskann_ssd.yaml | 20 ++ 8 files changed, 267 insertions(+), 203 deletions(-) rename cpp/bench/ann/src/diskann/{diskann_benchmark.cu => diskann_benchmark.cpp} (81%) create mode 100644 python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 679a866e2..8939b0213 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -301,7 +301,11 @@ if(CUVS_ANN_BENCH_USE_GGNN) endif() if(CUVS_ANN_BENCH_USE_DISKANN) - ConfigureAnnBench(NAME DISKANN PATH src/diskann/diskann_benchmark.cu LINKS cuvs diskann::diskann) + ConfigureAnnBench(NAME DISKANN_MEMORY PATH src/diskann/diskann_benchmark.cpp LINKS cuvs diskann::diskann) +endif() + +if(CUVS_ANN_BENCH_USE_DISKANN) + ConfigureAnnBench(NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS cuvs diskann::diskann) endif() # ################################################################################################## diff --git a/cpp/bench/ann/src/common/ann_types.hpp b/cpp/bench/ann/src/common/ann_types.hpp index 22a4cc11e..e815d85db 100644 --- a/cpp/bench/ann/src/common/ann_types.hpp +++ b/cpp/bench/ann/src/common/ann_types.hpp @@ -126,8 +126,9 @@ class algo : public algo_base { ~algo() noexcept override = default; virtual void build(const T* dataset, size_t nrow) = 0; + // virtual void build_from_dataset_bin(const std::string dataset_filename, size_t nrow); - virtual void build(std::string dataset_file, size_t nrow); + virtual void build_from_bin(std::string dataset_file, std::string path_to_index, size_t nrow) {}; virtual void set_search_param(const search_param& param) = 0; // TODO(snanditale): this assumes that an algorithm can always return k results. diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 16d87f4e1..b75217f1e 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -143,7 +143,7 @@ void bench_build(::benchmark::State& state, const auto algo_property = parse_algo_property(algo->get_preference(), index.build_param); - bool parse_base_file = (index.algo == "diskann_memory" || index.algo == "diskann_ssd"); + bool parse_base_file = index.algo == "diskann_ssd"; const T* base_set; if (parse_base_file) base_set = dataset->base_set(algo_property.dataset_memory_type); @@ -159,7 +159,8 @@ void bench_build(::benchmark::State& state, if (!parse_base_file) algo->build(base_set, index_size); else { - algo->build(dataset->base_filename(), index_size); + make_sure_parent_dir_exists(index.file); + algo->build_from_bin(dataset->base_filename(), index.file, index_size); } } catch (const std::exception& e) { state.SkipWithError(std::string(e.what())); diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cu b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp similarity index 81% rename from cpp/bench/ann/src/diskann/diskann_benchmark.cu rename to cpp/bench/ann/src/diskann/diskann_benchmark.cpp index 92b390205..b63d039b0 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cu +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -49,6 +49,16 @@ void parse_build_param(const nlohmann::json& conf, } } +template +void parse_build_param(const nlohmann::json& conf, + typename cuvs::bench::diskann_ssd::build_param& param) +{ + param.R = conf.at("R"); + if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } + if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } + // param.use_cagra_graph = conf.at("use_cagra_graph"); +} + template void parse_search_param(const nlohmann::json& conf, typename cuvs::bench::diskann_memory::search_param& param) @@ -57,6 +67,14 @@ void parse_search_param(const nlohmann::json& conf, param.num_threads = conf.at("num_threads"); } +template +void parse_search_param(const nlohmann::json& conf, + typename cuvs::bench::diskann_ssd::search_param& param) +{ + param.L_search = conf.at("L_search"); + param.num_threads = conf.at("num_threads"); +} + template class Algo> std::unique_ptr> make_algo(cuvs::bench::Metric metric, int dim, @@ -92,6 +110,8 @@ auto create_algo(const std::string& algo_name, if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) { if (algo_name == "diskann_memory") { a = make_algo(metric, dim, conf); } + else if (algo_name == "diskann_ssd") { a = make_algo(metric, dim, conf); } + } if (!a) { throw std::runtime_error("invalid algo: '" + algo_name + "'"); } @@ -106,6 +126,10 @@ std::unique_ptr::search_param> create_search_param auto param = std::make_unique::search_param>(); parse_search_param(conf, *param); return param; + } else if (algo_name == "diskann_ssd") { + auto param = std::make_unique::search_param>(); + parse_search_param(conf, *param); + return param; } throw std::runtime_error("invalid algo: '" + algo_name + "'"); } diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 63f6533cb..cb2257787 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -17,13 +17,16 @@ #include "../common/ann_types.hpp" #include "cuvs/neighbors/nn_descent.hpp" +#include "linux_aligned_file_reader.h" #include +#include #include #include #include #include +#include #include #include @@ -121,8 +124,8 @@ diskann_memory::diskann_memory(Metric metric, int dim, const build_param& par cuvs::neighbors::cagra::index_params cagra_index_params; cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; cagra_index_params.graph_degree = param.cagra_graph_degree; - auto nn_descent_params = cuvs::neighbors::nn_descent::index_params( - cagra_index_params.intermediate_graph_degree); + auto nn_descent_params = + cuvs::neighbors::nn_descent::index_params(cagra_index_params.intermediate_graph_degree); cagra_index_params.graph_build_params = nn_descent_params; cagra_index_params_ = std::make_shared(cagra_index_params); @@ -148,6 +151,7 @@ void diskann_memory::build(const T* dataset, size_t nrow) false, use_cagra_graph_, cagra_index_params_); + mem_index_->build(dataset, nrow, std::vector()); } template @@ -160,29 +164,26 @@ void diskann_memory::set_search_param(const search_param_base& param_) } template -void diskann_memory::search(const T* queries, - int batch_size, - int k, - algo_base::index_type* indices, - float* distances) const +void diskann_memory::search( + const T* queries, int batch_size, int k, algo_base::index_type* indices, float* distances) const { if (this->metric_objective_ == Mode::kLatency) { omp_set_num_threads(num_search_threads_); #pragma omp parallel for for (int64_t i = 0; i < (int64_t)batch_size; i++) { - mem_index_->search(queries + i * this->dim_, - static_cast(k), - L_search_, - indices + i * k, - distances + i * k); + // mem_index_->search(queries + i * this->dim_, + // static_cast(k), + // L_search_, + // indices + i * k, + // distances + i * k); } } else { for (int64_t i = 0; i < (int64_t)batch_size; i++) { - mem_index_->search(queries + i * this->dim_, - static_cast(k), - L_search_, - indices + i * k, - distances + i * k); + // mem_index_->search(queries + i * this->dim_, + // static_cast(k), + // L_search_, + // indices + i * k, + // distances + i * k); } } } @@ -199,154 +200,151 @@ void diskann_memory::load(const std::string& path_to_index) this->mem_index_->load(path_to_index.c_str(), num_threads_, 100); } -// template -// class diskann_ssd : public diskann_memory { -// public: -// struct build_param : public diskann_memory::build_param { -// uint32_t build_pq_bytes; -// }; - -// diskann_ssd(Metric metric, int dim, const build_param& param); - -// void build(const char* dataset_path, size_t nrow); - -// 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; -// diskann_ssd(const diskann_ssd& other) = default; -// std::unique_ptr> copy() override { return std::make_unique>(*this); } - -// algo_property get_preference() const override -// { -// algo_property property; -// property.dataset_memory_type = MemoryType::kHost; -// property.query_memory_type = MemoryType::kHost; -// return property; -// } - -// protected: -// uint32_t build_pq_bytes_ = 0; -// std::unique_ptr> p_flash_index_; - -// // std::shared_ptr thread_pool_; -// uint32_t num_nodes_to_cache_; -// }; - -// template -// diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) -// : algo(metric, dim) -// { -// assert(this->dim_ > 0); -// this->num_threads_ = param.num_threads; -// 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(num_threads_) -// .build()); -// use_cagra_graph_ = param.use_cagra_graph; -// if (use_cagra_graph_) { -// cuvs::neighbors::cagra::index_params cagra_index_params; -// cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; -// cagra_index_params.graph_degree = param.cagra_graph_degree; -// cagra_index_params.graph_build_params.nn_descent_params.graph_degree = -// cagra_index_params.intermediate_graph_degree; -// cagra_index_params.graph_build_params.nn_descent_params.intermediate_graph_degree = -// 1.5 * cagra_index_params.intermediate_graph_degree; -// cagra_index_params_ = -// std::make_shared(cagra_index_params); -// } -// } - -// template -// void diskann_ssd::build(std::string dataset_path, size_t nrow) -// { -// std::shared_ptr cagra_index_params_ptr{nullptr}; -// if (use_cagra_graph_) { -// cuvs::neighbors::cagra::index_params cagra_index_params; -// cagra_index_params.graph_degree = cagra_graph_degree_; -// cagra_index_params.intermediate_graph_degree = cagra_intermediate_graph_degree_; -// auto ivf_pq_params = cuvs::neighbors::cagra::graph_build_params::ivf_pq_params( -// raft::matrix_extent(nrow, this->dim_), parse_metric_type(this->metric_)); -// if (build_pq_bytes_ > 0) ivf_pq_params.build_params.pq_dim = build_pq_bytes_; -// ivf_pq_params.build_params.pq_bits = 8; -// cagra_index_params.graph_build_params = ivf_pq_params; -// cagra_index_params_ptr.reset(&cagra_index_params); -// } -// this->mem_index_ = std::make_shared>(parse_metric_to_diskann(this->metric_), -// this->dim_, -// nrow, -// diskann_index_write_params_, -// nullptr, -// 0, -// false, -// false, -// false, -// build_pq_bytes_ > 0, -// this->build_pq_bytes_, -// false, -// false, -// use_cagra_graph_, -// cagra_index_params_ptr); -// this->mem_index_->build(dataset_file.c_str(), nrow); -// } - -// template -// void diskann_ssd::set_search_param(const AnnSearchParam& param_) -// { -// auto param = dynamic_cast(param_); -// this->L_search_ = param.L_search; -// metric_objective_ = param.metric_objective; -// } - -// template -// void diskann_ssd::search( -// const T* queries, int batch_size, int k, size_t* neighbors, float* distances) const -// { -// std::vector node_list; -// p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); -// p_flash_index_->load_cache_list(node_list); -// node_list.clear(); -// node_list.shrink_to_fit(); - -// if (this->metric_objective_ == Mode::kLatency) { -// omp_set_num_threads(num_search_threads_); -// #pragma omp parallel for -// for (int64_t i = 0; i < (int64_t)batch_size; i++) { -// p_flash_index_->cached_beam_search(queries + (i * this->dim_), -// static_cast(k), -// L_search_, -// neighbors + i * k, -// distances + i * k, -// 2); -// } -// } else { -// for (int64_t i = 0; i < (int64_t)batch_size; i++) { -// p_flash_index_->cached_beam_search(queries + (i * this->dim_), -// static_cast(k), -// L_search_, -// neighbors + i * k, -// distances + i * k, -// 2); -// } -// } -// } - -// template -// void diskann_ssd::save(const std::string& path_to_index) const -// { -// this->diskann_index_->save(path_to_index.c_str()); -// } - -// template -// void diskann_ssd::load(const std::string& path_to_index) -// { -// std::shared_ptr reader = nullptr; -// reader.reset(new LinuxAlignedFileReader()); -// int result = p_flash_index_->load(omp_get_num_procs(), path_to_index.c_str()); -// } +template +class diskann_ssd : public algo { + public: + struct build_param { + uint32_t R; + uint32_t L_build; + uint32_t num_threads; + }; + + using search_param_base = typename algo::search_param; + struct search_param : public search_param_base { + uint32_t L_search; + uint32_t num_threads = omp_get_num_procs(); + Mode metric_objective; + }; + + diskann_ssd(Metric metric, int dim, const build_param& param); + + void build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) override; + void build(const T* dataset, size_t nrow) override {}; + + void set_search_param(const search_param_base& param_) override; + void search( + const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const override; + + void save(const std::string& path_to_index) const override; + void load(const std::string& path_to_index) override; + diskann_ssd(const diskann_ssd& other) = default; + std::unique_ptr> copy() override { return std::make_unique>(*this); } + + algo_property get_preference() const override + { + algo_property property; + property.dataset_memory_type = MemoryType::kHost; + property.query_memory_type = MemoryType::kHost; + return property; + } + + protected: + uint32_t build_pq_bytes_ = 0; + std::string index_build_params_str; +std::shared_ptr> p_flash_index_; + + // std::shared_ptr thread_pool_; + uint32_t num_nodes_to_cache_; + uint32_t L_search_; + + + bool use_cagra_graph_; + uint32_t max_points_; + std::shared_ptr> mem_index_{nullptr}; + std::shared_ptr cagra_index_params_{nullptr}; + int num_threads_; + + // uint32_t L_search_; + Mode metric_objective_; + // int num_search_threads_; +}; + +template +diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) : algo(metric, dim) +{ + // Currently set the indexing RAM budget and the search RAM budget to avoid sharding + uint32_t build_dram_budget = std::numeric_limits::max(); + uint32_t search_dram_budget = std::numeric_limits::max(); + index_build_params_str = std::string(std::to_string(param.R)) + " " + + std::string(std::to_string(param.L_build)) + " " + + std::string(std::to_string(search_dram_budget)) + " " + + std::string(std::to_string(build_dram_budget)) + " " + + std::string(std::to_string(param.num_threads)) + " " + + std::string(std::to_string(false)) + " " + std::string(std::to_string(false)) + + " " + std::string(std::to_string(0)) + " " + std::string(std::to_string(192)); +} + +template +void diskann_ssd::build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) +{ + // const std::string &b = ""; + // const std::string &c = ""; + diskann::build_disk_index(dataset_path.c_str(), path_to_index.c_str(), + index_build_params_str.c_str(), + parse_metric_to_diskann(this->metric_), + false, + std::string(""), + false, + std::string(""), + std::string(""), + static_cast(0), + static_cast(0), + cagra_index_params_); +} + +template +void diskann_ssd::set_search_param(const search_param_base& param_) +{ + auto param = dynamic_cast(param_); + this->L_search_ = param.L_search; + // metric_objective_ = param.metric_objective; +} + +template +void diskann_ssd::search( + const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const +{ + std::vector node_list; + p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); + p_flash_index_->load_cache_list(node_list); + node_list.clear(); + node_list.shrink_to_fit(); + + if (this->metric_objective_ == Mode::kLatency) { + omp_set_num_threads(omp_get_num_procs()); +#pragma omp parallel for + for (int64_t i = 0; i < (int64_t)batch_size; i++) { + p_flash_index_->cached_beam_search(queries + (i * this->dim_), + static_cast(k), + L_search_, + reinterpret_cast(neighbors + i * k), + distances + i * k, + 2); + } + } else { + for (int64_t i = 0; i < (int64_t)batch_size; i++) { + p_flash_index_->cached_beam_search(queries + (i * this->dim_), + static_cast(k), + L_search_, + reinterpret_cast(neighbors + i * k), + distances + i * k, + 2); + } + } +} + +template +void diskann_ssd::save(const std::string& path_to_index) const +{ + // Nothing to do here. Index already saved in build stage. +} + +template +void diskann_ssd::load(const std::string& path_to_index) +{ + std::shared_ptr reader = nullptr; + reader.reset(new LinuxAlignedFileReader()); + int result = p_flash_index_->load(omp_get_num_procs(), path_to_index.c_str()); +} }; // namespace cuvs::bench diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index c1e4f16de..3e48221dc 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -200,25 +200,34 @@ index 0000000..2703ec4 +endif() +include(${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) diff --git a/include/disk_utils.h b/include/disk_utils.h -index 08f046d..dc468d6 100644 +index 08f046d..9d88637 100644 --- a/include/disk_utils.h +++ b/include/disk_utils.h -@@ -82,7 +82,7 @@ DISKANN_DLLEXPORT int build_merged_vamana_index(std::string base_file, diskann:: +@@ -31,6 +31,8 @@ typedef int FileHandle; + #include "utils.h" + #include "windows_customizations.h" + ++#include ++ + namespace diskann + { + const size_t MAX_SAMPLE_POINTS_FOR_WARMUP = 100000; +@@ -82,7 +84,7 @@ DISKANN_DLLEXPORT int build_merged_vamana_index(std::string base_file, diskann:: uint32_t num_threads, bool use_filters = false, const std::string &label_file = std::string(""), const std::string &labels_to_medoids_file = std::string(""), - const std::string &universal_label = "", const uint32_t Lf = 0); -+ const std::string &universal_label = "", const uint32_t Lf = 0, bool use_cuvs_cagra_graph = false); ++ const std::string &universal_label = "", const uint32_t Lf = 0, std::shared_ptr cagra_index_params = nullptr); template DISKANN_DLLEXPORT uint32_t optimize_beamwidth(std::unique_ptr> &_pFlashIndex, -@@ -98,7 +98,8 @@ DISKANN_DLLEXPORT int build_disk_index( +@@ -98,7 +100,8 @@ DISKANN_DLLEXPORT int build_disk_index( bool use_filters = false, const std::string &label_file = std::string(""), // default is empty string for no label_file const std::string &universal_label = "", const uint32_t filter_threshold = 0, - const uint32_t Lf = 0); // default is empty string for no universal label + const uint32_t Lf = 0, -+ bool use_cuvs_cagra_graph = false); // default is empty string for no universal label ++ std::shared_ptr cagra_index_params = nullptr); // default is empty string for no universal label template DISKANN_DLLEXPORT void create_disk_layout(const std::string base_file, const std::string mem_index_file, @@ -547,7 +556,7 @@ index cbca264..de3dadd 100644 if (NOT MSVC) diff --git a/src/disk_utils.cpp b/src/disk_utils.cpp -index 0165602..dee8675 100644 +index 0165602..ee550c1 100644 --- a/src/disk_utils.cpp +++ b/src/disk_utils.cpp @@ -2,6 +2,7 @@ @@ -571,7 +580,7 @@ index 0165602..dee8675 100644 uint32_t num_threads, bool use_filters, const std::string &label_file, const std::string &labels_to_medoids_file, const std::string &universal_label, - const uint32_t Lf) -+ const uint32_t Lf, bool use_cuvs_cagra_graph) ++ const uint32_t Lf, std::shared_ptr cagra_index_params) { + std::cout << "inside build_merged_vamana_index" << std::endl; size_t base_num, base_dim; @@ -582,31 +591,38 @@ index 0165602..dee8675 100644 std::make_shared(paras), nullptr, defaults::NUM_FROZEN_POINTS_STATIC, false, false, false, - build_pq_bytes > 0, build_pq_bytes, use_opq, use_filters); -+ build_pq_bytes > 0, build_pq_bytes, use_opq, use_filters, use_cuvs_cagra_graph); ++ build_pq_bytes > 0, build_pq_bytes, use_opq, use_filters, cagra_index_params != nullptr, cagra_index_params); if (!use_filters) _index.build(base_file.c_str(), base_num); else -@@ -723,7 +726,7 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr - diskann::Index _index(compareMetric, shard_base_dim, shard_base_pts, +@@ -719,11 +722,12 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr + + uint64_t shard_base_dim, shard_base_pts; + get_bin_metadata(shard_base_file, shard_base_pts, shard_base_dim); ++ bool use_cuvs_cagra_graph = cagra_index_params != nullptr; + +- diskann::Index _index(compareMetric, shard_base_dim, shard_base_pts, ++ diskann::Index _index(compareMetric, shard_base_dim, shard_base_pts, std::make_shared(low_degree_params), nullptr, defaults::NUM_FROZEN_POINTS_STATIC, false, false, false, build_pq_bytes > 0, - build_pq_bytes, use_opq); -+ build_pq_bytes, use_opq, use_cuvs_cagra_graph); ++ build_pq_bytes, use_opq, false, use_cuvs_cagra_graph, cagra_index_params); if (!use_filters) { _index.build(shard_base_file.c_str(), shard_base_pts); -@@ -1101,8 +1104,9 @@ template +@@ -1101,8 +1105,10 @@ template int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, diskann::Metric compareMetric, bool use_opq, const std::string &codebook_prefix, bool use_filters, const std::string &label_file, const std::string &universal_label, const uint32_t filter_threshold, - const uint32_t Lf) -+ const uint32_t Lf, bool use_cuvs_cagra_graph) ++ const uint32_t Lf, std::shared_ptr cagra_index_params) { -+ std::cout << "inside build_disk_index: use_cuvs_cagra_graph: " << use_cuvs_cagra_graph << std::endl; ++ bool use_cuvs_cagra_graph = cagra_index_params != nullptr; ++ // std::cout << "inside build_disk_index: use_cuvs_cagra_graph: " << use_cuvs_cagra_graph << std::endl; std::stringstream parser; parser << std::string(indexBuildParameters); std::string cur_param; -@@ -1289,7 +1293,9 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const +@@ -1289,7 +1295,9 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const Timer timer; diskann::get_bin_metadata(data_file_to_use.c_str(), points_num, dim); const double p_val = ((double)MAX_PQ_TRAINING_SET_SIZE / (double)points_num); @@ -617,7 +633,7 @@ index 0165602..dee8675 100644 if (use_disk_pq) { generate_disk_quantized_data(data_file_to_use, disk_pq_pivots_path, disk_pq_compressed_vectors_path, -@@ -1309,12 +1315,14 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const +@@ -1309,12 +1317,14 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const num_pq_chunks = atoi(param_list[8].c_str()); } @@ -632,7 +648,7 @@ index 0165602..dee8675 100644 // Gopal. Splitting diskann_dll into separate DLLs for search and build. // This code should only be available in the "build" DLL. -@@ -1323,10 +1331,11 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const +@@ -1323,10 +1333,11 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const #endif // Whether it is cosine or inner product, we still L2 metric due to the pre-processing. timer.reset(); @@ -641,16 +657,16 @@ index 0165602..dee8675 100644 indexing_ram_budget, mem_index_path, medoids_path, centroids_path, build_pq_bytes, use_opq, num_threads, use_filters, labels_file_to_use, - labels_to_medoids_path, universal_label, Lf); -+ labels_to_medoids_path, universal_label, Lf, use_cuvs_cagra_graph); ++ labels_to_medoids_path, universal_label, Lf, cagra_index_params); diskann::cout << timer.elapsed_seconds_for_step("building merged vamana index") << std::endl; timer.reset(); -@@ -1432,21 +1441,21 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da +@@ -1432,21 +1443,21 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da const std::string &codebook_prefix, bool use_filters, const std::string &label_file, const std::string &universal_label, - const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, diskann::Metric compareMetric, bool use_opq, @@ -658,7 +674,7 @@ index 0165602..dee8675 100644 const std::string &label_file, const std::string &universal_label, - const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, diskann::Metric compareMetric, bool use_opq, @@ -666,16 +682,16 @@ index 0165602..dee8675 100644 const std::string &label_file, const std::string &universal_label, - const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); // LabelT = uint16 template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, -@@ -1454,51 +1463,51 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da +@@ -1454,51 +1465,51 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da const std::string &codebook_prefix, bool use_filters, const std::string &label_file, const std::string &universal_label, - const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, diskann::Metric compareMetric, bool use_opq, @@ -683,7 +699,7 @@ index 0165602..dee8675 100644 const std::string &label_file, const std::string &universal_label, - const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, diskann::Metric compareMetric, bool use_opq, @@ -691,45 +707,45 @@ index 0165602..dee8675 100644 const std::string &label_file, const std::string &universal_label, - const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_merged_vamana_index( std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, - const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_merged_vamana_index( std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, - const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_merged_vamana_index( std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, - const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); // Label=16_t template DISKANN_DLLEXPORT int build_merged_vamana_index( std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, - const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_merged_vamana_index( std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, - const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); template DISKANN_DLLEXPORT int build_merged_vamana_index( std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, - const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, bool use_cuvs_cagra_graph); ++ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); }; // namespace diskann diff --git a/src/dll/CMakeLists.txt b/src/dll/CMakeLists.txt index 096d1b7..6d01516 100644 diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml index 347257c2c..7ec9e709f 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml @@ -1,7 +1,7 @@ name: diskann_memory constraints: build: cuvs_bench.constraints.diskann_memory_build_constraints - # search: cuvs_bench.constraints.diskann_memory_search_constraints + search: cuvs_bench.constraints.diskann_memory_search_constraints groups: base: build: diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml new file mode 100644 index 000000000..ee0ab31f2 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml @@ -0,0 +1,20 @@ +name: diskann_ssd +constraints: + # build: cuvs_bench.constraints.diskann_memory_build_constraints + # search: cuvs_bench.constraints.diskann_memory_search_constraints +groups: + base: + build: + R: [64] + L_build: [128] + # alpha: [1.0, 1.2] + # use_cagra_graph: [False] + search: + L_search: [10, 20, 30, 40, 50, 100, 200, 300] + # cagra: + # build: + # cagra_graph_degree: [32, 64, 96] + # cagra_intermediate_graph_degree: [64, 96, 128] + # use_cagra_graph: [True] + # search: + # L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file From dbc84cc226f78d0b36bb1ef9858d82d6371303c0 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 5 Aug 2024 11:10:00 -0700 Subject: [PATCH 06/58] rm num_threads_ --- cpp/bench/ann/src/diskann/diskann_wrapper.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index cb2257787..b290d0c87 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -253,7 +253,6 @@ std::shared_ptr> p_flash_index_; uint32_t max_points_; std::shared_ptr> mem_index_{nullptr}; std::shared_ptr cagra_index_params_{nullptr}; - int num_threads_; // uint32_t L_search_; Mode metric_objective_; @@ -278,8 +277,6 @@ diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) : template void diskann_ssd::build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) { - // const std::string &b = ""; - // const std::string &c = ""; diskann::build_disk_index(dataset_path.c_str(), path_to_index.c_str(), index_build_params_str.c_str(), parse_metric_to_diskann(this->metric_), From 7e3721809c8142ae5daa31e59fb0a1ae74b7a04e Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Mon, 5 Aug 2024 16:01:27 -0500 Subject: [PATCH 07/58] FEA Add cuvs-bench to dependencies and conda environments --- .../bench_ann_cuda-118_arch-aarch64.yaml | 43 ++++ .../bench_ann_cuda-118_arch-x86_64.yaml | 43 ++++ .../bench_ann_cuda-125_arch-aarch64.yaml | 39 ++++ .../bench_ann_cuda-125_arch-x86_64.yaml | 39 ++++ dependencies.yaml | 45 ++++ python/cuvs_bench/LICENSE | 201 ++++++++++++++++++ python/cuvs_bench/cuvs_bench/VERSION | 1 + python/cuvs_bench/pyproject.toml | 70 ++++++ 8 files changed, 481 insertions(+) create mode 100644 conda/environments/bench_ann_cuda-118_arch-aarch64.yaml create mode 100644 conda/environments/bench_ann_cuda-118_arch-x86_64.yaml create mode 100644 conda/environments/bench_ann_cuda-125_arch-aarch64.yaml create mode 100644 conda/environments/bench_ann_cuda-125_arch-x86_64.yaml create mode 100644 python/cuvs_bench/LICENSE create mode 100644 python/cuvs_bench/cuvs_bench/VERSION create mode 100644 python/cuvs_bench/pyproject.toml diff --git a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml new file mode 100644 index 000000000..4f24d08ec --- /dev/null +++ b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml @@ -0,0 +1,43 @@ +# This file is generated by `rapids-dependency-file-generator`. +# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +channels: +- rapidsai +- rapidsai-nightly +- dask/label/dev +- conda-forge +- nvidia +dependencies: +- benchmark>=1.8.2 +- c-compiler +- clang-tools=16.0.6 +- clang==16.0.6 +- cmake>=3.26.4,!=3.30.0 +- cuda-nvtx=11.8 +- cuda-profiler-api=11.8.86 +- cuda-version=11.8 +- cudatoolkit +- cxx-compiler +- cython>=3.0.0 +- gcc_linux-aarch64=11.* +- glog>=0.6.0 +- h5py>=3.8.0 +- hnswlib=0.7.0 +- libcublas-dev=11.11.3.6 +- libcublas=11.11.3.6 +- libcurand-dev=10.3.0.86 +- libcurand=10.3.0.86 +- libcusolver-dev=11.4.1.48 +- libcusolver=11.4.1.48 +- libcusparse-dev=11.7.5.86 +- libcusparse=11.7.5.86 +- matplotlib +- nccl>=2.9.9 +- ninja +- nlohmann_json>=3.11.2 +- nvcc_linux-aarch64=11.8 +- openblas +- pandas +- pyyaml +- rmm==24.10.*,>=0.0.0a0 +- sysroot_linux-aarch64==2.17 +name: bench_ann_cuda-118_arch-aarch64 diff --git a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml new file mode 100644 index 000000000..7d5f8236c --- /dev/null +++ b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml @@ -0,0 +1,43 @@ +# This file is generated by `rapids-dependency-file-generator`. +# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +channels: +- rapidsai +- rapidsai-nightly +- dask/label/dev +- conda-forge +- nvidia +dependencies: +- benchmark>=1.8.2 +- c-compiler +- clang-tools=16.0.6 +- clang==16.0.6 +- cmake>=3.26.4,!=3.30.0 +- cuda-nvtx=11.8 +- cuda-profiler-api=11.8.86 +- cuda-version=11.8 +- cudatoolkit +- cxx-compiler +- cython>=3.0.0 +- gcc_linux-64=11.* +- glog>=0.6.0 +- h5py>=3.8.0 +- hnswlib=0.7.0 +- libcublas-dev=11.11.3.6 +- libcublas=11.11.3.6 +- libcurand-dev=10.3.0.86 +- libcurand=10.3.0.86 +- libcusolver-dev=11.4.1.48 +- libcusolver=11.4.1.48 +- libcusparse-dev=11.7.5.86 +- libcusparse=11.7.5.86 +- matplotlib +- nccl>=2.9.9 +- ninja +- nlohmann_json>=3.11.2 +- nvcc_linux-64=11.8 +- openblas +- pandas +- pyyaml +- rmm==24.10.*,>=0.0.0a0 +- sysroot_linux-64==2.17 +name: bench_ann_cuda-118_arch-x86_64 diff --git a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml new file mode 100644 index 000000000..50a4b2d40 --- /dev/null +++ b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml @@ -0,0 +1,39 @@ +# This file is generated by `rapids-dependency-file-generator`. +# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +channels: +- rapidsai +- rapidsai-nightly +- dask/label/dev +- conda-forge +- nvidia +dependencies: +- benchmark>=1.8.2 +- c-compiler +- clang-tools=16.0.6 +- clang==16.0.6 +- cmake>=3.26.4,!=3.30.0 +- cuda-cudart-dev +- cuda-nvcc +- cuda-nvtx-dev +- cuda-profiler-api +- cuda-version=12.5 +- cxx-compiler +- cython>=3.0.0 +- gcc_linux-aarch64=11.* +- glog>=0.6.0 +- h5py>=3.8.0 +- hnswlib=0.7.0 +- libcublas-dev +- libcurand-dev +- libcusolver-dev +- libcusparse-dev +- matplotlib +- nccl>=2.9.9 +- ninja +- nlohmann_json>=3.11.2 +- openblas +- pandas +- pyyaml +- rmm==24.10.*,>=0.0.0a0 +- sysroot_linux-aarch64==2.17 +name: bench_ann_cuda-125_arch-aarch64 diff --git a/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml new file mode 100644 index 000000000..ab266d405 --- /dev/null +++ b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml @@ -0,0 +1,39 @@ +# This file is generated by `rapids-dependency-file-generator`. +# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +channels: +- rapidsai +- rapidsai-nightly +- dask/label/dev +- conda-forge +- nvidia +dependencies: +- benchmark>=1.8.2 +- c-compiler +- clang-tools=16.0.6 +- clang==16.0.6 +- cmake>=3.26.4,!=3.30.0 +- cuda-cudart-dev +- cuda-nvcc +- cuda-nvtx-dev +- cuda-profiler-api +- cuda-version=12.5 +- cxx-compiler +- cython>=3.0.0 +- gcc_linux-64=11.* +- glog>=0.6.0 +- h5py>=3.8.0 +- hnswlib=0.7.0 +- libcublas-dev +- libcurand-dev +- libcusolver-dev +- libcusparse-dev +- matplotlib +- nccl>=2.9.9 +- ninja +- nlohmann_json>=3.11.2 +- openblas +- pandas +- pyyaml +- rmm==24.10.*,>=0.0.0a0 +- sysroot_linux-64==2.17 +name: bench_ann_cuda-125_arch-x86_64 diff --git a/dependencies.yaml b/dependencies.yaml index 9bb8682bf..dc773ab69 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -21,6 +21,18 @@ files: - test_py_cuvs - cupy - rust + bench_ann: + output: conda + matrix: + cuda: ["11.8", "12.5"] + arch: [x86_64, aarch64] + includes: + - rapids_build + - cuda + - cuda_version + - develop + - bench + - bench_python test_cpp: output: none includes: @@ -89,6 +101,20 @@ files: - test_python_common - test_py_cuvs - cupy + py_build_cuvs_bench: + output: pyproject + pyproject_dir: python/cuvs_bench + extras: + table: build-system + includes: + - rapids_build + py_run_cuvs_bench: + output: pyproject + pyproject_dir: python/cuvs_bench + extras: + table: project + includes: + - bench_python channels: - rapidsai - rapidsai-nightly @@ -429,3 +455,22 @@ dependencies: - output_types: [conda, requirements, pyproject] packages: - scikit-learn + bench: + common: + - output_types: [conda, pyproject, requirements] + packages: + - hnswlib=0.7.0 + - nlohmann_json>=3.11.2 + - glog>=0.6.0 + - h5py>=3.8.0 + - benchmark>=1.8.2 + - openblas + - *rmm_unsuffixed + bench_python: + common: + - output_types: [conda] + packages: + - matplotlib + - pandas + - pyyaml + - pandas diff --git a/python/cuvs_bench/LICENSE b/python/cuvs_bench/LICENSE new file mode 100644 index 000000000..1a89b9054 --- /dev/null +++ b/python/cuvs_bench/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 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. diff --git a/python/cuvs_bench/cuvs_bench/VERSION b/python/cuvs_bench/cuvs_bench/VERSION new file mode 100644 index 000000000..7c7ba0443 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/VERSION @@ -0,0 +1 @@ +24.10.00 diff --git a/python/cuvs_bench/pyproject.toml b/python/cuvs_bench/pyproject.toml new file mode 100644 index 000000000..17caa8e28 --- /dev/null +++ b/python/cuvs_bench/pyproject.toml @@ -0,0 +1,70 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + +[build-system] +build-backend = "rapids_build_backend.build" +requires = [ + "cmake>=3.26.4,!=3.30.0", + "cython>=3.0.0", + "ninja", +] # 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" +dynamic = ["version"] +description = "cuVS benchmarks" +authors = [ + { name = "NVIDIA Corporation" }, +] +license = { text = "Apache 2.0" } +requires-python = ">=3.9" +dependencies = [ +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Database", + "Topic :: Scientific/Engineering", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] + +[project.urls] +Homepage = "https://github.com/rapidsai/raft" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +"*" = ["*.*", "VERSION"] + +[tool.isort] +line_length = 79 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +combine_as_imports = true +order_by_type = true +skip = [ + "thirdparty", + ".eggs", + ".git", + ".hg", + ".mypy_cache", + ".tox", + ".venv", + "_build", + "buck-out", + "build", + "dist", +] + +[tool.setuptools.dynamic] +version = { file = "cuvs_bench/VERSION" } + +[tool.rapids-build-backend] +build-backend = "scikit_build_core.build" +requires = [] +dependencies-file = "../../dependencies.yaml" +matrix-entry = "cuda_suffixed=true" From b2aef6d6e1a11120a6bff67ad09b079df807177e Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Mon, 5 Aug 2024 16:10:40 -0500 Subject: [PATCH 08/58] FIX add missing deps --- conda/environments/bench_ann_cuda-118_arch-aarch64.yaml | 3 +++ conda/environments/bench_ann_cuda-118_arch-x86_64.yaml | 3 +++ conda/environments/bench_ann_cuda-125_arch-aarch64.yaml | 3 +++ conda/environments/bench_ann_cuda-125_arch-x86_64.yaml | 3 +++ dependencies.yaml | 1 + 5 files changed, 13 insertions(+) diff --git a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml index 4f24d08ec..cc43126a7 100644 --- a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml @@ -14,10 +14,12 @@ dependencies: - cmake>=3.26.4,!=3.30.0 - cuda-nvtx=11.8 - cuda-profiler-api=11.8.86 +- cuda-python>=11.7.1,<12.0a0 - cuda-version=11.8 - cudatoolkit - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - gcc_linux-aarch64=11.* - glog>=0.6.0 - h5py>=3.8.0 @@ -37,6 +39,7 @@ dependencies: - nvcc_linux-aarch64=11.8 - openblas - pandas +- pylibraft==24.10.*,>=0.0.0a0 - pyyaml - rmm==24.10.*,>=0.0.0a0 - sysroot_linux-aarch64==2.17 diff --git a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml index 7d5f8236c..a1f01f19e 100644 --- a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml @@ -14,10 +14,12 @@ dependencies: - cmake>=3.26.4,!=3.30.0 - cuda-nvtx=11.8 - cuda-profiler-api=11.8.86 +- cuda-python>=11.7.1,<12.0a0 - cuda-version=11.8 - cudatoolkit - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - gcc_linux-64=11.* - glog>=0.6.0 - h5py>=3.8.0 @@ -37,6 +39,7 @@ dependencies: - nvcc_linux-64=11.8 - openblas - pandas +- pylibraft==24.10.*,>=0.0.0a0 - pyyaml - rmm==24.10.*,>=0.0.0a0 - sysroot_linux-64==2.17 diff --git a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml index 50a4b2d40..6251a5e16 100644 --- a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml @@ -16,9 +16,11 @@ dependencies: - cuda-nvcc - cuda-nvtx-dev - cuda-profiler-api +- cuda-python>=12.0,<13.0a0 - cuda-version=12.5 - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - gcc_linux-aarch64=11.* - glog>=0.6.0 - h5py>=3.8.0 @@ -33,6 +35,7 @@ dependencies: - nlohmann_json>=3.11.2 - openblas - pandas +- pylibraft==24.10.*,>=0.0.0a0 - pyyaml - rmm==24.10.*,>=0.0.0a0 - sysroot_linux-aarch64==2.17 diff --git a/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml index ab266d405..faf370143 100644 --- a/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml @@ -16,9 +16,11 @@ dependencies: - cuda-nvcc - cuda-nvtx-dev - cuda-profiler-api +- cuda-python>=12.0,<13.0a0 - cuda-version=12.5 - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - gcc_linux-64=11.* - glog>=0.6.0 - h5py>=3.8.0 @@ -33,6 +35,7 @@ dependencies: - nlohmann_json>=3.11.2 - openblas - pandas +- pylibraft==24.10.*,>=0.0.0a0 - pyyaml - rmm==24.10.*,>=0.0.0a0 - sysroot_linux-64==2.17 diff --git a/dependencies.yaml b/dependencies.yaml index dc773ab69..3a0d9577f 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -28,6 +28,7 @@ files: arch: [x86_64, aarch64] includes: - rapids_build + - build_py_cuvs - cuda - cuda_version - develop From bf75242d7661dbe946f979bf79d91aa34977d62e Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Mon, 5 Aug 2024 19:52:31 -0500 Subject: [PATCH 09/58] FIX version and other improvements --- conda/environments/bench_ann_cuda-118_arch-aarch64.yaml | 2 +- conda/environments/bench_ann_cuda-118_arch-x86_64.yaml | 2 +- conda/environments/bench_ann_cuda-125_arch-aarch64.yaml | 2 +- conda/environments/bench_ann_cuda-125_arch-x86_64.yaml | 2 +- dependencies.yaml | 3 ++- python/cuvs_bench/pyproject.toml | 5 ++++- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml index cc43126a7..5ca327fc5 100644 --- a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml @@ -23,7 +23,7 @@ dependencies: - gcc_linux-aarch64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.7.0 +- hnswlib=0.6.2 - libcublas-dev=11.11.3.6 - libcublas=11.11.3.6 - libcurand-dev=10.3.0.86 diff --git a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml index a1f01f19e..410624168 100644 --- a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml @@ -23,7 +23,7 @@ dependencies: - gcc_linux-64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.7.0 +- hnswlib=0.6.2 - libcublas-dev=11.11.3.6 - libcublas=11.11.3.6 - libcurand-dev=10.3.0.86 diff --git a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml index 6251a5e16..f22f6ee44 100644 --- a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml @@ -24,7 +24,7 @@ dependencies: - gcc_linux-aarch64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.7.0 +- hnswlib=0.6.2 - libcublas-dev - libcurand-dev - libcusolver-dev diff --git a/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml index faf370143..06b2c5338 100644 --- a/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml @@ -24,7 +24,7 @@ dependencies: - gcc_linux-64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.7.0 +- hnswlib=0.6.2 - libcublas-dev - libcurand-dev - libcusolver-dev diff --git a/dependencies.yaml b/dependencies.yaml index 3a0d9577f..9f44911c8 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -109,6 +109,7 @@ files: table: build-system includes: - rapids_build + - build_py_cuvs py_run_cuvs_bench: output: pyproject pyproject_dir: python/cuvs_bench @@ -460,7 +461,7 @@ dependencies: common: - output_types: [conda, pyproject, requirements] packages: - - hnswlib=0.7.0 + - hnswlib=0.6.2 - nlohmann_json>=3.11.2 - glog>=0.6.0 - h5py>=3.8.0 diff --git a/python/cuvs_bench/pyproject.toml b/python/cuvs_bench/pyproject.toml index 17caa8e28..ec41af3df 100644 --- a/python/cuvs_bench/pyproject.toml +++ b/python/cuvs_bench/pyproject.toml @@ -4,12 +4,15 @@ build-backend = "rapids_build_backend.build" requires = [ "cmake>=3.26.4,!=3.30.0", + "cuda-python", "cython>=3.0.0", "ninja", + "pylibraft==24.10.*,>=0.0.0a0", + "rmm==24.10.*,>=0.0.0a0", ] # 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 = "cuvs-bench" dynamic = ["version"] description = "cuVS benchmarks" authors = [ From a8bcdef525055669238156da94d800dc0614097a Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Tue, 6 Aug 2024 15:59:32 -0500 Subject: [PATCH 10/58] FEA Add cuvs_bench.run --- .../bench_ann_cuda-118_arch-aarch64.yaml | 3 +- .../bench_ann_cuda-118_arch-x86_64.yaml | 3 +- .../bench_ann_cuda-125_arch-aarch64.yaml | 3 +- .../bench_ann_cuda-125_arch-x86_64.yaml | 3 +- cpp/CMakeLists.txt | 2 +- dependencies.yaml | 11 +- .../cuvs_bench/config/algos/__init__.py | 0 .../constraints/__init__.py} | 2 +- .../cuvs_bench/config/algos/cuvs_cagra.yaml | 4 +- .../config/algos/cuvs_cagra_hnswlib.yaml | 2 +- .../cuvs_bench/config/algos/cuvs_ivf_pq.yaml | 4 +- .../config/algos/faiss_gpu_ivf_pq.yaml | 4 +- .../cuvs_bench/config/algos/hnswlib.yaml | 2 +- .../config/{ => datasets}/bigann-100M.yaml | 0 .../config/{ => datasets}/datasets.yaml | 0 .../config/{ => datasets}/deep-100M.yaml | 0 .../config/{ => datasets}/deep-1B.yaml | 0 .../{ => datasets}/deep-image-96-inner.yaml | 0 .../fashion-mnist-784-euclidean.yaml | 0 .../{ => datasets}/gist-960-euclidean.yaml | 0 .../{ => datasets}/glove-100-angular.yaml | 0 .../{ => datasets}/glove-100-inner.yaml | 0 .../{ => datasets}/glove-50-angular.yaml | 0 .../config/{ => datasets}/glove-50-inner.yaml | 0 .../{ => datasets}/lastfm-65-angular.yaml | 0 .../{ => datasets}/mnist-784-euclidean.yaml | 0 .../{ => datasets}/nytimes-256-angular.yaml | 0 .../{ => datasets}/nytimes-256-inner.yaml | 0 .../{ => datasets}/sift-128-euclidean.yaml | 0 .../config/{ => datasets}/wiki_all_10M.yaml | 0 .../config/{ => datasets}/wiki_all_1M.yaml | 0 .../config/{ => datasets}/wiki_all_88M.yaml | 0 python/cuvs_bench/cuvs_bench/run/__init__.py | 17 + python/cuvs_bench/cuvs_bench/run/__main__.py | 202 +++++++ python/cuvs_bench/cuvs_bench/run/run.py | 538 ++++++++++++++++++ python/cuvs_bench/cuvs_bench/run/runners.py | 246 ++++++++ python/cuvs_bench/pyproject.toml | 17 +- 37 files changed, 1024 insertions(+), 39 deletions(-) create mode 100644 python/cuvs_bench/cuvs_bench/config/algos/__init__.py rename python/cuvs_bench/cuvs_bench/config/{constraints.py => algos/constraints/__init__.py} (98%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/bigann-100M.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/datasets.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/deep-100M.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/deep-1B.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/deep-image-96-inner.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/fashion-mnist-784-euclidean.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/gist-960-euclidean.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/glove-100-angular.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/glove-100-inner.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/glove-50-angular.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/glove-50-inner.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/lastfm-65-angular.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/mnist-784-euclidean.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/nytimes-256-angular.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/nytimes-256-inner.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/sift-128-euclidean.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/wiki_all_10M.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/wiki_all_1M.yaml (100%) rename python/cuvs_bench/cuvs_bench/config/{ => datasets}/wiki_all_88M.yaml (100%) create mode 100644 python/cuvs_bench/cuvs_bench/run/__init__.py create mode 100644 python/cuvs_bench/cuvs_bench/run/__main__.py create mode 100644 python/cuvs_bench/cuvs_bench/run/run.py create mode 100644 python/cuvs_bench/cuvs_bench/run/runners.py diff --git a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml index 5ca327fc5..eee696308 100644 --- a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml @@ -11,6 +11,7 @@ dependencies: - c-compiler - clang-tools=16.0.6 - clang==16.0.6 +- click - cmake>=3.26.4,!=3.30.0 - cuda-nvtx=11.8 - cuda-profiler-api=11.8.86 @@ -23,7 +24,7 @@ dependencies: - gcc_linux-aarch64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.6.2 +- hnswlib=0.7.0 - libcublas-dev=11.11.3.6 - libcublas=11.11.3.6 - libcurand-dev=10.3.0.86 diff --git a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml index 410624168..92a246d18 100644 --- a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml @@ -11,6 +11,7 @@ dependencies: - c-compiler - clang-tools=16.0.6 - clang==16.0.6 +- click - cmake>=3.26.4,!=3.30.0 - cuda-nvtx=11.8 - cuda-profiler-api=11.8.86 @@ -23,7 +24,7 @@ dependencies: - gcc_linux-64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.6.2 +- hnswlib=0.7.0 - libcublas-dev=11.11.3.6 - libcublas=11.11.3.6 - libcurand-dev=10.3.0.86 diff --git a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml index f22f6ee44..77db9fc09 100644 --- a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml @@ -11,6 +11,7 @@ dependencies: - c-compiler - clang-tools=16.0.6 - clang==16.0.6 +- click - cmake>=3.26.4,!=3.30.0 - cuda-cudart-dev - cuda-nvcc @@ -24,7 +25,7 @@ dependencies: - gcc_linux-aarch64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.6.2 +- hnswlib=0.7.0 - libcublas-dev - libcurand-dev - libcusolver-dev diff --git a/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml index 06b2c5338..7379c2ca1 100644 --- a/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-125_arch-x86_64.yaml @@ -11,6 +11,7 @@ dependencies: - c-compiler - clang-tools=16.0.6 - clang==16.0.6 +- click - cmake>=3.26.4,!=3.30.0 - cuda-cudart-dev - cuda-nvcc @@ -24,7 +25,7 @@ dependencies: - gcc_linux-64=11.* - glog>=0.6.0 - h5py>=3.8.0 -- hnswlib=0.6.2 +- hnswlib=0.7.0 - libcublas-dev - libcurand-dev - libcusolver-dev diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 3b483538a..02c2efa0b 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -55,7 +55,7 @@ option(BUILD_SHARED_LIBS "Build cuvs shared libraries" ON) option(BUILD_TESTS "Build cuvs unit-tests" ON) option(BUILD_C_LIBRARY "Build raft C API library" OFF) option(BUILD_C_TESTS "Build raft C API tests" OFF) -option(BUILD_ANN_BENCH "Build cuVS ann benchmarks" OFF) +option(BUILD_ANN_BENCH "Build cuVS ann benchmarks" ON) option(BUILD_CAGRA_HNSWLIB "Build CAGRA+hnswlib interface" ON) option(CUDA_ENABLE_KERNELINFO "Enable kernel resource usage info" OFF) option(CUDA_ENABLE_LINEINFO diff --git a/dependencies.yaml b/dependencies.yaml index 9f44911c8..6c52cb4cd 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -102,14 +102,6 @@ files: - test_python_common - test_py_cuvs - cupy - py_build_cuvs_bench: - output: pyproject - pyproject_dir: python/cuvs_bench - extras: - table: build-system - includes: - - rapids_build - - build_py_cuvs py_run_cuvs_bench: output: pyproject pyproject_dir: python/cuvs_bench @@ -461,7 +453,7 @@ dependencies: common: - output_types: [conda, pyproject, requirements] packages: - - hnswlib=0.6.2 + - hnswlib=0.7.0 - nlohmann_json>=3.11.2 - glog>=0.6.0 - h5py>=3.8.0 @@ -476,3 +468,4 @@ dependencies: - pandas - pyyaml - pandas + - click diff --git a/python/cuvs_bench/cuvs_bench/config/algos/__init__.py b/python/cuvs_bench/cuvs_bench/config/algos/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/python/cuvs_bench/cuvs_bench/config/constraints.py b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py similarity index 98% rename from python/cuvs_bench/cuvs_bench/config/constraints.py rename to python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py index ff451c056..de05bd752 100644 --- a/python/cuvs_bench/cuvs_bench/config/constraints.py +++ b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023-2024, NVIDIA CORPORATION. +# 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. diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra.yaml index e7b049d0c..4b0e0289b 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra.yaml @@ -1,7 +1,7 @@ name: cuvs_cagra constraints: - build: cuvs_bench.constraints.raft_cagra_build_constraints - search: cuvs_bench.constraints.raft_cagra_search_constraints + build: cuvs_bench.config.algos.constraints.cuvs_cagra_build + search: cuvs_bench.config.algos.constraints.cuvs_cagra_search groups: base: build: diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra_hnswlib.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra_hnswlib.yaml index 70e344dfd..f1a7f272c 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra_hnswlib.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_cagra_hnswlib.yaml @@ -1,6 +1,6 @@ name: cuvs_cagra_hnswlib constraints: - search: cuvs_bench.constraints.hnswlib_search + search: cuvs_bench.config.algos.constraints.hnswlib_search groups: base: build: diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_ivf_pq.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_ivf_pq.yaml index aa95d6716..d68e7973a 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_ivf_pq.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_ivf_pq.yaml @@ -1,7 +1,7 @@ name: cuvs_ivf_pq constraints: - build: cuvs_bench.constraints.cuvs_ivf_pq_build - search: cuvs_bench.constraints.cuvs_ivf_pq_search + build: cuvs_bench.config.algos.constraints.cuvs_ivf_pq_build + search: cuvs_bench.config.algos.constraints.cuvs_ivf_pq_search groups: base: build: diff --git a/python/cuvs_bench/cuvs_bench/config/algos/faiss_gpu_ivf_pq.yaml b/python/cuvs_bench/cuvs_bench/config/algos/faiss_gpu_ivf_pq.yaml index 1bd78b736..782f3aed1 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/faiss_gpu_ivf_pq.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/faiss_gpu_ivf_pq.yaml @@ -1,7 +1,7 @@ name: faiss_gpu_ivf_pq constraints: - build: cuvs_bench.constraints.faiss_gpu_ivf_pq_build - search: cuvs_bench.constraints.faiss_gpu_ivf_pq_search + build: cuvs_bench.config.algos.constraints.faiss_gpu_ivf_pq_build + search: cuvs_bench.config.algos.constraints.faiss_gpu_ivf_pq_search groups: base: build: diff --git a/python/cuvs_bench/cuvs_bench/config/algos/hnswlib.yaml b/python/cuvs_bench/cuvs_bench/config/algos/hnswlib.yaml index dbd73155d..93d8cff2d 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/hnswlib.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/hnswlib.yaml @@ -1,6 +1,6 @@ name: hnswlib constraints: - search: cuvs_bench.constraints.hnswlib_search + search: cuvs_bench.config.algos.constraints.hnswlib_search groups: base: build: diff --git a/python/cuvs_bench/cuvs_bench/config/bigann-100M.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/bigann-100M.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/bigann-100M.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/bigann-100M.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/datasets.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/datasets.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/datasets.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/datasets.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/deep-100M.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/deep-100M.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/deep-100M.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/deep-100M.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/deep-1B.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/deep-1B.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/deep-1B.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/deep-1B.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/deep-image-96-inner.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/deep-image-96-inner.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/deep-image-96-inner.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/deep-image-96-inner.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/fashion-mnist-784-euclidean.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/fashion-mnist-784-euclidean.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/fashion-mnist-784-euclidean.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/fashion-mnist-784-euclidean.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/gist-960-euclidean.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/gist-960-euclidean.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/gist-960-euclidean.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/gist-960-euclidean.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/glove-100-angular.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/glove-100-angular.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/glove-100-angular.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/glove-100-angular.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/glove-100-inner.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/glove-100-inner.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/glove-100-inner.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/glove-100-inner.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/glove-50-angular.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/glove-50-angular.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/glove-50-angular.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/glove-50-angular.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/glove-50-inner.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/glove-50-inner.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/glove-50-inner.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/glove-50-inner.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/lastfm-65-angular.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/lastfm-65-angular.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/lastfm-65-angular.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/lastfm-65-angular.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/mnist-784-euclidean.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/mnist-784-euclidean.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/mnist-784-euclidean.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/mnist-784-euclidean.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/nytimes-256-angular.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/nytimes-256-angular.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/nytimes-256-angular.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/nytimes-256-angular.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/nytimes-256-inner.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/nytimes-256-inner.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/nytimes-256-inner.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/nytimes-256-inner.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/sift-128-euclidean.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/sift-128-euclidean.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/sift-128-euclidean.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/sift-128-euclidean.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/wiki_all_10M.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/wiki_all_10M.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/wiki_all_10M.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/wiki_all_10M.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/wiki_all_1M.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/wiki_all_1M.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/wiki_all_1M.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/wiki_all_1M.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/wiki_all_88M.yaml b/python/cuvs_bench/cuvs_bench/config/datasets/wiki_all_88M.yaml similarity index 100% rename from python/cuvs_bench/cuvs_bench/config/wiki_all_88M.yaml rename to python/cuvs_bench/cuvs_bench/config/datasets/wiki_all_88M.yaml diff --git a/python/cuvs_bench/cuvs_bench/run/__init__.py b/python/cuvs_bench/cuvs_bench/run/__init__.py new file mode 100644 index 000000000..7cb04e6f8 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/run/__init__.py @@ -0,0 +1,17 @@ +# +# 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. +# + +from .run import run_benchmark diff --git a/python/cuvs_bench/cuvs_bench/run/__main__.py b/python/cuvs_bench/cuvs_bench/run/__main__.py new file mode 100644 index 000000000..fb269014e --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/run/__main__.py @@ -0,0 +1,202 @@ +# +# 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. +# + +import click +import os + +from pathlib import Path +from typing import Optional + +from . import run_benchmark + + +@click.command() +@click.option( + "--subset-size", + type=click.IntRange(min=1), + help="the number of subset rows of the dataset to build the index" +) +@click.option( + "-k", + "--count", + default=10, + show_default=True, + type=click.IntRange(min=1), + help="the number of nearest neighbors to search for" +) +@click.option( + "-bs", "--batch-size", + default=10000, + show_default=True, + type=click.IntRange(min=1), + help="number of query vectors to use in each query trial" +) +@click.option( + "--dataset-configuration", + help="path to YAML configuration file for datasets" +) +@click.option( + "--configuration", + help="path to YAML configuration file or directory for algorithms" + "Any run groups found in the specified file/directory will " + "automatically override groups of the same name present in the " + "default configurations, including `base`", +) +@click.option( + "--dataset", + default="glove-100-inner", + show_default=True, + help="name of dataset" +) +@click.option( + "--dataset-path", + default=lambda: os.environ.get("RAPIDS_DATASET_ROOT_DIR", + os.path.join(Path(__file__).parent, "datasets/")), + show_default=True, + help="path to dataset folder, by default will look in RAPIDS_DATASET_ROOT_DIR if defined, " + "otherwise a datasets subdirectory from the calling directory", +) +@click.option( + "--build", + is_flag=True, + help="Build the index" +) +@click.option( + "--search", + is_flag=True, + help="Perform the search" +) +@click.option( + "--algorithms", + default=None, + show_default=True, + help="run only comma separated list of named algorithms. If parameters `groups` and `algo-groups` are both undefined, " + "then group `base` is run by default", +) +@click.option( + "--groups", + default="base", + show_default=True, + help="run only comma separated groups of parameters" +) +@click.option( + "--algo-groups", + help='add comma separated . to run. Example usage: "--algo-groups=raft_cagra.large,hnswlib.large"', +) +@click.option( + "-f", + "--force", + is_flag=True, + help="re-run algorithms even if their results already exist" +) +@click.option( + "-m", + "--search-mode", + default="latency", + show_default=True, + help="run search in 'latency' (measure individual batches) or 'throughput' (pipeline batches and measure end-to-end) mode", +) +@click.option( + "-t", + "--search-threads", + default=None, + show_default=True, + help="specify the number threads to use for throughput benchmark. Single value or a pair of min and max separated by ':'. " + "Example: --search-threads=1:4. Power of 2 values between 'min' and 'max' will be used. " + "If only 'min' is specified, then a single test is run with 'min' threads. By default min=1, max=.", +) +@click.option( + "-r", + "--dry-run", + is_flag=True, + help="dry-run mode will convert the yaml config for the specified algorithms and datasets to the json format that's consumed " + "by the lower-level c++ binaries and then print the command to run execute the benchmarks but will not actually execute " + "the command.", +) +@click.option( + "--raft-log-level", + default="info", + show_default=True, + help="Log level, possible values are [off, error, warn, info, debug, trace]. Default: 'info'. " + "Note that 'debug' or more detailed logging level requires that the library is compiled with " + "-DRAFT_ACTIVE_LEVEL= where >= ", +) +def main( + subset_size: Optional[int], + count: int, + batch_size: int, + dataset_configuration: Optional[str], + configuration: Optional[str], + dataset: str, + dataset_path: str, + build: bool, + search: bool, + algorithms: Optional[str], + groups: str, + algo_groups: Optional[str], + force: bool, + search_mode: str, + search_threads: Optional[str], + dry_run: bool, + raft_log_level: str +) -> None: + """ + Main function to run the benchmark with the provided options. + + Parameters + ---------- + subset_size : Optional[int] + The number of subset rows of the dataset to build the index. + count : int + The number of nearest neighbors to search for. + batch_size : int + Number of query vectors to use in each query trial. + dataset_configuration : Optional[str] + Path to YAML configuration file for datasets. + configuration : Optional[str] + Path to YAML configuration file or directory for algorithms. + dataset : str + Name of the dataset to use. + dataset_path : str + Path to the dataset folder. + build : bool + Whether to build the indices. + search : bool + Whether to perform the search. + algorithms : Optional[str] + Comma-separated list of algorithm names to use. + groups : str + Comma-separated list of groups to consider. + algo_groups : Optional[str] + Comma-separated list of algorithm groups to consider. + force : bool + Whether to force the execution regardless of warnings. + search_mode : str + The mode of search to perform ('latency' or 'throughput'). + search_threads : Optional[str] + The number of threads to use for throughput benchmark. + dry_run : bool + Whether to perform a dry run without actual execution. + raft_log_level : str + The logging level for the RAFT library. + + """ + + run_benchmark(**locals()) + + +if __name__ == '__main__': + main() diff --git a/python/cuvs_bench/cuvs_bench/run/run.py b/python/cuvs_bench/cuvs_bench/run/run.py new file mode 100644 index 000000000..3f3a25a2a --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/run/run.py @@ -0,0 +1,538 @@ +# +# 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. +# + +import importlib +import itertools +import json +import os +import subprocess +import sys +import uuid +import warnings +import yaml + +from importlib import import_module +from typing import Optional, Tuple, Union, Dict, Any + +from .runners import cuvs_bench_cpp + + +def run_benchmark( + subset_size: int, + count: int, + batch_size: int, + dataset_configuration: Optional[str], + configuration: Optional[str], + dataset: str, + dataset_path: str, + build: Optional[bool], + search: Optional[bool], + algorithms: Optional[str], + groups: str, + algo_groups: Optional[str], + force: bool, + search_mode: str, + search_threads: int, + dry_run: bool, + raft_log_level: int +) -> None: + """ + Runs a benchmarking process based on the provided configurations. + + Parameters + ---------- + count : int + The number of iterations to run. + batch_size : int + The size of each batch for processing. + dataset_configuration : Optional[str] + Path to the dataset configuration file. + configuration : Optional[str] + Path to the algorithm configuration file or directory. + dataset : str + The name of the dataset to use. + dataset_path : str + The path to the dataset directory. + build : Optional[bool] + Whether to build the indices. + search : Optional[bool] + Whether to perform the search. + algorithms : Optional[str] + Comma-separated list of algorithm names to use. + groups : str + Comma-separated list of groups to consider. + algo_groups : Optional[str] + Comma-separated list of algorithm groups to consider. + force : bool + Whether to force the execution regardless of warnings. + search_mode : str + The mode of search to perform. + search_threads : int + The number of threads to use for searching. + dry_run : bool + Whether to perform a dry run without actual execution. + raft_log_level : int + The logging level for the RAFT library. + + Returns + ------- + None + """ + + scripts_path = os.path.dirname(os.path.realpath(__file__)) + call_path = os.getcwd() + gpu_present = rmm_present() + + with open(os.path.join(scripts_path, "../config", "algorithms.yaml"), "r") as f: + algos_yaml = yaml.safe_load(f) + + # If both build and search are not provided, + # run both + if not build and not search: + build = True + search = True + + # look for dataset configuration path, if not given then use the + # default location in cuvs_bench/conf + if dataset_configuration: + dataset_conf_f = dataset_configuration + else: + dataset_conf_f = os.path.join(scripts_path, "../config/datasets", "datasets.yaml") + with open(dataset_conf_f, "r") as f: + dataset_conf_all = yaml.safe_load(f) + + # load datasets configuration files + dataset_conf = None + for dset in dataset_conf_all: + if dataset == dset["name"]: + dataset_conf = dset + break + if not dataset_conf: + raise ValueError("Could not find a dataset configuration") + + conf_file = dict() + conf_file["dataset"] = dataset_conf + if subset_size: + conf_file["dataset"]["subset_size"] = subset_size + + conf_file["search_basic_param"] = {} + conf_file["search_basic_param"]["k"] = count + conf_file["search_basic_param"]["batch_size"] = batch_size + + algos_conf_fs = os.listdir(os.path.join(scripts_path, "../config", "algos")) + algos_conf_fs = [ + os.path.join(scripts_path, "../config", "algos", f) + for f in algos_conf_fs + if ".json" not in f and "constraint" not in f and ".py" not in f + ] + conf_filedir = os.path.join(scripts_path, "conf", "algos") + if configuration: + if os.path.isdir(configuration): + conf_filedir = configuration + algos_conf_fs = algos_conf_fs + [ + os.path.join(configuration, f) + for f in os.listdir(configuration) + if ".json" not in f + ] + elif os.path.isfile(configuration): + conf_filedir = os.path.normpath(configuration).split(os.sep) + conf_filedir = os.path.join(*conf_filedir[:-1]) + algos_conf_fs = algos_conf_fs + [configuration] + + filter_algos = True if algorithms else False + if filter_algos: + allowed_algos = algorithms.split(",") + named_groups = groups.split(",") + filter_algo_groups = True if algo_groups else False + allowed_algo_groups = None + if filter_algo_groups: + allowed_algo_groups = [ + algo_group.split(".") for algo_group in algo_groups.split(",") + ] + allowed_algo_groups = list(zip(*allowed_algo_groups)) + algos_conf = dict() + for algo_f in algos_conf_fs: + with open(algo_f, "r") as f: + try: + algo = yaml.safe_load(f) + except Exception as e: + warnings.warn( + f"Could not load YAML config {algo_f} due to " + + e.with_traceback() + ) + continue + insert_algo = True + insert_algo_group = False + if filter_algos: + if algo["name"] not in allowed_algos: + insert_algo = False + if filter_algo_groups: + if algo["name"] in allowed_algo_groups[0]: + insert_algo_group = True + + def add_algo_group(group_list): + if algo["name"] not in algos_conf: + algos_conf[algo["name"]] = {"groups": {}} + for group in algo["groups"].keys(): + if group in group_list: + algos_conf[algo["name"]]["groups"][group] = algo[ + "groups" + ][group] + if "constraints" in algo: + algos_conf[algo["name"]]["constraints"] = algo[ + "constraints" + ] + + if insert_algo: + add_algo_group(named_groups) + if insert_algo_group: + add_algo_group(allowed_algo_groups[1]) + + executables_to_run = dict() + for algo in algos_conf.keys(): + validate_algorithm(algos_yaml, algo, gpu_present) + for group in algos_conf[algo]["groups"].keys(): + executable = find_executable( + algos_yaml, algo, group, count, batch_size + ) + if executable not in executables_to_run: + executables_to_run[executable] = {"index": []} + build_params = algos_conf[algo]["groups"][group]["build"] or {} + search_params = algos_conf[algo]["groups"][group]["search"] or {} + + param_names = [] + param_lists = [] + for param in build_params.keys(): + param_names.append(param) + param_lists.append(build_params[param]) + + all_build_params = itertools.product(*param_lists) + + search_param_names = [] + search_param_lists = [] + for search_param in search_params.keys(): + search_param_names.append(search_param) + search_param_lists.append(search_params[search_param]) + + for params in all_build_params: + index = {"algo": algo, "build_param": {}} + if group != "base": + index_name = f"{algo}_{group}" + else: + index_name = f"{algo}" + for i in range(len(params)): + index["build_param"][param_names[i]] = params[i] + index_name += "." + f"{param_names[i]}{params[i]}" + + if "constraints" in algos_conf[algo]: + if "build" in algos_conf[algo]["constraints"]: + importable = algos_conf[algo]["constraints"]["build"] + importable = importable.split(".") + module = ".".join(importable[:-1]) + func = importable[-1] + validator = import_module(module) + build_constraints = getattr(validator, func) + if "dims" not in conf_file["dataset"]: + raise ValueError( + "`dims` needed for build constraints but not " + "specified in datasets.yaml" + ) + if not build_constraints( + index["build_param"], conf_file["dataset"]["dims"] + ): + continue + index_filename = ( + index_name + if len(index_name) < 128 + else str(hash(index_name)) + ) + index["name"] = index_name + index["file"] = os.path.join( + dataset_path, dataset, "index", index_filename + ) + index["search_params"] = [] + all_search_params = itertools.product(*search_param_lists) + for search_params in all_search_params: + search_dict = dict() + for i in range(len(search_params)): + search_dict[search_param_names[i]] = search_params[i] + if "constraints" in algos_conf[algo]: + if "search" in algos_conf[algo]["constraints"]: + importable = algos_conf[algo]["constraints"][ + "search" + ] + importable = importable.split(".") + module = ".".join(importable[:-1]) + func = importable[-1] + validator = import_module(module) + search_constraints = getattr(validator, func) + if search_constraints( + search_dict, + index["build_param"], + count, + batch_size, + ): + index["search_params"].append(search_dict) + else: + index["search_params"].append(search_dict) + executables_to_run[executable]["index"].append(index) + + if len(index["search_params"]) == 0: + print("No search parameters were added to configuration") + executable = find_executable( + algos_yaml, algo, group, count, batch_size + ) + if executable not in executables_to_run: + executables_to_run[executable] = {"index": []} + build_params = algos_conf[algo]["groups"][group]["build"] or {} + search_params = algos_conf[algo]["groups"][group]["search"] or {} + + param_names = [] + param_lists = [] + for param in build_params.keys(): + param_names.append(param) + param_lists.append(build_params[param]) + + all_build_params = itertools.product(*param_lists) + + search_param_names = [] + search_param_lists = [] + for search_param in search_params.keys(): + search_param_names.append(search_param) + search_param_lists.append(search_params[search_param]) + + for params in all_build_params: + index = {"algo": algo, "build_param": {}} + if group != "base": + index_name = f"{algo}_{group}" + else: + index_name = f"{algo}" + for i in range(len(params)): + index["build_param"][param_names[i]] = params[i] + index_name += "." + f"{param_names[i]}{params[i]}" + + if "constraints" in algos_conf[algo]: + if "build" in algos_conf[algo]["constraints"]: + importable = algos_conf[algo]["constraints"]["build"] + importable = importable.split(".") + module = ".".join(importable[:-1]) + func = importable[-1] + validator = import_module(module) + build_constraints = getattr(validator, func) + if "dims" not in conf_file["dataset"]: + raise ValueError( + "`dims` needed for build constraints but not " + "specified in datasets.yaml" + ) + if not build_constraints( + index["build_param"], conf_file["dataset"]["dims"] + ): + continue + index_filename = ( + index_name + if len(index_name) < 128 + else str(hash(index_name)) + ) + index["name"] = index_name + index["file"] = os.path.join( + dataset_path, dataset, "index", index_filename + ) + index["search_params"] = [] + all_search_params = itertools.product(*search_param_lists) + for search_params in all_search_params: + search_dict = dict() + for i in range(len(search_params)): + search_dict[search_param_names[i]] = search_params[i] + # if "constraints" in algos_conf[algo]: + # todo: refactor common code + if False: + if "search" in algos_conf[algo]["constraints"]: + if validate_constraints(algos_conf, + algo, + "search", + search_dict, + index["build_param"], + count, + batch_size): + index["search_params"].append(search_dict) + else: + index["search_params"].append(search_dict) + executables_to_run[executable]["index"].append(index) + + if len(index["search_params"]) == 0: + print("No search parameters were added to configuration") + + cuvs_bench_cpp( + conf_file, + f"{dataset}", + conf_filedir, + executables_to_run, + dataset_path, + force, + build, + search, + dry_run, + count, + batch_size, + search_threads, + search_mode, + raft_log_level, + ) + + +def rmm_present() -> bool: + """ + Check if RMM is present. + + Returns + ------- + bool + True if RMM is present, False otherwise. + """ + try: + import rmm # noqa: F401 + return True + except ImportError: + return False + + +def find_executable(algos_conf: dict, algo: str, group: str, k: int, batch_size: int) -> Tuple[str, str, Tuple[str, str]]: + """ + Find the executable for the given algorithm and group. + + Parameters + ---------- + algos_conf : dict + The configuration dictionary for the algorithms. + algo : str + The name of the algorithm. + group : str + The name of the group. + k : int + The number of nearest neighbors to search for. + batch_size : int + The size of each batch for processing. + + Returns + ------- + Tuple[str, str, Tuple[str, str]] + A tuple containing the executable name, the path to the executable, and the file name. + """ + executable = algos_conf[algo]["executable"] + file_name = (f"{algo},{group}", f"{algo},{group},k{k},bs{batch_size}") + + # Check for devcontainer build + scripts_path = os.path.dirname(os.path.realpath(__file__)) + build_path = "/home/coder/cuvs/cpp/build/latest/bench/ann" + print(f"build_path: {build_path}") + if os.path.exists(build_path): + print(f"-- Detected devcontainer artifacts in {build_path}. ") + return executable, build_path, file_name + + build_path = os.getenv("CUVS_HOME") + if build_path is not None: + build_path = os.path.join(build_path, "cpp", "build", "release", executable) + if os.path.exists(build_path): + print(f"-- Using RAFT bench from repository in {build_path}. ") + return executable, build_path, file_name + + # # todo: better path detection for devcontainer + # build_path = os.getenv("CUVS_BENCH_BUILD_PATH") + # print("build_path: ", build_path) + # if build_path is not None: + # if os.path.exists(build_path): + # print(f"-- Using devcontainer location from {build_path}. ") + # return executable, build_path, file_name + + conda_path = os.getenv("CONDA_PREFIX") + if conda_path is not None: + conda_path = os.path.join(conda_path, "bin", "ann", executable) + if os.path.exists(conda_path): + print("-- Using cuVS bench found in conda environment. ") + return executable, conda_path, file_name + else: + raise FileNotFoundError(executable) + else: + raise FileNotFoundError(executable) + + +def validate_algorithm(algos_conf: dict, algo: str, gpu_present: bool) -> bool: + """ + Validate algorithm and whether it requires gpu. . + + Parameters + ---------- + algos_conf : dict + The configuration dictionary for the algorithms. + algo : str + The name of the algorithm. + gpu_present : bool + Whether a GPU is present. + + Returns + ------- + bool + True if the algorithm is valid for the current hardware configuration, False otherwise. + """ + algos_conf_keys = set(algos_conf.keys()) + if gpu_present: + return algo in algos_conf_keys + else: + return algo in algos_conf_keys and algos_conf[algo]["requires_gpu"] is False + + +def validate_constraints( + algos_conf: Dict[str, Any], + algo: str, + constraint_type: str, + param: Dict[str, Any], + dims: Any, + k: Optional[int], + batch_size: Optional[int] +) -> bool: + """ + Validate the constraints for the given algorithm and constraint type. + + Parameters + ---------- + algos_conf : Dict[str, Any] + The configuration dictionary for the algorithms. + algo : str + The name of the algorithm. + constraint_type : str + The type of constraint to validate ('build' or 'search'). + param : Dict[str, Any] + The parameters to validate against the constraints. + dims : Any + The dimensions required for the constraints. + + Returns + ------- + bool + True if the constraints are valid, False otherwise. + """ + if constraint_type in algos_conf[algo]["constraints"]: + importable = algos_conf[algo]["constraints"][constraint_type] + importable = importable.split(".") + module = ".".join(importable[:-1]) + func = importable[-1] + print(f"module: {module}") + validator = importlib.import_module(module) + constraints_func = getattr(validator, func) + if constraint_type == "build" and "dims" not in conf_file["dataset"]: + raise ValueError("`dims` needed for build constraints but not specified in datasets.yaml") + return constraints_func(param, dims) + return True diff --git a/python/cuvs_bench/cuvs_bench/run/runners.py b/python/cuvs_bench/cuvs_bench/run/runners.py new file mode 100644 index 000000000..54d32c77d --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/run/runners.py @@ -0,0 +1,246 @@ +# +# 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. +# + +import os +import json +import subprocess +import uuid + +from typing import Dict, List, Optional, Tuple, Union + + +def cuvs_bench_cpp( + conf_file: Dict, + conf_filename: str, + conf_filedir: str, + executables_to_run: Dict[Tuple[str, str, Tuple[str, str]], Dict[str, List[Dict]]], + dataset_path: str, + force: bool, + build: bool, + search: bool, + dry_run: bool, + k: int, + batch_size: int, + search_threads: Optional[int], + mode: str = "throughput", + raft_log_level: str = "info" +) -> None: + """ + Run the CUVS benchmarking tool with the provided configuration. + + Parameters + ---------- + conf_file : Dict + The configuration file content. + conf_filename : str + The name of the configuration file. + conf_filedir : str + The directory of the configuration file. + executables_to_run : Dict[Tuple[str, str, Tuple[str, str]], Dict[str, List[Dict]]] + Dictionary of executables to run and their configurations. + dataset_path : str + The path to the dataset. + force : bool + Whether to force the execution regardless of existing results. + build : bool + Whether to build the indices. + search : bool + Whether to perform the search. + dry_run : bool + Whether to perform a dry run without actual execution. + k : int + The number of nearest neighbors to search for. + batch_size : int + The size of each batch for processing. + search_threads : Optional[int] + The number of threads to use for searching. + mode : str, optional + The mode of search to perform ('latency' or 'throughput'), by default 'throughput'. + raft_log_level : str, optional + The logging level for the RAFT library, by default 'info'. + + Returns + ------- + None + """ + for executable, ann_executable_path, output_filename in executables_to_run.keys(): + # Need to write temporary configuration + temp_conf_filename = f"{conf_filename}_{output_filename[1]}_{uuid.uuid1()}.json" + with open(temp_conf_filename, "w") as f: + temp_conf = { + "dataset": conf_file["dataset"], + "search_basic_param": conf_file["search_basic_param"], + "index": executables_to_run[(executable, ann_executable_path, output_filename)]["index"] + } + json_str = json.dumps(temp_conf, indent=2) + f.write(json_str) + + legacy_result_folder = os.path.join(dataset_path, conf_file["dataset"]["name"], "result") + os.makedirs(legacy_result_folder, exist_ok=True) + + if build: + build_folder = os.path.join(legacy_result_folder, "build") + os.makedirs(build_folder, exist_ok=True) + build_file = f"{output_filename[0]}.json" + temp_build_file = f"{build_file}.lock" + cmd = [ + ann_executable_path, + "--build", + f"--data_prefix={dataset_path}", + "--benchmark_out_format=json", + "--benchmark_counters_tabular=true", + f"--benchmark_out={os.path.join(build_folder, temp_build_file)}", + f"--raft_log_level={parse_log_level(raft_log_level)}" + ] + if force: + cmd.append("--force") + cmd.append(temp_conf_filename) + + if dry_run: + print(f"Benchmark command for {output_filename[0]}:\n{' '.join(cmd)}\n") + else: + try: + subprocess.run(cmd, check=True) + merge_build_files(build_folder, build_file, temp_build_file) + except Exception as e: + print(f"Error occurred running benchmark: {e}") + finally: + os.remove(os.path.join(build_folder, temp_build_file)) + if not search: + os.remove(temp_conf_filename) + + if search: + search_folder = os.path.join(legacy_result_folder, "search") + os.makedirs(search_folder, exist_ok=True) + search_file = f"{output_filename[1]}.json" + cmd = [ + ann_executable_path, + "--search", + f"--data_prefix={dataset_path}", + "--benchmark_counters_tabular=true", + f"--override_kv=k:{k}", + f"--override_kv=n_queries:{batch_size}", + "--benchmark_min_warmup_time=1", + "--benchmark_out_format=json", + f"--mode={mode}", + f"--benchmark_out={os.path.join(search_folder, search_file)}", + f"--raft_log_level={parse_log_level(raft_log_level)}" + ] + if force: + cmd.append("--force") + if search_threads: + cmd.append(f"--threads={search_threads}") + cmd.append(temp_conf_filename) + + if dry_run: + print(f"Benchmark command for {output_filename[1]}:\n{' '.join(cmd)}\n") + else: + try: + subprocess.run(cmd, check=True) + except Exception as e: + print(f"Error occurred running benchmark: {e}") + finally: + os.remove(temp_conf_filename) + + +log_levels = { + "off": 0, + "error": 1, + "warn": 2, + "info": 3, + "debug": 4, + "trace": 5, +} + +def parse_log_level(level_str: str) -> int: + """ + Parse the log level from string to integer. + + Parameters + ---------- + level_str : str + The log level as a string. + + Returns + ------- + int + The corresponding integer value of the log level. + + Raises + ------ + ValueError + If the log level string is invalid. + """ + if level_str not in log_levels: + raise ValueError(f"Invalid log level: {level_str}") + return log_levels[level_str.lower()] + + +def merge_build_files(build_dir: str, build_file: str, temp_build_file: str) -> None: + """ + Merge temporary build files into the main build file. + + Parameters + ---------- + build_dir : str + The directory of the build files. + build_file : str + The main build file. + temp_build_file : str + The temporary build file to merge. + + Returns + ------- + None + + Raises + ------ + ValueError + If the temporary build file is not found. + """ + build_dict = {} + + # If build file exists, read it + build_json_path = os.path.join(build_dir, build_file) + tmp_build_json_path = os.path.join(build_dir, temp_build_file) + if os.path.isfile(build_json_path): + try: + with open(build_json_path, "r") as f: + build_dict = json.load(f) + except Exception as e: + print(f"Error loading existing build file: {build_json_path} ({e})") + + temp_build_dict = {} + if os.path.isfile(tmp_build_json_path): + with open(tmp_build_json_path, "r") as f: + temp_build_dict = json.load(f) + else: + raise ValueError(f"Temp build file not found: {tmp_build_json_path}") + + tmp_benchmarks = temp_build_dict.get("benchmarks", {}) + benchmarks = build_dict.get("benchmarks", {}) + + # If the build time is absolute 0 then an error occurred + final_bench_dict = {b["name"]: b for b in benchmarks if b["real_time"] > 0} + + for tmp_bench in tmp_benchmarks: + if tmp_bench["real_time"] > 0: + final_bench_dict[tmp_bench["name"]] = tmp_bench + + temp_build_dict["benchmarks"] = list(final_bench_dict.values()) + with open(build_json_path, "w") as f: + json_str = json.dumps(temp_build_dict, indent=2) + f.write(json_str) diff --git a/python/cuvs_bench/pyproject.toml b/python/cuvs_bench/pyproject.toml index ec41af3df..bf5372e55 100644 --- a/python/cuvs_bench/pyproject.toml +++ b/python/cuvs_bench/pyproject.toml @@ -1,18 +1,11 @@ # Copyright (c) 2024, NVIDIA CORPORATION. [build-system] -build-backend = "rapids_build_backend.build" requires = [ - "cmake>=3.26.4,!=3.30.0", - "cuda-python", - "cython>=3.0.0", - "ninja", - "pylibraft==24.10.*,>=0.0.0a0", - "rmm==24.10.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project] -name = "cuvs-bench" +name = "cuvs_bench" dynamic = ["version"] description = "cuVS benchmarks" authors = [ @@ -36,9 +29,6 @@ classifiers = [ [project.urls] Homepage = "https://github.com/rapidsai/raft" -[tool.setuptools.packages.find] -where = ["src"] - [tool.setuptools.package-data] "*" = ["*.*", "VERSION"] @@ -66,8 +56,3 @@ skip = [ [tool.setuptools.dynamic] version = { file = "cuvs_bench/VERSION" } -[tool.rapids-build-backend] -build-backend = "scikit_build_core.build" -requires = [] -dependencies-file = "../../dependencies.yaml" -matrix-entry = "cuda_suffixed=true" From 3818da9cb1cd27ed60638e19b476d7cb878e8bc9 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 6 Aug 2024 15:25:57 -0700 Subject: [PATCH 11/58] update patch;build command --- cpp/cmake/patches/diskann.diff | 107 ++++++++++++++++++++++--- cpp/cmake/thirdparty/get_diskann.cmake | 7 +- 2 files changed, 103 insertions(+), 11 deletions(-) diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 3e48221dc..8d168dbd8 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..55633bf 100644 +index 3d3d2b8..5b6941a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,25 @@ set(CMAKE_STANDARD 17) @@ -28,7 +28,7 @@ index 3d3d2b8..55633bf 100644 if(NOT MSVC) set(CMAKE_CXX_COMPILER g++) endif() -@@ -145,18 +164,6 @@ if (MSVC) +@@ -145,62 +164,56 @@ if (MSVC) "${DISKANN_MKL_LIB_PATH}/mkl_intel_thread.lib") else() # expected path for manual intel mkl installs @@ -44,19 +44,108 @@ index 3d3d2b8..55633bf 100644 - 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") - foreach(POSSIBLE_MKL_LIB_PATH ${POSSIBLE_MKL_LIB_PATHS}) - if (EXISTS ${POSSIBLE_MKL_LIB_PATH}) -@@ -286,7 +293,7 @@ if(MSVC) +- 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") +- 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) +- endif() +- endforeach() +- +- set(POSSIBLE_MKL_INCLUDE_PATHS "/opt/intel/oneapi/mkl/latest/include;/usr/include/mkl;/opt/intel/mkl/include/;") +- foreach(POSSIBLE_MKL_INCLUDE_PATH ${POSSIBLE_MKL_INCLUDE_PATHS}) +- if (EXISTS ${POSSIBLE_MKL_INCLUDE_PATH}) +- set(MKL_INCLUDE_PATH ${POSSIBLE_MKL_INCLUDE_PATH}) +- endif() +- endforeach() +- if(NOT MKL_PATH) +- message(FATAL_ERROR "Could not find Intel MKL in standard locations; use -DMKL_PATH to specify the install location for your environment") +- elseif(NOT MKL_INCLUDE_PATH) +- message(FATAL_ERROR "Could not find Intel MKL in standard locations; use -DMKL_INCLUDE_PATH to specify the install location for headers for your environment") +- endif() +- if (EXISTS ${MKL_PATH}/libmkl_def.so.2) +- set(MKL_DEF_SO ${MKL_PATH}/libmkl_def.so.2) +- elseif(EXISTS ${MKL_PATH}/libmkl_def.so) +- set(MKL_DEF_SO ${MKL_PATH}/libmkl_def.so) +- else() +- message(FATAL_ERROR "Despite finding MKL, libmkl_def.so was not found in expected locations.") +- endif() +- link_directories(${MKL_PATH}) +- include_directories(${MKL_INCLUDE_PATH}) ++ find_package(MKL CONFIG REQUIRED) ++ ++ #target_compile_options(${PROJECT_NAME} PUBLIC $) ++ include_directories($) ++ link_libraries($) ++ ++# set(POSSIBLE_MKL_LIB_PATHS "/raid/tarangj/miniconda3/envs/all_cuda-125_arch-x86_64/lib/libmkl_core.so;/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") ++# 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) ++# endif() ++# endforeach() ++ ++# set(POSSIBLE_MKL_INCLUDE_PATHS "/raid/tarangj/miniconda3/envs/all_cuda-125_arch-x86_64/include;/opt/intel/oneapi/mkl/latest/include;/usr/include/mkl;/opt/intel/mkl/include/;") ++# foreach(POSSIBLE_MKL_INCLUDE_PATH ${POSSIBLE_MKL_INCLUDE_PATHS}) ++# if (EXISTS ${POSSIBLE_MKL_INCLUDE_PATH}) ++# set(MKL_INCLUDE_PATH ${POSSIBLE_MKL_INCLUDE_PATH}) ++# endif() ++# endforeach() ++# if(NOT MKL_PATH) ++# message(FATAL_ERROR "Could not find Intel MKL in standard locations; use -DMKL_PATH to specify the install location for your environment") ++# elseif(NOT MKL_INCLUDE_PATH) ++# message(FATAL_ERROR "Could not find Intel MKL in standard locations; use -DMKL_INCLUDE_PATH to specify the install location for headers for your environment") ++# endif() ++# if (EXISTS ${MKL_PATH}/libmkl_def.so.2) ++# set(MKL_DEF_SO ${MKL_PATH}/libmkl_def.so.2) ++# elseif(EXISTS ${MKL_PATH}/libmkl_def.so) ++# set(MKL_DEF_SO ${MKL_PATH}/libmkl_def.so) ++# else() ++# message(FATAL_ERROR "Despite finding MKL, libmkl_def.so was not found in expected locations.") ++# endif() ++# link_directories(${MKL_PATH}) ++# include_directories(${MKL_INCLUDE_PATH}) + + # 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) +- else() +- # static linking for python so as to minimize customer dependency issues +- link_libraries( +- ${MKL_PATH}/libmkl_intel_ilp64.a +- ${MKL_PATH}/libmkl_intel_thread.a +- ${MKL_PATH}/libmkl_core.a +- ${MKL_DEF_SO} +- iomp5 +- pthread +- m +- dl +- ) ++# else() ++# # static linking for python so as to minimize customer dependency issues ++# link_libraries( ++# ${MKL_PATH}/libmkl_intel_ilp64.a ++# ${MKL_PATH}/libmkl_intel_thread.a ++# ${MKL_PATH}/libmkl_core.a ++# ${MKL_DEF_SO} ++# iomp5 ++# pthread ++# m ++# dl ++# ) + endif() + endif() + +@@ -286,7 +299,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 "${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 -laio") 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 +307,6 @@ else() +@@ -300,10 +313,6 @@ else() endif() add_subdirectory(src) @@ -67,7 +156,7 @@ index 3d3d2b8..55633bf 100644 if (UNIT_TEST) enable_testing() -@@ -331,3 +334,7 @@ include(clang-format.cmake) +@@ -331,3 +340,7 @@ include(clang-format.cmake) if(PYBIND) add_subdirectory(python) endif() diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index 51535e944..359302b0d 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -15,6 +15,10 @@ #============================================================================= function(find_and_configure_diskann) + set(oneValueArgs VERSION REPOSITORY PINNED_TAG) + cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN} ) + 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") @@ -35,8 +39,7 @@ function(find_and_configure_diskann) "PYBIND OFF" "UNIT_TEST OFF" "RESTAPI OFF" - "PORTABLE OFF" - "-DMKL_PATH /raid/tarangj/miniconda3/envs/all_cuda-125_arch-x86_64/lib") + "PORTABLE OFF") include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(diskann) From ec6d70c37fc50d8f914e489fa1af9b9e34722fb6 Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Tue, 6 Aug 2024 17:49:21 -0500 Subject: [PATCH 12/58] FIX some cuvs_bench python build dependencies --- dependencies.yaml | 15 +++++++++++++++ python/cuvs_bench/pyproject.toml | 14 +++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index 6c52cb4cd..2773fef0c 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -102,6 +102,13 @@ files: - test_python_common - test_py_cuvs - cupy + py_build_cuvs_bench: + output: pyproject + pyproject_dir: python/cuvs_bench + extras: + table: build-system + includes: + - rapids_build_setuptools py_run_cuvs_bench: output: pyproject pyproject_dir: python/cuvs_bench @@ -173,6 +180,14 @@ dependencies: - matrix: {cuda: "11.2", arch: aarch64} packages: [nvcc_linux-aarch64=11.2] + rapids_build_setuptools: + common: + - output_types: [requirements, pyproject] + packages: + - &rapids_build_backend rapids-build-backend>=0.3.0,<0.4.0.dev0 + - setuptools + - wheel + build_py_cuvs: common: - output_types: [conda] diff --git a/python/cuvs_bench/pyproject.toml b/python/cuvs_bench/pyproject.toml index bf5372e55..9894dfc17 100644 --- a/python/cuvs_bench/pyproject.toml +++ b/python/cuvs_bench/pyproject.toml @@ -2,6 +2,9 @@ [build-system] requires = [ + "rapids-build-backend>=0.3.0,<0.4.0.dev0", + "setuptools", + "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project] @@ -26,11 +29,16 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] +[tool.rapids-build-backend] +build-backend = "setuptools.build_meta" +dependencies-file = "../../dependencies.yaml" +matrix-entry = "cuda_suffixed=true" + [project.urls] -Homepage = "https://github.com/rapidsai/raft" +Homepage = "https://github.com/rapidsai/cuvs" -[tool.setuptools.package-data] -"*" = ["*.*", "VERSION"] +[tool.setuptools] +license-files = ["LICENSE"] [tool.isort] line_length = 79 From 585ad53b9f8aa49690655f166e463ee0326e385f Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Tue, 6 Aug 2024 18:10:12 -0500 Subject: [PATCH 13/58] FIX add missing algorithms.yaml --- .../cuvs_bench/cuvs_bench/config/__init__.py | 17 ++++++++ .../cuvs_bench/config/algorithms.yaml | 42 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 python/cuvs_bench/cuvs_bench/config/__init__.py create mode 100644 python/cuvs_bench/cuvs_bench/config/algorithms.yaml diff --git a/python/cuvs_bench/cuvs_bench/config/__init__.py b/python/cuvs_bench/cuvs_bench/config/__init__.py new file mode 100644 index 000000000..7c04e3fd8 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/__init__.py @@ -0,0 +1,17 @@ +# +# 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. +# + +from .algos.constraints import * diff --git a/python/cuvs_bench/cuvs_bench/config/algorithms.yaml b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml new file mode 100644 index 000000000..dc1127fbc --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml @@ -0,0 +1,42 @@ +faiss_gpu_flat: + executable: FAISS_GPU_FLAT_ANN_BENCH + requires_gpu: true +faiss_gpu_ivf_flat: + executable: FAISS_GPU_IVF_FLAT_ANN_BENCH + requires_gpu: true +faiss_gpu_ivf_pq: + executable: FAISS_GPU_IVF_PQ_ANN_BENCH + requires_gpu: true +faiss_gpu_ivf_sq: + executable: FAISS_GPU_IVF_PQ_ANN_BENCH + requires_gpu: true +faiss_cpu_flat: + executable: FAISS_CPU_FLAT_ANN_BENCH + requires_gpu: false +faiss_cpu_ivf_flat: + executable: FAISS_CPU_IVF_FLAT_ANN_BENCH + requires_gpu: false +faiss_cpu_ivf_pq: + executable: FAISS_CPU_IVF_PQ_ANN_BENCH + requires_gpu: false +cuvs_ivf_flat: + executable: CUVS_IVF_FLAT_ANN_BENCH + requires_gpu: true +cuvs_ivf_pq: + executable: CUVS_IVF_PQ_ANN_BENCH + requires_gpu: true +cuvs_cagra: + executable: CUVS_CAGRA_ANN_BENCH + requires_gpu: true +cuvs_brute_force: + executable: CUVS_BRUTE_FORCE_ANN_BENCH + requires_gpu: true +ggnn: + executable: GGNN_ANN_BENCH + requires_gpu: true +hnswlib: + executable: HNSWLIB_ANN_BENCH + requires_gpu: false +cuvs_cagra_hnswlib: + executable: CUVS_CAGRA_HNSWLIB_ANN_BENCH + requires_gpu: true From 33b075da41a8de66a1b9a505b086fa77383da6cd Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 7 Aug 2024 14:48:19 -0700 Subject: [PATCH 14/58] working mem index --- cpp/bench/ann/src/common/benchmark.hpp | 2 +- .../ann/src/diskann/diskann_benchmark.cpp | 25 +- cpp/bench/ann/src/diskann/diskann_wrapper.h | 226 ++++++++-------- cpp/cmake/patches/diskann.diff | 243 ++++++------------ .../cuvs_bench/config/algorithms.yaml | 6 + .../config/algos/constraints/__init__.py | 22 +- .../config/algos/diskann_memory.yaml | 5 +- .../cuvs_bench/config/algos/diskann_ssd.yaml | 26 +- 8 files changed, 244 insertions(+), 311 deletions(-) diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index b75217f1e..dee7ceca0 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -146,7 +146,7 @@ void bench_build(::benchmark::State& state, bool parse_base_file = index.algo == "diskann_ssd"; const T* base_set; - if (parse_base_file) base_set = dataset->base_set(algo_property.dataset_memory_type); + if (!parse_base_file) base_set = dataset->base_set(algo_property.dataset_memory_type); std::size_t index_size = dataset->base_set_size(); cuda_timer gpu_timer{algo}; diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp index b63d039b0..3837ac828 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -55,8 +55,18 @@ void parse_build_param(const nlohmann::json& conf, { param.R = conf.at("R"); if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } - if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } - // param.use_cagra_graph = conf.at("use_cagra_graph"); + if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); } + if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } + param.use_cagra_graph = conf.at("use_cagra_graph"); + if (param.use_cagra_graph) { + if (conf.contains("cagra_graph_degree")) { + param.cagra_graph_degree = conf.at("cagra_graph_degree"); + } else { + param.cagra_graph_degree = param.R; + } + param.cagra_intermediate_graph_degree = conf.at("cagra_intermediate_graph_degree"); + } + if (conf.contains("QD")) { param.QD = conf.at("QD"); } } template @@ -73,6 +83,9 @@ void parse_search_param(const nlohmann::json& conf, { param.L_search = conf.at("L_search"); param.num_threads = conf.at("num_threads"); + if (conf.contains("num_nodes_to_cache")) { + param.num_nodes_to_cache = conf.at("num_nodes_to_cache"); + } } template class Algo> @@ -109,9 +122,11 @@ auto create_algo(const std::string& algo_name, if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) { - if (algo_name == "diskann_memory") { a = make_algo(metric, dim, conf); } - else if (algo_name == "diskann_ssd") { a = make_algo(metric, dim, conf); } - + if (algo_name == "diskann_memory") { + a = make_algo(metric, dim, conf); + } else if (algo_name == "diskann_ssd") { + a = make_algo(metric, dim, conf); + } } if (!a) { throw std::runtime_error("invalid algo: '" + algo_name + "'"); } diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index b290d0c87..024dcdd44 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -16,6 +16,7 @@ #pragma once #include "../common/ann_types.hpp" +#include "../common/thread_pool.hpp" #include "cuvs/neighbors/nn_descent.hpp" #include "linux_aligned_file_reader.h" @@ -23,10 +24,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -64,25 +65,28 @@ class diskann_memory : public algo { struct search_param : public search_param_base { uint32_t L_search; uint32_t num_threads = omp_get_num_procs(); - Mode metric_objective; + // Mode metric_objective; }; diskann_memory(Metric metric, int dim, const build_param& param); - void build(const T* dataset, size_t nrow) override; + virtual void build(const T* dataset, size_t nrow) override; void set_search_param(const search_param_base& param) override; - void search(const T* queries, - int batch_size, - int k, - algo_base::index_type* indices, - float* distances) const override; + virtual void search(const T* queries, + int batch_size, + int k, + algo_base::index_type* indices, + float* distances) const override; - void save(const std::string& path_to_index) const override; - void load(const std::string& path_to_index) override; + virtual void save(const std::string& path_to_index) const override; + virtual void load(const std::string& path_to_index) override; diskann_memory(const diskann_memory& other) = default; - std::unique_ptr> copy() override { return std::make_unique>(*this); } + virtual std::unique_ptr> copy() override + { + return std::make_unique>(*this); + } [[nodiscard]] auto get_preference() const -> algo_property override { @@ -92,18 +96,22 @@ class diskann_memory : public algo { return property; } - private: + protected: bool use_cagra_graph_; std::shared_ptr diskann_index_write_params_{nullptr}; uint32_t max_points_; - uint32_t build_pq_bytes_; - std::shared_ptr> mem_index_{nullptr}; + uint32_t build_pq_bytes_ = 0; std::shared_ptr cagra_index_params_{nullptr}; int num_threads_; uint32_t L_search_; - Mode metric_objective_; + Mode bench_mode_; int num_search_threads_; + std::shared_ptr thread_pool_; + + private: + std::shared_ptr> mem_index_{nullptr}; + void initialize_index_(); }; template @@ -126,16 +134,16 @@ diskann_memory::diskann_memory(Metric metric, int dim, const build_param& par cagra_index_params.graph_degree = param.cagra_graph_degree; auto nn_descent_params = cuvs::neighbors::nn_descent::index_params(cagra_index_params.intermediate_graph_degree); - cagra_index_params.graph_build_params = nn_descent_params; + cagra_index_params.graph_build_params = nn_descent_params; + cagra_index_params.guarantee_connectivity = true; cagra_index_params_ = std::make_shared(cagra_index_params); } } template -void diskann_memory::build(const T* dataset, size_t nrow) +void diskann_memory::initialize_index_() { - max_points_ = nrow; this->mem_index_ = std::make_shared>(parse_metric_to_diskann(this->metric_), this->dim_, max_points_, @@ -151,6 +159,12 @@ void diskann_memory::build(const T* dataset, size_t nrow) false, use_cagra_graph_, cagra_index_params_); +} +template +void diskann_memory::build(const T* dataset, size_t nrow) +{ + max_points_ = nrow; + initialize_index_(); mem_index_->build(dataset, nrow, std::vector()); } @@ -159,31 +173,33 @@ void diskann_memory::set_search_param(const search_param_base& param_) { auto param = dynamic_cast(param_); this->L_search_ = param.L_search; - metric_objective_ = param.metric_objective; num_search_threads_ = param.num_threads; + + // bench_mode_ = param.metric_objective; + bench_mode_ = Mode::kLatency; + + // Create a pool if multiple query threads have been set and the pool hasn't been created already + bool create_pool = (bench_mode_ == Mode::kLatency && num_search_threads_ > 1 && !thread_pool_); + if (create_pool) { thread_pool_ = std::make_shared(num_search_threads_); } } template void diskann_memory::search( const T* queries, int batch_size, int k, algo_base::index_type* indices, float* distances) const { - if (this->metric_objective_ == Mode::kLatency) { - omp_set_num_threads(num_search_threads_); -#pragma omp parallel for - for (int64_t i = 0; i < (int64_t)batch_size; i++) { - // mem_index_->search(queries + i * this->dim_, - // static_cast(k), - // L_search_, - // indices + i * k, - // distances + i * k); - } + auto f = [&](int i) { + // diskann in-memory index can only handle a single vector at a time. + mem_index_->search(queries + i * this->dim_, + static_cast(k), + L_search_, + reinterpret_cast(indices + i * k), + distances + i * k); + }; + if (bench_mode_ == Mode::kLatency && num_threads_ > 1) { + thread_pool_->submit(f, batch_size); } else { - for (int64_t i = 0; i < (int64_t)batch_size; i++) { - // mem_index_->search(queries + i * this->dim_, - // static_cast(k), - // L_search_, - // indices + i * k, - // distances + i * k); + for (int i = 0; i < batch_size; i++) { + f(i); } } } @@ -197,105 +213,80 @@ void diskann_memory::save(const std::string& path_to_index) const template void diskann_memory::load(const std::string& path_to_index) { + initialize_index_(); this->mem_index_->load(path_to_index.c_str(), num_threads_, 100); } template -class diskann_ssd : public algo { +class diskann_ssd : public diskann_memory { public: - struct build_param { - uint32_t R; - uint32_t L_build; - uint32_t num_threads; + struct build_param : diskann_memory::build_param { + uint32_t QD = 512; }; - using search_param_base = typename algo::search_param; - struct search_param : public search_param_base { - uint32_t L_search; - uint32_t num_threads = omp_get_num_procs(); - Mode metric_objective; + struct search_param : diskann_memory::search_param { + uint32_t num_nodes_to_cache = 512; }; diskann_ssd(Metric metric, int dim, const build_param& param); void build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) override; - void build(const T* dataset, size_t nrow) override {}; - - void set_search_param(const search_param_base& param_) override; + void build(const T* dataset, size_t nrow) override { + // do nothing. will not be used. + }; - void search( - const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const override; + void search(const T* queries, + int batch_size, + int k, + algo_base::index_type* neighbors, + float* distances) const override; void save(const std::string& path_to_index) const override; void load(const std::string& path_to_index) override; diskann_ssd(const diskann_ssd& other) = default; std::unique_ptr> copy() override { return std::make_unique>(*this); } - algo_property get_preference() const override - { - algo_property property; - property.dataset_memory_type = MemoryType::kHost; - property.query_memory_type = MemoryType::kHost; - return property; - } - - protected: - uint32_t build_pq_bytes_ = 0; + private: std::string index_build_params_str; -std::shared_ptr> p_flash_index_; - - // std::shared_ptr thread_pool_; - uint32_t num_nodes_to_cache_; - uint32_t L_search_; + std::shared_ptr> p_flash_index_; + uint32_t num_nodes_to_cache_ = 10000; - bool use_cagra_graph_; - uint32_t max_points_; std::shared_ptr> mem_index_{nullptr}; - std::shared_ptr cagra_index_params_{nullptr}; - - // uint32_t L_search_; - Mode metric_objective_; - // int num_search_threads_; }; template -diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) : algo(metric, dim) +diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) : diskann_memory(metric, dim, param) { - // Currently set the indexing RAM budget and the search RAM budget to avoid sharding + // Currently set the indexing RAM budget and the search RAM budget to max value avoid sharding uint32_t build_dram_budget = std::numeric_limits::max(); uint32_t search_dram_budget = std::numeric_limits::max(); - index_build_params_str = std::string(std::to_string(param.R)) + " " + - std::string(std::to_string(param.L_build)) + " " + - std::string(std::to_string(search_dram_budget)) + " " + - std::string(std::to_string(build_dram_budget)) + " " + - std::string(std::to_string(param.num_threads)) + " " + - std::string(std::to_string(false)) + " " + std::string(std::to_string(false)) + - " " + std::string(std::to_string(0)) + " " + std::string(std::to_string(192)); + index_build_params_str = + std::string(std::to_string(param.R)) + " " + std::string(std::to_string(param.L_build)) + " " + + std::string(std::to_string(search_dram_budget)) + " " + + std::string(std::to_string(build_dram_budget)) + " " + + std::string(std::to_string(param.num_threads)) + " " + std::string(std::to_string(false)) + + " " + std::string(std::to_string(false)) + " " + std::string(std::to_string(0)) + " " + + std::string(std::to_string(param.QD)); } template -void diskann_ssd::build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) +void diskann_ssd::build_from_bin(std::string dataset_path, + std::string path_to_index, + size_t nrow) { - diskann::build_disk_index(dataset_path.c_str(), path_to_index.c_str(), - index_build_params_str.c_str(), - parse_metric_to_diskann(this->metric_), - false, - std::string(""), - false, - std::string(""), - std::string(""), - static_cast(0), - static_cast(0), - cagra_index_params_); -} - -template -void diskann_ssd::set_search_param(const search_param_base& param_) -{ - auto param = dynamic_cast(param_); - this->L_search_ = param.L_search; - // metric_objective_ = param.metric_objective; + diskann::build_disk_index(dataset_path.c_str(), + path_to_index.c_str(), + index_build_params_str.c_str(), + parse_metric_to_diskann(this->metric_), + false, + std::string(""), + false, + std::string(""), + std::string(""), + static_cast(0), + static_cast(0), + this->cagra_index_params_); } template @@ -308,25 +299,20 @@ void diskann_ssd::search( node_list.clear(); node_list.shrink_to_fit(); - if (this->metric_objective_ == Mode::kLatency) { - omp_set_num_threads(omp_get_num_procs()); -#pragma omp parallel for - for (int64_t i = 0; i < (int64_t)batch_size; i++) { - p_flash_index_->cached_beam_search(queries + (i * this->dim_), - static_cast(k), - L_search_, - reinterpret_cast(neighbors + i * k), - distances + i * k, - 2); - } + auto f = [&](int i) { + // diskann ssd index can only handle a single vector at a time. + p_flash_index_->cached_beam_search(queries + (i * this->dim_), + static_cast(k), + this->L_search_, + reinterpret_cast(neighbors + i * k), + distances + i * k, + 2); + }; + if (this->bench_mode_ == Mode::kLatency && this->num_search_threads_ > 1) { + this->thread_pool_->submit(f, batch_size); } else { - for (int64_t i = 0; i < (int64_t)batch_size; i++) { - p_flash_index_->cached_beam_search(queries + (i * this->dim_), - static_cast(k), - L_search_, - reinterpret_cast(neighbors + i * k), - distances + i * k, - 2); + for (int i = 0; i < batch_size; i++) { + f(i); } } } @@ -342,6 +328,6 @@ void diskann_ssd::load(const std::string& path_to_index) { std::shared_ptr reader = nullptr; reader.reset(new LinuxAlignedFileReader()); - int result = p_flash_index_->load(omp_get_num_procs(), path_to_index.c_str()); + int result = p_flash_index_->load(this->num_search_threads_, path_to_index.c_str()); } }; // namespace cuvs::bench diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 8d168dbd8..e81684a76 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..5b6941a 100644 +index 3d3d2b8..0aca533 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,25 @@ set(CMAKE_STANDARD 17) @@ -28,7 +28,7 @@ index 3d3d2b8..5b6941a 100644 if(NOT MSVC) set(CMAKE_CXX_COMPILER g++) endif() -@@ -145,62 +164,56 @@ if (MSVC) +@@ -145,62 +164,16 @@ if (MSVC) "${DISKANN_MKL_LIB_PATH}/mkl_intel_thread.lib") else() # expected path for manual intel mkl installs @@ -43,7 +43,8 @@ index 3d3d2b8..5b6941a 100644 - message(FATAL_ERROR "Could not find Intel OMP in standard locations; use -DOMP_PATH to specify the install location for your environment") - endif() - link_directories(${OMP_PATH}) -- ++ find_package(MKL CONFIG REQUIRED) + - 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") - foreach(POSSIBLE_MKL_LIB_PATH ${POSSIBLE_MKL_LIB_PATHS}) - if (EXISTS ${POSSIBLE_MKL_LIB_PATH}) @@ -71,39 +72,9 @@ index 3d3d2b8..5b6941a 100644 - endif() - link_directories(${MKL_PATH}) - include_directories(${MKL_INCLUDE_PATH}) -+ find_package(MKL CONFIG REQUIRED) -+ + #target_compile_options(${PROJECT_NAME} PUBLIC $) + include_directories($) + link_libraries($) -+ -+# set(POSSIBLE_MKL_LIB_PATHS "/raid/tarangj/miniconda3/envs/all_cuda-125_arch-x86_64/lib/libmkl_core.so;/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") -+# 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) -+# endif() -+# endforeach() -+ -+# set(POSSIBLE_MKL_INCLUDE_PATHS "/raid/tarangj/miniconda3/envs/all_cuda-125_arch-x86_64/include;/opt/intel/oneapi/mkl/latest/include;/usr/include/mkl;/opt/intel/mkl/include/;") -+# foreach(POSSIBLE_MKL_INCLUDE_PATH ${POSSIBLE_MKL_INCLUDE_PATHS}) -+# if (EXISTS ${POSSIBLE_MKL_INCLUDE_PATH}) -+# set(MKL_INCLUDE_PATH ${POSSIBLE_MKL_INCLUDE_PATH}) -+# endif() -+# endforeach() -+# if(NOT MKL_PATH) -+# message(FATAL_ERROR "Could not find Intel MKL in standard locations; use -DMKL_PATH to specify the install location for your environment") -+# elseif(NOT MKL_INCLUDE_PATH) -+# message(FATAL_ERROR "Could not find Intel MKL in standard locations; use -DMKL_INCLUDE_PATH to specify the install location for headers for your environment") -+# endif() -+# if (EXISTS ${MKL_PATH}/libmkl_def.so.2) -+# set(MKL_DEF_SO ${MKL_PATH}/libmkl_def.so.2) -+# elseif(EXISTS ${MKL_PATH}/libmkl_def.so) -+# set(MKL_DEF_SO ${MKL_PATH}/libmkl_def.so) -+# else() -+# message(FATAL_ERROR "Despite finding MKL, libmkl_def.so was not found in expected locations.") -+# endif() -+# link_directories(${MKL_PATH}) -+# include_directories(${MKL_INCLUDE_PATH}) # compile flags and link libraries add_compile_options(-m64 -Wl,--no-as-needed) @@ -121,22 +92,10 @@ index 3d3d2b8..5b6941a 100644 - m - dl - ) -+# else() -+# # static linking for python so as to minimize customer dependency issues -+# link_libraries( -+# ${MKL_PATH}/libmkl_intel_ilp64.a -+# ${MKL_PATH}/libmkl_intel_thread.a -+# ${MKL_PATH}/libmkl_core.a -+# ${MKL_DEF_SO} -+# iomp5 -+# pthread -+# m -+# dl -+# ) endif() endif() -@@ -286,7 +299,7 @@ if(MSVC) +@@ -286,7 +259,7 @@ if(MSVC) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/x64/Release) else() set(ENV{TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD} 500000000000) @@ -145,7 +104,7 @@ index 3d3d2b8..5b6941a 100644 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 +313,6 @@ else() +@@ -300,10 +273,6 @@ else() endif() add_subdirectory(src) @@ -156,7 +115,7 @@ index 3d3d2b8..5b6941a 100644 if (UNIT_TEST) enable_testing() -@@ -331,3 +340,7 @@ include(clang-format.cmake) +@@ -331,3 +300,7 @@ include(clang-format.cmake) if(PYBIND) add_subdirectory(python) endif() @@ -261,6 +220,49 @@ index 7e2a7ac..538b55a 100644 if (calc_recall_flag) { diskann::cout << std::setw(16) << recall << std::endl; +diff --git a/build.sh b/build.sh +new file mode 100755 +index 0000000..79f0fa0 +--- /dev/null ++++ b/build.sh +@@ -0,0 +1,37 @@ ++#!/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..2703ec4 @@ -437,7 +439,7 @@ index 0a0a617..c4ee71d 100644 \ No newline at end of file +} // namespace diskann diff --git a/include/index.h b/include/index.h -index b9bf4f3..e365fdc 100644 +index b9bf4f3..60ef863 100644 --- a/include/index.h +++ b/include/index.h @@ -29,6 +29,11 @@ @@ -461,28 +463,17 @@ index b9bf4f3..e365fdc 100644 DISKANN_DLLEXPORT ~Index(); -@@ -236,6 +241,11 @@ template clas +@@ -236,6 +241,9 @@ template clas Index(const Index &) = delete; Index &operator=(const Index &) = delete; -+ // Build the raft CAGRA index ++ // Build the cuVS CAGRA index + void build_cuvs_cagra_index(const T* data); -+ -+ void build_cuvs_cagra_index_quantized(const uint8_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 +296,8 @@ template clas - // Acquire exclusive _update_lock before calling - void link(); - -+ void add_cuvs_cagra_nbrs(); -+ - // Acquire exclusive _tag_lock and _delete_lock before calling - int reserve_location(); - -@@ -444,5 +456,9 @@ template clas +@@ -444,5 +452,9 @@ template clas std::vector _locks; static const float INDEX_GROWTH_FACTOR; @@ -581,26 +572,15 @@ index a8e64d0..7fbc1bb 100644 + std::shared_ptr _cuvs_cagra_index_params; }; } // namespace diskann -diff --git a/include/index_factory.h b/include/index_factory.h -index 76fb0b9..f672bc6 100644 ---- a/include/index_factory.h -+++ b/include/index_factory.h -@@ -48,4 +48,4 @@ class IndexFactory - std::unique_ptr _config; - }; - --} // namespace diskann -+} // namespace diskann -\ No newline at end of file diff --git a/include/program_options_utils.hpp b/include/program_options_utils.hpp -index 2be6059..fb6be55 100644 +index 2be6059..922fbe5 100644 --- a/include/program_options_utils.hpp +++ b/include/program_options_utils.hpp @@ -77,5 +77,6 @@ const char *UNIVERSAL_LABEL = "in the labels file instead of listing all labels for a node. DiskANN will not automatically assign a " "universal label to a node."; const char *FILTERED_LBUILD = "Build complexity for filtered points, higher value results in better graphs"; -+const char *RAFT_CAGRA_INDEX = "Use the raft CAGRA graph instead of the Vamana graph"; ++const char *CUVS_CAGRA_INDEX = "Use the raft CAGRA graph instead of the Vamana graph"; } // namespace program_options_utils diff --git a/include/utils.h b/include/utils.h @@ -645,7 +625,7 @@ index cbca264..de3dadd 100644 if (NOT MSVC) diff --git a/src/disk_utils.cpp b/src/disk_utils.cpp -index 0165602..ee550c1 100644 +index 0165602..ee06fab 100644 --- a/src/disk_utils.cpp +++ b/src/disk_utils.cpp @@ -2,6 +2,7 @@ @@ -699,7 +679,7 @@ index 0165602..ee550c1 100644 if (!use_filters) { _index.build(shard_base_file.c_str(), shard_base_pts); -@@ -1101,8 +1105,10 @@ template +@@ -1101,8 +1105,9 @@ template int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, diskann::Metric compareMetric, bool use_opq, const std::string &codebook_prefix, bool use_filters, const std::string &label_file, const std::string &universal_label, const uint32_t filter_threshold, @@ -707,22 +687,19 @@ index 0165602..ee550c1 100644 + const uint32_t Lf, std::shared_ptr cagra_index_params) { + bool use_cuvs_cagra_graph = cagra_index_params != nullptr; -+ // std::cout << "inside build_disk_index: use_cuvs_cagra_graph: " << use_cuvs_cagra_graph << std::endl; std::stringstream parser; parser << std::string(indexBuildParameters); std::string cur_param; -@@ -1289,7 +1295,9 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const +@@ -1289,7 +1294,7 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const Timer timer; diskann::get_bin_metadata(data_file_to_use.c_str(), points_num, dim); const double p_val = ((double)MAX_PQ_TRAINING_SET_SIZE / (double)points_num); - + -+ if (!use_cuvs_cagra_graph) { -+ std::cout << "entered !use_cuvs_cagra_graph if block" << std::endl; if (use_disk_pq) { generate_disk_quantized_data(data_file_to_use, disk_pq_pivots_path, disk_pq_compressed_vectors_path, -@@ -1309,12 +1317,14 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const +@@ -1309,6 +1314,7 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const num_pq_chunks = atoi(param_list[8].c_str()); } @@ -730,18 +707,7 @@ index 0165602..ee550c1 100644 diskann::cout << "Compressing " << dim << "-dimensional data into " << num_pq_chunks << " bytes per vector." << std::endl; - generate_quantized_data(data_file_to_use, pq_pivots_path, pq_compressed_vectors_path, compareMetric, p_val, - num_pq_chunks, use_opq, codebook_prefix); - diskann::cout << timer.elapsed_seconds_for_step("generating quantized data") << std::endl; -+} - - // Gopal. Splitting diskann_dll into separate DLLs for search and build. - // This code should only be available in the "build" DLL. -@@ -1323,10 +1333,11 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const - #endif - // Whether it is cosine or inner product, we still L2 metric due to the pre-processing. - timer.reset(); -+ std::cout << "now running build_merged_vamana_index" << std::endl; +@@ -1326,7 +1332,7 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const diskann::build_merged_vamana_index(data_file_to_use.c_str(), diskann::Metric::L2, L, R, p_val, indexing_ram_budget, mem_index_path, medoids_path, centroids_path, build_pq_bytes, use_opq, num_threads, use_filters, labels_file_to_use, @@ -750,7 +716,7 @@ index 0165602..ee550c1 100644 diskann::cout << timer.elapsed_seconds_for_step("building merged vamana index") << std::endl; timer.reset(); -@@ -1432,21 +1443,21 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da +@@ -1432,21 +1438,21 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da const std::string &codebook_prefix, bool use_filters, const std::string &label_file, const std::string &universal_label, @@ -775,7 +741,7 @@ index 0165602..ee550c1 100644 // LabelT = uint16 template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, -@@ -1454,51 +1465,51 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da +@@ -1454,51 +1460,51 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da const std::string &codebook_prefix, bool use_filters, const std::string &label_file, const std::string &universal_label, @@ -848,7 +814,7 @@ index 096d1b7..6d01516 100644 \ No newline at end of file +endforeach() diff --git a/src/index.cpp b/src/index.cpp -index bf93344..531cd75 100644 +index bf93344..d6c22f7 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1,6 +1,7 @@ @@ -896,7 +862,7 @@ index bf93344..531cd75 100644 // Initialize an index with metric m, load the data of type T with filename // (bin), and initialize max_points template -@@ -38,8 +57,11 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr::Index(const IndexConfig &index_config, std::shared_ptr), _conc_consolidate(index_config.concurrent_consolidate), + _cuvs_cagra_index(index_config.cuvs_cagra_index) { -+ std::cout << "inside params function index_config.cuvs_cagra_index" << index_config.cuvs_cagra_index -+ << " _cuvs_cagra_index " << _cuvs_cagra_index << std::endl; if (_dynamic_index && !_enable_tags) { - throw ANNException("ERROR: Dynamic Indexing must have tags enabled.", -1, __FUNCSIG__, __FILE__, __LINE__); -@@ -109,6 +131,21 @@ Index::Index(const IndexConfig &index_config, std::shared_ptr::Index(const IndexConfig &index_config, std::shared_ptrget_dims()); } } @@ -924,6 +887,7 @@ index bf93344..531cd75 100644 + else + { + cuvs::neighbors::cagra::index_params cuvs_cagra_index_params; ++ cuvs_cagra_index_params.graph_degree = _indexingRange; + cuvs_cagra_index_params.metric = parse_metric_to_cuvs(_dist_metric); + _cuvs_cagra_index_params = std::make_shared(cuvs_cagra_index_params); + } @@ -931,7 +895,7 @@ index bf93344..531cd75 100644 } template -@@ -117,7 +154,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -117,7 +153,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, @@ -941,7 +905,7 @@ index bf93344..531cd75 100644 : Index( IndexConfigBuilder() .with_metric(m) -@@ -134,6 +172,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point +@@ -134,6 +171,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()) @@ -950,16 +914,7 @@ index bf93344..531cd75 100644 .build(), IndexFactory::construct_datastore(DataStoreStrategy::MEMORY, (max_points == 0 ? (size_t)1 : max_points) + -@@ -145,6 +185,8 @@ Index::Index(Metric m, const size_t dim, const size_t max_point - (size_t)((index_parameters == nullptr ? 0 : index_parameters->max_degree) * - defaults::GRAPH_SLACK_FACTOR * 1.05))) - { -+ std::cout << "inside index build cuvs_cagra_index: " << cuvs_cagra_index -+ << " _cuvs_cagra_index: " << _cuvs_cagra_index << std::endl; - if (_pq_dist) - { - _pq_data_store = IndexFactory::construct_pq_datastore(DataStoreStrategy::MEMORY, max_points + num_frozen_pts, -@@ -372,7 +414,36 @@ void Index::save(const char *filename, bool compact_before_save +@@ -372,7 +411,36 @@ void Index::save(const char *filename, bool compact_before_save // the error code for delete_file, but will ignore now because // delete should succeed if save will succeed. delete_file(graph_file); @@ -974,19 +929,19 @@ index bf93344..531cd75 100644 + size_t file_offset = 0; + out.seekp(file_offset, out.beg); + size_t index_size = 24; -+ uint32_t max_degree = _indexingRange; ++ uint32_t max_degree = _cuvs_cagra_index_params->graph_degree; + out.write((char *)&index_size, sizeof(uint64_t)); + out.write((char *)&max_degree, sizeof(uint32_t)); + uint32_t ep_u32 = _start; + out.write((char *)&ep_u32, sizeof(uint32_t)); + out.write((char *)&_num_frozen_pts, sizeof(size_t)); + -+ uint32_t GK = (uint32_t)_indexingRange; ++ uint32_t GK = max_degree; + for (uint32_t i = 0; i < _nd + _num_frozen_pts; i++) + { + + out.write((char *)&GK, sizeof(uint32_t)); -+ out.write((char *)(host_cagra_graph.data() + _indexingRange * i), GK * sizeof(uint32_t)); ++ out.write((char *)(host_cagra_graph.data() + GK * i), GK * sizeof(uint32_t)); + index_size += (size_t)(sizeof(uint32_t) * (GK + 1)); + } + out.seekp(file_offset, out.beg); @@ -997,40 +952,7 @@ index bf93344..531cd75 100644 delete_file(data_file); save_data(data_file); delete_file(tags_file); -@@ -732,6 +803,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 +811,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 +912,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) - { -@@ -1270,6 +1345,7 @@ void Index::inter_insert(uint32_t n, std::vector &pru - - template void Index::link() - { -+ std::cout << "inside link()" << std::endl; - uint32_t num_threads = _indexingThreads; - if (num_threads != 0) - omp_set_num_threads(num_threads); -@@ -1448,8 +1524,6 @@ void Index::set_start_points(const T *data, size_t data_count) +@@ -1448,8 +1516,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__); @@ -1039,7 +961,7 @@ index bf93344..531cd75 100644 for (location_t i = 0; i < _num_frozen_pts; i++) { _data_store->set_vector((location_t)(i + _max_points), data + i * _dim); -@@ -1505,6 +1579,20 @@ void Index::set_start_points_at_random(T radius, uint32_t rando +@@ -1505,6 +1571,20 @@ void Index::set_start_points_at_random(T radius, uint32_t rando set_start_points(points_data.data(), points_data.size()); } @@ -1060,7 +982,7 @@ index bf93344..531cd75 100644 template void Index::build_with_data_populated(const std::vector &tags) { -@@ -1559,6 +1647,7 @@ void Index::build_with_data_populated(const std::vector & +@@ -1559,6 +1639,7 @@ void Index::build_with_data_populated(const std::vector & _has_built = true; } @@ -1068,7 +990,7 @@ index bf93344..531cd75 100644 template void Index::_build(const DataType &data, const size_t num_points_to_load, TagVector &tags) { -@@ -1597,7 +1686,12 @@ void Index::build(const T *data, const size_t num_points_to_loa +@@ -1597,7 +1678,12 @@ void Index::build(const T *data, const size_t num_points_to_loa _data_store->populate_data(data, (location_t)num_points_to_load); } @@ -1082,7 +1004,7 @@ index bf93344..531cd75 100644 } template -@@ -1683,7 +1777,14 @@ void Index::build(const char *filename, const size_t num_points +@@ -1683,7 +1769,14 @@ void Index::build(const char *filename, const size_t num_points std::unique_lock tl(_tag_lock); _nd = num_points_to_load; } @@ -1098,12 +1020,3 @@ index bf93344..531cd75 100644 } template -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/python/cuvs_bench/cuvs_bench/config/algorithms.yaml b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml index dc1127fbc..53ef55dd8 100644 --- a/python/cuvs_bench/cuvs_bench/config/algorithms.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml @@ -40,3 +40,9 @@ hnswlib: cuvs_cagra_hnswlib: executable: CUVS_CAGRA_HNSWLIB_ANN_BENCH requires_gpu: true +diskann_memory: + executable: DISKANN_MEMORY_ANN_BENCH + requires_gpu: true +diskann_ssd: + executable: DISKANN_SSD_ANN_BENCH + requires_gpu: true diff --git a/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py index d25da1b9c..584a692ed 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py +++ b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py @@ -100,11 +100,25 @@ def hnswlib_search(params, build_params, k, batch_size): if "ef" in params: return params["ef"] >= k +############################################################################### +# DiskANN constraints # +############################################################################### -def diskann_memory_build(params, build_params, k, batch_size): +def diskann_memory_build(params, dim): ret = True - if "cagra_graph_degree" in params: - ret = params["cagra_graph_degree"] <= params["cagra_intermediate_graph_degree"] + if "cagra_intermediate_graph_degree" in params: + ret = params["R"] <= params["cagra_intermediate_graph_degree"] if "R" in params and "L_build" in params: ret = params["R"] <= params["L_build"] - return ret \ No newline at end of file + return ret + + +def diskann_ssd_build(params, dim): + ret = True + if "cagra_intermediate_graph_degree" in params: + ret = params["R"] <= params["cagra_intermediate_graph_degree"] + if "R" in params and "L_build" in params: + ret = params["R"] <= params["L_build"] + if "QD" in params: + ret = params["QD"] <= dim + return ret diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml index 7ec9e709f..47cc470b5 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml @@ -1,7 +1,6 @@ name: diskann_memory constraints: - build: cuvs_bench.constraints.diskann_memory_build_constraints - search: cuvs_bench.constraints.diskann_memory_search_constraints + build: cuvs_bench.config.algos.constraints.diskann_memory_build groups: base: build: @@ -13,7 +12,7 @@ groups: L_search: [10, 20, 30, 40, 50, 100, 200, 300] cagra: build: - cagra_graph_degree: [32, 64, 96] + R: [32, 64, 96] cagra_intermediate_graph_degree: [64, 96, 128] use_cagra_graph: [True] search: diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml index ee0ab31f2..d7b017743 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml @@ -1,20 +1,20 @@ name: diskann_ssd constraints: - # build: cuvs_bench.constraints.diskann_memory_build_constraints - # search: cuvs_bench.constraints.diskann_memory_search_constraints + build: cuvs_bench.config.algos.constraints.diskann_ssd_build groups: base: build: - R: [64] - L_build: [128] - # alpha: [1.0, 1.2] - # use_cagra_graph: [False] + R: [64, 96] + L_build: [64, 128, 256, 384] + use_cagra_graph: [False] + QD: [192] search: L_search: [10, 20, 30, 40, 50, 100, 200, 300] - # cagra: - # build: - # cagra_graph_degree: [32, 64, 96] - # cagra_intermediate_graph_degree: [64, 96, 128] - # use_cagra_graph: [True] - # search: - # L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file + cagra: + build: + R: [32, 64, 96] + cagra_intermediate_graph_degree: [64, 96, 128] + use_cagra_graph: [True] + QD: [192] + search: + L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file From ffea66359a458aa1e7a896cbc7447e03d8599c6f Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 8 Aug 2024 11:09:40 -0700 Subject: [PATCH 15/58] remove base_set warning --- cpp/bench/ann/src/common/benchmark.hpp | 5 +++-- cpp/bench/ann/src/diskann/diskann_benchmark.cpp | 15 +-------------- .../cuvs_bench/config/algos/diskann_memory.yaml | 2 ++ 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index dee7ceca0..381a6333a 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -145,7 +145,7 @@ void bench_build(::benchmark::State& state, bool parse_base_file = index.algo == "diskann_ssd"; - const T* base_set; + const T* base_set = nullptr; if (!parse_base_file) base_set = dataset->base_set(algo_property.dataset_memory_type); std::size_t index_size = dataset->base_set_size(); @@ -156,8 +156,9 @@ void bench_build(::benchmark::State& state, [[maybe_unused]] auto ntx_lap = nvtx.lap(); [[maybe_unused]] auto gpu_lap = gpu_timer.lap(); try { - if (!parse_base_file) + if (!parse_base_file) { algo->build(base_set, index_size); + } else { make_sure_parent_dir_exists(index.file); algo->build_from_bin(dataset->base_filename(), index.file, index_size); diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp index 3837ac828..c6eff3394 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -37,7 +37,7 @@ void parse_build_param(const nlohmann::json& conf, param.R = conf.at("R"); if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); } - if (conf.contains("numThreads")) { param.num_threads = conf.at("numThreads"); } + if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } param.use_cagra_graph = conf.at("use_cagra_graph"); if (param.use_cagra_graph) { if (conf.contains("cagra_graph_degree")) { @@ -98,19 +98,6 @@ std::unique_ptr> make_algo(cuvs::bench::Metric metric, return std::make_unique>(metric, dim, param); } -template class Algo> -std::unique_ptr> make_algo(cuvs::bench::Metric metric, - int dim, - const nlohmann::json& conf, - const std::vector& dev_list) -{ - typename Algo::build_param param; - parse_build_param(conf, param); - - (void)dev_list; - return std::make_unique>(metric, dim, param); -} - template auto create_algo(const std::string& algo_name, const std::string& distance, diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml index 47cc470b5..eeb44b668 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml @@ -9,6 +9,7 @@ groups: alpha: [1.0, 1.2] use_cagra_graph: [False] search: + num_threads: [32] L_search: [10, 20, 30, 40, 50, 100, 200, 300] cagra: build: @@ -16,4 +17,5 @@ groups: cagra_intermediate_graph_degree: [64, 96, 128] use_cagra_graph: [True] search: + num_threads: [32] L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file From 63621f4ff258ae3e1440dac1b121a30647ba74c1 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 1 Oct 2024 15:55:19 -0700 Subject: [PATCH 16/58] revert some changes --- LICENSE | 202 +----------------- cpp/bench/ann/CMakeLists.txt | 5 +- cpp/bench/ann/src/common/ann_types.hpp | 1 - python/cuvs_bench/LICENSE | 202 +----------------- .../faiss_gpu_ivf_pq,base,k10,bs10000.json | 62 ------ python/cuvs_bench/cuvs_bench/run/runners.py | 1 + python/cuvs_bench/pyproject.toml | 2 +- 7 files changed, 5 insertions(+), 470 deletions(-) delete mode 100644 python/cuvs_bench/cuvs_bench/run/datasets/wiki_all_10M/result/search/faiss_gpu_ivf_pq,base,k10,bs10000.json diff --git a/LICENSE b/LICENSE index 1a89b9054..30cff7403 100755 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 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. +../../LICENSE \ No newline at end of file diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index c27ecce35..1cef113ad 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -32,7 +32,7 @@ option(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benc option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" ON) option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) -option(CUVS_ANN_BENCH_USE_DISKANN "Include cuVS CAGRA with DISKANN search in benchmark" OFF) +option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" OFF) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF ) @@ -299,9 +299,6 @@ endif() if(CUVS_ANN_BENCH_USE_DISKANN) ConfigureAnnBench(NAME DISKANN_MEMORY PATH src/diskann/diskann_benchmark.cpp LINKS cuvs diskann::diskann) -endif() - -if(CUVS_ANN_BENCH_USE_DISKANN) ConfigureAnnBench(NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS cuvs diskann::diskann) endif() diff --git a/cpp/bench/ann/src/common/ann_types.hpp b/cpp/bench/ann/src/common/ann_types.hpp index 84b50240a..2070de505 100644 --- a/cpp/bench/ann/src/common/ann_types.hpp +++ b/cpp/bench/ann/src/common/ann_types.hpp @@ -129,7 +129,6 @@ class algo : public algo_base { ~algo() noexcept override = default; virtual void build(const T* dataset, size_t nrow) = 0; - // virtual void build_from_dataset_bin(const std::string dataset_filename, size_t nrow); virtual void build_from_bin(std::string dataset_file, std::string path_to_index, size_t nrow) {}; diff --git a/python/cuvs_bench/LICENSE b/python/cuvs_bench/LICENSE index 1a89b9054..30cff7403 100644 --- a/python/cuvs_bench/LICENSE +++ b/python/cuvs_bench/LICENSE @@ -1,201 +1 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 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. +../../LICENSE \ No newline at end of file diff --git a/python/cuvs_bench/cuvs_bench/run/datasets/wiki_all_10M/result/search/faiss_gpu_ivf_pq,base,k10,bs10000.json b/python/cuvs_bench/cuvs_bench/run/datasets/wiki_all_10M/result/search/faiss_gpu_ivf_pq,base,k10,bs10000.json deleted file mode 100644 index c6595f486..000000000 --- a/python/cuvs_bench/cuvs_bench/run/datasets/wiki_all_10M/result/search/faiss_gpu_ivf_pq,base,k10,bs10000.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "context": { - "date": "2024-09-19T15:46:40-07:00", - "host_name": "ipp1-3302", - "executable": "/raid/tarangj/miniconda3/envs/new-cuvs-bench/bin/ann/FAISS_GPU_IVF_PQ_ANN_BENCH", - "num_cpus": 96, - "mhz_per_cpu": 2300, - "cpu_scaling_enabled": true, - "caches": [ - { - "type": "Data", - "level": 1, - "size": 32768, - "num_sharing": 1 - }, - { - "type": "Instruction", - "level": 1, - "size": 32768, - "num_sharing": 1 - }, - { - "type": "Unified", - "level": 2, - "size": 524288, - "num_sharing": 1 - }, - { - "type": "Unified", - "level": 3, - "size": 16777216, - "num_sharing": 3 - } - ], - "load_avg": [1.69,1.89,6.98], - "library_build_type": "release", - "command_line": "/raid/tarangj/miniconda3/envs/new-cuvs-bench/bin/ann/FAISS_GPU_IVF_PQ_ANN_BENCH --search --data_prefix=/home/nfs/tarangj/cuvs2/cuvs/python/cuvs_bench/cuvs_bench/run/datasets/ --benchmark_counters_tabular=true --override_kv=k:10 --override_kv=n_queries:10000 --benchmark_min_warmup_time=1 --benchmark_out_format=json --mode=latency --benchmark_out=/home/nfs/tarangj/cuvs2/cuvs/python/cuvs_bench/cuvs_bench/run/datasets/wiki_all_10M/result/search/faiss_gpu_ivf_pq,base,k10,bs10000.json --raft_log_level=3 wiki_all_10M_faiss_gpu_ivf_pq,base,k10,bs10000_08b48c7a-76d9-11ef-9ede-d85ed30db299.json", - "dataset": "wiki_all_10M", - "distance": "euclidean", - "gpu_driver_version": "12.2", - "gpu_gpuDirectRDMASupported": "1", - "gpu_hostNativeAtomicSupported": "0", - "gpu_mem_bus_width": "5120", - "gpu_mem_freq": "1512000000.000000", - "gpu_mem_global_size": "85174583296", - "gpu_mem_shared_size": "167936", - "gpu_name": "NVIDIA A100 80GB PCIe", - "gpu_pageableMemoryAccess": "0", - "gpu_pageableMemoryAccessUsesHostPageTables": "0", - "gpu_runtime_version": "12.5", - "gpu_sm_count": "108", - "gpu_sm_freq": "1410000000.000000", - "host_cores_used": "48", - "host_cpu_freq_max": "2300000000", - "host_cpu_freq_min": "1500000000", - "host_pagesize": "4096", - "host_processors_sysconf": "96", - "host_processors_used": "96", - "host_total_ram_size": "540884389888", - "host_total_swap_size": "8589930496" - }, - "benchmarks": [ diff --git a/python/cuvs_bench/cuvs_bench/run/runners.py b/python/cuvs_bench/cuvs_bench/run/runners.py index 8ab7974fb..5a540d2e5 100644 --- a/python/cuvs_bench/cuvs_bench/run/runners.py +++ b/python/cuvs_bench/cuvs_bench/run/runners.py @@ -187,6 +187,7 @@ def cuvs_bench_cpp( "trace": 5, } + def parse_log_level(level_str: str) -> int: """ Parse the log level from string to integer. diff --git a/python/cuvs_bench/pyproject.toml b/python/cuvs_bench/pyproject.toml index cd1051fa3..41ebad116 100644 --- a/python/cuvs_bench/pyproject.toml +++ b/python/cuvs_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 = "cuvs_bench" +name = "cuvs-bench" dynamic = ["version"] description = "cuVS benchmarks" authors = [ From 450dcee4728fa8e1d57f49c2786413a35b52f6aa Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 1 Oct 2024 15:57:13 -0700 Subject: [PATCH 17/58] revert --- LICENSE | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 201 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 30cff7403..36ef90e5b 100755 --- a/LICENSE +++ b/LICENSE @@ -1 +1,201 @@ -../../LICENSE \ No newline at end of file + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 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. \ No newline at end of file From b0f4b57d99aaf0b333b4dd083f848c8d609b8e14 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 1 Oct 2024 15:59:15 -0700 Subject: [PATCH 18/58] revert --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 36ef90e5b..1a89b9054 100755 --- a/LICENSE +++ b/LICENSE @@ -198,4 +198,4 @@ 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. \ No newline at end of file + limitations under the License. From 8cd6c4019e85eea9b79aa622146d2ccc44b1948c Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 1 Oct 2024 16:22:05 -0700 Subject: [PATCH 19/58] revert --- python/cuvs/pyproject.toml | 4 ++-- python/cuvs_bench/cuvs_bench/VERSION | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/cuvs/pyproject.toml b/python/cuvs/pyproject.toml index 42f93c915..bf62f5adf 100644 --- a/python/cuvs/pyproject.toml +++ b/python/cuvs/pyproject.toml @@ -118,7 +118,7 @@ sdist.reproducible = true wheel.packages = ["cuvs"] [tool.scikit-build.metadata.version] -provider = "scikit-build-core.metadata.regex" +provider = "scikit_build_core.metadata.regex" input = "cuvs/VERSION" regex = "(?P.*)" @@ -129,7 +129,7 @@ requires = [ "cython>=3.0.0", "ninja", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. -build-backend = "scikit-build-core.build" +build-backend = "scikit_build_core.build" dependencies-file = "../../dependencies.yaml" matrix-entry = "cuda_suffixed=true;use_cuda_wheels=true" diff --git a/python/cuvs_bench/cuvs_bench/VERSION b/python/cuvs_bench/cuvs_bench/VERSION index 7c7ba0443..83ac26b20 100644 --- a/python/cuvs_bench/cuvs_bench/VERSION +++ b/python/cuvs_bench/cuvs_bench/VERSION @@ -1 +1 @@ -24.10.00 +../../../VERSION From d658856132933813bbcb0d699238e0d5e94b4124 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 2 Oct 2024 09:25:06 -0700 Subject: [PATCH 20/58] update dependencies --- dependencies.yaml | 3 +++ python/cuvs_bench/LICENSE | 2 +- .../cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index cc8f5985c..08871ab46 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -475,6 +475,9 @@ dependencies: - h5py>=3.8.0 - benchmark>=1.8.2 - openblas + - libboost-devel + - libaio + - mkl-devel bench_python: common: - output_types: [conda, pyproject, requirements] diff --git a/python/cuvs_bench/LICENSE b/python/cuvs_bench/LICENSE index 30cff7403..fd50777c3 100644 --- a/python/cuvs_bench/LICENSE +++ b/python/cuvs_bench/LICENSE @@ -1 +1 @@ -../../LICENSE \ No newline at end of file +../../LICENSE diff --git a/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py index 584a692ed..2200759cb 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py +++ b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py @@ -100,10 +100,12 @@ def hnswlib_search(params, build_params, k, batch_size): if "ef" in params: return params["ef"] >= k + ############################################################################### # DiskANN constraints # ############################################################################### + def diskann_memory_build(params, dim): ret = True if "cagra_intermediate_graph_degree" in params: From 2e080c6290c1dfe50bfd03dc6c1d533d705d656c Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 2 Oct 2024 17:01:30 -0700 Subject: [PATCH 21/58] update diff --- cpp/bench/ann/CMakeLists.txt | 2 +- .../ann/src/diskann/diskann_benchmark.cpp | 18 - cpp/bench/ann/src/diskann/diskann_wrapper.h | 29 +- cpp/cmake/patches/diskann.diff | 982 +----------------- .../config/algos/diskann_memory.yaml | 9 - .../cuvs_bench/config/algos/diskann_ssd.yaml | 9 - 6 files changed, 44 insertions(+), 1005 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 1cef113ad..b8276a0ac 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -32,7 +32,7 @@ option(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benc option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" ON) option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) -option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" OFF) +option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF ) diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp index c6eff3394..bc6cfca6a 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -38,15 +38,6 @@ void parse_build_param(const nlohmann::json& conf, if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); } if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } - param.use_cagra_graph = conf.at("use_cagra_graph"); - if (param.use_cagra_graph) { - if (conf.contains("cagra_graph_degree")) { - param.cagra_graph_degree = conf.at("cagra_graph_degree"); - } else { - param.cagra_graph_degree = param.R; - } - param.cagra_intermediate_graph_degree = conf.at("cagra_intermediate_graph_degree"); - } } template @@ -57,15 +48,6 @@ void parse_build_param(const nlohmann::json& conf, if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); } if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } - param.use_cagra_graph = conf.at("use_cagra_graph"); - if (param.use_cagra_graph) { - if (conf.contains("cagra_graph_degree")) { - param.cagra_graph_degree = conf.at("cagra_graph_degree"); - } else { - param.cagra_graph_degree = param.R; - } - param.cagra_intermediate_graph_degree = conf.at("cagra_intermediate_graph_degree"); - } if (conf.contains("QD")) { param.QD = conf.at("QD"); } } diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 024dcdd44..a2ba2888d 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -20,7 +20,6 @@ #include "cuvs/neighbors/nn_descent.hpp" #include "linux_aligned_file_reader.h" -#include #include #include @@ -56,9 +55,6 @@ class diskann_memory : public algo { uint32_t build_pq_bytes = 0; float alpha = 1.2; int num_threads = omp_get_num_procs(); - bool use_cagra_graph; - uint32_t cagra_graph_degree; - uint32_t cagra_intermediate_graph_degree; }; using search_param_base = typename algo::search_param; @@ -97,11 +93,9 @@ class diskann_memory : public algo { } protected: - bool use_cagra_graph_; std::shared_ptr diskann_index_write_params_{nullptr}; uint32_t max_points_; uint32_t build_pq_bytes_ = 0; - std::shared_ptr cagra_index_params_{nullptr}; int num_threads_; uint32_t L_search_; @@ -127,18 +121,6 @@ diskann_memory::diskann_memory(Metric metric, int dim, const build_param& par .with_saturate_graph(false) .with_num_threads(num_threads_) .build()); - use_cagra_graph_ = param.use_cagra_graph; - if (use_cagra_graph_) { - cuvs::neighbors::cagra::index_params cagra_index_params; - cagra_index_params.intermediate_graph_degree = param.cagra_intermediate_graph_degree; - cagra_index_params.graph_degree = param.cagra_graph_degree; - auto nn_descent_params = - cuvs::neighbors::nn_descent::index_params(cagra_index_params.intermediate_graph_degree); - cagra_index_params.graph_build_params = nn_descent_params; - cagra_index_params.guarantee_connectivity = true; - cagra_index_params_ = - std::make_shared(cagra_index_params); - } } template @@ -153,12 +135,10 @@ void diskann_memory::initialize_index_() false, false, false, - !use_cagra_graph_ && build_pq_bytes_ > 0, - use_cagra_graph_ ? 0 : build_pq_bytes_, - false, + build_pq_bytes_ > 0, + build_pq_bytes_, false, - use_cagra_graph_, - cagra_index_params_); + false); } template void diskann_memory::build(const T* dataset, size_t nrow) @@ -285,8 +265,7 @@ void diskann_ssd::build_from_bin(std::string dataset_path, std::string(""), std::string(""), static_cast(0), - static_cast(0), - this->cagra_index_params_); + static_cast(0)); } template diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index e81684a76..f7ce8b8b7 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,34 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..0aca533 100644 +index 3d3d2b8..94ea453 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -23,6 +23,25 @@ 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) -+ -+rapids_cpm_init() -+ - if(NOT MSVC) - set(CMAKE_CXX_COMPILER g++) - endif() -@@ -145,62 +164,16 @@ if (MSVC) +@@ -145,62 +145,20 @@ if (MSVC) "${DISKANN_MKL_LIB_PATH}/mkl_intel_thread.lib") else() # expected path for manual intel mkl installs @@ -38,12 +12,15 @@ index 3d3d2b8..0aca533 100644 - get_filename_component(OMP_PATH ${POSSIBLE_OMP_PATH} DIRECTORY) - endif() - endforeach() -- -- if(NOT OMP_PATH) -- message(FATAL_ERROR "Could not find Intel OMP in standard locations; use -DOMP_PATH to specify the install location for your environment") -- endif() -- link_directories(${OMP_PATH}) + find_package(MKL CONFIG REQUIRED) ++ #target_compile_options(${PROJECT_NAME} PUBLIC $) ++ include_directories($) ++ link_libraries($) + + if(NOT OMP_PATH) + message(FATAL_ERROR "Could not find Intel OMP in standard locations; use -DOMP_PATH to specify the install location for your environment") + 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") - foreach(POSSIBLE_MKL_LIB_PATH ${POSSIBLE_MKL_LIB_PATHS}) @@ -72,10 +49,7 @@ index 3d3d2b8..0aca533 100644 - endif() - link_directories(${MKL_PATH}) - include_directories(${MKL_INCLUDE_PATH}) -+ #target_compile_options(${PROJECT_NAME} PUBLIC $) -+ include_directories($) -+ link_libraries($) - +- # compile flags and link libraries add_compile_options(-m64 -Wl,--no-as-needed) if (NOT PYBIND) @@ -95,7 +69,7 @@ index 3d3d2b8..0aca533 100644 endif() endif() -@@ -286,7 +259,7 @@ if(MSVC) +@@ -286,7 +244,7 @@ if(MSVC) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/x64/Release) else() set(ENV{TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD} 500000000000) @@ -104,7 +78,7 @@ index 3d3d2b8..0aca533 100644 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 +273,6 @@ else() +@@ -300,10 +258,6 @@ else() endif() add_subdirectory(src) @@ -115,908 +89,30 @@ index 3d3d2b8..0aca533 100644 if (UNIT_TEST) enable_testing() -@@ -331,3 +300,7 @@ include(clang-format.cmake) - if(PYBIND) - add_subdirectory(python) - endif() -+ -+if(NOT TARGET cuvs::cuvs) -+ find_package(cuvs) -+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/build_memory_index.cpp b/apps/build_memory_index.cpp -index 544e42d..eedb04e 100644 ---- a/apps/build_memory_index.cpp -+++ b/apps/build_memory_index.cpp -@@ -1,6 +1,7 @@ - // Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT license. - -+#include - #include - #include - #include -@@ -27,7 +28,7 @@ int main(int argc, char **argv) - std::string data_type, dist_fn, data_path, index_path_prefix, label_file, universal_label, label_type; - uint32_t num_threads, R, L, Lf, build_PQ_bytes; - float alpha; -- bool use_pq_build, use_opq; -+ bool use_pq_build, use_opq, cuvs_cagra_index; - - po::options_description desc{ - program_options_utils::make_program_description("build_memory_index", "Build a memory-based DiskANN index.")}; -@@ -70,6 +71,8 @@ int main(int argc, char **argv) - program_options_utils::FILTERED_LBUILD); - optional_configs.add_options()("label_type", po::value(&label_type)->default_value("uint"), - program_options_utils::LABEL_TYPE_DESCRIPTION); -+ optional_configs.add_options()("cuvs_cagra_index", po::value(&cuvs_cagra_index)->default_value(true), -+ program_options_utils::cuvs_cagra_INDEX); - - // Merge required and optional parameters - desc.add(required_configs).add(optional_configs); -@@ -146,6 +149,7 @@ int main(int argc, char **argv) - .is_use_opq(use_opq) - .is_pq_dist_build(use_pq_build) - .with_num_pq_chunks(build_PQ_bytes) -+ .is_cuvs_cagra_index(cuvs_cagra_index) - .build(); - - auto index_factory = diskann::IndexFactory(config); -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/apps/search_disk_index.cpp b/apps/search_disk_index.cpp -index 7e2a7ac..538b55a 100644 ---- a/apps/search_disk_index.cpp -+++ b/apps/search_disk_index.cpp -@@ -179,7 +179,7 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre - std::string recall_string = "Recall@" + std::to_string(recall_at); - diskann::cout << std::setw(6) << "L" << std::setw(12) << "Beamwidth" << std::setw(16) << "QPS" << std::setw(16) - << "Mean Latency" << std::setw(16) << "99.9 Latency" << std::setw(16) << "Mean IOs" << std::setw(16) -- << "CPU (s)"; -+ << "CPU (s)" << std::setw(16) << "n_hops" << std::setw(16) << "n_cmps"; - if (calc_recall_flag) - { - diskann::cout << std::setw(16) << recall_string << std::endl; -@@ -269,6 +269,12 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre - - auto mean_cpuus = diskann::get_mean_stats(stats, query_num, - [](const diskann::QueryStats &stats) { return stats.cpu_us; }); -+ -+ auto mean_n_hops = diskann::get_mean_stats(stats, query_num, -+ [](const diskann::QueryStats &stats) { return stats.n_hops; }); -+ -+ auto mean_n_cmps = diskann::get_mean_stats(stats, query_num, -+ [](const diskann::QueryStats &stats) { return stats.n_cmps; }); - - double recall = 0; - if (calc_recall_flag) -@@ -280,7 +286,7 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre - - diskann::cout << std::setw(6) << L << std::setw(12) << optimized_beamwidth << std::setw(16) << qps - << std::setw(16) << mean_latency << std::setw(16) << latency_999 << std::setw(16) << mean_ios -- << std::setw(16) << mean_cpuus; -+ << std::setw(16) << mean_cpuus << std::setw(16) << mean_n_hops << std::setw(16) << mean_n_cmps; - if (calc_recall_flag) - { - diskann::cout << std::setw(16) << recall << std::endl; -diff --git a/build.sh b/build.sh -new file mode 100755 -index 0000000..79f0fa0 ---- /dev/null -+++ b/build.sh -@@ -0,0 +1,37 @@ -+#!/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..2703ec4 ---- /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.08") -+ -+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/include/disk_utils.h b/include/disk_utils.h -index 08f046d..9d88637 100644 ---- a/include/disk_utils.h -+++ b/include/disk_utils.h -@@ -31,6 +31,8 @@ typedef int FileHandle; - #include "utils.h" - #include "windows_customizations.h" - -+#include -+ - namespace diskann - { - const size_t MAX_SAMPLE_POINTS_FOR_WARMUP = 100000; -@@ -82,7 +84,7 @@ DISKANN_DLLEXPORT int build_merged_vamana_index(std::string base_file, diskann:: - uint32_t num_threads, bool use_filters = false, - const std::string &label_file = std::string(""), - const std::string &labels_to_medoids_file = std::string(""), -- const std::string &universal_label = "", const uint32_t Lf = 0); -+ const std::string &universal_label = "", const uint32_t Lf = 0, std::shared_ptr cagra_index_params = nullptr); - - template - DISKANN_DLLEXPORT uint32_t optimize_beamwidth(std::unique_ptr> &_pFlashIndex, -@@ -98,7 +100,8 @@ DISKANN_DLLEXPORT int build_disk_index( - bool use_filters = false, - const std::string &label_file = std::string(""), // default is empty string for no label_file - const std::string &universal_label = "", const uint32_t filter_threshold = 0, -- const uint32_t Lf = 0); // default is empty string for no universal label -+ const uint32_t Lf = 0, -+ std::shared_ptr cagra_index_params = nullptr); // default is empty string for no universal label - - template - DISKANN_DLLEXPORT void create_disk_layout(const std::string base_file, const std::string mem_index_file, -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/in_mem_data_store.h b/include/in_mem_data_store.h -index 0a0a617..c4ee71d 100644 ---- a/include/in_mem_data_store.h -+++ b/include/in_mem_data_store.h -@@ -71,9 +71,10 @@ template class InMemDataStore : public AbstractDataStore class InMemDataStore : public AbstractDataStore _pre_computed_norms; - }; - --} // namespace diskann -\ No newline at end of file -+} // namespace diskann -diff --git a/include/index.h b/include/index.h -index b9bf4f3..60ef863 100644 ---- a/include/index.h -+++ b/include/index.h -@@ -29,6 +29,11 @@ - #define EXPAND_IF_FULL 0 - #define DEFAULT_MAXC 750 - -+// namespace cuvs::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 cuvs_cagra_index = false, const std::shared_ptr cuvs_cagra_index_params = nullptr); - - DISKANN_DLLEXPORT ~Index(); - -@@ -236,6 +241,9 @@ template clas - Index(const Index &) = delete; - Index &operator=(const Index &) = delete; - -+ // Build the cuVS CAGRA index -+ void build_cuvs_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); -@@ -444,5 +452,9 @@ template clas - std::vector _locks; - - static const float INDEX_GROWTH_FACTOR; -+ -+ bool _cuvs_cagra_index = true; -+ std::shared_ptr _cuvs_cagra_index_params = nullptr; -+ std::vector host_cagra_graph; - }; - } // namespace diskann -diff --git a/include/index_config.h b/include/index_config.h -index a8e64d0..7fbc1bb 100644 ---- a/include/index_config.h -+++ b/include/index_config.h -@@ -2,6 +2,9 @@ - - #include "common_includes.h" - #include "parameters.h" -+#include -+ -+#include - - namespace diskann - { -@@ -43,18 +46,23 @@ struct IndexConfig - // Params for searching index - std::shared_ptr index_search_params; - -+ bool cuvs_cagra_index; -+ std::shared_ptr cuvs_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, -- 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) -+ bool cuvs_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 cuvs_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), -- 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) -+ cuvs_cagra_index(cuvs_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), cuvs_cagra_index_params{cuvs_cagra_index_params} - { - } - -@@ -196,6 +204,19 @@ class IndexConfigBuilder - return *this; - } - -+ IndexConfigBuilder &is_cuvs_cagra_index(bool is_cuvs_cagra_index) -+ { -+ this->_cuvs_cagra_index = is_cuvs_cagra_index; -+ return *this; -+ } -+ -+ IndexConfigBuilder &with_cuvs_cagra_index_params( -+ std::shared_ptr cuvs_cagra_index_params_ptr) -+ { -+ this->_cuvs_cagra_index_params = cuvs_cagra_index_params_ptr; -+ return *this; -+ } -+ - IndexConfig build() - { - if (_data_type == "" || _data_type.empty()) -@@ -221,8 +242,8 @@ 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, -- _use_opq, _filtered_index, _data_type, _tag_type, _label_type, _index_write_params, -- _index_search_params); -+ _use_opq, _filtered_index, _cuvs_cagra_index, _data_type, _tag_type, _label_type, -+ _index_write_params, _index_search_params, _cuvs_cagra_index_params); - } - - IndexConfigBuilder(const IndexConfigBuilder &) = delete; -@@ -242,6 +263,7 @@ class IndexConfigBuilder - bool _concurrent_consolidate = false; - bool _use_opq = false; - bool _filtered_index{defaults::HAS_LABELS}; -+ bool _cuvs_cagra_index = true; - - size_t _num_pq_chunks = 0; - size_t _num_frozen_pts{defaults::NUM_FROZEN_POINTS_STATIC}; -@@ -252,5 +274,6 @@ class IndexConfigBuilder - - std::shared_ptr _index_write_params; - std::shared_ptr _index_search_params; -+ std::shared_ptr _cuvs_cagra_index_params; - }; - } // namespace diskann -diff --git a/include/program_options_utils.hpp b/include/program_options_utils.hpp -index 2be6059..922fbe5 100644 ---- a/include/program_options_utils.hpp -+++ b/include/program_options_utils.hpp -@@ -77,5 +77,6 @@ const char *UNIVERSAL_LABEL = - "in the labels file instead of listing all labels for a node. DiskANN will not automatically assign a " - "universal label to a node."; - const char *FILTERED_LBUILD = "Build complexity for filtered points, higher value results in better graphs"; -+const char *CUVS_CAGRA_INDEX = "Use the raft CAGRA graph instead of the Vamana graph"; - - } // namespace program_options_utils -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..de3dadd 100644 ---- a/src/CMakeLists.txt -+++ b/src/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) - - if(MSVC) - add_subdirectory(dll) -@@ -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 cuvs) -+ target_link_libraries(${PROJECT_NAME}_s PRIVATE cuvs) - endif() - - if (NOT MSVC) -diff --git a/src/disk_utils.cpp b/src/disk_utils.cpp -index 0165602..ee06fab 100644 ---- a/src/disk_utils.cpp -+++ b/src/disk_utils.cpp -@@ -2,6 +2,7 @@ - // Licensed under the MIT license. - - #include "common_includes.h" -+#include "pq_common.h" - - #if defined(DISKANN_RELEASE_UNUSED_TCMALLOC_MEMORY_AT_CHECKPOINTS) && defined(DISKANN_BUILD) - #include "gperftools/malloc_extension.h" -@@ -127,6 +128,7 @@ size_t calculate_num_pq_chunks(double final_index_ram_limit, size_t points_num, - num_pq_chunks = num_pq_chunks > dim ? dim : num_pq_chunks; - num_pq_chunks = num_pq_chunks > MAX_PQ_CHUNKS ? MAX_PQ_CHUNKS : num_pq_chunks; - -+ std::cout << "num_pq_chunks" << num_pq_chunks << "MAX_PQ_CHUNKS" << MAX_PQ_CHUNKS << std::endl; - diskann::cout << "Compressing " << dim << "-dimensional data into " << num_pq_chunks << " bytes per vector." - << std::endl; - return num_pq_chunks; -@@ -630,8 +632,9 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr - std::string medoids_file, std::string centroids_file, size_t build_pq_bytes, bool use_opq, - uint32_t num_threads, bool use_filters, const std::string &label_file, - const std::string &labels_to_medoids_file, const std::string &universal_label, -- const uint32_t Lf) -+ const uint32_t Lf, std::shared_ptr cagra_index_params) - { -+ std::cout << "inside build_merged_vamana_index" << std::endl; - size_t base_num, base_dim; - diskann::get_bin_metadata(base_file, base_num, base_dim); - -@@ -652,7 +655,7 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr - diskann::Index _index(compareMetric, base_dim, base_num, - std::make_shared(paras), nullptr, - defaults::NUM_FROZEN_POINTS_STATIC, false, false, false, -- build_pq_bytes > 0, build_pq_bytes, use_opq, use_filters); -+ build_pq_bytes > 0, build_pq_bytes, use_opq, use_filters, cagra_index_params != nullptr, cagra_index_params); - if (!use_filters) - _index.build(base_file.c_str(), base_num); - else -@@ -719,11 +722,12 @@ int build_merged_vamana_index(std::string base_file, diskann::Metric compareMetr - - uint64_t shard_base_dim, shard_base_pts; - get_bin_metadata(shard_base_file, shard_base_pts, shard_base_dim); -+ bool use_cuvs_cagra_graph = cagra_index_params != nullptr; - -- diskann::Index _index(compareMetric, shard_base_dim, shard_base_pts, -+ diskann::Index _index(compareMetric, shard_base_dim, shard_base_pts, - std::make_shared(low_degree_params), nullptr, - defaults::NUM_FROZEN_POINTS_STATIC, false, false, false, build_pq_bytes > 0, -- build_pq_bytes, use_opq); -+ build_pq_bytes, use_opq, false, use_cuvs_cagra_graph, cagra_index_params); - if (!use_filters) - { - _index.build(shard_base_file.c_str(), shard_base_pts); -@@ -1101,8 +1105,9 @@ template - int build_disk_index(const char *dataFilePath, const char *indexFilePath, const char *indexBuildParameters, - diskann::Metric compareMetric, bool use_opq, const std::string &codebook_prefix, bool use_filters, - const std::string &label_file, const std::string &universal_label, const uint32_t filter_threshold, -- const uint32_t Lf) -+ const uint32_t Lf, std::shared_ptr cagra_index_params) - { -+ bool use_cuvs_cagra_graph = cagra_index_params != nullptr; - std::stringstream parser; - parser << std::string(indexBuildParameters); - std::string cur_param; -@@ -1289,7 +1294,7 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const - Timer timer; - diskann::get_bin_metadata(data_file_to_use.c_str(), points_num, dim); - const double p_val = ((double)MAX_PQ_TRAINING_SET_SIZE / (double)points_num); +diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp +index bba101b..fbb81d5 100644 +--- a/src/pq_flash_index.cpp ++++ b/src/pq_flash_index.cpp +@@ -209,11 +209,6 @@ template void PQFlashIndex::load_cache_ + diskann::cout << "Loading the cache list into memory.." << std::flush; + size_t num_cached_nodes = node_list.size(); + +- // borrow thread data +- ScratchStoreManager> manager(this->_thread_data); +- auto this_thread_data = manager.scratch_space(); +- IOContext &ctx = this_thread_data->ctx; - -+ - if (use_disk_pq) - { - generate_disk_quantized_data(data_file_to_use, disk_pq_pivots_path, disk_pq_compressed_vectors_path, -@@ -1309,6 +1314,7 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const - num_pq_chunks = atoi(param_list[8].c_str()); - } - -+ std::cout << "line 1318" << "num_pq_chunks" << num_pq_chunks << "MAX_PQ_CHUNKS" << MAX_PQ_CHUNKS << std::endl; - diskann::cout << "Compressing " << dim << "-dimensional data into " << num_pq_chunks << " bytes per vector." - << std::endl; - -@@ -1326,7 +1332,7 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const - diskann::build_merged_vamana_index(data_file_to_use.c_str(), diskann::Metric::L2, L, R, p_val, - indexing_ram_budget, mem_index_path, medoids_path, centroids_path, - build_pq_bytes, use_opq, num_threads, use_filters, labels_file_to_use, -- labels_to_medoids_path, universal_label, Lf); -+ labels_to_medoids_path, universal_label, Lf, cagra_index_params); - diskann::cout << timer.elapsed_seconds_for_step("building merged vamana index") << std::endl; - - timer.reset(); -@@ -1432,21 +1438,21 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da - const std::string &codebook_prefix, bool use_filters, - const std::string &label_file, - const std::string &universal_label, -- const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, - const char *indexBuildParameters, - diskann::Metric compareMetric, bool use_opq, - const std::string &codebook_prefix, bool use_filters, - const std::string &label_file, - const std::string &universal_label, -- const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, - const char *indexBuildParameters, - diskann::Metric compareMetric, bool use_opq, - const std::string &codebook_prefix, bool use_filters, - const std::string &label_file, - const std::string &universal_label, -- const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); - // LabelT = uint16 - template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, - const char *indexBuildParameters, -@@ -1454,51 +1460,51 @@ template DISKANN_DLLEXPORT int build_disk_index(const char *da - const std::string &codebook_prefix, bool use_filters, - const std::string &label_file, - const std::string &universal_label, -- const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, - const char *indexBuildParameters, - diskann::Metric compareMetric, bool use_opq, - const std::string &codebook_prefix, bool use_filters, - const std::string &label_file, - const std::string &universal_label, -- const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_disk_index(const char *dataFilePath, const char *indexFilePath, - const char *indexBuildParameters, - diskann::Metric compareMetric, bool use_opq, - const std::string &codebook_prefix, bool use_filters, - const std::string &label_file, - const std::string &universal_label, -- const uint32_t filter_threshold, const uint32_t Lf); -+ const uint32_t filter_threshold, const uint32_t Lf, std::shared_ptr cagra_index_params); - - template DISKANN_DLLEXPORT int build_merged_vamana_index( - std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, - double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, - size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, -- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_merged_vamana_index( - std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, - double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, - size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, -- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_merged_vamana_index( - std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, - double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, - size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, -- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); - // Label=16_t - template DISKANN_DLLEXPORT int build_merged_vamana_index( - std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, - double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, - size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, -- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_merged_vamana_index( - std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, - double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, - size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, -- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); - template DISKANN_DLLEXPORT int build_merged_vamana_index( - std::string base_file, diskann::Metric compareMetric, uint32_t L, uint32_t R, double sampling_rate, - double ram_budget, std::string mem_index_path, std::string medoids_path, std::string centroids_file, - size_t build_pq_bytes, bool use_opq, uint32_t num_threads, bool use_filters, const std::string &label_file, -- const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf); -+ const std::string &labels_to_medoids_file, const std::string &universal_label, const uint32_t Lf, std::shared_ptr cagra_index_params); - }; // namespace diskann -diff --git a/src/dll/CMakeLists.txt b/src/dll/CMakeLists.txt -index 096d1b7..6d01516 100644 ---- a/src/dll/CMakeLists.txt -+++ b/src/dll/CMakeLists.txt -@@ -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.cpp -index bf93344..d6c22f7 100644 ---- a/src/index.cpp -+++ b/src/index.cpp -@@ -1,6 +1,7 @@ - // Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT license. - -+#include - #include - - #include -@@ -13,6 +14,8 @@ - #include "tsl/robin_set.h" - #include "windows_customizations.h" - #include "tag_uint128.h" -+#include -+#include - #if defined(DISKANN_RELEASE_UNUSED_TCMALLOC_MEMORY_AT_CHECKPOINTS) && defined(DISKANN_BUILD) - #include "gperftools/malloc_extension.h" - #endif -@@ -22,11 +25,27 @@ - #endif - - #include "index.h" -+#include -+#include - - #define MAX_POINTS_FOR_USING_BITSET 10000000 - - namespace diskann - { -+ -+cuvs::distance::DistanceType parse_metric_to_cuvs(diskann::Metric m) -+{ -+ switch (m) -+ { -+ case diskann::Metric::L2: -+ return cuvs::distance::DistanceType::L2Expanded; -+ case diskann::Metric::INNER_PRODUCT: -+ return cuvs::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 +57,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), -+ _cuvs_cagra_index(index_config.cuvs_cagra_index) - { - if (_dynamic_index && !_enable_tags) - { -@@ -109,6 +129,22 @@ Index::Index(const IndexConfig &index_config, std::shared_ptrget_dims()); - } - } -+ -+ if (_cuvs_cagra_index) -+ { -+ if (index_config.cuvs_cagra_index_params != nullptr) -+ { -+ assert(parse_metric_to_cuvs(dist_metric) == cuvs_cagra_index_params->metric); -+ _cuvs_cagra_index_params = index_config.cuvs_cagra_index_params; -+ } -+ else -+ { -+ cuvs::neighbors::cagra::index_params cuvs_cagra_index_params; -+ cuvs_cagra_index_params.graph_degree = _indexingRange; -+ cuvs_cagra_index_params.metric = parse_metric_to_cuvs(_dist_metric); -+ _cuvs_cagra_index_params = std::make_shared(cuvs_cagra_index_params); -+ } -+ } - } - - template -@@ -117,7 +153,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 cuvs_cagra_index, -+ const std::shared_ptr cuvs_cagra_index_params) - : Index( - IndexConfigBuilder() - .with_metric(m) -@@ -134,6 +171,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_cuvs_cagra_index(cuvs_cagra_index) -+ .with_cuvs_cagra_index_params(cuvs_cagra_index_params) - .build(), - IndexFactory::construct_datastore(DataStoreStrategy::MEMORY, - (max_points == 0 ? (size_t)1 : max_points) + -@@ -372,7 +411,36 @@ void Index::save(const char *filename, bool compact_before_save - // the error code for delete_file, but will ignore now because - // delete should succeed if save will succeed. - delete_file(graph_file); -- save_graph(graph_file); -+ if (!_cuvs_cagra_index) -+ save_graph(graph_file); -+ else -+ { -+ std::ofstream out; -+ open_file_to_write(out, graph_file); -+ -+ size_t file_offset = 0; -+ out.seekp(file_offset, out.beg); -+ size_t index_size = 24; -+ uint32_t max_degree = _cuvs_cagra_index_params->graph_degree; -+ out.write((char *)&index_size, sizeof(uint64_t)); -+ out.write((char *)&max_degree, sizeof(uint32_t)); -+ uint32_t ep_u32 = _start; -+ out.write((char *)&ep_u32, sizeof(uint32_t)); -+ out.write((char *)&_num_frozen_pts, sizeof(size_t)); -+ -+ uint32_t GK = max_degree; -+ for (uint32_t i = 0; i < _nd + _num_frozen_pts; i++) -+ { -+ -+ out.write((char *)&GK, sizeof(uint32_t)); -+ out.write((char *)(host_cagra_graph.data() + GK * i), GK * sizeof(uint32_t)); -+ index_size += (size_t)(sizeof(uint32_t) * (GK + 1)); -+ } -+ out.seekp(file_offset, out.beg); -+ out.write((char *)&index_size, sizeof(uint64_t)); -+ out.write((char *)&max_degree, sizeof(uint32_t)); -+ out.close(); -+ } - delete_file(data_file); - save_data(data_file); - delete_file(tags_file); -@@ -1448,8 +1516,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 +1571,20 @@ 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_cuvs_cagra_index(const T *data) -+{ -+ raft::device_resources handle; -+ auto dataset_view = raft::make_host_matrix_view(data, int64_t(_nd), _dim); -+ auto cuvs_index = cuvs::neighbors::cagra::build(handle, *_cuvs_cagra_index_params, dataset_view); -+ auto stream = handle.get_stream(); -+ auto device_graph = cuvs_index.graph(); -+ host_cagra_graph.resize(device_graph.extent(0) * device_graph.extent(1)); -+ -+ raft::copy(host_cagra_graph.data(), device_graph.data_handle(), device_graph.extent(0) * device_graph.extent(1), -+ stream); -+ handle.sync_stream(); -+} -+ - template - void Index::build_with_data_populated(const std::vector &tags) - { -@@ -1559,6 +1639,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,7 +1678,12 @@ 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); -+ if (_cuvs_cagra_index) -+ build_cuvs_cagra_index(data); -+ else -+ { -+ build_with_data_populated(tags); -+ } - } - - template -@@ -1683,7 +1769,14 @@ void Index::build(const char *filename, const size_t num_points - std::unique_lock tl(_tag_lock); - _nd = num_points_to_load; - } -- build_with_data_populated(tags); -+ -+ if (_cuvs_cagra_index) -+ { -+ auto _in_mem_data_store = std::static_pointer_cast>(_data_store); -+ build_cuvs_cagra_index(_in_mem_data_store->_data); -+ } -+ else -+ build_with_data_populated(tags); - } - - template + // Allocate space for neighborhood cache + _nhood_cache_buf = new uint32_t[num_cached_nodes * (_max_degree + 1)]; + memset(_nhood_cache_buf, 0, num_cached_nodes * (_max_degree + 1)); +@@ -506,10 +501,6 @@ template void PQFlashIndex::use_medoids + alloc_aligned(((void **)&_centroid_data), _num_medoids * _aligned_dim * sizeof(float), 32); + std::memset(_centroid_data, 0, _num_medoids * _aligned_dim * sizeof(float)); + +- // borrow ctx +- ScratchStoreManager> manager(this->_thread_data); +- auto data = manager.scratch_space(); +- IOContext &ctx = data->ctx; + diskann::cout << "Loading centroid data from medoids vector data of " << _num_medoids << " medoid(s)" << std::endl; + + std::vector nodes_to_read; diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml index eeb44b668..13055ce2e 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml @@ -7,15 +7,6 @@ groups: R: [64, 96] L_build: [64, 128, 256, 384] alpha: [1.0, 1.2] - use_cagra_graph: [False] search: num_threads: [32] L_search: [10, 20, 30, 40, 50, 100, 200, 300] - cagra: - build: - R: [32, 64, 96] - cagra_intermediate_graph_degree: [64, 96, 128] - use_cagra_graph: [True] - search: - num_threads: [32] - L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml index d7b017743..510d8c106 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml @@ -6,15 +6,6 @@ groups: build: R: [64, 96] L_build: [64, 128, 256, 384] - use_cagra_graph: [False] - QD: [192] - search: - L_search: [10, 20, 30, 40, 50, 100, 200, 300] - cagra: - build: - R: [32, 64, 96] - cagra_intermediate_graph_degree: [64, 96, 128] - use_cagra_graph: [True] QD: [192] search: L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file From 58a729c7998f6ede6205286d6d1d081d0db48647 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 8 Oct 2024 16:47:29 -0700 Subject: [PATCH 22/58] diskann_memory working --- README.md | 148 +-- build.sh | 25 +- ci/build_python.sh | 18 + conda/recipes/cuvs_bench/build.sh | 5 + .../cuvs_bench/conda_build_config.yaml | 70 ++ conda/recipes/cuvs_bench/meta.yaml | 105 ++ conda/recipes/cuvs_bench_cpu/build.sh | 5 + .../cuvs_bench_cpu/conda_build_config.yaml | 29 + conda/recipes/cuvs_bench_cpu/meta.yaml | 67 ++ conda/recipes/libcuvs/meta.yaml | 1 + cpp/CMakeLists.txt | 1011 +++++++++-------- cpp/bench/ann/src/diskann/diskann_wrapper.h | 32 +- cpp/cmake/patches/diskann.diff | 36 +- cpp/cmake/thirdparty/get_cuvs.cmake | 64 ++ cpp/cmake/thirdparty/get_diskann.cmake | 5 +- cpp/include/cuvs/neighbors/cagra.h | 11 +- cpp/include/cuvs/neighbors/hnsw.h | 6 +- cpp/include/cuvs/neighbors/hnsw.hpp | 6 +- cpp/src/neighbors/cagra_c.cpp | 8 + .../detail/cagra/cagra_serialize.cuh | 21 +- cpp/src/neighbors/detail/hnsw.hpp | 13 +- cpp/src/neighbors/hnsw.cpp | 24 +- cpp/src/neighbors/hnsw_c.cpp | 16 +- .../ivf_flat/ivf_flat_interleaved_scan.cuh | 4 +- cpp/src/neighbors/ivf_pq/ivf_pq_build.cuh | 34 + .../ivf_pq/ivf_pq_compute_similarity_impl.cuh | 3 + cpp/src/neighbors/ivf_pq/ivf_pq_search.cuh | 42 +- cpp/test/neighbors/ann_ivf_pq.cuh | 24 +- .../ann_ivf_pq/test_float_int64_t.cu | 8 +- .../ann_ivf_pq/test_int8_t_int64_t.cu | 5 +- .../ann_ivf_pq/test_uint8_t_int64_t.cu | 8 +- docs/source/{basics.rst => api_basics.rst} | 0 docs/source/api_docs.rst | 6 +- ...erability.rst => api_interoperability.rst} | 0 docs/source/build.rst | 19 +- docs/source/c_api/neighbors.rst | 1 + .../choosing_and_configuring_indexes.rst | 98 ++ docs/source/comparing_indexes.rst | 60 + docs/source/cpp_api/neighbors.rst | 1 + docs/source/cuvs_bench/build.rst | 59 + docs/source/cuvs_bench/datasets.rst | 62 + docs/source/cuvs_bench/index.rst | 770 +++++++++++++ docs/source/cuvs_bench/param_tuning.rst | 674 +++++++++++ docs/source/cuvs_bench/wiki_all_dataset.rst | 55 + docs/source/getting_started.rst | 122 +- docs/source/images/build_benchmarks.png | Bin 0 -> 43332 bytes docs/source/images/index_recalls.png | Bin 0 -> 148929 bytes docs/source/images/recall_buckets.png | Bin 0 -> 70402 bytes docs/source/index.rst | 35 +- docs/source/indexes/bruteforce.rst | 62 + docs/source/indexes/cagra.rst | 149 +++ docs/source/indexes/indexes.rst | 19 + docs/source/indexes/ivfflat.rst | 116 ++ docs/source/indexes/ivfpq.rst | 140 +++ docs/source/integrations.rst | 53 +- docs/source/integrations/faiss.rst | 14 + docs/source/integrations/kinetica.rst | 6 + docs/source/integrations/lucene.rst | 6 + docs/source/integrations/milvus.rst | 8 + docs/source/python_api/neighbors.rst | 1 + docs/source/python_api/neighbors_hnsw.rst | 30 + docs/source/tuning_guide.rst | 56 + .../vector_databases_vs_vector_search.rst | 57 + python/cuvs/cuvs/neighbors/CMakeLists.txt | 1 + python/cuvs/cuvs/neighbors/cagra/cagra.pxd | 17 + python/cuvs/cuvs/neighbors/cagra/cagra.pyx | 17 +- .../cuvs/cuvs/neighbors/hnsw/CMakeLists.txt | 24 + python/cuvs/cuvs/neighbors/hnsw/__init__.pxd | 0 python/cuvs/cuvs/neighbors/hnsw/__init__.py | 25 + python/cuvs/cuvs/neighbors/hnsw/hnsw.pxd | 53 + python/cuvs/cuvs/neighbors/hnsw/hnsw.pyx | 380 +++++++ python/cuvs/cuvs/test/test_hnsw.py | 97 ++ python/cuvs_bench/cuvs_bench/VERSION | 2 +- .../cuvs_bench/config/algorithms.yaml | 9 + .../config/algos/cuvs_mg_cagra.yaml | 13 + .../config/algos/cuvs_mg_ivf_flat.yaml | 9 + .../config/algos/cuvs_mg_ivf_pq.yaml | 41 + .../config/algos/diskann_memory.yaml | 5 +- .../generate_groundtruth/__main__.py | 241 ++++ .../cuvs_bench/generate_groundtruth/utils.py | 101 ++ .../cuvs_bench/get_dataset/__main__.py | 115 ++ .../cuvs_bench/get_dataset/fbin_to_f16bin.py | 49 + .../cuvs_bench/get_dataset/hdf5_to_fbin.py | 90 ++ python/cuvs_bench/cuvs_bench/run/__main__.py | 5 +- python/cuvs_bench/cuvs_bench/run/run.py | 3 +- .../cuvs_bench/split_groundtruth/__main__.py | 57 + .../split_groundtruth/split_groundtruth.pl | 45 + 87 files changed, 5147 insertions(+), 785 deletions(-) create mode 100644 conda/recipes/cuvs_bench/build.sh create mode 100644 conda/recipes/cuvs_bench/conda_build_config.yaml create mode 100644 conda/recipes/cuvs_bench/meta.yaml create mode 100644 conda/recipes/cuvs_bench_cpu/build.sh create mode 100644 conda/recipes/cuvs_bench_cpu/conda_build_config.yaml create mode 100644 conda/recipes/cuvs_bench_cpu/meta.yaml create mode 100644 cpp/cmake/thirdparty/get_cuvs.cmake rename docs/source/{basics.rst => api_basics.rst} (100%) rename docs/source/{interoperability.rst => api_interoperability.rst} (100%) create mode 100644 docs/source/choosing_and_configuring_indexes.rst create mode 100644 docs/source/comparing_indexes.rst create mode 100644 docs/source/cuvs_bench/build.rst create mode 100644 docs/source/cuvs_bench/datasets.rst create mode 100644 docs/source/cuvs_bench/index.rst create mode 100644 docs/source/cuvs_bench/param_tuning.rst create mode 100644 docs/source/cuvs_bench/wiki_all_dataset.rst create mode 100644 docs/source/images/build_benchmarks.png create mode 100644 docs/source/images/index_recalls.png create mode 100644 docs/source/images/recall_buckets.png create mode 100644 docs/source/indexes/bruteforce.rst create mode 100644 docs/source/indexes/cagra.rst create mode 100644 docs/source/indexes/indexes.rst create mode 100644 docs/source/indexes/ivfflat.rst create mode 100644 docs/source/indexes/ivfpq.rst create mode 100644 docs/source/integrations/faiss.rst create mode 100644 docs/source/integrations/kinetica.rst create mode 100644 docs/source/integrations/lucene.rst create mode 100644 docs/source/integrations/milvus.rst create mode 100644 docs/source/python_api/neighbors_hnsw.rst create mode 100644 docs/source/tuning_guide.rst create mode 100644 docs/source/vector_databases_vs_vector_search.rst create mode 100644 python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt create mode 100644 python/cuvs/cuvs/neighbors/hnsw/__init__.pxd create mode 100644 python/cuvs/cuvs/neighbors/hnsw/__init__.py create mode 100644 python/cuvs/cuvs/neighbors/hnsw/hnsw.pxd create mode 100644 python/cuvs/cuvs/neighbors/hnsw/hnsw.pyx create mode 100644 python/cuvs/cuvs/test/test_hnsw.py mode change 100644 => 120000 python/cuvs_bench/cuvs_bench/VERSION create mode 100644 python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_cagra.yaml create mode 100644 python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_flat.yaml create mode 100644 python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_pq.yaml create mode 100644 python/cuvs_bench/cuvs_bench/generate_groundtruth/__main__.py create mode 100644 python/cuvs_bench/cuvs_bench/generate_groundtruth/utils.py create mode 100644 python/cuvs_bench/cuvs_bench/get_dataset/__main__.py create mode 100644 python/cuvs_bench/cuvs_bench/get_dataset/fbin_to_f16bin.py create mode 100644 python/cuvs_bench/cuvs_bench/get_dataset/hdf5_to_fbin.py create mode 100644 python/cuvs_bench/cuvs_bench/split_groundtruth/__main__.py create mode 100644 python/cuvs_bench/cuvs_bench/split_groundtruth/split_groundtruth.pl diff --git a/README.md b/README.md index e23b94616..cb4930a27 100755 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ #
 cuVS: Vector Search and Clustering on the GPU
> [!note] -> cuVS is a new library mostly derived from the approximate nearest neighbors and clustering algorithms in the [RAPIDS RAFT](https://github.com/rapidsai/raft) library of data mining primitives. RAPIDS RAFT currently contains the most fully-featured versions of the approximate nearest neighbors and clustering algorithms in cuVS. We are in the process of migrating the algorithms from RAFT to cuVS, but if you are unsure of which to use, please consider the following: -> 1. RAFT contains C++ and Python APIs for all of the approximate nearest neighbors and clustering algorithms. -> 2. cuVS contains a growing support for different languages, including C, C++, Python, and Rust. We will be adding more language support to cuVS in the future but will not be improving the language support for RAFT. -> 3. Once all of RAFT's approximate nearest neighbors and clustering algorithms are moved to cuVS, the RAFT APIs will be deprecated and eventually removed altogether. Once removed, RAFT will become a lightweight header-only library. In the meantime, there's no harm in using RAFT if support for additional languages is not needed. - +> cuVS is a new library mostly derived from the approximate nearest neighbors and clustering algorithms in the [RAPIDS RAFT](https://github.com/rapidsai/raft) library of machine learning and data mining primitives. As of version 24.10 (Release in October 2024), cuVS contains the most fully-featured versions of the approximate nearest neighbors and clustering algorithms from RAFT. The algorithms which have been migrated over to cuVS will be removed from RAFT in version 24.12 (released in December 2024). ## Contents @@ -18,10 +14,11 @@ ## Useful Resources +- [Documentation](https://docs.rapids.ai/api/cuvs/nightly/): Library documentation. +- [Build and Install Guide](https://docs.rapids.ai/api/cuvs/nightly/build): Instructions for installing and building cuVS. +- [Getting Started Guide](https://docs.rapids.ai/api/cuvs/nightly/getting_started): Guide to getting started with cuVS. - [Code Examples](https://github.com/rapidsai/cuvs/tree/HEAD/examples): Self-contained Code Examples. - [API Reference Documentation](https://docs.rapids.ai/api/cuvs/nightly/api_docs): API Documentation. -- [Getting Started Guide](https://docs.rapids.ai/api/cuvs/nightly/getting_started): Getting started with RAFT. -- [Build and Install Guide](https://docs.rapids.ai/api/cuvs/nightly/build): Instructions for installing and building cuVS. - [RAPIDS Community](https://rapids.ai/community.html): Get help, contribute, and collaborate. - [GitHub repository](https://github.com/rapidsai/cuvs): Download the cuVS source code. - [Issue tracker](https://github.com/rapidsai/cuvs/issues): Report issues or request features. @@ -30,22 +27,75 @@ cuVS contains state-of-the-art implementations of several algorithms for running approximate nearest neighbors and clustering on the GPU. It can be used directly or through the various databases and other libraries that have integrated it. The primary goal of cuVS is to simplify the use of GPUs for vector similarity search and clustering. +Vector search is an information retrieval method that has been growing in popularity over the past few years, partly because of the rising importance of multimedia embeddings created from unstructured data and the need to perform semantic search on the embeddings to find items which are semantically similar to each other. + +Vector search is also used in _data mining and machine learning_ tasks and comprises an important step in many _clustering_ and _visualization_ algorithms like [UMAP](https://arxiv.org/abs/2008.00325), [t-SNE](https://lvdmaaten.github.io/tsne/), K-means, and [HDBSCAN](https://hdbscan.readthedocs.io/en/latest/how_hdbscan_works.html). + +Finally, faster vector search enables interactions between dense vectors and graphs. Converting a pile of dense vectors into nearest neighbors graphs unlocks the entire world of graph analysis algorithms, such as those found in [GraphBLAS](https://graphblas.org/) and [cuGraph](https://github.com/rapidsai/cugraph). + +Below are some common use-cases for vector search + +- ### Semantic search + - Generative AI & Retrieval augmented generation (RAG) + - Recommender systems + - Computer vision + - Image search + - Text search + - Audio search + - Molecular search + - Model training + + +- ### Data mining + - Clustering algorithms + - Visualization algorithms + - Sampling algorithms + - Class balancing + - Ensemble methods + - k-NN graph construction + +## Why cuVS? + +There are several benefits to using cuVS and GPUs for vector search, including + +1. Fast index build +2. Latency critical and high throughput search +3. Parameter tuning +4. Cost savings +5. Interoperability (build on GPU, deploy on CPU) +6. Multiple language support +7. Building blocks for composing new or accelerating existing algorithms + +In addition to the items above, cuVS takes on the burden of keeping non-trivial accelerated code up to date as new NVIDIA architectures and CUDA versions are released. This provides a deslightful development experimence, guaranteeing that any libraries, databases, or applications built on top of it will always be getting the best performance and scale. + ## Installing cuVS -cuVS comes with pre-built packages that can be installed through [conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python). Different packages are available for the different languages supported by cuVS: +cuVS comes with pre-built packages that can be installed through [conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python) and [pip](https://pip.pypa.io/en/stable/). Different packages are available for the different languages supported by cuVS: -| Python | C/C++ | -|--------|-----------------------------| -| `cuvs` | `libcuvs`, `libcuvs-static` | +| Python | C/C++ | +|--------|-----------| +| `cuvs` | `libcuvs` | ### Stable release -It is recommended to use [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) to install the desired packages. The following command will install the Python package. You can substitute `cuvs` for any of the packages in the table above: +It is recommended to use [mamba](https://conda.github.io/conda-libmamba-solver/user-guide/) to install the desired packages. The following command will install the Python package. You can substitute `cuvs` for any of the packages in the table above: ```bash -mamba install -c conda-forge -c nvidia -c rapidsai cuvs +conda install -c conda-forge -c nvidia -c rapidsai cuvs ``` +The cuVS Python package can also be `installed through pip `_. + +For CUDA 11 packages: +```bash +pip install cuvs-cu11 --extra-index-url=https://pypi.nvidia.com +```` + +And CUDA 12 packages: +```bash +pip install cuvs-cu12 --extra-index-url=https://pypi.nvidia.com +``` + ### Nightlies If installing a version that has not yet been released, the `rapidsai` channel can be replaced with `rapidsai-nightly`: @@ -53,11 +103,11 @@ If installing a version that has not yet been released, the `rapidsai` channel c mamba install -c conda-forge -c nvidia -c rapidsai-nightly cuvs=24.12 ``` -Please see the [Build and Install Guide](https://docs.rapids.ai/api/cuvs/stable/build/) for more information on installing cuVS and building from source. +cuVS also has `pip` wheel packages that can be installed. Please see the [Build and Install Guide](https://docs.rapids.ai/api/cuvs/nightly/build/) for more information on installing the available cuVS packages and building from source. ## Getting Started -The following code snippets train an approximate nearest neighbors index for the CAGRA algorithm. +The following code snippets train an approximate nearest neighbors index for the CAGRA algorithm in the various different languages supported by cuVS. ### Python API @@ -85,7 +135,7 @@ cagra::index_params index_params; auto index = cagra::build(res, index_params, dataset); ``` -For more examples of the C++ APIs, refer to the [examples](https://github.com/rapidsai/cuvs/tree/HEAD/examples) directory in the codebase. +For more code examples of the C++ APIs, including drop-in Cmake project templates, please refer to the [C++ examples](https://github.com/rapidsai/cuvs/tree/HEAD/examples) directory in the codebase. ### C API @@ -110,6 +160,8 @@ cuvsCagraIndexParamsDestroy(index_params); cuvsResourcesDestroy(res); ``` +For more code examples of the C APIs, including drop-in Cmake project templates, please refer to the [C examples](https://github.com/rapidsai/cuvs/tree/branch-24.10/examples/c) + ### Rust API ```rust @@ -171,6 +223,7 @@ fn cagra_example() -> Result<()> { } ``` +For more code examples of the Rust APIs, including a drop-in project templates, please refer to the [Rust examples](https://github.com/rapidsai/cuvs/tree/branch-24.10/examples/rust). ## Contributing @@ -178,60 +231,9 @@ If you are interested in contributing to the cuVS library, please read our [Cont ## References -When citing cuVS generally, please consider referencing this Github repository. -```bibtex -@misc{rapidsai, - title={Rapidsai/cuVS: Vector Search and Clustering on the GPU.}, - url={https://github.com/rapidsai/cuvs}, - journal={GitHub}, - publisher={Nvidia RAPIDS}, - author={Rapidsai}, - year={2024} -} -``` - -If citing CAGRA, please consider the following bibtex: -```bibtex -@misc{ootomo2023cagra, - title={CAGRA: Highly Parallel Graph Construction and Approximate Nearest Neighbor Search for GPUs}, - author={Hiroyuki Ootomo and Akira Naruse and Corey Nolet and Ray Wang and Tamas Feher and Yong Wang}, - year={2023}, - eprint={2308.15136}, - archivePrefix={arXiv}, - primaryClass={cs.DS} -} -``` - -If citing the k-selection routines, please consider the following bibtex: -```bibtex -@proceedings{10.1145/3581784, - title = {SC '23: Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis}, - year = {2023}, - isbn = {9798400701092}, - publisher = {Association for Computing Machinery}, - address = {New York, NY, USA}, - abstract = {Started in 1988, the SC Conference has become the annual nexus for researchers and practitioners from academia, industry and government to share information and foster collaborations to advance the state of the art in High Performance Computing (HPC), Networking, Storage, and Analysis.}, - location = {, Denver, CO, USA, } -} -``` - -If citing the nearest neighbors descent API, please consider the following bibtex: -```bibtex -@inproceedings{10.1145/3459637.3482344, - author = {Wang, Hui and Zhao, Wan-Lei and Zeng, Xiangxiang and Yang, Jianye}, - title = {Fast K-NN Graph Construction by GPU Based NN-Descent}, - year = {2021}, - isbn = {9781450384469}, - publisher = {Association for Computing Machinery}, - address = {New York, NY, USA}, - url = {https://doi.org/10.1145/3459637.3482344}, - doi = {10.1145/3459637.3482344}, - abstract = {NN-Descent is a classic k-NN graph construction approach. It is still widely employed in machine learning, computer vision, and information retrieval tasks due to its efficiency and genericness. However, the current design only works well on CPU. In this paper, NN-Descent has been redesigned to adapt to the GPU architecture. A new graph update strategy called selective update is proposed. It reduces the data exchange between GPU cores and GPU global memory significantly, which is the processing bottleneck under GPU computation architecture. This redesign leads to full exploitation of the parallelism of the GPU hardware. In the meantime, the genericness, as well as the simplicity of NN-Descent, are well-preserved. Moreover, a procedure that allows to k-NN graph to be merged efficiently on GPU is proposed. It makes the construction of high-quality k-NN graphs for out-of-GPU-memory datasets tractable. Our approach is 100-250\texttimes{} faster than the single-thread NN-Descent and is 2.5-5\texttimes{} faster than the existing GPU-based approaches as we tested on million as well as billion scale datasets.}, - booktitle = {Proceedings of the 30th ACM International Conference on Information \& Knowledge Management}, - pages = {1929–1938}, - numpages = {10}, - keywords = {high-dimensional, nn-descent, gpu, k-nearest neighbor graph}, - location = {Virtual Event, Queensland, Australia}, - series = {CIKM '21} -} -``` +For the interested reader, many of the accelerated implementations in cuVS are also based on research papers which can provide a lot more background. We also ask you to please cite the corresponding algorithms by referencing them in your own research. +- [CAGRA: Highly Parallel Graph Construction and Approximate Nearest Neighbor Search](https://arxiv.org/abs/2308.15136) +- [Top-K Algorithms on GPU: A Comprehensive Study and New Methods](https://dl.acm.org/doi/10.1145/3581784.3607062>) +- [Fast K-NN Graph Construction by GPU Based NN-Descent](https://dl.acm.org/doi/abs/10.1145/3459637.3482344?casa_token=O_nan1B1F5cAAAAA:QHWDEhh0wmd6UUTLY9_Gv6c3XI-5DXM9mXVaUXOYeStlpxTPmV3nKvABRfoivZAaQ3n8FWyrkWw>) +- [cuSLINK: Single-linkage Agglomerative Clustering on the GPU](https://arxiv.org/abs/2306.16354) +- [GPU Semiring Primitives for Sparse Neighborhood Methods](https://arxiv.org/abs/2104.06357) diff --git a/build.sh b/build.sh index c66a0c35e..b787d3a41 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,7 @@ ARGS=$* # scripts, and that this script resides in the repo dir! REPODIR=$(cd $(dirname $0); pwd) -VALIDARGS="clean libcuvs python rust docs tests bench-ann examples --uninstall -v -g -n --compile-static-lib --allgpuarch --no-mg --no-nvtx --show_depr_warn --incl-cache-stats --time -h" +VALIDARGS="clean libcuvs python rust docs tests bench-ann examples --uninstall -v -g -n --compile-static-lib --allgpuarch --no-mg --no-cpu --cpu-only --no-shared-libs --no-nvtx --show_depr_warn --incl-cache-stats --time -h" HELP="$0 [ ...] [ ...] [--cmake-args=\"\"] [--cache-tool=] [--limit-tests=] [--limit-bench-ann=] [--build-metrics=] where is: clean - remove all existing build artifacts and configuration (start over) @@ -37,11 +37,13 @@ HELP="$0 [ ...] [ ...] [--cmake-args=\"\"] [--cache-tool==3.26.4,!=3.30.0" + +nccl_version: + - ">=2.19" + +glog_version: + - ">=0.6.0" + +h5py_version: + - ">=3.8.0" + +nlohmann_json_version: + - ">=3.11.2" + +# The CTK libraries below are missing from the conda-forge::cudatoolkit package +# for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages +# and the "*_run_*" version specifiers correspond to `11.x` packages. + +cuda11_libcublas_host_version: + - "=11.11.3.6" + +cuda11_libcublas_run_version: + - ">=11.5.2.43,<12.0.0" + +cuda11_libcurand_host_version: + - "=10.3.0.86" + +cuda11_libcurand_run_version: + - ">=10.2.5.43,<10.3.1" + +cuda11_libcusolver_host_version: + - "=11.4.1.48" + +cuda11_libcusolver_run_version: + - ">=11.2.0.43,<11.4.2" + +cuda11_libcusparse_host_version: + - "=11.7.5.86" + +cuda11_libcusparse_run_version: + - ">=11.6.0.43,<12.0.0" + +# `cuda-profiler-api` only has `11.8.0` and `12.0.0` packages for all +# architectures. The "*_host_*" version specifiers correspond to `11.8` packages and the +# "*_run_*" version specifiers correspond to `11.x` packages. + +cuda11_cuda_profiler_api_host_version: + - "=11.8.86" + +cuda11_cuda_profiler_api_run_version: + - ">=11.4.240,<12" diff --git a/conda/recipes/cuvs_bench/meta.yaml b/conda/recipes/cuvs_bench/meta.yaml new file mode 100644 index 000000000..9ecbf82bb --- /dev/null +++ b/conda/recipes/cuvs_bench/meta.yaml @@ -0,0 +1,105 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + +# Usage: +# conda build . -c rapidsai -c conda-forge -c nvidia +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} +{% set py_version = environ['CONDA_PY'] %} +{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} +{% set cuda_major = cuda_version.split('.')[0] %} +{% set date_string = environ['RAPIDS_DATE_STRING'] %} + +package: + name: cuvs_bench + version: {{ version }} + script: build.sh + +source: + path: ../../.. + +build: + script_env: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + - CMAKE_C_COMPILER_LAUNCHER + - CMAKE_CUDA_COMPILER_LAUNCHER + - CMAKE_CXX_COMPILER_LAUNCHER + - CMAKE_GENERATOR + - PARALLEL_LEVEL + - RAPIDS_ARTIFACTS_DIR + - SCCACHE_BUCKET + - SCCACHE_IDLE_TIMEOUT + - SCCACHE_REGION + - SCCACHE_S3_KEY_PREFIX=cuvs-bench-aarch64 # [aarch64] + - SCCACHE_S3_KEY_PREFIX=cuvs-bench-linux64 # [linux64] + - SCCACHE_S3_USE_SSL + number: {{ GIT_DESCRIBE_NUMBER }} + string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} + ignore_run_exports_from: + {% if cuda_major == "11" %} + - {{ compiler('cuda11') }} + {% else %} + - {{ compiler('cuda') }} + - cuda-cudart-dev + - libcublas-dev + {% endif %} + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + {% if cuda_major == "11" %} + - {{ compiler('cuda11') }} ={{ cuda_version }} + {% else %} + - {{ compiler('cuda') }} + {% endif %} + - cuda-version ={{ cuda_version }} + - cmake {{ cmake_version }} + - ninja + - {{ stdlib("c") }} + + host: + - benchmark + - cuda-version ={{ cuda_version }} + {% if cuda_major == "11" %} + - cuda-profiler-api {{ cuda11_cuda_profiler_api_run_version }} + - libcublas {{ cuda11_libcublas_host_version }} + - libcublas-dev {{ cuda11_libcublas_host_version }} + {% else %} + - cuda-cudart-dev + - cuda-profiler-api + - libcublas-dev + {% endif %} + - glog {{ glog_version }} + - libcuvs {{ version }} + - nlohmann_json {{ nlohmann_json_version }} + - openblas + # rmm is needed to determine if package is gpu-enabled + - python + - rapids-build-backend>=0.3.0,<0.4.0.dev0 + - rmm ={{ minor_version }} + + run: + - benchmark + - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} + {% if cuda_major == "11" %} + - cudatoolkit + {% else %} + - cuda-cudart + - libcublas + {% endif %} + - glog {{ glog_version }} + - libcuvs {{ version }} + - h5py {{ h5py_version }} + - matplotlib + - pandas + - pyyaml + # rmm is needed to determine if package is gpu-enabled + - pylibraft ={{ minor_version }} + - python + - rmm ={{ minor_version }} +about: + home: https://rapids.ai/ + license: Apache-2.0 + summary: cuVS GPU and CPU benchmarks diff --git a/conda/recipes/cuvs_bench_cpu/build.sh b/conda/recipes/cuvs_bench_cpu/build.sh new file mode 100644 index 000000000..163872053 --- /dev/null +++ b/conda/recipes/cuvs_bench_cpu/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +./build.sh bench-ann --cpu-only --no-nvtx --build-metrics=bench_ann_cpu --incl-cache-stats +cmake --install cpp/build --component ann_bench diff --git a/conda/recipes/cuvs_bench_cpu/conda_build_config.yaml b/conda/recipes/cuvs_bench_cpu/conda_build_config.yaml new file mode 100644 index 000000000..ed6f708e1 --- /dev/null +++ b/conda/recipes/cuvs_bench_cpu/conda_build_config.yaml @@ -0,0 +1,29 @@ +c_compiler_version: + - 11 + +cxx_compiler_version: + - 11 + +c_stdlib: + - sysroot + +c_stdlib_version: + - "2.17" + +cmake_version: + - ">=3.26.4,!=3.30.0" + +glog_version: + - ">=0.6.0" + +h5py_version: + - ">=3.8.0" + +nlohmann_json_version: + - ">=3.11.2" + +spdlog_version: + - ">=1.14.1,<1.15" + +fmt_version: + - ">=11.0.2,<12" diff --git a/conda/recipes/cuvs_bench_cpu/meta.yaml b/conda/recipes/cuvs_bench_cpu/meta.yaml new file mode 100644 index 000000000..0ce5db744 --- /dev/null +++ b/conda/recipes/cuvs_bench_cpu/meta.yaml @@ -0,0 +1,67 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + +# Usage: +# conda build . -c rapidsai -c conda-forge -c nvidia +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} +{% set py_version = environ['CONDA_PY'] %} +{% set date_string = environ['RAPIDS_DATE_STRING'] %} + +package: + name: cuvs_bench_cpu + version: {{ version }} + script: build.sh + +source: + path: ../../.. + +build: + script_env: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + - CMAKE_C_COMPILER_LAUNCHER + - CMAKE_CUDA_COMPILER_LAUNCHER + - CMAKE_CXX_COMPILER_LAUNCHER + - CMAKE_GENERATOR + - PARALLEL_LEVEL + - RAPIDS_ARTIFACTS_DIR + - SCCACHE_BUCKET + - SCCACHE_IDLE_TIMEOUT + - SCCACHE_REGION + - SCCACHE_S3_KEY_PREFIX=cuvs-bench-cpu-aarch64 # [aarch64] + - SCCACHE_S3_KEY_PREFIX=cuvs-bench-cpu-linux64 # [linux64] + - SCCACHE_S3_USE_SSL + number: {{ GIT_DESCRIBE_NUMBER }} + string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - cmake {{ cmake_version }} + - ninja + - {{ stdlib("c") }} + + host: + - benchmark + - fmt {{ fmt_version }} + - glog {{ glog_version }} + - nlohmann_json {{ nlohmann_json_version }} + - openblas + - python + - rapids-build-backend>=0.3.0,<0.4.0.dev0 + - spdlog {{ spdlog_version }} + + run: + - benchmark + - glog {{ glog_version }} + - h5py {{ h5py_version }} + - matplotlib + - pandas + - pyyaml + - python +about: + home: https://rapids.ai/ + license: Apache-2.0 + summary: cuVS CPU benchmarks diff --git a/conda/recipes/libcuvs/meta.yaml b/conda/recipes/libcuvs/meta.yaml index 3dd7c8f2e..46552c397 100644 --- a/conda/recipes/libcuvs/meta.yaml +++ b/conda/recipes/libcuvs/meta.yaml @@ -161,6 +161,7 @@ outputs: - libcusolver - libcusparse {% endif %} + - libraft-headers ={{ minor_version }} about: home: https://rapids.ai/ license: Apache-2.0 diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 66d489c24..3e98a247e 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -86,6 +86,12 @@ if(NOT BUILD_C_LIBRARY) set(BUILD_C_TESTS OFF) endif() +if(NOT BUILD_SHARED_LIBS) + set(BUILD_TESTS OFF) + set(BUILD_C_LIBRARY OFF) + set(BUILD_CAGRA_HNSWLIB OFF) +endif() + # Needed because GoogleBenchmark changes the state of FindThreads.cmake, causing subsequent runs to # have different values for the `Threads::Threads` target. Setting this flag ensures # `Threads::Threads` is the same value across all builds so that cache hits occur @@ -176,6 +182,7 @@ rapids_cpm_init() if(NOT BUILD_CPU_ONLY) include(cmake/thirdparty/get_raft.cmake) + include(cmake/thirdparty/get_cutlass.cmake) endif() if(BUILD_C_LIBRARY) @@ -187,8 +194,6 @@ if(BUILD_TESTS OR BUILD_C_TESTS) rapids_cpm_gtest(BUILD_STATIC) endif() -include(cmake/thirdparty/get_cutlass.cmake) - if(BUILD_CUVS_BENCH) include(${rapids-cmake-dir}/cpm/gbench.cmake) rapids_cpm_gbench(BUILD_STATIC) @@ -200,566 +205,568 @@ endif() # ################################################################################################## # * cuvs --------------------------------------------------------------------- -add_library( - cuvs-cagra-search STATIC - src/neighbors/cagra_search_float.cu - src/neighbors/cagra_search_half.cu - src/neighbors/cagra_search_int8.cu - src/neighbors/cagra_search_uint8.cu - src/neighbors/detail/cagra/compute_distance.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_float_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_float_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_float_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_half_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_half_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_half_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_int8_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_int8_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_int8_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_uint8_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_uint8_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_uint8_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_float_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_float_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_float_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_half_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_half_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_half_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_int8_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_int8_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_int8_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim128_t8.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim256_t16.cu - src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim512_t32.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim128_t8_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim128_t8_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim256_t16_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim256_t16_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim512_t32_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim512_t32_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim128_t8_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim128_t8_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim256_t16_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim256_t16_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim512_t32_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim512_t32_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim128_t8_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim128_t8_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim256_t16_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim256_t16_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim512_t32_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim512_t32_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim128_t8_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim128_t8_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim256_t16_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim256_t16_8pq_4subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim512_t32_8pq_2subd_half.cu - src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim512_t32_8pq_4subd_half.cu - src/neighbors/detail/cagra/search_multi_cta_float_uint32.cu - src/neighbors/detail/cagra/search_multi_cta_half_uint32.cu - src/neighbors/detail/cagra/search_multi_cta_int8_uint32.cu - src/neighbors/detail/cagra/search_multi_cta_uint8_uint32.cu - src/neighbors/detail/cagra/search_single_cta_float_uint32.cu - src/neighbors/detail/cagra/search_single_cta_half_uint32.cu - src/neighbors/detail/cagra/search_single_cta_int8_uint32.cu - src/neighbors/detail/cagra/search_single_cta_uint8_uint32.cu -) +if(BUILD_SHARED_LIBS) + add_library( + cuvs-cagra-search STATIC + src/neighbors/cagra_search_float.cu + src/neighbors/cagra_search_half.cu + src/neighbors/cagra_search_int8.cu + src/neighbors/cagra_search_uint8.cu + src/neighbors/detail/cagra/compute_distance.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_float_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_float_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_float_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_half_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_half_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_half_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_int8_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_int8_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_int8_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_uint8_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_uint8_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_InnerProduct_uint8_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_float_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_float_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_float_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_half_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_half_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_half_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_int8_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_int8_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_int8_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim128_t8.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim256_t16.cu + src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim512_t32.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim128_t8_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim128_t8_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim256_t16_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim256_t16_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim512_t32_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim512_t32_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim128_t8_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim128_t8_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim256_t16_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim256_t16_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim512_t32_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_half_uint32_dim512_t32_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim128_t8_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim128_t8_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim256_t16_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim256_t16_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim512_t32_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_int8_uint32_dim512_t32_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim128_t8_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim128_t8_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim256_t16_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim256_t16_8pq_4subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim512_t32_8pq_2subd_half.cu + src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_uint8_uint32_dim512_t32_8pq_4subd_half.cu + src/neighbors/detail/cagra/search_multi_cta_float_uint32.cu + src/neighbors/detail/cagra/search_multi_cta_half_uint32.cu + src/neighbors/detail/cagra/search_multi_cta_int8_uint32.cu + src/neighbors/detail/cagra/search_multi_cta_uint8_uint32.cu + src/neighbors/detail/cagra/search_single_cta_float_uint32.cu + src/neighbors/detail/cagra/search_single_cta_half_uint32.cu + src/neighbors/detail/cagra/search_single_cta_int8_uint32.cu + src/neighbors/detail/cagra/search_single_cta_uint8_uint32.cu + ) -file(GLOB_RECURSE compute_distance_sources "src/neighbors/detail/cagra/compute_distance_*.cu") -set_source_files_properties(${compute_distance_sources} PROPERTIES COMPILE_FLAGS -maxrregcount=64) - -set_target_properties( - cuvs-cagra-search - PROPERTIES BUILD_RPATH "\$ORIGIN" - CXX_STANDARD 17 - CXX_STANDARD_REQUIRED ON - CUDA_STANDARD 17 - CUDA_STANDARD_REQUIRED ON - CUDA_SEPARABLE_COMPILATION ON - INTERFACE_POSITION_INDEPENDENT_CODE ON - POSITION_INDEPENDENT_CODE ON -) -target_link_libraries(cuvs-cagra-search PRIVATE raft::raft) -target_include_directories( - cuvs-cagra-search PRIVATE "$" -) -target_compile_options( - cuvs-cagra-search PRIVATE "$<$:${CUVS_CXX_FLAGS}>" - "$<$:${CUVS_CUDA_FLAGS}>" -) + file(GLOB_RECURSE compute_distance_sources "src/neighbors/detail/cagra/compute_distance_*.cu") + set_source_files_properties(${compute_distance_sources} PROPERTIES COMPILE_FLAGS -maxrregcount=64) -if(BUILD_MG_ALGOS) - set(CUVS_MG_ALGOS - src/neighbors/mg/mg_flat_float_int64_t.cu - src/neighbors/mg/mg_flat_int8_t_int64_t.cu - src/neighbors/mg/mg_flat_uint8_t_int64_t.cu - src/neighbors/mg/mg_pq_float_int64_t.cu - src/neighbors/mg/mg_pq_half_int64_t.cu - src/neighbors/mg/mg_pq_int8_t_int64_t.cu - src/neighbors/mg/mg_pq_uint8_t_int64_t.cu - src/neighbors/mg/mg_cagra_float_uint32_t.cu - src/neighbors/mg/mg_cagra_half_uint32_t.cu - src/neighbors/mg/mg_cagra_int8_t_uint32_t.cu - src/neighbors/mg/mg_cagra_uint8_t_uint32_t.cu - src/neighbors/mg/omp_checks.cpp - src/neighbors/mg/nccl_comm.cpp + set_target_properties( + cuvs-cagra-search + PROPERTIES BUILD_RPATH "\$ORIGIN" + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CUDA_STANDARD 17 + CUDA_STANDARD_REQUIRED ON + CUDA_SEPARABLE_COMPILATION ON + INTERFACE_POSITION_INDEPENDENT_CODE ON + POSITION_INDEPENDENT_CODE ON + ) + target_link_libraries(cuvs-cagra-search PRIVATE raft::raft) + target_include_directories( + cuvs-cagra-search PRIVATE "$" + ) + target_compile_options( + cuvs-cagra-search PRIVATE "$<$:${CUVS_CXX_FLAGS}>" + "$<$:${CUVS_CUDA_FLAGS}>" ) -endif() - -add_library( - cuvs_objs OBJECT - src/cluster/kmeans_balanced_fit_float.cu - src/cluster/kmeans_fit_mg_float.cu - src/cluster/kmeans_fit_mg_double.cu - src/cluster/kmeans_fit_double.cu - src/cluster/kmeans_fit_float.cu - src/cluster/kmeans_auto_find_k_float.cu - src/cluster/kmeans_fit_predict_double.cu - src/cluster/kmeans_fit_predict_float.cu - src/cluster/kmeans_predict_double.cu - src/cluster/kmeans_predict_float.cu - src/cluster/kmeans_balanced_fit_float.cu - src/cluster/kmeans_balanced_fit_predict_float.cu - src/cluster/kmeans_balanced_predict_float.cu - src/cluster/kmeans_balanced_fit_int8.cu - src/cluster/kmeans_balanced_fit_predict_int8.cu - src/cluster/kmeans_balanced_predict_int8.cu - src/cluster/kmeans_transform_double.cu - src/cluster/kmeans_transform_float.cu - src/cluster/single_linkage_float.cu - src/core/bitset.cu - src/distance/detail/pairwise_matrix/dispatch_canberra_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_canberra_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_canberra_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_correlation_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_correlation_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_correlation_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_cosine_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_cosine_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_cosine_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_kl_divergence_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_kl_divergence_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_kl_divergence_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_l1_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l1_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l1_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_l2_expanded_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l2_expanded_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l2_expanded_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_l_inf_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l_inf_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_l_inf_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_russel_rao_float_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_russel_rao_half_float_float_int.cu - src/distance/detail/pairwise_matrix/dispatch_russel_rao_double_double_double_int.cu - src/distance/detail/pairwise_matrix/dispatch_rbf.cu - src/distance/detail/pairwise_matrix/dispatch_l2_expanded_double_double_double_int64_t.cu - src/distance/detail/pairwise_matrix/dispatch_l2_expanded_float_float_float_int64_t.cu - src/distance/detail/fused_distance_nn.cu - src/distance/distance.cu - src/distance/pairwise_distance.cu - src/neighbors/brute_force.cu - src/neighbors/cagra_build_float.cu - src/neighbors/cagra_build_half.cu - src/neighbors/cagra_build_int8.cu - src/neighbors/cagra_build_uint8.cu - src/neighbors/cagra_extend_float.cu - src/neighbors/cagra_extend_int8.cu - src/neighbors/cagra_extend_uint8.cu - src/neighbors/cagra_optimize.cu - src/neighbors/cagra_serialize_float.cu - src/neighbors/cagra_serialize_half.cu - src/neighbors/cagra_serialize_int8.cu - src/neighbors/cagra_serialize_uint8.cu - src/neighbors/iface/iface_cagra_float_uint32_t.cu - src/neighbors/iface/iface_cagra_half_uint32_t.cu - src/neighbors/iface/iface_cagra_int8_t_uint32_t.cu - src/neighbors/iface/iface_cagra_uint8_t_uint32_t.cu - src/neighbors/iface/iface_flat_float_int64_t.cu - src/neighbors/iface/iface_flat_int8_t_int64_t.cu - src/neighbors/iface/iface_flat_uint8_t_int64_t.cu - src/neighbors/iface/iface_pq_float_int64_t.cu - src/neighbors/iface/iface_pq_half_int64_t.cu - src/neighbors/iface/iface_pq_int8_t_int64_t.cu - src/neighbors/iface/iface_pq_uint8_t_int64_t.cu - src/neighbors/detail/cagra/cagra_build.cpp - src/neighbors/detail/cagra/topk_for_cagra/topk.cu - $<$:src/neighbors/hnsw.cpp> - src/neighbors/ivf_flat_index.cpp - src/neighbors/ivf_flat/ivf_flat_build_extend_float_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_build_extend_int8_t_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_build_extend_uint8_t_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_helpers.cu - src/neighbors/ivf_flat/ivf_flat_search_float_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_search_int8_t_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_search_uint8_t_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_serialize_float_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_serialize_int8_t_int64_t.cu - src/neighbors/ivf_flat/ivf_flat_serialize_uint8_t_int64_t.cu - src/neighbors/ivf_pq_index.cpp - src/neighbors/ivf_pq/ivf_pq_build_common.cu - src/neighbors/ivf_pq/ivf_pq_serialize.cu - src/neighbors/ivf_pq/ivf_pq_deserialize.cu - src/neighbors/ivf_pq/detail/ivf_pq_build_extend_float_int64_t.cu - src/neighbors/ivf_pq/detail/ivf_pq_build_extend_half_int64_t.cu - src/neighbors/ivf_pq/detail/ivf_pq_build_extend_int8_t_int64_t.cu - src/neighbors/ivf_pq/detail/ivf_pq_build_extend_uint8_t_int64_t.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_false.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_true.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_half.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_half.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_float.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_false.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_true.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_false_bitset64.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_true_bitset64.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_half_bitset64.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_half_bitset64.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_float_bitset64.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_false_bitset64.cu - src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_true_bitset64.cu - src/neighbors/ivf_pq/detail/ivf_pq_search_float_int64_t.cu - src/neighbors/ivf_pq/detail/ivf_pq_search_half_int64_t.cu - src/neighbors/ivf_pq/detail/ivf_pq_search_int8_t_int64_t.cu - src/neighbors/ivf_pq/detail/ivf_pq_search_uint8_t_int64_t.cu - src/neighbors/nn_descent.cu - src/neighbors/nn_descent_float.cu - src/neighbors/nn_descent_half.cu - src/neighbors/nn_descent_int8.cu - src/neighbors/nn_descent_uint8.cu - src/neighbors/reachability.cu - src/neighbors/refine/detail/refine_device_float_float.cu - src/neighbors/refine/detail/refine_device_half_float.cu - src/neighbors/refine/detail/refine_device_int8_t_float.cu - src/neighbors/refine/detail/refine_device_uint8_t_float.cu - src/neighbors/refine/detail/refine_host_float_float.cpp - src/neighbors/refine/detail/refine_host_half_float.cpp - src/neighbors/refine/detail/refine_host_int8_t_float.cpp - src/neighbors/refine/detail/refine_host_uint8_t_float.cpp - src/neighbors/sample_filter.cu - src/neighbors/vamana_build_float.cu - src/neighbors/vamana_build_uint8.cu - src/neighbors/vamana_build_int8.cu - src/neighbors/vamana_serialize_float.cu - src/neighbors/vamana_serialize_uint8.cu - src/neighbors/vamana_serialize_int8.cu - src/selection/select_k_float_int64_t.cu - src/selection/select_k_float_int32_t.cu - src/selection/select_k_float_uint32_t.cu - src/selection/select_k_half_uint32_t.cu - src/stats/silhouette_score.cu - src/stats/trustworthiness_score.cu - ${CUVS_MG_ALGOS} -) -set_target_properties( - cuvs_objs - PROPERTIES CXX_STANDARD 17 - CXX_STANDARD_REQUIRED ON - CUDA_STANDARD 17 - CUDA_STANDARD_REQUIRED ON - POSITION_INDEPENDENT_CODE ON -) -target_compile_options( - cuvs_objs PRIVATE "$<$:${CUVS_CXX_FLAGS}>" - "$<$:${CUVS_CUDA_FLAGS}>" -) -target_link_libraries( - cuvs_objs PUBLIC raft::raft rmm::rmm ${CUVS_CTK_MATH_DEPENDENCIES} - $ -) + if(BUILD_MG_ALGOS) + set(CUVS_MG_ALGOS + src/neighbors/mg/mg_flat_float_int64_t.cu + src/neighbors/mg/mg_flat_int8_t_int64_t.cu + src/neighbors/mg/mg_flat_uint8_t_int64_t.cu + src/neighbors/mg/mg_pq_float_int64_t.cu + src/neighbors/mg/mg_pq_half_int64_t.cu + src/neighbors/mg/mg_pq_int8_t_int64_t.cu + src/neighbors/mg/mg_pq_uint8_t_int64_t.cu + src/neighbors/mg/mg_cagra_float_uint32_t.cu + src/neighbors/mg/mg_cagra_half_uint32_t.cu + src/neighbors/mg/mg_cagra_int8_t_uint32_t.cu + src/neighbors/mg/mg_cagra_uint8_t_uint32_t.cu + src/neighbors/mg/omp_checks.cpp + src/neighbors/mg/nccl_comm.cpp + ) + endif() -add_library(cuvs SHARED $) -add_library(cuvs_static STATIC $) + add_library( + cuvs_objs OBJECT + src/cluster/kmeans_balanced_fit_float.cu + src/cluster/kmeans_fit_mg_float.cu + src/cluster/kmeans_fit_mg_double.cu + src/cluster/kmeans_fit_double.cu + src/cluster/kmeans_fit_float.cu + src/cluster/kmeans_auto_find_k_float.cu + src/cluster/kmeans_fit_predict_double.cu + src/cluster/kmeans_fit_predict_float.cu + src/cluster/kmeans_predict_double.cu + src/cluster/kmeans_predict_float.cu + src/cluster/kmeans_balanced_fit_float.cu + src/cluster/kmeans_balanced_fit_predict_float.cu + src/cluster/kmeans_balanced_predict_float.cu + src/cluster/kmeans_balanced_fit_int8.cu + src/cluster/kmeans_balanced_fit_predict_int8.cu + src/cluster/kmeans_balanced_predict_int8.cu + src/cluster/kmeans_transform_double.cu + src/cluster/kmeans_transform_float.cu + src/cluster/single_linkage_float.cu + src/core/bitset.cu + src/distance/detail/pairwise_matrix/dispatch_canberra_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_canberra_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_canberra_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_correlation_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_correlation_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_correlation_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_cosine_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_cosine_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_cosine_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_kl_divergence_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_kl_divergence_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_kl_divergence_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_l1_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l1_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l1_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_l2_expanded_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l2_expanded_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l2_expanded_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_l_inf_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l_inf_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_l_inf_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_russel_rao_float_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_russel_rao_half_float_float_int.cu + src/distance/detail/pairwise_matrix/dispatch_russel_rao_double_double_double_int.cu + src/distance/detail/pairwise_matrix/dispatch_rbf.cu + src/distance/detail/pairwise_matrix/dispatch_l2_expanded_double_double_double_int64_t.cu + src/distance/detail/pairwise_matrix/dispatch_l2_expanded_float_float_float_int64_t.cu + src/distance/detail/fused_distance_nn.cu + src/distance/distance.cu + src/distance/pairwise_distance.cu + src/neighbors/brute_force.cu + src/neighbors/cagra_build_float.cu + src/neighbors/cagra_build_half.cu + src/neighbors/cagra_build_int8.cu + src/neighbors/cagra_build_uint8.cu + src/neighbors/cagra_extend_float.cu + src/neighbors/cagra_extend_int8.cu + src/neighbors/cagra_extend_uint8.cu + src/neighbors/cagra_optimize.cu + src/neighbors/cagra_serialize_float.cu + src/neighbors/cagra_serialize_half.cu + src/neighbors/cagra_serialize_int8.cu + src/neighbors/cagra_serialize_uint8.cu + src/neighbors/iface/iface_cagra_float_uint32_t.cu + src/neighbors/iface/iface_cagra_half_uint32_t.cu + src/neighbors/iface/iface_cagra_int8_t_uint32_t.cu + src/neighbors/iface/iface_cagra_uint8_t_uint32_t.cu + src/neighbors/iface/iface_flat_float_int64_t.cu + src/neighbors/iface/iface_flat_int8_t_int64_t.cu + src/neighbors/iface/iface_flat_uint8_t_int64_t.cu + src/neighbors/iface/iface_pq_float_int64_t.cu + src/neighbors/iface/iface_pq_half_int64_t.cu + src/neighbors/iface/iface_pq_int8_t_int64_t.cu + src/neighbors/iface/iface_pq_uint8_t_int64_t.cu + src/neighbors/detail/cagra/cagra_build.cpp + src/neighbors/detail/cagra/topk_for_cagra/topk.cu + $<$:src/neighbors/hnsw.cpp> + src/neighbors/ivf_flat_index.cpp + src/neighbors/ivf_flat/ivf_flat_build_extend_float_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_build_extend_int8_t_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_build_extend_uint8_t_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_helpers.cu + src/neighbors/ivf_flat/ivf_flat_search_float_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_search_int8_t_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_search_uint8_t_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_serialize_float_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_serialize_int8_t_int64_t.cu + src/neighbors/ivf_flat/ivf_flat_serialize_uint8_t_int64_t.cu + src/neighbors/ivf_pq_index.cpp + src/neighbors/ivf_pq/ivf_pq_build_common.cu + src/neighbors/ivf_pq/ivf_pq_serialize.cu + src/neighbors/ivf_pq/ivf_pq_deserialize.cu + src/neighbors/ivf_pq/detail/ivf_pq_build_extend_float_int64_t.cu + src/neighbors/ivf_pq/detail/ivf_pq_build_extend_half_int64_t.cu + src/neighbors/ivf_pq/detail/ivf_pq_build_extend_int8_t_int64_t.cu + src/neighbors/ivf_pq/detail/ivf_pq_build_extend_uint8_t_int64_t.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_false.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_true.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_half.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_half.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_float.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_false.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_true.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_false_bitset64.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_fp8_true_bitset64.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_half_half_bitset64.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_half_bitset64.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_float_bitset64.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_false_bitset64.cu + src/neighbors/ivf_pq/detail/ivf_pq_compute_similarity_float_fp8_true_bitset64.cu + src/neighbors/ivf_pq/detail/ivf_pq_search_float_int64_t.cu + src/neighbors/ivf_pq/detail/ivf_pq_search_half_int64_t.cu + src/neighbors/ivf_pq/detail/ivf_pq_search_int8_t_int64_t.cu + src/neighbors/ivf_pq/detail/ivf_pq_search_uint8_t_int64_t.cu + src/neighbors/nn_descent.cu + src/neighbors/nn_descent_float.cu + src/neighbors/nn_descent_half.cu + src/neighbors/nn_descent_int8.cu + src/neighbors/nn_descent_uint8.cu + src/neighbors/reachability.cu + src/neighbors/refine/detail/refine_device_float_float.cu + src/neighbors/refine/detail/refine_device_half_float.cu + src/neighbors/refine/detail/refine_device_int8_t_float.cu + src/neighbors/refine/detail/refine_device_uint8_t_float.cu + src/neighbors/refine/detail/refine_host_float_float.cpp + src/neighbors/refine/detail/refine_host_half_float.cpp + src/neighbors/refine/detail/refine_host_int8_t_float.cpp + src/neighbors/refine/detail/refine_host_uint8_t_float.cpp + src/neighbors/sample_filter.cu + src/neighbors/vamana_build_float.cu + src/neighbors/vamana_build_uint8.cu + src/neighbors/vamana_build_int8.cu + src/neighbors/vamana_serialize_float.cu + src/neighbors/vamana_serialize_uint8.cu + src/neighbors/vamana_serialize_int8.cu + src/selection/select_k_float_int64_t.cu + src/selection/select_k_float_int32_t.cu + src/selection/select_k_float_uint32_t.cu + src/selection/select_k_half_uint32_t.cu + src/stats/silhouette_score.cu + src/stats/trustworthiness_score.cu + ${CUVS_MG_ALGOS} + ) -target_compile_options( - cuvs INTERFACE $<$:--expt-extended-lambda - --expt-relaxed-constexpr> -) + set_target_properties( + cuvs_objs + PROPERTIES CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CUDA_STANDARD 17 + CUDA_STANDARD_REQUIRED ON + POSITION_INDEPENDENT_CODE ON + ) + target_compile_options( + cuvs_objs PRIVATE "$<$:${CUVS_CXX_FLAGS}>" + "$<$:${CUVS_CUDA_FLAGS}>" + ) + target_link_libraries( + cuvs_objs PUBLIC raft::raft rmm::rmm ${CUVS_CTK_MATH_DEPENDENCIES} + $ + ) -add_library(cuvs::cuvs ALIAS cuvs) -add_library(cuvs::cuvs_static ALIAS cuvs_static) - -set_target_properties( - cuvs_static - PROPERTIES BUILD_RPATH "\$ORIGIN" - INSTALL_RPATH "\$ORIGIN" - CXX_STANDARD 17 - CXX_STANDARD_REQUIRED ON - POSITION_INDEPENDENT_CODE ON - INTERFACE_POSITION_INDEPENDENT_CODE ON - EXPORT_NAME cuvs_static -) + add_library(cuvs SHARED $) + add_library(cuvs_static STATIC $) -target_compile_options(cuvs_static PRIVATE "$<$:${CUVS_CXX_FLAGS}>") + target_compile_options( + cuvs INTERFACE $<$:--expt-extended-lambda + --expt-relaxed-constexpr> + ) -target_include_directories( - cuvs_objs - PUBLIC "$" - "$" - INTERFACE "$" -) + add_library(cuvs::cuvs ALIAS cuvs) + add_library(cuvs::cuvs_static ALIAS cuvs_static) -target_include_directories( - cuvs_static - PUBLIC "$" - INTERFACE "$" -) + set_target_properties( + cuvs_static + PROPERTIES BUILD_RPATH "\$ORIGIN" + INSTALL_RPATH "\$ORIGIN" + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + POSITION_INDEPENDENT_CODE ON + INTERFACE_POSITION_INDEPENDENT_CODE ON + EXPORT_NAME cuvs_static + ) -# ensure CUDA symbols aren't relocated to the middle of the debug build binaries -target_link_options(cuvs_static PRIVATE $) + target_compile_options(cuvs_static PRIVATE "$<$:${CUVS_CXX_FLAGS}>") -target_include_directories( - cuvs_static PUBLIC "$" - "$" -) + target_include_directories( + cuvs_objs + PUBLIC "$" + "$" + INTERFACE "$" + ) -target_include_directories( - cuvs PUBLIC "$" - "$" -) + target_include_directories( + cuvs_static + PUBLIC "$" + INTERFACE "$" + ) -rapids_find_package( - OpenMP REQUIRED - BUILD_EXPORT_SET cuvs-exports - INSTALL_EXPORT_SET cuvs-exports -) + # ensure CUDA symbols aren't relocated to the middle of the debug build binaries + target_link_options(cuvs_static PRIVATE $) -if(NOT BUILD_CPU_ONLY) + target_include_directories( + cuvs_static PUBLIC "$" + "$" + ) - set(CUVS_CUSOLVER_DEPENDENCY CUDA::cusolver${_ctk_static_suffix}) - set(CUVS_CUBLAS_DEPENDENCY CUDA::cublas${_ctk_static_suffix}) - set(CUVS_CURAND_DEPENDENCY CUDA::curand${_ctk_static_suffix}) - set(CUVS_CUSPARSE_DEPENDENCY CUDA::cusparse${_ctk_static_suffix}) + target_include_directories( + cuvs PUBLIC "$" + "$" + ) - set(CUVS_CTK_MATH_DEPENDENCIES ${CUVS_CUBLAS_DEPENDENCY} ${CUVS_CUSOLVER_DEPENDENCY} - ${CUVS_CUSPARSE_DEPENDENCY} ${CUVS_CURAND_DEPENDENCY} + rapids_find_package( + OpenMP REQUIRED + BUILD_EXPORT_SET cuvs-exports + INSTALL_EXPORT_SET cuvs-exports ) - if(BUILD_MG_ALGOS) - set(CUVS_COMMS_DEPENDENCY nccl) - endif() + if(NOT BUILD_CPU_ONLY) - # Keep cuVS as lightweight as possible. Only CUDA libs and rmm should be used in global target. - target_link_libraries( - cuvs - PUBLIC rmm::rmm raft::raft ${CUVS_CTK_MATH_DEPENDENCIES} - PRIVATE nvidia::cutlass::cutlass $ cuvs-cagra-search - ${CUVS_COMMS_DEPENDENCY} - ) + set(CUVS_CUSOLVER_DEPENDENCY CUDA::cusolver${_ctk_static_suffix}) + set(CUVS_CUBLAS_DEPENDENCY CUDA::cublas${_ctk_static_suffix}) + set(CUVS_CURAND_DEPENDENCY CUDA::curand${_ctk_static_suffix}) + set(CUVS_CUSPARSE_DEPENDENCY CUDA::cusparse${_ctk_static_suffix}) - target_link_libraries( - cuvs_static - PUBLIC rmm::rmm raft::raft ${CUVS_CTK_MATH_DEPENDENCIES} - PRIVATE nvidia::cutlass::cutlass $ - ) -endif() + set(CUVS_CTK_MATH_DEPENDENCIES ${CUVS_CUBLAS_DEPENDENCY} ${CUVS_CUSOLVER_DEPENDENCY} + ${CUVS_CUSPARSE_DEPENDENCY} ${CUVS_CURAND_DEPENDENCY} + ) -if(BUILD_MG_ALGOS) - target_compile_definitions(cuvs PUBLIC CUVS_BUILD_MG_ALGOS) - target_compile_definitions(cuvs_objs PUBLIC CUVS_BUILD_MG_ALGOS) -endif() + if(BUILD_MG_ALGOS) + set(CUVS_COMMS_DEPENDENCY nccl) + endif() -if(BUILD_CAGRA_HNSWLIB) - target_link_libraries(cuvs_objs PRIVATE hnswlib::hnswlib) - target_compile_definitions(cuvs_objs PUBLIC CUVS_BUILD_CAGRA_HNSWLIB) -endif() + # Keep cuVS as lightweight as possible. Only CUDA libs and rmm should be used in global target. + target_link_libraries( + cuvs + PUBLIC rmm::rmm raft::raft ${CUVS_CTK_MATH_DEPENDENCIES} + PRIVATE nvidia::cutlass::cutlass $ + cuvs-cagra-search ${CUVS_COMMS_DEPENDENCY} + ) -# Endian detection -include(TestBigEndian) -test_big_endian(BIG_ENDIAN) -if(BIG_ENDIAN) - target_compile_definitions(cuvs PRIVATE CUVS_SYSTEM_LITTLE_ENDIAN=0) -else() - target_compile_definitions(cuvs PRIVATE CUVS_SYSTEM_LITTLE_ENDIAN=1) -endif() + target_link_libraries( + cuvs_static + PUBLIC rmm::rmm raft::raft ${CUVS_CTK_MATH_DEPENDENCIES} + PRIVATE nvidia::cutlass::cutlass $ + ) + endif() -file( - WRITE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld" - [=[ + if(BUILD_MG_ALGOS) + target_compile_definitions(cuvs PUBLIC CUVS_BUILD_MG_ALGOS) + target_compile_definitions(cuvs_objs PUBLIC CUVS_BUILD_MG_ALGOS) + endif() + + if(BUILD_CAGRA_HNSWLIB) + target_link_libraries(cuvs_objs PRIVATE hnswlib::hnswlib) + target_compile_definitions(cuvs_objs PUBLIC CUVS_BUILD_CAGRA_HNSWLIB) + endif() + + # Endian detection + include(TestBigEndian) + test_big_endian(BIG_ENDIAN) + if(BIG_ENDIAN) + target_compile_definitions(cuvs PRIVATE CUVS_SYSTEM_LITTLE_ENDIAN=0) + else() + target_compile_definitions(cuvs PRIVATE CUVS_SYSTEM_LITTLE_ENDIAN=1) + endif() + + file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld" + [=[ SECTIONS { .nvFatBinSegment : { *(.nvFatBinSegment) } .nv_fatbin : { *(.nv_fatbin) } } ]=] -) - -# ################################################################################################## -# * NVTX support in cuvs ----------------------------------------------------- - -if(CUVS_NVTX) - # This enables NVTX within the project with no option to disable it downstream. - target_link_libraries(cuvs PUBLIC CUDA::nvtx3) - target_compile_definitions(cuvs PUBLIC NVTX_ENABLED) -else() - # Allow enable NVTX downstream if not set here. This creates a new option at build/install time, - # which is set by default to OFF, but can be enabled in the dependent project. - get_property( - nvtx_option_help_string - CACHE CUVS_NVTX - PROPERTY HELPSTRING ) - string( - CONCAT - nvtx_export_string - "option(CUVS_NVTX \"" - ${nvtx_option_help_string} - "\" OFF)" - [=[ + + # ################################################################################################ + # * NVTX support in cuvs ----------------------------------------------------- + + if(CUVS_NVTX) + # This enables NVTX within the project with no option to disable it downstream. + target_link_libraries(cuvs PUBLIC CUDA::nvtx3) + target_compile_definitions(cuvs PUBLIC NVTX_ENABLED) + else() + # Allow enable NVTX downstream if not set here. This creates a new option at build/install time, + # which is set by default to OFF, but can be enabled in the dependent project. + get_property( + nvtx_option_help_string + CACHE CUVS_NVTX + PROPERTY HELPSTRING + ) + string( + CONCAT + nvtx_export_string + "option(CUVS_NVTX \"" + ${nvtx_option_help_string} + "\" OFF)" + [=[ target_link_libraries(cuvs::cuvs INTERFACE $<$:CUDA::nvtx3>) target_compile_definitions(cuvs::cuvs INTERFACE $<$:NVTX_ENABLED>) ]=] - ) -endif() - -set_target_properties( - cuvs - PROPERTIES BUILD_RPATH "\$ORIGIN" - INSTALL_RPATH "\$ORIGIN" - CXX_STANDARD 17 - CXX_STANDARD_REQUIRED ON - CUDA_STANDARD 17 - CUDA_STANDARD_REQUIRED ON - INTERFACE_POSITION_INDEPENDENT_CODE ON - POSITION_INDEPENDENT_CODE ON -) - -target_compile_options( - cuvs PRIVATE "$<$:${CUVS_CXX_FLAGS}>" - "$<$:${CUVS_CUDA_FLAGS}>" -) -# ensure CUDA symbols aren't relocated to the middle of the debug build binaries -target_link_options(cuvs PRIVATE $) - -# ################################################################################################## -# * cuvs_c ------------------------------------------------------------------------------- -if(BUILD_C_LIBRARY) - add_library( - cuvs_c SHARED - src/core/c_api.cpp - src/neighbors/brute_force_c.cpp - src/neighbors/ivf_flat_c.cpp - src/neighbors/ivf_pq_c.cpp - src/neighbors/cagra_c.cpp - $<$:src/neighbors/hnsw_c.cpp> - src/neighbors/refine/refine_c.cpp - src/distance/pairwise_distance_c.cpp - ) - - if(BUILD_CAGRA_HNSWLIB) - target_link_libraries(cuvs_c PRIVATE hnswlib::hnswlib) - target_compile_definitions(cuvs_c PUBLIC CUVS_BUILD_CAGRA_HNSWLIB) + ) endif() - add_library(cuvs::c_api ALIAS cuvs_c) - set_target_properties( - cuvs_c + cuvs PROPERTIES BUILD_RPATH "\$ORIGIN" INSTALL_RPATH "\$ORIGIN" CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON - POSITION_INDEPENDENT_CODE ON + CUDA_STANDARD 17 + CUDA_STANDARD_REQUIRED ON INTERFACE_POSITION_INDEPENDENT_CODE ON - EXPORT_NAME c_api + POSITION_INDEPENDENT_CODE ON ) - target_compile_options(cuvs_c PRIVATE "$<$:${CUVS_CXX_FLAGS}>") - - target_include_directories( - cuvs_c - PUBLIC "$" - INTERFACE "$" + target_compile_options( + cuvs PRIVATE "$<$:${CUVS_CXX_FLAGS}>" + "$<$:${CUVS_CUDA_FLAGS}>" ) + # ensure CUDA symbols aren't relocated to the middle of the debug build binaries + target_link_options(cuvs PRIVATE $) + + # ################################################################################################ + # * cuvs_c ------------------------------------------------------------------------------- + if(BUILD_C_LIBRARY) + add_library( + cuvs_c SHARED + src/core/c_api.cpp + src/neighbors/brute_force_c.cpp + src/neighbors/ivf_flat_c.cpp + src/neighbors/ivf_pq_c.cpp + src/neighbors/cagra_c.cpp + $<$:src/neighbors/hnsw_c.cpp> + src/neighbors/refine/refine_c.cpp + src/distance/pairwise_distance_c.cpp + ) - target_link_libraries( - cuvs_c - PUBLIC cuvs::cuvs ${CUVS_CTK_MATH_DEPENDENCIES} - PRIVATE raft::raft - ) + if(BUILD_CAGRA_HNSWLIB) + target_link_libraries(cuvs_c PRIVATE hnswlib::hnswlib) + target_compile_definitions(cuvs_c PUBLIC CUVS_BUILD_CAGRA_HNSWLIB) + endif() + + add_library(cuvs::c_api ALIAS cuvs_c) + + set_target_properties( + cuvs_c + PROPERTIES BUILD_RPATH "\$ORIGIN" + INSTALL_RPATH "\$ORIGIN" + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + POSITION_INDEPENDENT_CODE ON + INTERFACE_POSITION_INDEPENDENT_CODE ON + EXPORT_NAME c_api + ) - # ensure CUDA symbols aren't relocated to the middle of the debug build binaries - target_link_options(cuvs_c PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld") -endif() + target_compile_options(cuvs_c PRIVATE "$<$:${CUVS_CXX_FLAGS}>") -# ################################################################################################## -# * install targets----------------------------------------------------------- -rapids_cmake_install_lib_dir(lib_dir) -include(GNUInstallDirs) -include(CPack) - -install( - TARGETS cuvs cuvs_static - DESTINATION ${lib_dir} - COMPONENT cuvs - EXPORT cuvs-exports -) + target_include_directories( + cuvs_c + PUBLIC "$" + INTERFACE "$" + ) -install( - DIRECTORY include/cuvs - COMPONENT cuvs - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) + target_link_libraries( + cuvs_c + PUBLIC cuvs::cuvs ${CUVS_CTK_MATH_DEPENDENCIES} + PRIVATE raft::raft + ) + + # ensure CUDA symbols aren't relocated to the middle of the debug build binaries + target_link_options(cuvs_c PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld") + endif() + + # ################################################################################################ + # * install targets----------------------------------------------------------- + rapids_cmake_install_lib_dir(lib_dir) + include(GNUInstallDirs) + include(CPack) -if(BUILD_C_LIBRARY) install( - TARGETS cuvs_c + TARGETS cuvs cuvs_static DESTINATION ${lib_dir} - COMPONENT c_api - EXPORT cuvs-c-exports + COMPONENT cuvs + EXPORT cuvs-exports ) -endif() -install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/include/cuvs/version_config.hpp - COMPONENT cuvs - DESTINATION include/cuvs -) + install( + DIRECTORY include/cuvs + COMPONENT cuvs + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) -if(TARGET cuvs_c) - list(APPEND cuvs_components c_api) - list(APPEND cuvs_export_sets cuvs-c-exports) - set(CUVS_C_TARGET cuvs_c) -endif() + if(BUILD_C_LIBRARY) + install( + TARGETS cuvs_c + DESTINATION ${lib_dir} + COMPONENT c_api + EXPORT cuvs-c-exports + ) + endif() -# Use `rapids_export` for 22.04 as it will have COMPONENT support -rapids_export( - INSTALL cuvs - EXPORT_SET cuvs-exports - COMPONENTS ${cuvs_components} - COMPONENTS_EXPORT_SET ${cuvs_export_sets} - GLOBAL_TARGETS cuvs ${CUVS_C_TARGET} - NAMESPACE cuvs:: -) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/include/cuvs/version_config.hpp + COMPONENT cuvs + DESTINATION include/cuvs + ) -# ################################################################################################## -# * build export ------------------------------------------------------------- -rapids_export( - BUILD cuvs - EXPORT_SET cuvs-exports - COMPONENTS ${cuvs_components} - COMPONENTS_EXPORT_SET ${cuvs_export_sets} - GLOBAL_TARGETS cuvs ${CUVS_C_TARGET} - NAMESPACE cuvs:: -) + if(TARGET cuvs_c) + list(APPEND cuvs_components c_api) + list(APPEND cuvs_export_sets cuvs-c-exports) + set(CUVS_C_TARGET cuvs_c) + endif() + + # Use `rapids_export` for 22.04 as it will have COMPONENT support + rapids_export( + INSTALL cuvs + EXPORT_SET cuvs-exports + COMPONENTS ${cuvs_components} + COMPONENTS_EXPORT_SET ${cuvs_export_sets} + GLOBAL_TARGETS cuvs ${CUVS_C_TARGET} + NAMESPACE cuvs:: + ) + + # ################################################################################################ + # * build export ------------------------------------------------------------- + rapids_export( + BUILD cuvs + EXPORT_SET cuvs-exports + COMPONENTS ${cuvs_components} + COMPONENTS_EXPORT_SET ${cuvs_export_sets} + GLOBAL_TARGETS cuvs ${CUVS_C_TARGET} + NAMESPACE cuvs:: + ) +endif() # ################################################################################################## # * build test executable ---------------------------------------------------- diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 621bcad7f..25dfd8adf 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -17,16 +17,16 @@ #include "../common/ann_types.hpp" #include "../common/thread_pool.hpp" -#include "cuvs/neighbors/nn_descent.hpp" -#include "linux_aligned_file_reader.h" #include #include #include #include +#include #include #include +#include #include #include @@ -102,10 +102,11 @@ class diskann_memory : public algo { Mode bench_mode_; int num_search_threads_; std::shared_ptr thread_pool_; + std::string index_path_prefix_; private: std::shared_ptr> mem_index_{nullptr}; - void initialize_index_(); + void initialize_index_(size_t max_points); }; template @@ -119,16 +120,16 @@ diskann_memory::diskann_memory(Metric metric, int dim, const build_param& par .with_filter_list_size(0) .with_alpha(param.alpha) .with_saturate_graph(false) - .with_num_threads(num_threads_) + .with_num_threads(param.num_threads) .build()); } template -void diskann_memory::initialize_index_() +void diskann_memory::initialize_index_(size_t max_points) { this->mem_index_ = std::make_shared>(parse_metric_to_diskann(this->metric_), this->dim_, - max_points_, + max_points, diskann_index_write_params_, nullptr, 0, @@ -143,8 +144,7 @@ void diskann_memory::initialize_index_() template void diskann_memory::build(const T* dataset, size_t nrow) { - max_points_ = nrow; - initialize_index_(); + initialize_index_(nrow); mem_index_->build(dataset, nrow, std::vector()); } @@ -152,13 +152,15 @@ template void diskann_memory::set_search_param(const search_param_base& param_) { auto param = dynamic_cast(param_); - this->L_search_ = param.L_search; + L_search_ = param.L_search; num_search_threads_ = param.num_threads; - // bench_mode_ = param.metric_objective; - bench_mode_ = Mode::kLatency; + // only latency mode supported with thread pool + bench_mode_ = Mode::kLatency; // Create a pool if multiple query threads have been set and the pool hasn't been created already + initialize_index_(0); + this->mem_index_->load(index_path_prefix_.c_str(), num_search_threads_, L_search_); bool create_pool = (bench_mode_ == Mode::kLatency && num_search_threads_ > 1 && !thread_pool_); if (create_pool) { thread_pool_ = std::make_shared(num_search_threads_); } } @@ -172,10 +174,10 @@ void diskann_memory::search( mem_index_->search(queries + i * this->dim_, static_cast(k), L_search_, - reinterpret_cast(indices + i * k), + reinterpret_cast(indices + i * k), distances + i * k); }; - if (bench_mode_ == Mode::kLatency && num_threads_ > 1) { + if (bench_mode_ == Mode::kLatency && num_search_threads_ > 1) { thread_pool_->submit(f, batch_size); } else { for (int i = 0; i < batch_size; i++) { @@ -193,8 +195,8 @@ void diskann_memory::save(const std::string& path_to_index) const template void diskann_memory::load(const std::string& path_to_index) { - initialize_index_(); - this->mem_index_->load(path_to_index.c_str(), num_threads_, 100); + // only save the index path prefix here + index_path_prefix_ = path_to_index; } template diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index 1f0e67308..c1146f318 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d3d2b8..e5da6b7 100644 +index 3d3d2b8..3079d12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -145,62 +145,15 @@ if (MSVC) +@@ -145,62 +145,14 @@ if (MSVC) "${DISKANN_MKL_LIB_PATH}/mkl_intel_thread.lib") else() # expected path for manual intel mkl installs @@ -46,7 +46,6 @@ index 3d3d2b8..e5da6b7 100644 - link_directories(${MKL_PATH}) - include_directories(${MKL_INCLUDE_PATH}) + find_package(MKL CONFIG REQUIRED) -+ #target_compile_options(${PROJECT_NAME} PUBLIC $) + include_directories($) + link_libraries($) @@ -69,7 +68,7 @@ index 3d3d2b8..e5da6b7 100644 endif() endif() -@@ -286,7 +239,7 @@ if(MSVC) +@@ -286,7 +238,7 @@ if(MSVC) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/x64/Release) else() set(ENV{TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD} 500000000000) @@ -78,7 +77,7 @@ index 3d3d2b8..e5da6b7 100644 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 +253,6 @@ else() +@@ -300,10 +252,6 @@ else() endif() add_subdirectory(src) @@ -89,30 +88,3 @@ index 3d3d2b8..e5da6b7 100644 if (UNIT_TEST) enable_testing() -diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp -index bba101b..fbb81d5 100644 ---- a/src/pq_flash_index.cpp -+++ b/src/pq_flash_index.cpp -@@ -209,11 +209,6 @@ template void PQFlashIndex::load_cache_ - diskann::cout << "Loading the cache list into memory.." << std::flush; - size_t num_cached_nodes = node_list.size(); - -- // borrow thread data -- ScratchStoreManager> manager(this->_thread_data); -- auto this_thread_data = manager.scratch_space(); -- IOContext &ctx = this_thread_data->ctx; -- - // Allocate space for neighborhood cache - _nhood_cache_buf = new uint32_t[num_cached_nodes * (_max_degree + 1)]; - memset(_nhood_cache_buf, 0, num_cached_nodes * (_max_degree + 1)); -@@ -506,10 +501,6 @@ template void PQFlashIndex::use_medoids - alloc_aligned(((void **)&_centroid_data), _num_medoids * _aligned_dim * sizeof(float), 32); - std::memset(_centroid_data, 0, _num_medoids * _aligned_dim * sizeof(float)); - -- // borrow ctx -- ScratchStoreManager> manager(this->_thread_data); -- auto data = manager.scratch_space(); -- IOContext &ctx = data->ctx; - diskann::cout << "Loading centroid data from medoids vector data of " << _num_medoids << " medoid(s)" << std::endl; - - std::vector nodes_to_read; diff --git a/cpp/cmake/thirdparty/get_cuvs.cmake b/cpp/cmake/thirdparty/get_cuvs.cmake new file mode 100644 index 000000000..c21cccbcc --- /dev/null +++ b/cpp/cmake/thirdparty/get_cuvs.cmake @@ -0,0 +1,64 @@ +# ============================================================================= +# 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. + +# Use RAPIDS_VERSION_MAJOR_MINOR from rapids_config.cmake +set(CUVS_VERSION "${RAPIDS_VERSION_MAJOR_MINOR}") +set(CUVS_FORK "rapidsai") +set(CUVS_PINNED_TAG "branch-${RAPIDS_VERSION_MAJOR_MINOR}") + +function(find_and_configure_cuvs) + set(oneValueArgs VERSION FORK PINNED_TAG ENABLE_NVTX CLONE_ON_PIN BUILD_CPU_ONLY BUILD_SHARED_LIBS) + cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN} ) + + if(PKG_CLONE_ON_PIN AND NOT PKG_PINNED_TAG STREQUAL "branch-${CUVS_VERSION}") + message(STATUS "cuVS: pinned tag found: ${PKG_PINNED_TAG}. Cloning cuVS locally.") + set(CPM_DOWNLOAD_cuvs ON) + endif() + + #----------------------------------------------------- + # Invoke CPM find_package() + #----------------------------------------------------- + rapids_cpm_find(cuvs ${PKG_VERSION} + GLOBAL_TARGETS cuvs::cuvs + BUILD_EXPORT_SET cuvs-bench-exports + INSTALL_EXPORT_SET cuvs-bench-exports + COMPONENTS cuvs + CPM_ARGS + GIT_REPOSITORY https://github.com/${PKG_FORK}/cuvs.git + GIT_TAG ${PKG_PINNED_TAG} + SOURCE_SUBDIR cpp + OPTIONS + "BUILD_SHARED_LIBS ${PKG_BUILD_SHARED_LIBS}" + "BUILD_CPU_ONLY ${PKG_BUILD_CPU_ONLY}" + "BUILD_TESTS OFF" + "BUILD_CAGRA_HNSWLIB OFF" + "CUVS_CLONE_ON_PIN ${PKG_CLONE_ON_PIN}" + ) +endfunction() + + +# Change pinned tag here to test a commit in CI +# To use a different cuVS locally, set the CMake variable +# CPM_cuvs_SOURCE=/path/to/local/cuvs +find_and_configure_cuvs(VERSION ${CUVS_VERSION}.00 + FORK ${CUVS_FORK} + PINNED_TAG ${CUVS_PINNED_TAG} + ENABLE_NVTX OFF + # When PINNED_TAG above doesn't match the default rapids branch, + # force local cuvs clone in build directory + # even if it's already installed. + CLONE_ON_PIN ${CUVS_CLONE_ON_PIN} + BUILD_CPU_ONLY ${BUILD_CPU_ONLY} + BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} +) diff --git a/cpp/cmake/thirdparty/get_diskann.cmake b/cpp/cmake/thirdparty/get_diskann.cmake index 31803451c..8cea20d5c 100644 --- a/cpp/cmake/thirdparty/get_diskann.cmake +++ b/cpp/cmake/thirdparty/get_diskann.cmake @@ -30,11 +30,8 @@ function(find_and_configure_diskann) rapids_cpm_generate_patch_command(diskann ${version} patch_command) rapids_cpm_find(diskann ${version} - GLOBAL_TARGETS diskann::diskann + GLOBAL_TARGETS diskann CPM_ARGS - GIT_REPOSITORY ${repository} - GIT_TAG ${tag} - GIT_SHALLOW ${shallow} ${patch_command} OPTIONS "PYBIND OFF" "UNIT_TEST OFF" diff --git a/cpp/include/cuvs/neighbors/cagra.h b/cpp/include/cuvs/neighbors/cagra.h index 241f5d8b0..14331ebbc 100644 --- a/cpp/include/cuvs/neighbors/cagra.h +++ b/cpp/include/cuvs/neighbors/cagra.h @@ -267,6 +267,15 @@ cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t* index); */ cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index); +/** + * @brief Get dimension of the CAGRA index + * + * @param[in] index CAGRA index + * @param[out] dim return dimension of the index + * @return cuvsError_t + */ +cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int* dim); + /** * @} */ @@ -338,7 +347,7 @@ cuvsError_t cuvsCagraBuild(cuvsResources_t res, * with the same type of `queries`, such that `index.dtype.code == * queries.dl_tensor.dtype.code` Types for input are: * 1. `queries`: - *` a. kDLDataType.code == kDLFloat` and `kDLDataType.bits = 32` + * a. `kDLDataType.code == kDLFloat` and `kDLDataType.bits = 32` * b. `kDLDataType.code == kDLInt` and `kDLDataType.bits = 8` * c. `kDLDataType.code == kDLUInt` and `kDLDataType.bits = 8` * 2. `neighbors`: `kDLDataType.code == kDLUInt` and `kDLDataType.bits = 32` diff --git a/cpp/include/cuvs/neighbors/hnsw.h b/cpp/include/cuvs/neighbors/hnsw.h index 5e94de60a..0495c574a 100644 --- a/cpp/include/cuvs/neighbors/hnsw.h +++ b/cpp/include/cuvs/neighbors/hnsw.h @@ -105,8 +105,10 @@ cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index); * with the same type of `queries`, such that `index.dtype.code == * queries.dl_tensor.dtype.code` * Supported types for input are: - * 1. `queries`: `kDLDataType.code == kDLFloat` or `kDLDataType.code == kDLInt` and - * `kDLDataType.bits = 32` + * 1. `queries`: + * a. `kDLDataType.code == kDLFloat` and `kDLDataType.bits = 32` + * b. `kDLDataType.code == kDLInt` and `kDLDataType.bits = 8` + * c. `kDLDataType.code == kDLUInt` and `kDLDataType.bits = 8` * 2. `neighbors`: `kDLDataType.code == kDLUInt` and `kDLDataType.bits = 64` * 3. `distances`: `kDLDataType.code == kDLFloat` and `kDLDataType.bits = 32` * NOTE: The HNSW index can only be searched by the hnswlib wrapper in cuVS, diff --git a/cpp/include/cuvs/neighbors/hnsw.hpp b/cpp/include/cuvs/neighbors/hnsw.hpp index 007adef0d..d5abd6d55 100644 --- a/cpp/include/cuvs/neighbors/hnsw.hpp +++ b/cpp/include/cuvs/neighbors/hnsw.hpp @@ -173,6 +173,8 @@ std::unique_ptr> from_cagra( /**@}*/ +// TODO: Filtered Search APIs: https://github.com/rapidsai/cuvs/issues/363 + /** * @defgroup hnsw_cpp_index_search Search hnswlib index * @{ @@ -260,7 +262,7 @@ void search(raft::resources const& res, void search(raft::resources const& res, const search_params& params, const index& idx, - raft::host_matrix_view queries, + raft::host_matrix_view queries, raft::host_matrix_view neighbors, raft::host_matrix_view distances); @@ -303,7 +305,7 @@ void search(raft::resources const& res, void search(raft::resources const& res, const search_params& params, const index& idx, - raft::host_matrix_view queries, + raft::host_matrix_view queries, raft::host_matrix_view neighbors, raft::host_matrix_view distances); diff --git a/cpp/src/neighbors/cagra_c.cpp b/cpp/src/neighbors/cagra_c.cpp index 164448f2c..6985ff094 100644 --- a/cpp/src/neighbors/cagra_c.cpp +++ b/cpp/src/neighbors/cagra_c.cpp @@ -176,6 +176,14 @@ extern "C" cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index_c_ptr) }); } +extern "C" cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int* dim) +{ + return cuvs::core::translate_exceptions([=] { + auto index_ptr = reinterpret_cast*>(index->addr); + *dim = index_ptr->dim(); + }); +} + extern "C" cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor* dataset_tensor, diff --git a/cpp/src/neighbors/detail/cagra/cagra_serialize.cuh b/cpp/src/neighbors/detail/cagra/cagra_serialize.cuh index b92ef0ace..a077c098f 100644 --- a/cpp/src/neighbors/detail/cagra/cagra_serialize.cuh +++ b/cpp/src/neighbors/detail/cagra/cagra_serialize.cuh @@ -120,9 +120,9 @@ void serialize_to_hnswlib(raft::resources const& res, os.write(reinterpret_cast(&curr_element_count), sizeof(std::size_t)); // Example:M: 16, dim = 128, data_t = float, index_t = uint32_t, list_size_type = uint32_t, // labeltype: size_t size_data_per_element_ = M * 2 * sizeof(index_t) + sizeof(list_size_type) + - // dim * 4 + sizeof(labeltype) - auto size_data_per_element = - static_cast(index_.graph_degree() * sizeof(IdxT) + 4 + index_.dim() * 4 + 8); + // dim * sizeof(T) + sizeof(labeltype) + auto size_data_per_element = static_cast(index_.graph_degree() * sizeof(IdxT) + 4 + + index_.dim() * sizeof(T) + 8); os.write(reinterpret_cast(&size_data_per_element), sizeof(std::size_t)); // label_offset std::size_t label_offset = size_data_per_element - 8; @@ -185,18 +185,9 @@ void serialize_to_hnswlib(raft::resources const& res, } auto data_row = host_dataset.data_handle() + (index_.dim() * i); - if constexpr (std::is_same_v) { - for (std::size_t j = 0; j < index_.dim(); ++j) { - auto data_elem = static_cast(host_dataset(i, j)); - os.write(reinterpret_cast(&data_elem), sizeof(float)); - } - } else if constexpr (std::is_same_v or std::is_same_v) { - for (std::size_t j = 0; j < index_.dim(); ++j) { - auto data_elem = static_cast(host_dataset(i, j)); - os.write(reinterpret_cast(&data_elem), sizeof(int)); - } - } else { - RAFT_FAIL("Unsupported dataset type while saving CAGRA dataset to HNSWlib format"); + for (std::size_t j = 0; j < index_.dim(); ++j) { + auto data_elem = static_cast(host_dataset(i, j)); + os.write(reinterpret_cast(&data_elem), sizeof(T)); } os.write(reinterpret_cast(&i), sizeof(std::size_t)); diff --git a/cpp/src/neighbors/detail/hnsw.hpp b/cpp/src/neighbors/detail/hnsw.hpp index 0d1ae4ec9..ce1e03264 100644 --- a/cpp/src/neighbors/detail/hnsw.hpp +++ b/cpp/src/neighbors/detail/hnsw.hpp @@ -110,9 +110,9 @@ std::unique_ptr> from_cagra(raft::resources const& res, return std::unique_ptr>(hnsw_index); } -template -void get_search_knn_results(hnswlib::HierarchicalNSW const* idx, - const QueriesT* query, +template +void get_search_knn_results(hnswlib::HierarchicalNSW::type> const* idx, + const T* query, int k, uint64_t* indices, float* distances) @@ -127,11 +127,11 @@ void get_search_knn_results(hnswlib::HierarchicalNSW const* idx, } } -template +template void search(raft::resources const& res, const search_params& params, const index& idx, - raft::host_matrix_view queries, + raft::host_matrix_view queries, raft::host_matrix_view neighbors, raft::host_matrix_view distances) { @@ -146,7 +146,8 @@ void search(raft::resources const& res, idx.set_ef(params.ef); auto const* hnswlib_index = - reinterpret_cast const*>(idx.get_index()); + reinterpret_cast::type> const*>( + idx.get_index()); // when num_threads == 0, automatically maximize parallelism if (params.num_threads) { diff --git a/cpp/src/neighbors/hnsw.cpp b/cpp/src/neighbors/hnsw.cpp index 36cbb16c9..e6f3fbcc7 100644 --- a/cpp/src/neighbors/hnsw.cpp +++ b/cpp/src/neighbors/hnsw.cpp @@ -34,20 +34,20 @@ CUVS_INST_HNSW_FROM_CAGRA(int8_t); #undef CUVS_INST_HNSW_FROM_CAGRA -#define CUVS_INST_HNSW_SEARCH(T, QueriesT) \ - void search(raft::resources const& res, \ - const search_params& params, \ - const index& idx, \ - raft::host_matrix_view queries, \ - raft::host_matrix_view neighbors, \ - raft::host_matrix_view distances) \ - { \ - detail::search(res, params, idx, queries, neighbors, distances); \ +#define CUVS_INST_HNSW_SEARCH(T) \ + void search(raft::resources const& res, \ + const search_params& params, \ + const index& idx, \ + raft::host_matrix_view queries, \ + raft::host_matrix_view neighbors, \ + raft::host_matrix_view distances) \ + { \ + detail::search(res, params, idx, queries, neighbors, distances); \ } -CUVS_INST_HNSW_SEARCH(float, float); -CUVS_INST_HNSW_SEARCH(uint8_t, int); -CUVS_INST_HNSW_SEARCH(int8_t, int); +CUVS_INST_HNSW_SEARCH(float); +CUVS_INST_HNSW_SEARCH(uint8_t); +CUVS_INST_HNSW_SEARCH(int8_t); #undef CUVS_INST_HNSW_SEARCH diff --git a/cpp/src/neighbors/hnsw_c.cpp b/cpp/src/neighbors/hnsw_c.cpp index ab5268a6d..a19875641 100644 --- a/cpp/src/neighbors/hnsw_c.cpp +++ b/cpp/src/neighbors/hnsw_c.cpp @@ -31,7 +31,7 @@ #include namespace { -template +template void _search(cuvsResources_t res, cuvsHnswSearchParams params, cuvsHnswIndex index, @@ -46,7 +46,7 @@ void _search(cuvsResources_t res, search_params.ef = params.ef; search_params.num_threads = params.numThreads; - using queries_mdspan_type = raft::host_matrix_view; + using queries_mdspan_type = raft::host_matrix_view; using neighbors_mdspan_type = raft::host_matrix_view; using distances_mdspan_type = raft::host_matrix_view; auto queries_mds = cuvs::core::from_dlpack(queries_tensor); @@ -127,16 +127,13 @@ extern "C" cuvsError_t cuvsHnswSearch(cuvsResources_t res, auto index = *index_c_ptr; RAFT_EXPECTS(queries.dtype.code == index.dtype.code, "type mismatch between index and queries"); - RAFT_EXPECTS(queries.dtype.bits == 32, "number of bits in queries dtype should be 32"); if (index.dtype.code == kDLFloat) { - _search( - res, *params, index, queries_tensor, neighbors_tensor, distances_tensor); + _search(res, *params, index, queries_tensor, neighbors_tensor, distances_tensor); } else if (index.dtype.code == kDLUInt) { - _search( - res, *params, index, queries_tensor, neighbors_tensor, distances_tensor); + _search(res, *params, index, queries_tensor, neighbors_tensor, distances_tensor); } else if (index.dtype.code == kDLInt) { - _search(res, *params, index, queries_tensor, neighbors_tensor, distances_tensor); + _search(res, *params, index, queries_tensor, neighbors_tensor, distances_tensor); } else { RAFT_FAIL("Unsupported index dtype: %d and bits: %d", queries.dtype.code, queries.dtype.bits); } @@ -152,13 +149,10 @@ extern "C" cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, return cuvs::core::translate_exceptions([=] { if (index->dtype.code == kDLFloat && index->dtype.bits == 32) { index->addr = reinterpret_cast(_deserialize(res, filename, dim, metric)); - index->dtype.code = kDLFloat; } else if (index->dtype.code == kDLUInt && index->dtype.bits == 8) { index->addr = reinterpret_cast(_deserialize(res, filename, dim, metric)); - index->dtype.code = kDLInt; } else if (index->dtype.code == kDLInt && index->dtype.bits == 8) { index->addr = reinterpret_cast(_deserialize(res, filename, dim, metric)); - index->dtype.code = kDLUInt; } else { RAFT_FAIL("Unsupported dtype in file %s", filename); } diff --git a/cpp/src/neighbors/ivf_flat/ivf_flat_interleaved_scan.cuh b/cpp/src/neighbors/ivf_flat/ivf_flat_interleaved_scan.cuh index 9626b2ce5..f5a4267cd 100644 --- a/cpp/src/neighbors/ivf_flat/ivf_flat_interleaved_scan.cuh +++ b/cpp/src/neighbors/ivf_flat/ivf_flat_interleaved_scan.cuh @@ -1206,8 +1206,8 @@ void launch_with_fixed_consts(cuvs::distance::DistanceType metric, Args&&... arg inner_prod_dist>( {}, raft::compose_op(raft::add_const_op{1.0f}, raft::mul_const_op{-1.0f}), - std::forward(args)...); - // NB: update the description of `knn::ivf_flat::build` when adding here a new metric. + std::forward(args)...); // NB: update the description of `knn::ivf_flat::build` when + // adding here a new metric. default: RAFT_FAIL("The chosen distance metric is not supported (%d)", int(metric)); } } diff --git a/cpp/src/neighbors/ivf_pq/ivf_pq_build.cuh b/cpp/src/neighbors/ivf_pq/ivf_pq_build.cuh index c65ea8108..4c9867126 100644 --- a/cpp/src/neighbors/ivf_pq/ivf_pq_build.cuh +++ b/cpp/src/neighbors/ivf_pq/ivf_pq_build.cuh @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -41,6 +42,8 @@ #include #include #include +#include +#include #include #include #include @@ -1466,6 +1469,13 @@ void extend(raft::resources const& handle, std::is_same_v, "Unsupported data type"); + if (index->metric() == distance::DistanceType::CosineExpanded) { + if constexpr (std::is_same_v || std::is_same_v) + RAFT_FAIL( + "CosineExpanded distance metric is currently not supported for uint8_t and int8_t data " + "type"); + } + rmm::device_async_resource_ref device_memory = raft::resource::get_workspace_resource(handle); rmm::device_async_resource_ref large_memory = raft::resource::get_large_workspace_resource(handle); @@ -1632,6 +1642,14 @@ void extend(raft::resources const& handle, vec_batches.prefetch_next_batch(); for (const auto& vec_batch : vec_batches) { const auto& idx_batch = *idx_batches++; + if (index->metric() == CosineExpanded) { + auto vec_batch_view = raft::make_device_matrix_view( + const_cast(vec_batch.data()), vec_batch.size(), index->dim()); + raft::linalg::row_normalize(handle, + raft::make_const_mdspan(vec_batch_view), + vec_batch_view, + raft::linalg::NormType::L2Norm); + } process_and_fill_codes(handle, *index, vec_batch.data(), @@ -1683,6 +1701,13 @@ auto build(raft::resources const& handle, << (int)params.pq_dim << std::endl; RAFT_EXPECTS(n_rows > 0 && dim > 0, "empty dataset"); RAFT_EXPECTS(n_rows >= params.n_lists, "number of rows can't be less than n_lists"); + if (params.metric == distance::DistanceType::CosineExpanded) { + // TODO: support int8_t and uint8_t types (https://github.com/rapidsai/cuvs/issues/389) + if constexpr (std::is_same_v || std::is_same_v) + RAFT_FAIL( + "CosineExpanded distance metric is currently not supported for uint8_t and int8_t data " + "type"); + } auto stream = raft::resource::get_cuda_stream(handle); @@ -1755,6 +1780,11 @@ auto build(raft::resources const& handle, cuvs::cluster::kmeans::balanced_params kmeans_params; kmeans_params.n_iters = params.kmeans_n_iters; kmeans_params.metric = static_cast((int)index.metric()); + + if (index.metric() == distance::DistanceType::CosineExpanded) { + raft::linalg::row_normalize( + handle, trainset_const_view, trainset.view(), raft::linalg::NormType::L2Norm); + } cuvs::cluster::kmeans_balanced::fit( handle, kmeans_params, trainset_const_view, centers_view, utils::mapping{}); @@ -1762,6 +1792,10 @@ auto build(raft::resources const& handle, rmm::device_uvector labels(n_rows_train, stream, big_memory_resource); auto centers_const_view = raft::make_device_matrix_view( cluster_centers, index.n_lists(), index.dim()); + if (index.metric() == distance::DistanceType::CosineExpanded) { + raft::linalg::row_normalize( + handle, centers_const_view, centers_view, raft::linalg::NormType::L2Norm); + } auto labels_view = raft::make_device_vector_view(labels.data(), n_rows_train); cuvs::cluster::kmeans_balanced::predict(handle, diff --git a/cpp/src/neighbors/ivf_pq/ivf_pq_compute_similarity_impl.cuh b/cpp/src/neighbors/ivf_pq/ivf_pq_compute_similarity_impl.cuh index 8404ca1f9..fbbdd06c2 100644 --- a/cpp/src/neighbors/ivf_pq/ivf_pq_compute_similarity_impl.cuh +++ b/cpp/src/neighbors/ivf_pq/ivf_pq_compute_similarity_impl.cuh @@ -369,6 +369,7 @@ RAFT_KERNEL compute_similarity_kernel(uint32_t dim, reinterpret_cast(lut_end)[i] = query[i] - cluster_center[i]; } } break; + case distance::DistanceType::CosineExpanded: case distance::DistanceType::InnerProduct: { float2 pvals; for (uint32_t i = threadIdx.x; i < dim; i += blockDim.x) { @@ -408,6 +409,7 @@ RAFT_KERNEL compute_similarity_kernel(uint32_t dim, diff -= pq_c; score += diff * diff; } break; + case distance::DistanceType::CosineExpanded: case distance::DistanceType::InnerProduct: { // NB: we negate the scores as we hardcoded select-topk to always compute the minimum float q; @@ -485,6 +487,7 @@ RAFT_KERNEL compute_similarity_kernel(uint32_t dim, reinterpret_cast(pq_thread_data), lut_scores, early_stop_limit); + if (metric == distance::DistanceType::CosineExpanded) { score = OutT(1) + score; } } if constexpr (kManageLocalTopK) { block_topk.add(score, sample_offset + i); diff --git a/cpp/src/neighbors/ivf_pq/ivf_pq_search.cuh b/cpp/src/neighbors/ivf_pq/ivf_pq_search.cuh index e185f18dc..db8f9fbd3 100644 --- a/cpp/src/neighbors/ivf_pq/ivf_pq_search.cuh +++ b/cpp/src/neighbors/ivf_pq/ivf_pq_search.cuh @@ -37,6 +37,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -104,12 +107,21 @@ void select_clusters(raft::resources const& handle, This is a negative inner-product distance. We minimize it to find the similar clusters. + NB: qc_distances is NOT used further in ivfpq_search. + + Cosine distance: + `qc_distances[i, j] = - (queries[i], cluster_centers[j])` + + This is a negative inner-product distance. The queries and cluster centers are row normalized. + We minimize it to find the similar clusters. + NB: qc_distances is NOT used further in ivfpq_search. */ float norm_factor; switch (metric) { case cuvs::distance::DistanceType::L2SqrtExpanded: case cuvs::distance::DistanceType::L2Expanded: norm_factor = 1.0 / -2.0; break; + case cuvs::distance::DistanceType::CosineExpanded: case cuvs::distance::DistanceType::InnerProduct: norm_factor = 0.0; break; default: RAFT_FAIL("Unsupported distance type %d.", int(metric)); } @@ -133,6 +145,7 @@ void select_clusters(raft::resources const& handle, gemm_k = dim + 1; RAFT_EXPECTS(gemm_k <= dim_ext, "unexpected gemm_k or dim_ext"); } break; + case cuvs::distance::DistanceType::CosineExpanded: case cuvs::distance::DistanceType::InnerProduct: { alpha = -1.0; beta = 0.0; @@ -363,8 +376,9 @@ void ivfpq_search_worker(raft::resources const& handle, // stores basediff (query[i] - center[i]) precomp_data_count = index.rot_dim(); } break; + case distance::DistanceType::CosineExpanded: case distance::DistanceType::InnerProduct: { - // stores two components (query[i] * center[i], query[i] * center[i]) + // stores two components (query[i], query[i] * center[i]) precomp_data_count = index.rot_dim() * 2; } break; default: { @@ -457,8 +471,14 @@ void ivfpq_search_worker(raft::resources const& handle, num_samples_vector); // Postprocessing - ivf::detail::postprocess_distances( - distances, topk_dists.data(), index.metric(), n_queries, topK, scaling_factor, true, stream); + ivf::detail::postprocess_distances(distances, + topk_dists.data(), + index.metric(), + n_queries, + topK, + scaling_factor, + index.metric() != distance::DistanceType::CosineExpanded, + stream); ivf::detail::postprocess_neighbors(neighbors, neighbors_uint32, index.inds_ptrs().data_handle(), @@ -508,6 +528,7 @@ struct ivfpq_search { { bool signed_metric = false; switch (metric) { + case cuvs::distance::DistanceType::CosineExpanded: signed_metric = true; break; case cuvs::distance::DistanceType::InnerProduct: signed_metric = true; break; default: break; } @@ -606,6 +627,12 @@ inline void search(raft::resources const& handle, static_assert(std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v, "Unsupported element type."); + if (index.metric() == distance::DistanceType::CosineExpanded) { + if constexpr (std::is_same_v || std::is_same_v) + RAFT_FAIL( + "CosineExpanded distance metric is currently not supported for uint8_t and int8_t data " + "type"); + } raft::common::nvtx::range fun_scope( "ivf_pq::search(n_queries = %u, n_probes = %u, k = %u, dim = %zu)", n_queries, @@ -698,7 +725,14 @@ inline void search(raft::resources const& handle, rot_queries.data(), index.rot_dim(), stream); - + if (index.metric() == distance::DistanceType::CosineExpanded) { + auto rot_queries_view = raft::make_device_matrix_view( + rot_queries.data(), max_queries, index.rot_dim()); + raft::linalg::row_normalize(handle, + raft::make_const_mdspan(rot_queries_view), + rot_queries_view, + raft::linalg::NormType::L2Norm); + } for (uint32_t offset_b = 0; offset_b < queries_batch; offset_b += max_batch_size) { uint32_t batch_size = min(max_batch_size, queries_batch - offset_b); /* The distance calculation is done in the rotated/transformed space; diff --git a/cpp/test/neighbors/ann_ivf_pq.cuh b/cpp/test/neighbors/ann_ivf_pq.cuh index f02568b74..fd4e330db 100644 --- a/cpp/test/neighbors/ann_ivf_pq.cuh +++ b/cpp/test/neighbors/ann_ivf_pq.cuh @@ -282,6 +282,8 @@ class ivf_pq_test : public ::testing::TestWithParam { uint32_t n_take, uint32_t n_skip) { + // the original data cannot be reconstructed since the dataset was normalized + if (index.metric() == cuvs::distance::DistanceType::CosineExpanded) { return; } auto& rec_list = index.lists()[label]; auto dim = index.dim(); n_take = std::min(n_take, rec_list->size.load()); @@ -313,6 +315,7 @@ class ivf_pq_test : public ::testing::TestWithParam { auto old_list = index->lists()[label]; auto n_rows = old_list->size.load(); if (n_rows == 0) { return; } + if (index->metric() == cuvs::distance::DistanceType::CosineExpanded) { return; } auto vectors_1 = raft::make_device_matrix(handle_, n_rows, index->dim()); auto indices = raft::make_device_vector(handle_, n_rows); @@ -374,7 +377,7 @@ class ivf_pq_test : public ::testing::TestWithParam { cuvs::Compare{})); // Pack a few vectors back to the list. - int row_offset = 9; + int row_offset = 5; int n_vec = 3; ASSERT_TRUE(row_offset + n_vec < n_rows); size_t offset = row_offset * index->pq_dim(); @@ -884,6 +887,25 @@ inline auto enum_variety_l2sqrt() -> test_cases_t }); } +inline auto enum_variety_cosine() -> test_cases_t +{ + return map(enum_variety(), [](const ivf_pq_inputs& x) { + ivf_pq_inputs y(x); + if (y.min_recall.has_value()) { + if (y.search_params.lut_dtype == CUDA_R_8U) { + // TODO: Increase this recall threshold for 8 bit lut + // (https://github.com/rapidsai/cuvs/issues/390) + y.min_recall = y.min_recall.value() * 0.70; + } else { + // In other cases it seems to perform a little bit better, still worse than L2 + y.min_recall = y.min_recall.value() * 0.94; + } + } + y.index_params.metric = distance::DistanceType::CosineExpanded; + return y; + }); +} + /** * Try different number of n_probes, some of which may trigger the non-fused version of the search * kernel. diff --git a/cpp/test/neighbors/ann_ivf_pq/test_float_int64_t.cu b/cpp/test/neighbors/ann_ivf_pq/test_float_int64_t.cu index cdc6c1b7e..834fdb3d0 100644 --- a/cpp/test/neighbors/ann_ivf_pq/test_float_int64_t.cu +++ b/cpp/test/neighbors/ann_ivf_pq/test_float_int64_t.cu @@ -25,9 +25,13 @@ TEST_BUILD_HOST_INPUT_SEARCH(f32_f32_i64) TEST_BUILD_HOST_INPUT_OVERLAP_SEARCH(f32_f32_i64) TEST_BUILD_EXTEND_SEARCH(f32_f32_i64) TEST_BUILD_SERIALIZE_SEARCH(f32_f32_i64) -INSTANTIATE(f32_f32_i64, defaults() + small_dims() + big_dims_moderate_lut()); +INSTANTIATE(f32_f32_i64, + defaults() + small_dims() + big_dims_moderate_lut() + enum_variety_l2() + + enum_variety_l2sqrt() + enum_variety_ip() + enum_variety_cosine()); TEST_BUILD_SEARCH(f32_f32_i64_filter) -INSTANTIATE(f32_f32_i64_filter, defaults() + small_dims() + big_dims_moderate_lut()); +INSTANTIATE(f32_f32_i64_filter, + defaults() + small_dims() + big_dims_moderate_lut() + enum_variety_l2() + + enum_variety_l2sqrt() + enum_variety_ip() + enum_variety_cosine()); } // namespace cuvs::neighbors::ivf_pq diff --git a/cpp/test/neighbors/ann_ivf_pq/test_int8_t_int64_t.cu b/cpp/test/neighbors/ann_ivf_pq/test_int8_t_int64_t.cu index 80b0e2ccb..c9e5d4f01 100644 --- a/cpp/test/neighbors/ann_ivf_pq/test_int8_t_int64_t.cu +++ b/cpp/test/neighbors/ann_ivf_pq/test_int8_t_int64_t.cu @@ -25,8 +25,9 @@ TEST_BUILD_SEARCH(f32_i08_i64) TEST_BUILD_HOST_INPUT_SEARCH(f32_i08_i64) TEST_BUILD_HOST_INPUT_OVERLAP_SEARCH(f32_i08_i64) TEST_BUILD_SERIALIZE_SEARCH(f32_i08_i64) -INSTANTIATE(f32_i08_i64, defaults() + big_dims() + var_k()); +INSTANTIATE(f32_i08_i64, defaults() + big_dims() + var_k() + enum_variety_l2() + enum_variety_ip()); TEST_BUILD_SEARCH(f32_i08_i64_filter) -INSTANTIATE(f32_i08_i64_filter, defaults() + big_dims() + var_k()); +INSTANTIATE(f32_i08_i64_filter, + defaults() + big_dims() + var_k() + enum_variety_l2() + enum_variety_ip()); } // namespace cuvs::neighbors::ivf_pq diff --git a/cpp/test/neighbors/ann_ivf_pq/test_uint8_t_int64_t.cu b/cpp/test/neighbors/ann_ivf_pq/test_uint8_t_int64_t.cu index 0216a1e80..6e0732227 100644 --- a/cpp/test/neighbors/ann_ivf_pq/test_uint8_t_int64_t.cu +++ b/cpp/test/neighbors/ann_ivf_pq/test_uint8_t_int64_t.cu @@ -25,8 +25,12 @@ TEST_BUILD_SEARCH(f32_u08_i64) TEST_BUILD_HOST_INPUT_SEARCH(f32_u08_i64) TEST_BUILD_HOST_INPUT_OVERLAP_SEARCH(f32_u08_i64) TEST_BUILD_EXTEND_SEARCH(f32_u08_i64) -INSTANTIATE(f32_u08_i64, small_dims_per_cluster() + enum_variety()); +INSTANTIATE(f32_u08_i64, + small_dims_per_cluster() + enum_variety() + enum_variety_l2() + enum_variety_l2sqrt() + + enum_variety_ip()); TEST_BUILD_SEARCH(f32_u08_i64_filter) -INSTANTIATE(f32_u08_i64_filter, small_dims_per_cluster() + enum_variety()); +INSTANTIATE(f32_u08_i64_filter, + small_dims_per_cluster() + enum_variety() + enum_variety_l2() + enum_variety_l2sqrt() + + enum_variety_ip()); } // namespace cuvs::neighbors::ivf_pq diff --git a/docs/source/basics.rst b/docs/source/api_basics.rst similarity index 100% rename from docs/source/basics.rst rename to docs/source/api_basics.rst diff --git a/docs/source/api_docs.rst b/docs/source/api_docs.rst index fe71ff313..f4deef506 100644 --- a/docs/source/api_docs.rst +++ b/docs/source/api_docs.rst @@ -2,10 +2,12 @@ API Reference ============= .. toctree:: - :maxdepth: 1 - :caption: Contents: + :maxdepth: 3 c_api.rst cpp_api.rst python_api.rst rust_api/index.rst + +* :ref:`genindex` +* :ref:`search` \ No newline at end of file diff --git a/docs/source/interoperability.rst b/docs/source/api_interoperability.rst similarity index 100% rename from docs/source/interoperability.rst rename to docs/source/api_interoperability.rst diff --git a/docs/source/build.rst b/docs/source/build.rst index 9d0d391dc..a6b8ccd13 100644 --- a/docs/source/build.rst +++ b/docs/source/build.rst @@ -9,8 +9,6 @@ The cuVS software development kit provides APIs for C, C++, Python, and Rust lan * `Python through Pip`_ - * `Rust through crates.io`_ - - `Build from source`_ * `Prerequisites`_ @@ -38,21 +36,21 @@ C, C++, and Python through Conda The easiest way to install the pre-compiled C, C++, and Python packages is through conda. You can get a minimal conda installation with `miniforge `__. -Use the following commands, depending on your CUDA version, to install cuVS packages (replace `rapidsai` with `rapidsai-nightly` to install more up-to-date but less stable nightly packages). `mamba` is preferred over the `conda` command. +Use the following commands, depending on your CUDA version, to install cuVS packages (replace `rapidsai` with `rapidsai-nightly` to install more up-to-date but less stable nightly packages). `mamba` is preferred over the `conda` command and can be enabled using `this guide `_. C/C++ Package ~~~~~~~~~~~~~ .. code-block:: bash - mamba install -c rapidsai -c conda-forge -c nvidia libcuvs cuda-version=12.5 + conda install -c rapidsai -c conda-forge -c nvidia libcuvs cuda-version=12.5 Python Package ~~~~~~~~~~~~~~ .. code-block:: bash - mamba install -c rapidsai -c conda-forge -c nvidia cuvs cuda-version=12.5 + conda install -c rapidsai -c conda-forge -c nvidia cuvs cuda-version=12.5 Python through Pip ^^^^^^^^^^^^^^^^^^ @@ -73,9 +71,6 @@ And CUDA 12 packages: Note: these packages statically link the C and C++ libraries so the `libcuvs` and `libcuvs_c` shared libraries won't be readily available to use in your code. -Rust through crates.io -^^^^^^^^^^^^^^^^^^^^^^ - Build from source ----------------- @@ -97,15 +92,15 @@ Conda environment scripts are provided for installing the necessary dependencies .. code-block:: bash - mamba env create --name cuvs -f conda/environments/all_cuda-125_arch-x86_64.yaml - mamba activate cuvs + conda env create --name cuvs -f conda/environments/all_cuda-125_arch-x86_64.yaml + conda activate cuvs The process for building from source with CUDA 11 differs slightly in that your host system will also need to have CUDA toolkit installed which is greater than, or equal to, the version you install into you conda environment. Installing CUDA toolkit into your host system is necessary because `nvcc` is not provided with Conda's cudatoolkit dependencies for CUDA 11. The following example will install create and install dependencies for a CUDA 11.8 conda environment .. code-block:: bash - mamba env create --name cuvs -f conda/environments/all_cuda-118_arch-x86_64.yaml - mamba activate cuvs + conda env create --name cuvs -f conda/environments/all_cuda-118_arch-x86_64.yaml + conda activate cuvs The recommended way to build and install cuVS from source is to use the `build.sh` script in the root of the repository. This script can build both the C++ and Python artifacts and provides CMake options for building and installing the headers, tests, benchmarks, and the pre-compiled shared library. diff --git a/docs/source/c_api/neighbors.rst b/docs/source/c_api/neighbors.rst index dc55a74dc..9c3fce672 100644 --- a/docs/source/c_api/neighbors.rst +++ b/docs/source/c_api/neighbors.rst @@ -13,3 +13,4 @@ Nearest Neighbors neighbors_ivf_flat_c.rst neighbors_ivf_pq_c.rst neighbors_cagra_c.rst + neighbors_hnsw_c.rst diff --git a/docs/source/choosing_and_configuring_indexes.rst b/docs/source/choosing_and_configuring_indexes.rst new file mode 100644 index 000000000..b4c140f29 --- /dev/null +++ b/docs/source/choosing_and_configuring_indexes.rst @@ -0,0 +1,98 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Primer on vector search indexes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Vector search indexes often use approximations to trade-off accuracy of the results for speed, either through lowering latency (end-to-end single query speed) or by increasing throughput (the number of query vectors that can be satisfied in a short period of time). Vector search indexes, especially ones that use approximations, are very closely related to machine learning models but they are optimized for fast search and accuracy of results. + +When the number of vectors is very small, such as less than 100 thousand vectors, it could be fast enough to use a brute-force (also known as a flat index), which returns exact results but at the expense of exhaustively searching all possible neighbors + +Objectives +========== + +This primer addresses the challenge of configuring vector search indexes, but its primary goal is to get a user up and running quickly with acceptable enough results for a good choice of index type and a small and manageable tuning knob, rather than providing a comprehensive guide to tuning each and every hyper-parameter. + +For this reason, we focus on 4 primary data sizes: + +#. Tiny datasets where GPU is likely not needed (< 100 thousand vectors) +#. Small datasets where GPU might not be needed (< 1 million vectors) +#. Large datasets (> 1 million vectors), goal is fast index creation at the expense of search quality +#. Large datasets where high quality is preferred at the expense of fast index creation + +Like other machine learning algorithms, vector search indexes generally have a training step – which means building the index – and an inference – or search step. The hyper-parameters also tend to be broken down into build and search parameters. + +While not always the case, a general trend is often observed where the search speed decreases as the quality increases. This also tends to be the case with the index build performance, though different algorithms have different relationships between build time, quality, and search time. It’s important to understand that there’s no free lunch so there will always be trade-offs for each index type. + +Definition of quality +===================== + +What do we mean when we say quality of an index? In machine learning terminology, we measure this using recall, which is sometimes used interchangeably to mean accuracy, even though the two are slightly different measures. Recall, when used in vector search, essentially means “out of all of my results, which results would have been included in the exact results?” In vector search, the objective is to find some number of vectors that are closest to a given query vector so recall tends to be more relaxed than accuracy, discriminating only on set inclusion, rather than on exact ordered list matching, which would be closer to an accuracy measure. + +Choosing vector search indexes +============================== + +Many vector search algorithms improve scalability while reducing the number of distances by partitioning the vector space into smaller pieces, often through the use of clustering, hashing, trees, and other techniques. Another popular technique is to reduce the width or dimensionality of the space in order to decrease the cost of computing each distance. + +Tiny datasets (< 100 thousand vectors) +-------------------------------------- + +These datasets are very small and it’s questionable whether or not the GPU would provide any value at all. If the dimensionality is also relatively small (< 1024), you could just use brute-force or HNSW on the CPU and get great performance. If the dimensionality is relatively large (1536, 2048, 4096), you should consider using HNSW. If build time performance is critical, you should consider using CAGRA to build the graph and convert it to an HNSW graph for search (this capability exists today in the standalone cuVS/RAFT libraries and will soon be added to Milvus). An IVF flat index can also be a great candidate here, as it can improve the search performance over brute-force by partitioning the vector space and thus reducing the search space. + +Small datasets where GPU might not be needed (< 1 million vectors) +------------------------------------------------------------------ + +For smaller dimensionality, such as 1024 or below, you could consider using a brute-force (aka flat) index on GPU and get very good search performance with exact results. You could also use a graph-based index like HNSW on the CPU or CAGRA on the GPU. If build time is critical, you could even build a CAGRA graph on the GPU and convert it to HNSW graph on the CPU. + +For larger dimensionality (1536, 2048, 4096), you will start to see lower build-time performance with HNSW for higher quality search settings, and so it becomes more clear that building a CAGRA graph can be useful instead. + +Large datasets (> 1 million vectors), goal is fast index creation at the expense of search quality +-------------------------------------------------------------------------------------------------- + +For fast ingest where slightly lower search quality is acceptable (85% recall and above), the IVF (inverted file index) methods can be very useful, as they can be very fast to build and still have acceptable search performance. IVF-flat index will partition the vectors into some number of clusters (specified by the user as n_lists) and at search time, some number of closest clusters (defined by n_probes) will be searched with brute-force for each query vector. + +IVF-PQ is similar to IVF-flat with the major difference that the vectors are compressed using a lossy product quantized compression so the index can have a much smaller footprint on the GPU. In general, it’s advised to set n_lists = sqrt(n_vectors) and set n_probes to some percentage of n_lists (e.g. 1%, 2%, 4%, 8%, 16%). Because IVF-PQ is a lossy compression, a refinement step can be performed by initially increasing the number of neighbors (by some multiple factor) and using the raw vectors to compute the exact distances, ultimately reducing the neighborhoods down to size k. Even a refinement of 2x (which would query initially for k*2) can be quite effective in making up for recall lost by the PQ compression, but it does come at the expense of having to keep the raw vectors around (keeping in mind many databases store the raw vectors anyways). + +Large datasets (> 1 million vectors), goal is high quality search at the expense of fast index creation +------------------------------------------------------------------------------------------------------- + +By trading off index creation performance, an extremely high quality search model can be built. Generally, all of the vector search index types have hyperparameters that have a direct correlation with the search accuracy and so they can be cranked up to yield better recall. Unfortunately, this can also significantly increase the index build time and reduce the search throughput. The trick here is to find the fastest build time that can achieve the best recall with the lowest latency or highest throughput possible. + +As for suggested index types, graph-based algorithms like HNSW and CAGRA tend to scale very well to larger datasets while having superior search performance with respect to quality. The challenge is that graph-based indexes require learning a graph and so, as the subtitle of this section suggests, have a tendency to be slower to build than other options. Using the CAGRA algorithm on the GPU can reduce the build time significantly over HNSW, while also having a superior throughput (and lower latency) than searching on the CPU. Currently, the downside to using CAGRA on the GPU is that it requires both the graph and the raw vectors to fit into GPU memory. A middle-ground can be reached by building a CAGRA graph on the GPU and converting it to an HNSW for high quality (and moderately fast) search on the CPU. + + +Tuning and hyperparameter optimization +====================================== + +Unfortunately, for large datasets, doing a hyper-parameter optimization on the whole dataset is not always feasible. It is possible, however, to perform a hyper-parameter optimization on the smaller subsets and find reasonably acceptable parameters that should generalize fairly well to the entire dataset. Generally this hyper-parameter optimization will require computing a ground truth on the subset with an exact method like brute-force and then using it to evaluate several searches on randomly sampled vectors. + +Full hyper-parameter optimization may also not always be necessary- for example, once you have built a ground truth dataset on a subset, many times you can start by building an index with the default build parameters and then playing around with different search parameters until you get the desired quality and search performance. For massive indexes that might be multiple terabytes, you could also take this subsampling of, say, 10M vectors, train an index and then tune the search parameters from there. While there might be a small margin of error, the chosen build/search parameters should generalize fairly well for the databases that build locally partitioned indexes. + + +Summary of vector search index types +==================================== + +.. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - Name + - Trade-offs + - Best to use with... + * - Brute-force (aka flat) + - Exact search but requires exhaustive distance computations + - Tiny datasets (< 100k vectors) + * - IVF-Flat + - Partitions the vector space to reduce distance computations for brute-force search at the expense of recall + - Small datasets (<1M vectors) or larger datasets (>1M vectors) where fast index build time is prioritized over quality. + * - IVF-PQ + - Adds product quantization to IVF-Flat to achieve scale at the expense of recall + - Large datasets (>>1M vectors) where fast index build is prioritized over quality + * - HNSW + - Significantly reduces distance computations at the expense of longer build times + - Small datasets (<1M vectors) or large datasets (>1M vectors) where quality and speed of search are prioritized over index build times + * - CAGRA + - Significantly reduces distance computations at the expense of longer build times (though build times improve over HNSW) + - Large datasets (>>1M vectors) where quality and speed of search are prioritized over index build times but index build times are still important. + * - CAGRA build +HNSW search + - (coming soon to Milvus) + - Significantly reduces distance computations and improves build times at the expense of higher search latency / lower throughput. + Large datasets (>>1M vectors) where index build times and quality of search is important but GPU resources are limited and latency of search is not. diff --git a/docs/source/comparing_indexes.rst b/docs/source/comparing_indexes.rst new file mode 100644 index 000000000..221aab6d7 --- /dev/null +++ b/docs/source/comparing_indexes.rst @@ -0,0 +1,60 @@ +.. _comparing_indexes: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Comparing performance of vector indexes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This document provides a brief overview methodology for comparing vector search indexes and models. For guidance on how to choose and configure an index type, please refer to :doc:`this ` guide. + +Unlike traditional database indexes, which will generally return correct results even without performance tuning, vector search indexes are more closely related to ML models and they can return absolutely garbage results if they have not been tuned. + +For this reason, it’s important to consider the parameters that an index is built upon, both for its potential quality and throughput/latency, when comparing two trained indexes. While easier to build an index on its default parameters than having to tune them, a well tuned index can have a significantly better search quality AND perform within search perf constraints like maximal throughput and minimal latency. + + +What is recall? +=============== + +Recall is a measure of model quality. Imagine for a particular vector, we know the exact nearest neighbors because we computed them already. The recall for a query result can be computed by taking the set intersection between the exact nearest neighbors and the actual nearest neighbors. The number of neighbors in that intersection list gets divided by k, the number of neighbors being requested. To really give a fair estimate of the recall of a model, we use several query vectors, all with ground truth computed, and we take the total neighbors across all intersected neighbor lists and divide by n_queries * k. + +Parameter settings dictate the quality of an index. The graph below shows eight indexes from the same data but with different tuning parameters. Generally speaking, the indexes with higher average recall took longer to build. Which index is fair to report? + +.. image:: images/index_recalls.png + + +How do I compare models or indexing algorithms? +=============================================== + +In order to fairly compare the performance (e.g. latency and throughput) of an indexing algorithm or model against another, we always need to do so with respect to its potential recall. This is important and draws from the ML roots of vector search, but is often confusing to newcomers who might be more familiar with the database world. + +Best practice: Latency and throughput can only be compared at similar levels of recall. If you measure the performance of two indexes at different levels of recall, you are making an unfair comparison. + +Because recall levels can vary quite a bit across parameter settings, we tend to compare recall within a small set of potential buckets, so that parameter settings that perform within each bucket can be fairly compared. + +We suggest averaging performance within a range of recall. For general guidance, we tend to use the following buckets: + +#. 85% - 89% +#. 90% - 94% +#. 95% - 99% +#. >99% + +.. image:: images/recall_buckets.png + + +This allows us to make observations such as “at 95% recall level, model A can be built 3x faster than model B, but model B has 2x lower latency than model A” + +.. image:: images/build_benchmarks.png + + +Another important detail is that we compare these models against their best-case search performance within each recall window. This means that we aim to find models that not only have great recall quality but also have either the highest throughput or lowest latency within the window of interest. These best-cases are most often computed by doing a parameter sweep in a grid search (or other types of search optimizers) and looking at the best cases for each level of recall. + +The resulting data points will construct a curve known as a Pareto optimum. Please note that this process is specifically for showing best-case across recall and throughput/latency, but when we care about finding the parameters that yield the best recall and search performance, we are essentially performing a hyperparameter optimization, which is common in machine learning. + + +How do I do this on large vector databases? +=========================================== + +It turns out that most vector databases, like Milvus for example, make many smaller vector search indexing models for a single “index”, and the distribution of the vectors across the smaller index models are assumed to be completely uniform. This means we can use subsampling to our benefit, and tune on smaller sub-samples of the overall dataset. + +Please note, however, that there are often caps on the size of each of these smaller indexes, and that needs to be taken into consideration when choosing the size of the sub sample to tune. + +Please see :doc:`this guide ` for more information on the steps one would take to do this subsampling and tuning process. \ No newline at end of file diff --git a/docs/source/cpp_api/neighbors.rst b/docs/source/cpp_api/neighbors.rst index 0c68c8415..d55d58eb0 100644 --- a/docs/source/cpp_api/neighbors.rst +++ b/docs/source/cpp_api/neighbors.rst @@ -11,6 +11,7 @@ Nearest Neighbors neighbors_bruteforce.rst neighbors_cagra.rst + neighbors_hnsw.rst neighbors_ivf_flat.rst neighbors_ivf_pq.rst neighbors_nn_descent.rst diff --git a/docs/source/cuvs_bench/build.rst b/docs/source/cuvs_bench/build.rst new file mode 100644 index 000000000..de8432691 --- /dev/null +++ b/docs/source/cuvs_bench/build.rst @@ -0,0 +1,59 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Build cuVS Bench From Source +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Dependencies +============ + +CUDA 11 and a GPU with Volta architecture or later are required to run the benchmarks. + +Please refer to the :doc:`installation docs <../build>` for the base requirements to build cuVS. + +In addition to the base requirements for building cuVS, additional dependencies needed to build the ANN benchmarks include: +1. FAISS GPU >= 1.7.1 +2. Google Logging (GLog) +3. H5Py +4. HNSWLib +5. nlohmann_json +6. GGNN + +`rapids-cmake `_ is used to build the ANN benchmarks so the code for dependencies not already supplied in the CUDA toolkit will be downloaded and built automatically. + +The easiest (and most reproducible) way to install the dependencies needed to build the ANN benchmarks is to use the conda environment file located in the `conda/environments` directory of the cuVS repository. The following command will use `mamba` (which is preferred over `conda`) to build and activate a new environment for compiling the benchmarks: + +.. code-block:: bash + + conda env create --name cuvs_benchmarks -f conda/environments/cuvs_bench_cuda-118_arch-x86_64.yaml + conda activate cuvs_benchmarks + +The above conda environment will also reduce the compile times as dependencies like FAISS will already be installed and not need to be compiled with `rapids-cmake`. + +Compiling the Benchmarks +======================== + +After the needed dependencies are satisfied, the easiest way to compile ANN benchmarks is through the `build.sh` script in the root of the RAFT source code repository. The following will build the executables for all the support algorithms: + +.. code-block:: bash + + ./build.sh bench-ann + +You can limit the algorithms that are built by providing a semicolon-delimited list of executable names (each algorithm is suffixed with `_ANN_BENCH`): + +.. code-block:: bash + + ./build.sh bench-ann -n --limit-bench-ann=HNSWLIB_ANN_BENCH;CUVS_IVF_PQ_ANN_BENCH + +Available targets to use with `--limit-bench-ann` are: +- FAISS_GPU_IVF_FLAT_ANN_BENCH +- FAISS_GPU_IVF_PQ_ANN_BENCH +- FAISS_CPU_IVF_FLAT_ANN_BENCH +- FAISS_CPU_IVF_PQ_ANN_BENCH +- FAISS_GPU_FLAT_ANN_BENCH +- FAISS_CPU_FLAT_ANN_BENCH +- GGNN_ANN_BENCH +- HNSWLIB_ANN_BENCH +- CUVS_CAGRA_ANN_BENCH +- CUVS_IVF_PQ_ANN_BENCH +- CUVS_IVF_FLAT_ANN_BENCH + +By default, the `*_ANN_BENCH` executables program infer the dataset's datatype from the filename's extension. For example, an extension of `fbin` uses a `float` datatype, `f16bin` uses a `float16` datatype, extension of `i8bin` uses `int8_t` datatype, and `u8bin` uses `uint8_t` type. Currently, only `float`, `float16`, int8_t`, and `unit8_t` are supported. \ No newline at end of file diff --git a/docs/source/cuvs_bench/datasets.rst b/docs/source/cuvs_bench/datasets.rst new file mode 100644 index 000000000..0f6539e56 --- /dev/null +++ b/docs/source/cuvs_bench/datasets.rst @@ -0,0 +1,62 @@ +~~~~~~~~~~~~~~~~~~~ +cuVS Bench Datasets +~~~~~~~~~~~~~~~~~~~ + +A dataset usually has 4 binary files containing database vectors, query vectors, ground truth neighbors and their corresponding distances. For example, Glove-100 dataset has files `base.fbin` (database vectors), `query.fbin` (query vectors), `groundtruth.neighbors.ibin` (ground truth neighbors), and `groundtruth.distances.fbin` (ground truth distances). The first two files are for index building and searching, while the other two are associated with a particular distance and are used for evaluation. + +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/cuvs_bench/cuvs_bench/get_dataset/fbin_to_f16bin.py` to transform dataset from `float32` to `float16` type. + +Commonly used datasets can be downloaded from two websites: +#. Million-scale datasets can be found at the `Data sets `_ section of `ann-benchmarks `_. + + However, these datasets are in HDF5 format. Use `python/cuvs_bench/cuvs_bench/get_dataset/hdf5_to_fbin.py` to transform the format. The usage of this script is: + + .. code-block:: bash + + $ python/cuvs_bench/cuvs_bench/get_dataset/hdf5_to_fbin.py + usage: hdf5_to_fbin.py [-n] .hdf5 + -n: normalize base/query set + outputs: .base.fbin + .query.fbin + .groundtruth.neighbors.ibin + .groundtruth.distances.fbin + + So for an input `.hdf5` file, four output binary files will be produced. See previous section for an example of prepossessing GloVe dataset. + + Most datasets provided by `ann-benchmarks` use `Angular` or `Euclidean` distance. `Angular` denotes cosine distance. However, computing cosine distance reduces to computing inner product by normalizing vectors beforehand. In practice, we can always do the normalization to decrease computation cost, so it's better to measure the performance of inner product rather than cosine distance. The `-n` option of `hdf5_to_fbin.py` can be used to normalize the dataset. + +#. Billion-scale datasets can be found at `big-ann-benchmarks `_. The ground truth file contains both neighbors and distances, thus should be split. A script is provided for this: + + Take Deep-1B dataset as an example: + + .. code-block:: bash + + 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 + python -m cuvs_bench.split_groundtruth deep_new_groundtruth.public.10K.bin groundtruth + + # two files 'groundtruth.neighbors.ibin' and 'groundtruth.distances.fbin' should be produced + + Besides ground truth files for the whole billion-scale datasets, this site also provides ground truth files for the first 10M or 100M vectors of the base sets. This mean we can use these billion-scale datasets as million-scale datasets. To facilitate this, an optional parameter `subset_size` for dataset can be used. See the next step for further explanation. + +Generate ground truth +===================== + +If you have a dataset, but no corresponding ground truth file, then you can generate ground trunth using the `generate_groundtruth` utility. Example usage: + +.. code-block:: bash + + # With existing query file + python -m cuvs_bench.generate_groundtruth --dataset /dataset/base.fbin --output=groundtruth_dir --queries=/dataset/query.public.10K.fbin + + # With randomly generated queries + python -m cuvs_bench.generate_groundtruth --dataset /dataset/base.fbin --output=groundtruth_dir --queries=random --n_queries=10000 + + # Using only a subset of the dataset. Define queries by randomly + # selecting vectors from the (subset of the) dataset. + python -m cuvs_bench.generate_groundtruth --dataset /dataset/base.fbin --nrows=2000000 --output=groundtruth_dir --queries=random-choice --n_queries=10000 \ No newline at end of file diff --git a/docs/source/cuvs_bench/index.rst b/docs/source/cuvs_bench/index.rst new file mode 100644 index 000000000..61ac622d2 --- /dev/null +++ b/docs/source/cuvs_bench/index.rst @@ -0,0 +1,770 @@ +~~~~~~~~~~ +cuVS Bench +~~~~~~~~~~ + +cuVS bench provides a reproducible benchmarking tool for various ANN search implementations. It's especially suitable for comparing GPU implementations as well as comparing GPU against CPU. One of the primary goals of cuVS is to capture ideal index configurations for a variety of important usage patterns so the results can be reproduced easily on different hardware environments, such as on-prem and cloud. + +This tool offers several benefits, including + +#. Making fair comparisons of index build times + +#. Making fair comparisons of index search throughput and/or latency + +#. Finding the optimal parameter settings for a range of recall buckets + +#. Easily generating consistently styled plots for index build and search + +#. Profiling blind spots and potential for algorithm optimization + +#. Investigating the relationship between different parameter settings, index build times, and search performance. + +- `Installing the benchmarks`_ + + * `Conda`_ + + * `Docker`_ + +- `How to run the benchmarks`_ + + * `Step 1: Prepare the dataset`_ + + * `Step 2: Build and search index`_ + + * `Step 3: Data export`_ + + * `Step 4: Plot the results`_ + +- `Running the benchmarks`_ + + * `End-to-end: smaller-scale benchmarks (<1M to 10M)`_ + + * `End-to-end: large-scale benchmarks (>10M vectors)`_ + + * `Running with Docker containers`_ + + * `End-to-end run on GPU`_ + + * `Manually run the scripts inside the container`_ + + * `Evaluating the results`_ + +- `Creating and customizing dataset configurations`_ + + * `Multi-GPU benchmarks`_ + +- `Adding a new index algorithm`_ + + * `Implementation and configuration`_ + + * `Adding a Cmake target`_ + +Installing the benchmarks +========================= + +There are two main ways pre-compiled benchmarks are distributed: + +- `Conda`_ For users not using containers but want an easy to install and use Python package. Pip wheels are planned to be added as an alternative for users that cannot use conda and prefer to not use containers. +- `Docker`_ Only needs docker and [NVIDIA docker](https://github.com/NVIDIA/nvidia-docker) to use. Provides a single docker run command for basic dataset benchmarking, as well as all the functionality of the conda solution inside the containers. + +Conda +----- + +.. code-block:: bash + + conda create --name cuvs_benchmarks + conda activate cuvs_benchmarks + + # to install GPU package: + conda install -c rapidsai -c conda-forge -c nvidia cuvs-ann-bench= cuda-version=11.8* + + # to install CPU package for usage in CPU-only systems: + conda install -c rapidsai -c conda-forge cuvs-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. + +Please see the :doc:`build instructions ` to build the benchmarks from source. + +Docker +------ + +We provide images for GPU enabled systems, as well as systems without a GPU. The following images are available: + +- `cuvs-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. +- `cuvs-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. +- `cuvs-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 `_, meanwhile release (stable) versions are located in `NGC `_, starting with release 24.10. + +The following command pulls the nightly container for python version 10, cuda version 12, and CUVS version 23.10: + +.. code-block:: bash + + docker pull rapidsai/cuvs_bench:24.10a-cuda12.0-py3.10 #substitute cuvs_bench for the exact desired container. + +The CUDA and python versions can be changed for the supported values: +- Supported CUDA versions: 11.4 and 12.x +- Supported Python versions: 3.9 and 3.10. + +You can see the exact versions as well in the dockerhub site: +- `cuVS bench images `_ +- `cuVS bench with datasets preloaded images `_ +- `cuVS bench CPU only images `_ + +**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 `_ is required to use GPUs inside docker containers. + +How to run the benchmarks +========================= + +We provide a collection of lightweight Python scripts to run the benchmarks. There are 4 general steps to running the benchmarks and visualizing the results. +#. Prepare Dataset +#. Build Index and Search Index +#. Data Export +#. Plot Results + +Step 1: Prepare the dataset +--------------------------- + +The script `cuvs_bench.get_dataset` will download and unpack the dataset in directory that the user provides. As of now, only million-scale datasets are supported by this script. For more information on :doc:`datasets and formats `. + +The usage of this script is: + +.. code-block:: bash + + usage: get_dataset.py [-h] [--name NAME] [--dataset-path DATASET_PATH] [--normalize] + + options: + -h, --help show this help message and exit + --dataset DATASET dataset to download (default: glove-100-angular) + --dataset-path DATASET_PATH + path to download dataset (default: ${RAPIDS_DATASET_ROOT_DIR}) + --normalize normalize cosine distance to inner product (default: False) + +When option `normalize` is provided to the script, any dataset that has cosine distances +will be normalized to inner product. So, for example, the dataset `glove-100-angular` +will be written at location `datasets/glove-100-inner/`. + +Step 2: Build and search index +------------------------------ + +The script `cuvs_bench.run` will build and search indices for a given dataset and its +specified configuration. + +The usage of the script `cuvs_bench.run` is: + +.. code-block:: bash + + usage: __main__.py [-h] [--subset-size SUBSET_SIZE] [-k COUNT] [-bs BATCH_SIZE] [--dataset-configuration DATASET_CONFIGURATION] [--configuration CONFIGURATION] [--dataset DATASET] + [--dataset-path DATASET_PATH] [--build] [--search] [--algorithms ALGORITHMS] [--groups GROUPS] [--algo-groups ALGO_GROUPS] [-f] [-m SEARCH_MODE] + + options: + -h, --help show this help message and exit + --subset-size SUBSET_SIZE + the number of subset rows of the dataset to build the index (default: None) + -k COUNT, --count COUNT + the number of nearest neighbors to search for (default: 10) + -bs BATCH_SIZE, --batch-size BATCH_SIZE + number of query vectors to use in each query trial (default: 10000) + --dataset-configuration DATASET_CONFIGURATION + path to YAML configuration file for datasets (default: None) + --configuration CONFIGURATION + path to YAML configuration file or directory for algorithms Any run groups found in the specified file/directory will automatically override groups of the same name + present in the default configurations, including `base` (default: None) + --dataset DATASET name of dataset (default: glove-100-inner) + --dataset-path DATASET_PATH + path to dataset folder, by default will look in RAPIDS_DATASET_ROOT_DIR if defined, otherwise a datasets subdirectory from the calling directory (default: + os.getcwd()/datasets/) + --build + --search + --algorithms ALGORITHMS + run only comma separated list of named algorithms. If parameters `groups` and `algo-groups` are both undefined, then group `base` is run by default (default: None) + --groups GROUPS run only comma separated groups of parameters (default: base) + --algo-groups ALGO_GROUPS + add comma separated . to run. Example usage: "--algo-groups=cuvs_cagra.large,hnswlib.large" (default: None) + -f, --force re-run algorithms even if their results already exist (default: False) + -m SEARCH_MODE, --search-mode SEARCH_MODE + run search in 'latency' (measure individual batches) or 'throughput' (pipeline batches and measure end-to-end) mode (default: throughput) + -t SEARCH_THREADS, --search-threads SEARCH_THREADS + specify the number threads to use for throughput benchmark. Single value or a pair of min and max separated by ':'. Example --search-threads=1:4. Power of 2 values between 'min' and 'max' will be used. If only 'min' is + specified, then a single test is run with 'min' threads. By default min=1, max=. (default: None) + -r, --dry-run dry-run mode will convert the yaml config for the specified algorithms and datasets to the json format that's consumed by the lower-level c++ binaries and then print the command to run execute the benchmarks but + will not actually execute the command. (default: False) + +`dataset`: name of the dataset to be searched in `datasets.yaml`_ + +`dataset-configuration`: optional filepath to custom dataset YAML config which has an entry for arg `dataset` + +`configuration`: optional filepath to YAML configuration for an algorithm or to directory that contains YAML configurations for several algorithms. Refer to `Dataset.yaml config`_ for more info. + +`algorithms`: runs all algorithms that it can find in YAML configs found by `configuration`. By default, only `base` group will be run. + +`groups`: run only specific groups of parameters configurations for an algorithm. Groups are defined in YAML configs (see `configuration`), and by default run `base` group + +`algo-groups`: this parameter is helpful to append any specific algorithm+group combination to run the benchmark for in addition to all the arguments from `algorithms` and `groups`. It is of the format `.`, or for example, `cuvs_cagra.large` + +For every algorithm run by this script, it outputs an index build statistics JSON file in `/result/build/<{algo},{group}.json>` +and an index search statistics JSON file in `/result/search/<{algo},{group},k{k},bs{batch_size}.json>`. NOTE: The filenames will not have ",{group}" if `group = "base"`. + +For every algorithm run by this script, it outputs an index build statistics JSON file in `/result/build/<{algo},{group}.json>` +and an index search statistics JSON file in `/result/search/<{algo},{group},k{k},bs{batch_size}.json>`. NOTE: The filenames will not have ",{group}" if `group = "base"`. + +`dataset-path` : +#. data is read from `/` +#. indices are built in `//index` +#. build/search results are stored in `//result` + +`build` and `search` : if both parameters are not supplied to the script then it is assumed both are `True`. + +`indices` and `algorithms` : these parameters ensure that the algorithm specified for an index is available in `algos.yaml` and not disabled, as well as having an associated executable. + +Step 3: Data export +------------------- + +The script `cuvs_bench.data_export` will convert the intermediate JSON outputs produced by `cuvs_bench.run` to more easily readable CSV files, which are needed to build charts made by `cuvs_bench.plot`. + +.. code-block:: bash + + usage: data_export.py [-h] [--dataset DATASET] [--dataset-path DATASET_PATH] + + options: + -h, --help show this help message and exit + --dataset DATASET dataset to download (default: glove-100-inner) + --dataset-path DATASET_PATH + path to dataset folder (default: ${RAPIDS_DATASET_ROOT_DIR}) + +Build statistics CSV file is stored in `/result/build/<{algo},{group}.csv>` +and index search statistics CSV file in `/result/search/<{algo},{group},k{k},bs{batch_size},{suffix}.csv>`, where suffix has three values: +#. `raw`: All search results are exported +#. `throughput`: Pareto frontier of throughput results is exported +#. `latency`: Pareto frontier of latency results is exported + +Step 4: Plot the results +------------------------ + +The script `cuvs_bench.plot` will plot results for all algorithms found in index search statistics CSV files `/result/search/*.csv`. + +The usage of this script is: + +.. code-block:: bash + + usage: [-h] [--dataset DATASET] [--dataset-path DATASET_PATH] [--output-filepath OUTPUT_FILEPATH] [--algorithms ALGORITHMS] [--groups GROUPS] [--algo-groups ALGO_GROUPS] + [-k COUNT] [-bs BATCH_SIZE] [--build] [--search] [--x-scale X_SCALE] [--y-scale {linear,log,symlog,logit}] [--x-start X_START] [--mode {throughput,latency}] + [--time-unit {s,ms,us}] [--raw] + + options: + -h, --help show this help message and exit + --dataset DATASET dataset to plot (default: glove-100-inner) + --dataset-path DATASET_PATH + path to dataset folder (default: /home/coder/cuvs/datasets/) + --output-filepath OUTPUT_FILEPATH + directory for PNG to be saved (default: /home/coder/cuvs) + --algorithms ALGORITHMS + plot only comma separated list of named algorithms. If parameters `groups` and `algo-groups are both undefined, then group `base` is plot by default + (default: None) + --groups GROUPS plot only comma separated groups of parameters (default: base) + --algo-groups ALGO_GROUPS, --algo-groups ALGO_GROUPS + add comma separated . to plot. Example usage: "--algo-groups=cuvs_cagra.large,hnswlib.large" (default: None) + -k COUNT, --count COUNT + the number of nearest neighbors to search for (default: 10) + -bs BATCH_SIZE, --batch-size BATCH_SIZE + number of query vectors to use in each query trial (default: 10000) + --build + --search + --x-scale X_SCALE Scale to use when drawing the X-axis. Typically linear, logit or a2 (default: linear) + --y-scale {linear,log,symlog,logit} + Scale to use when drawing the Y-axis (default: linear) + --x-start X_START Recall values to start the x-axis from (default: 0.8) + --mode {throughput,latency} + search mode whose Pareto frontier is used on the y-axis (default: throughput) + --time-unit {s,ms,us} + time unit to plot when mode is latency (default: ms) + --raw Show raw results (not just Pareto frontier) of mode arg (default: False) + +`mode`: plots pareto frontier of `throughput` or `latency` results exported in the previous step + +`algorithms`: plots all algorithms that it can find results for the specified `dataset`. By default, only `base` group will be plotted. + +`groups`: plot only specific groups of parameters configurations for an algorithm. Groups are defined in YAML configs (see `configuration`), and by default run `base` group + +`algo-groups`: this parameter is helpful to append any specific algorithm+group combination to plot results for in addition to all the arguments from `algorithms` and `groups`. It is of the format `.`, or for example, `cuvs_cagra.large` + +Running the benchmarks +====================== + +End-to-end: smaller-scale benchmarks (<1M to 10M) +------------------------------------------------- + +The steps below demonstrate how to download, install, and run benchmarks on a subset of 10M vectors from the Yandex Deep-1B dataset By default the datasets will be stored and used from the folder indicated by the `RAPIDS_DATASET_ROOT_DIR` environment variable if defined, otherwise a datasets sub-folder from where the script is being called: + +.. code-block:: bash + + + # (1) prepare dataset. + python -m cuvs_bench.get_dataset --dataset deep-image-96-angular --normalize + + # (2) build and search index + python -m cuvs_bench.run --dataset deep-image-96-inner --algorithms cuvs_cagra --batch-size 10 -k 10 + + # (3) export data + python -m cuvs_bench.data_export --dataset deep-image-96-inner + + # (4) plot results + python -m cuvs_bench.plot --dataset deep-image-96-inner + + +.. list-table:: + + * - Dataset name + - Train rows + - Columns + - Test rows + - Distance + + * - `deep-image-96-angular` + - 10M + - 96 + - 10K + - Angular + + * - `fashion-mnist-784-euclidean` + - 60K + - 784 + - 10K + - Euclidean + + * - `glove-50-angular` + - 1.1M + - 50 + - 10K + - Angular + + * - `glove-100-angular` + - 1.1M + - 100 + - 10K + - Angular + + * - `mnist-784-euclidean` + - 60K + - 784 + - 10K + - Euclidean + + * - `nytimes-256-angular` + - 290K + - 256 + - 10K + - Angular + + * - `sift-128-euclidean` + - 1M + - 128 + - 10K + - Euclidean + +All of the datasets above contain ground test datasets with 100 neighbors. Thus `k` for these datasets must be less than or equal to 100. + +End-to-end: large-scale benchmarks (>10M vectors) +------------------------------------------------- + +`cuvs_bench.get_dataset` cannot be used to download the `billion-scale datasets`_ due to their size. You should instead use our billion-scale datasets guide to download and prepare them. +All other python commands mentioned below work as intended once the billion-scale dataset has been downloaded. + +To download billion-scale datasets, visit `big-ann-benchmarks `_ + +We also provide a new dataset called `wiki-all` containing 88 million 768-dimensional vectors. This dataset is meant for benchmarking a realistic retrieval-augmented generation (RAG)/LLM embedding size at scale. It also contains 1M and 10M vector subsets for smaller-scale experiments. See our :doc:`Wiki-all Dataset Guide ` for more information and to download the dataset. + + +The steps below demonstrate how to download, install, and run benchmarks on a subset of 100M vectors from the Yandex Deep-1B dataset. Please note that datasets of this scale are recommended for GPUs with larger amounts of memory, such as the A100 or H100. + +.. code-block:: bash + + mkdir -p datasets/deep-1B + # (1) prepare dataset + # download manually "Ground Truth" file of "Yandex DEEP" + # suppose the file name is deep_new_groundtruth.public.10K.bin + python -m cuvs_bench.split_groundtruth --groundtruth datasets/deep-1B/deep_new_groundtruth.public.10K.bin + # two files 'groundtruth.neighbors.ibin' and 'groundtruth.distances.fbin' should be produced + + # (2) build and search index + python -m cuvs_bench.run --dataset deep-1B --algorithms cuvs_cagra --batch-size 10 -k 10 + + # (3) export data + python -m cuvs_bench.data_export --dataset deep-1B + + # (4) plot results + python -m cuvs_bench.plot --dataset deep-1B + +The usage of `python -m cuvs_bench.split_groundtruth` is: + +.. code-block:: bash + usage: split_groundtruth.py [-h] --groundtruth GROUNDTRUTH + + options: + -h, --help show this help message and exit + --groundtruth GROUNDTRUTH + Path to billion-scale dataset groundtruth file (default: None) + +Running with Docker containers +------------------------------ + +Two methods are provided for running the benchmarks with the Docker containers. + +End-to-end run on GPU +~~~~~~~~~~~~~~~~~~~~~ + +When no other entrypoint is provided, an end-to-end script will run through all the steps in `Running the benchmarks`_ above. + +For GPU-enabled systems, the `DATA_FOLDER` variable should be a local folder where you want datasets stored in `$DATA_FOLDER/datasets` and results in `$DATA_FOLDER/result` (we highly recommend `$DATA_FOLDER` to be a dedicated folder for the datasets and results of the containers): + +.. code-block:: bash + + export DATA_FOLDER=path/to/store/datasets/and/results + docker run --gpus all --rm -it -u $(id -u) \ + -v $DATA_FOLDER:/data/benchmarks \ + rapidsai/cuvs-bench:24.10a-cuda11.8-py3.10 \ + "--dataset deep-image-96-angular" \ + "--normalize" \ + "--algorithms cuvs_cagra,cuvs_ivf_pq --batch-size 10 -k 10" \ + "" + +Usage of the above command is as follows: + +.. list-table:: + + * - Argument + - Description + + * - `rapidsai/cuvs-bench:24.10a-cuda11.8-py3.10` + - Image to use. Can be either `cuvs-bench` or `cuvs-bench-datasets` + + * - `"--dataset deep-image-96-angular"` + - Dataset name + + * - `"--normalize"` + - Whether to normalize the dataset + + * - `"--algorithms cuvs_cagra,hnswlib --batch-size 10 -k 10"` + - Arguments passed to the `run` script, such as the algorithms to benchmark, the batch size, and `k` + + * - `""` + - Additional (optional) arguments that will be passed to the `plot` script. + +***Note about user and file permissions:*** The flag `-u $(id -u)` allows the user inside the container to match the `uid` of the user outside the container, allowing the container to read and write to the mounted volume indicated by the `$DATA_FOLDER` variable. + +End-to-end run on CPU +~~~~~~~~~~~~~~~~~~~~~ + +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 `cuvs-bench-cpu` container and the `--gpus all` argument is no longer used: + +.. code-block:: bash + + export DATA_FOLDER=path/to/store/datasets/and/results + docker run --rm -it -u $(id -u) \ + -v $DATA_FOLDER:/data/benchmarks \ + rapidsai/cuvs-bench-cpu:24.10a-py3.10 \ + "--dataset deep-image-96-angular" \ + "--normalize" \ + "--algorithms hnswlib --batch-size 10 -k 10" \ + "" + +Manually run the scripts inside the container +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +All of the `cuvs-bench` images contain the Conda packages, so they can be used directly by logging directly into the container itself: + +.. code-block:: bash + + export DATA_FOLDER=path/to/store/datasets/and/results + docker run --gpus all --rm -it -u $(id -u) \ + --entrypoint /bin/bash \ + --workdir /data/benchmarks \ + -v $DATA_FOLDER:/data/benchmarks \ + rapidsai/cuvs-bench:24.10a-cuda11.8-py3.10 + +This will drop you into a command line in the container, with the `cuvs-bench` python package ready to use, as described in the [Running the benchmarks](#running-the-benchmarks) section above: + +.. code-block:: bash + + (base) root@00b068fbb862:/data/benchmarks# python -m cuvs_bench.get_dataset --dataset deep-image-96-angular --normalize + +Additionally, the containers can be run in detached mode without any issue. + +Evaluating the results +---------------------- + +The benchmarks capture several different measurements. The table below describes each of the measurements for index build benchmarks: + +.. list-table:: + + * - Name + - Description + + * - Benchmark + - A name that uniquely identifies the benchmark instance + + * - Time + - Wall-time spent training the index + + * - CPU + - CPU time spent training the index + + * - Iterations + - Number of iterations (this is usually 1) + + * - GPU + - GU time spent building + + * - index_size + - Number of vectors used to train index + +The table below describes each of the measurements for the index search benchmarks. The most important measurements `Latency`, `items_per_second`, `end_to_end`. + +.. list-table:: + + * - Name + - Description + + * - Benchmark + - A name that uniquely identifies the benchmark instance + + * - Time + - The wall-clock time of a single iteration (batch) divided by the number of threads. + + * - CPU + - The average CPU time (user + sys time). This does not include idle time (which can also happen while waiting for GPU sync). + + * - Iterations + - Total number of batches. This is going to be `total_queries` / `n_queries`. + + * - GPU + - GPU latency of a single batch (seconds). In throughput mode this is averaged over multiple threads. + + * - Latency + - Latency of a single batch (seconds), calculated from wall-clock time. In throughput mode this is averaged over multiple threads. + + * - Recall + - Proportion of correct neighbors to ground truth neighbors. Note this column is only present if groundtruth file is specified in dataset configuration. + + * - items_per_second + - Total throughput, a.k.a Queries per second (QPS). This is approximately `total_queries` / `end_to_end`. + + * - k + - Number of neighbors being queried in each iteration + + * - end_to_end + - Total time taken to run all batches for all iterations + + * - n_queries + - Total number of query vectors in each batch + + * - total_queries + - Total number of vectors queries across all iterations ( = `iterations` * `n_queries`) + +Note the following: +- A slightly different method is used to measure `Time` and `end_to_end`. That is why `end_to_end` = `Time` * `Iterations` holds only approximately. +- The actual table displayed on the screen may differ slightly as the hyper-parameters will also be displayed for each different combination being benchmarked. +- Recall calculation: the number of queries processed per test depends on the number of iterations. Because of this, recall can show slight fluctuations if less neighbors are processed then it is available for the benchmark. + +Creating and customizing dataset configurations +=============================================== + +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 CUVS in `${CUVS_HOME}/python/cuvs-ann-bench/src/cuvs_bench/run/conf` with configurations available for several datasets. Here's a simple example entry for the `sift-128-euclidean` dataset: + +.. code-block:: yaml + + - 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 + dims: 128 + distance: euclidean + +Configuration files for ANN algorithms supported by `cuvs-bench` are provided in `${CUVS_HOME}/python/cuvs-bench/src/cuvs_bench/run/conf`. `cuvs_cagra` algorithm configuration looks like: + +.. code-block:: yaml + + name: cuvs_cagra + groups: + base: + build: + graph_degree: [32, 64] + intermediate_graph_degree: [64, 96] + graph_build_algo: ["NN_DESCENT"] + search: + itopk: [32, 64, 128] + + large: + build: + graph_degree: [32, 64] + search: + itopk: [32, 64, 128] + +The default parameters for which the benchmarks are run can be overridden by creating a custom YAML file for algorithms with a `base` group. + +There config above has 2 fields: +1. `name` - define the name of the algorithm for which the parameters are being specified. +2. `groups` - define a run group which has a particular set of parameters. Each group helps create a cross-product of all hyper-parameter fields for `build` and `search`. + +The table below contains all algorithms supported by cuVS. Each unique algorithm will have its own set of `build` and `search` settings. The :doc:`ANN Algorithm Parameter Tuning Guide ` contains detailed instructions on choosing build and search parameters for each supported algorithm. + +.. list-table:: + + * - Library + - Algorithms + + * - FAISS_GPU + - `faiss_gpu_flat`, `faiss_gpu_ivf_flat`, `faiss_gpu_ivf_pq` + + * - FAISS_CPU + - `faiss_cpu_flat`, `faiss_cpu_ivf_flat`, `faiss_cpu_ivf_pq` + + * - GGNN + - `ggnn` + + * - HNSWLIB + - `hnswlib` + + * - cuVS + - `cuvs_brute_force`, `cuvs_cagra`, `cuvs_ivf_flat`, `cuvs_ivf_pq`, `cuvs_cagra_hnswlib` + + +Multi-GPU benchmarks +-------------------- + +cuVS implements single node multi-GPU versions of IVF-Flat, IVF-PQ and CAGRA indexes. + +.. list-table:: + + * - Index type + - Multi-GPU algo name + + * - IVF-Flat + - `cuvs_mg_ivf_flat` + + * - IVF-PQ + - `cuvs_mg_ivf_pq` + + * - CAGRA + - `cuvs_mg_cagra` + + +Adding a new index algorithm +============================ + +Implementation and configuration +-------------------------------- + +Implementation of a new algorithm should be a C++ class that inherits `class ANN` (defined in `cpp/bench/ann/src/ann.h`) and implements all the pure virtual functions. + +In addition, it should define two `struct`s for building and searching parameters. The searching parameter class should inherit `struct ANN::AnnSearchParam`. Take `class HnswLib` as an example, its definition is: + +.. code-block:: c++ + template + class HnswLib : public ANN { + public: + struct BuildParam { + int M; + int ef_construction; + int num_threads; + }; + + using typename ANN::AnnSearchParam; + struct SearchParam : public AnnSearchParam { + int ef; + int num_threads; + }; + + // ... + }; + + +The benchmark program uses JSON format natively in a configuration file to specify indexes to build, along with the build and search parameters. However the JSON config files are overly verbose and are not meant to be used directly. Instead, the Python scripts parse YAML and create these json files automatically. It's important to realize that these json objects align with the yaml objects for `build_param`, whose value is a JSON object, and `search_param`, whose value is an array of JSON objects. Take the json configuration for `HnswLib` as an example of the json after it's been parsed from yaml: + +.. code-block:: json + { + "name" : "hnswlib.M12.ef500.th32", + "algo" : "hnswlib", + "build_param": {"M":12, "efConstruction":500, "numThreads":32}, + "file" : "/path/to/file", + "search_params" : [ + {"ef":10, "numThreads":1}, + {"ef":20, "numThreads":1}, + {"ef":40, "numThreads":1}, + ], + "search_result_file" : "/path/to/file" + }, + +The build and search params are ultimately passed to the C++ layer as json objects for each param configuration to benchmark. The code below shows how to parse these params for `Hnswlib`: + +1. First, add two functions for parsing JSON object to `struct BuildParam` and `struct SearchParam`, respectively: + +.. code-block:: c++ + + template + void parse_build_param(const nlohmann::json& conf, + typename cuann::HnswLib::BuildParam& param) { + param.ef_construction = conf.at("efConstruction"); + param.M = conf.at("M"); + if (conf.contains("numThreads")) { + param.num_threads = conf.at("numThreads"); + } + } + + template + void parse_search_param(const nlohmann::json& conf, + typename cuann::HnswLib::SearchParam& param) { + param.ef = conf.at("ef"); + if (conf.contains("numThreads")) { + param.num_threads = conf.at("numThreads"); + } + } + + + +2. Next, add corresponding `if` case to functions `create_algo()` (in `cpp/bench/ann/) and `create_search_param()` by calling parsing functions. The string literal in `if` condition statement must be the same as the value of `algo` in configuration file. For example, + +.. code-block:: c++ + // JSON configuration file contains a line like: "algo" : "hnswlib" + if (algo == "hnswlib") { + // ... + } + +Adding a Cmake target +--------------------- + +In `cuvs/cpp/bench/ann/CMakeLists.txt`, we provide a `CMake` function to configure a new Benchmark target with the following signature: + + +.. code-block:: cmake + ConfigureAnnBench( + NAME + PATH + INCLUDES + CXXFLAGS + LINKS + ) + +To add a target for `HNSWLIB`, we would call the function as: + +.. code-block:: cmake + + ConfigureAnnBench( + NAME HNSWLIB PATH bench/ann/src/hnswlib/hnswlib_benchmark.cpp INCLUDES + ${CMAKE_CURRENT_BINARY_DIR}/_deps/hnswlib-src/hnswlib CXXFLAGS "${HNSW_CXX_FLAGS}" + ) + +This will create an executable called `HNSWLIB_ANN_BENCH`, which can then be used to run `HNSWLIB` benchmarks. + +Add a new entry to `algos.yaml` to map the name of the algorithm to its binary executable and specify whether the algorithm requires GPU support. + +.. code-block:: yaml + cuvs_ivf_pq: + executable: CUVS_IVF_PQ_ANN_BENCH + requires_gpu: true + +`executable` : specifies the name of the binary that will build/search the index. It is assumed to be available in `cuvs/cpp/build/`. +`requires_gpu` : denotes whether an algorithm requires GPU to run. \ No newline at end of file diff --git a/docs/source/cuvs_bench/param_tuning.rst b/docs/source/cuvs_bench/param_tuning.rst new file mode 100644 index 000000000..faffa9daf --- /dev/null +++ b/docs/source/cuvs_bench/param_tuning.rst @@ -0,0 +1,674 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +cuVS Bench Parameter Tuning Guide +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This guide outlines the various parameter settings that can be specified in :doc:`cuVS Benchmarks ` yaml configuration files and explains the impact they have on corresponding algorithms to help inform their settings for benchmarking across desired levels of recall. + +cuVS Indexes +============ + +cuvs_brute_force +---------------- + +Use cuVS brute-force index for exact search. Brute-force has no further build or search parameters. + +cuvs_ivf_flat +------------- + +IVF-flat uses an inverted-file index, which partitions the vectors into a series of clusters, or lists, storing them in an interleaved format which is optimized for fast distance computation. The searching of an IVF-flat index reduces the total vectors in the index to those within some user-specified nearest clusters called probes. + +IVF-flat is a simple algorithm which won't save any space, but it provides competitive search times even at higher levels of recall. + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `nlist` + - `build` + - Y + - Positive integer >0 + - Number of clusters to partition the vectors into. Larger values will put less points into each cluster but this will impact index build time as more clusters need to be trained. + + * - `niter` + - `build` + - N + - Positive integer >0 + - 20 + - Number of kmeans iterations to use when training the ivf clusters + + * - `ratio` + - `build` + - N + - Positive integer >0 + - 2 + - `1/ratio` is the number of training points which should be used to train the clusters. + + * - `dataset_memory_type` + - `build` + - N + - [`device`, `host`, `mmap`] + - `mmap` + - Where should the dataset reside? + + * - `query_memory_type` + - `search` + - [`device`, `host`, `mmap`] + - `device` + - Where should the queries reside? + + * - `nprobe` + - `search` + - Y + - Positive integer >0 + - + - The closest number of clusters to search for each query vector. Larger values will improve recall but will search more points in the index. + +cuvs_ivf_pq +----------- + +IVF-pq is an inverted-file index, which partitions the vectors into a series of clusters, or lists, in a similar way to IVF-flat above. The difference is that IVF-PQ uses product quantization to also compress the vectors, giving the index a smaller memory footprint. Unfortunately, higher levels of compression can also shrink recall, which a refinement step can improve when the original vectors are still available. + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `nlist` + - `build` + - Y + - Positive integer >0 + - Number of clusters to partition the vectors into. Larger values will put less points into each cluster but this will impact index build time as more clusters need to be trained. + + * - `niter` + - `build` + - N + - Positive integer >0 + - 20 + - Number of kmeans iterations to use when training the ivf clusters + + * - `ratio` + - `build` + - N + - Positive integer >0 + - 2 + - `1/ratio` is the number of training points which should be used to train the clusters. + + * - `pq_dim` + - `build` + - N + - Positive integer. Multiple of 8. + - 0 + - Dimensionality of the vector after product quantization. When 0, a heuristic is used to select this value. + + * - `pq_bits` + - `build` + - N + - Positive integer [4-8] + - 8 + - Bit length of the vector element after quantization. + + * - `codebook_kind` + - `build` + - N + - [`cluster`, `subspace`] + - `subspace` + - Type of codebook. See :doc:`IVF-PQ index overview <../indexes/ivfpq>` for more detail + + * - `dataset_memory_type` + - `build` + - N + - [`device`, `host`, `mmap`] + - `mmap` + - Where should the dataset reside? + + * - `query_memory_type` + - `search` + - [`device`, `host`, `mmap`] + - `device` + - Where should the queries reside? + + * - `nprobe` + - `search` + - Y + - Positive integer >0 + - + - The closest number of clusters to search for each query vector. Larger values will improve recall but will search more points in the index. + + * - `internalDistanceDtype` + - `search` + - N + - [`float`, `half`] + - `half` + - The precision to use for the distance computations. Lower precision can increase performance at the cost of accuracy. + + * - `smemLutDtype` + - `search` + - N + - [`float`, `half`, `fp8`] + - `half` + - The precision to use for the lookup table in shared memory. Lower precision can increase performance at the cost of accuracy. + + * - `refine_ratio` + - `search` + - N + - Positive integer >0 + - 1 + - `refine_ratio * k` nearest neighbors are queried from the index initially and an additional refinement step improves recall by selecting only the best `k` neighbors. + + +cuvs_cagra +---------- + +CAGRA uses a graph-based index, which creates an intermediate, approximate kNN graph using IVF-PQ and then further refining and optimizing to create a final kNN graph. This kNN graph is used by CAGRA as an index for search. + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `graph_degree` + - `build` + - N + - Positive integer >0 + - 64 + - Degree of the final kNN graph index. + + * - `intermediate_graph_degree` + - `build` + - N + - Positive integer >0 + - 128 + - Degree of the intermediate kNN graph before the CAGRA graph is optimized + + * - `graph_build_algo` + - `build` + - `N + - [`IVF_PQ`, NN_DESCENT`] + - `IVF_PQ` + - Algorithm to use for building the initial kNN graph, from which CAGRA will optimize into the navigable CAGRA graph + + * - `dataset_memory_type` + - `build` + - N + - [`device`, `host`, `mmap`] + - `mmap` + - Where should the dataset reside? + + * - `query_memory_type` + - `search` + - [`device`, `host`, `mmap`] + - `device` + - Where should the queries reside? + + * - `itopk` + - `search` + - N + - Positive integer >0 + - 64 + - Number of intermediate search results retained during the search. Higher values improve search accuracy at the cost of speed + + * - `search_width` + - `search` + - N + - Positive integer >0 + - 1 + - Number of graph nodes to select as the starting point for the search in each iteration. + + * - `max_iterations` + - `search` + - N + - Positive integer >=0 + - 0 + - Upper limit of search iterations. Auto select when 0 + + * - `algo` + - `search` + - N + - [`auto`, `single_cta`, `multi_cta`, `multi_kernel`] + - `auto` + - Algorithm to use for search. It's usually best to leave this to `auto`. + + * - `graph_memory_type` + - `search` + - N + - [`device`, `host_pinned`, `host_huge_page`] + - `device` + - Memory type to store graph + + * - `internal_dataset_memory_type` + - `search` + - N + - [`device`, `host_pinned`, `host_huge_page`] + - `device` + - Memory type to store dataset + +The `graph_memory_type` or `internal_dataset_memory_type` options can be useful for large datasets that do not fit the device memory. Setting `internal_dataset_memory_type` other than `device` has negative impact on search speed. Using `host_huge_page` option is only supported on systems with Heterogeneous Memory Management or on platforms that natively support GPU access to system allocated memory, for example Grace Hopper. + +To fine tune CAGRA index building we can customize IVF-PQ index builder options using the following settings. These take effect only if `graph_build_algo == "IVF_PQ"`. It is recommended to experiment using a separate IVF-PQ index to find the config that gives the largest QPS for large batch. Recall does not need to be very high, since CAGRA further optimizes the kNN neighbor graph. Some of the default values are derived from the dataset size which is assumed to be [n_vecs, dim]. + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `ivf_pq_build_nlist` + - `build` + - N + - Positive integer >0 + - sqrt(n_vecs) + - Number of clusters to partition the vectors into. Larger values will put less points into each cluster but this will impact index build time as more clusters need to be trained. + + * - `ivf_pq_build_niter` + - `build` + - N + - Positive integer >0 + - 25 + - Number of k-means iterations to use when training the clusters. + + * - `ivf_pq_build_ratio` + - `build` + - N + - Positive integer >0 + - 10 + - `1/ratio` is the number of training points which should be used to train the clusters. + + * - `ivf_pq_pq_dim` + - `build` + - N + - Positive integer. Multiple of 8 + - dim/2 rounded up to 8 + - Dimensionality of the vector after product quantization. When 0, a heuristic is used to select this value. `pq_dim` * `pq_bits` must be a multiple of 8. + + * - `ivf_pq_build_pq_bits` + - `build` + - N + - Positive integer [4-8] + - 8 + - Bit length of the vector element after quantization. + + * - `ivf_pq_build_codebook_kind` + - `build` + - N + - [`cluster`, `subspace`] + - `subspace` + - Type of codebook. See :doc:`IVF-PQ index overview <../indexes/ivfpq>` for more detail + + * - `ivf_pq_build_nprobe` + - `search` + - N + - Positive integer >0 + - min(2*dim, nlist) + - The closest number of clusters to search for each query vector. Larger values will improve recall but will search more points in the index. + + * - `ivf_pq_build_internalDistanceDtype` + - `search` + - N + - [`float`, `half`] + - `half` + - The precision to use for the distance computations. Lower precision can increase performance at the cost of accuracy. + + * - `ivf_pq_build_smemLutDtype` + - `search` + - N + - [`float`, `half`, `fp8`] + - `fp8` + - The precision to use for the lookup table in shared memory. Lower precision can increase performance at the cost of accuracy. + + * - `ivf_pq_build_refine_ratio` + - `search` + - N + - Positive integer >0 + - 2 + - `refine_ratio * k` nearest neighbors are queried from the index initially and an additional refinement step improves recall by selecting only the best `k` neighbors. + +Alternatively, if `graph_build_algo == "NN_DESCENT"`, then we can customize the following parameters + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `nn_descent_niter` + - `build` + - N + - Positive integer >0 + - 20 + - Number of nn-descent iterations + + * - `nn_descent_intermediate_graph_degree + - `build` + - N + - Positive integer >0 + - `cagra.intermediate_graph_degree` * 1.5 + - Intermadiate graph degree during nn-descent iterations + + * - nn_descent_termination_threshold + - `build` + - N + - Positive float >0 + - 1e-4 + - Early stopping threshold for nn-descent convergence + +cuvs_cagra_hnswlib +------------------ + +This is a benchmark that enables interoperability between `CAGRA` built `HNSW` search. It uses the `CAGRA` built graph as the base layer of an `hnswlib` index to search queries only within the base layer (this is enabled with a simple patch to `hnswlib`). + +`build` : Same as `build` of CAGRA + +`search` : Same as `search` of Hnswlib + +FAISS Indexes +============= + +faiss_gpu_flat +-------------- + +Use FAISS flat index on the GPU, which performs an exact search using brute-force and doesn't have any further build or search parameters. + +faiss_gpu_ivf_flat +------------------ + +IVF-flat uses an inverted-file index, which partitions the vectors into a series of clusters, or lists, storing them in an interleaved format which is optimized for fast distance computation. The searching of an IVF-flat index reduces the total vectors in the index to those within some user-specified nearest clusters called probes. + +IVF-flat is a simple algorithm which won't save any space, but it provides competitive search times even at higher levels of recall. + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `nlists` + - `build` + - Y + - Positive integer >0 + - + - Number of clusters to partition the vectors into. Larger values will put less points into each cluster but this will impact index build time as more clusters need to be trained + + * - `ratio` + - `build` + - N + - Positive integer >0 + - 2 + - `1/ratio` is the number of training points which should be used to train the clusters. + + * - `nprobe` + - `search` + - Y + - Positive integer >0 + - + - The closest number of clusters to search for each query vector. Larger values will improve recall but will search more points in the index. + +faiss_gpu_ivf_pq +---------------- + +IVF-pq is an inverted-file index, which partitions the vectors into a series of clusters, or lists, in a similar way to IVF-flat above. The difference is that IVF-PQ uses product quantization to also compress the vectors, giving the index a smaller memory footprint. Unfortunately, higher levels of compression can also shrink recall, which a refinement step can improve when the original vectors are still available. + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `nlist` + - `build` + - Y + - Positive integer >0 + - + - Number of clusters to partition the vectors into. Larger values will put less points into each cluster but this will impact index build time as more clusters need to be trained. + + * - `ratio` + - `build` + - N + - Positive integer >0 + - 2 + - `1/ratio` is the number of training points which should be used to train the clusters. + + * - `M_ratio` + - `build` + - Y + - Positive integer. Power of 2 [8-64] + - + - Ratio of numbeer of chunks or subquantizers for each vector. Computed by `dims` / `M_ratio` + + * - `usePrecomputed` + - `build` + - N + - Boolean + - `false` + - Use pre-computed lookup tables to speed up search at the cost of increased memory usage. + + * - `useFloat16` + - `build` + - N + - Boolean + - `false` + - Use half-precision floats for clustering step. + + * - `nprobe` + - `search` + - Y + - Positive integer >0 + - + - The closest number of clusters to search for each query vector. Larger values will improve recall but will search more points in the index. + + * - `refine_ratio` + - `search` + - N + - Positive number >=1 + - 1 + - `refine_ratio * k` nearest neighbors are queried from the index initially and an additional refinement step improves recall by selecting only the best `k` neighbors. + + +faiss_cpu_flat +-------------- + +Use FAISS flat index on the CPU, which performs an exact search using brute-force and doesn't have any further build or search parameters. + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `numThreads` + - `search` + - N + - Positive integer >0 + - 1 + - Number of threads to use for queries. + +faiss_cpu_ivf_flat +------------------ + +Use FAISS IVF-Flat index on CPU + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `nlists` + - `build` + - Y + - Positive integer >0 + - + - Number of clusters to partition the vectors into. Larger values will put less points into each cluster but this will impact index build time as more clusters need to be trained + + * - `ratio` + - `build` + - N + - Positive integer >0 + - 2 + - `1/ratio` is the number of training points which should be used to train the clusters. + + * - `nprobe` + - `search` + - Y + - Positive integer >0 + - + - The closest number of clusters to search for each query vector. Larger values will improve recall but will search more points in the index. + + * - `numThreads` + - `search` + - N + - Positive integer >0 + - 1 + - Number of threads to use for queries. + +faiss_cpu_ivf_pq +---------------- + +Use FAISS IVF-PQ index on CPU + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `nlist` + - `build` + - Y + - Positive integer >0 + - + - Number of clusters to partition the vectors into. Larger values will put less points into each cluster but this will impact index build time as more clusters need to be trained. + + * - `ratio` + - `build` + - N + - Positive integer >0 + - 2 + - `1/ratio` is the number of training points which should be used to train the clusters. + + * - `M` + - `build` + - Y + - Positive integer. Power of 2 [8-64] + - + - Ratio of number of chunks or subquantizers for each vector. Computed by `dims` / `M_ratio` + + * - `usePrecomputed` + - `build` + - N + - Boolean + - `false` + - Use pre-computed lookup tables to speed up search at the cost of increased memory usage. + + * - `bitsPerCode` + - `build` + - N + - Positive integer [4-8] + - 8 + - Number of bits for representing each quantized code. + + * - `nprobe` + - `search` + - Y + - Positive integer >0 + - + - The closest number of clusters to search for each query vector. Larger values will improve recall but will search more points in the index. + + * - `refine_ratio` + - `search` + - N + - Positive number >=1 + - 1 + - `refine_ratio * k` nearest neighbors are queried from the index initially and an additional refinement step improves recall by selecting only the best `k` neighbors. + + * - `numThreads` + - `search` + - N + - Positive integer >0 + - 1 + - Number of threads to use for queries. + +HNSW +==== + +hnswlib +------- + +.. list-table:: + + * - Parameter + - Type + - Required + - Data Type + - Default + - Description + + * - `efConstruction` + - `build` + - Y + - Positive integer >0 + - + - Controls index time and accuracy. Bigger values increase the index quality. At some point, increasing this will no longer improve the quality. + + * - `M` + - `build` + - Y + - Positive integer. Often between 2-100 + - + - umber of bi-directional links create for every new element during construction. Higher values work for higher intrinsic dimensionality and/or high recall, low values can work for datasets with low intrinsic dimensionality and/or low recalls. Also affects the algorithm's memory consumption. + + * - `numThreads` + - `build` + - N + - Positive integer >0 + - 1 + - Number of threads to use to build the index. + + * - `ef` + - `search` + - Y + - Positive integer >0 + - + - Size of the dynamic list for the nearest neighbors used for search. Higher value leads to more accurate but slower search. Cannot be lower than `k`. + + * - `numThreads` + - `search` + - N + - Positive integer >0 + - 1 + - Number of threads to use for queries. + +Please refer to `HNSW algorithm parameters guide `_ from `hnswlib` to learn more about these arguments. \ No newline at end of file diff --git a/docs/source/cuvs_bench/wiki_all_dataset.rst b/docs/source/cuvs_bench/wiki_all_dataset.rst new file mode 100644 index 000000000..04ac7d9a4 --- /dev/null +++ b/docs/source/cuvs_bench/wiki_all_dataset.rst @@ -0,0 +1,55 @@ +~~~~~~~~~~~~~~~~ +Wiki-all Dataset +~~~~~~~~~~~~~~~~ + + +The `wiki-all` dataset was created to stress vector search algorithms at scale with both a large number of vectors and dimensions. The entire dataset contains 88M vectors with 768 dimensions and is meant for testing the types of vectors one would typically encounter in retrieval augmented generation (RAG) workloads. The full dataset is ~251GB in size, which is intentionally larger than the typical memory of GPUs. The massive scale is intended to promote the use of compression and efficient out-of-core methods for both indexing and search. + +The dataset is composed of English wiki texts from `Kaggle `_ and multi-lingual wiki texts from `Cohere Wikipedia `_. + +Cohere's English Texts are older (2022) and smaller than the Kaggle English Wiki texts (2023) so the English texts have been removed from Cohere completely. The final Wiki texts include English Wiki from Kaggle and the other languages from Cohere. The English texts constitute 50% of the total text size. + +To form the final dataset, the Wiki texts were chunked into 85 million 128-token pieces. For reference, Cohere chunks Wiki texts into 104-token pieces. Finally, the embeddings of each chunk were computed using the `paraphrase-multilingual-mpnet-base-v2 `_ embedding model. The resulting dataset is an embedding matrix of size 88 million by 768. Also included with the dataset is a query file containing 10k query vectors and a groundtruth file to evaluate nearest neighbors algorithms. + +Getting the dataset +=================== + +Full dataset +------------ + +A version of the dataset is made available in the binary format that can be used directly by the :doc:`cuvs-bench ` 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: + +.. code-block:: bash + curl -s https://data.rapids.ai/raft/datasets/wiki_all/wiki_all.tar.{00..9} | tar -xf - -C wiki_all_88M/ + +The above has the unfortunate drawback that if the command should fail for any reason, all the parts need to be re-downloaded. The files can also be downloaded individually and then untarred to the directory. Each file is ~27GB and there are 10 of them. + +.. code-block:: bash + + curl -s https://data.rapids.ai/raft/datasets/wiki_all/wiki_all.tar.00 + ... + curl -s https://data.rapids.ai/raft/datasets/wiki_all/wiki_all.tar.09 + + cat wiki_all.tar.* | tar -xf - -C wiki_all_88M/ + +1M and 10M subsets +------------------ + +Also available are 1M and 10M subsets of the full dataset which are 2.9GB and 29GB, respectively. These subsets also include query sets of 10k vectors and corresponding groundtruth files. + +.. code-block:: bash + + curl -s https://data.rapids.ai/raft/datasets/wiki_all_1M/wiki_all_1M.tar + curl -s https://data.rapids.ai/raft/datasets/wiki_all_10M/wiki_all_10M.tar + +Using the dataset +================= + +After the dataset is downloaded and extracted to the `wiki_all_88M` directory (or `wiki_all_1M`/`wiki_all_10M` depending on whether the subsets are used), the files can be used in the benchmarking tool. The dataset name is `wiki_all` (or `wiki_all_1M`/`wiki_all_10M`), and the benchmarking tool can be used by specifying the appropriate name `--dataset wiki_all_88M` in the scripts. + +License info +============ + +The English wiki texts available on Kaggle come with the `CC BY-NCSA 4.0 `_ license and the Cohere wikipedia data set comes with the `Apache 2.0 `_ license. \ No newline at end of file diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 79b35c2d5..fa38c45ee 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -1,12 +1,120 @@ +~~~~~~~~~~~~~~~ Getting Started +~~~~~~~~~~~~~~~ + +- `New to vector search?`_ + + * :doc:`Primer on vector search ` + + * :doc:`Vector search indexes vs vector databases ` + + * :doc:`Index tuning guide ` + + * :doc:`Comparing vector search index performance ` + +- `Supported indexes`_ + + * :doc:`Vector search index guide ` + +- `Using cuVS APIs`_ + + * :doc:`C API Docs ` + + * :doc:`C++ API Docs ` + + * :doc:`Python API Docs ` + + * :doc:`Rust API Docs ` + + * :doc:`API basics ` + + * :doc:`API interoperability ` + +- `Where to next?`_ + + * `Social media`_ + + * `Blogs`_ + + * `Research`_ + + * `Get involved`_ + +New to vector search? +===================== + +If you are unfamiliar with the basics of vector search or how vector search differs from vector databases, then :doc:`this primer on vector search guide ` should provide some good insight. Another good resource for the uninitiated is our :doc:`vector databases vs vector search ` guide. As outlined in the primer, vector search as used in vector databases is often closer to machine learning than to traditional databases. This means that while traditional databases can often be slow without any performance tuning, they will usually still yield the correct results. Unfortunately, vector search indexes, like other machine learning models, can yield garbage results of not tuned correctly. + +Fortunately, this opens up the whole world of hyperparamer optimization to improve vector search performance and quality. Please see our :doc:`index tuning guide ` for more information. + +When comparing the performance of vector search indexes, it is important that considerations are made with respect to three main dimensions: + +#. Build time +#. Search quality +#. Search performance + +Please see the :doc:`primer on comparing vector search index performance ` for more information on methodologies and how to make a fair apples-to-apples comparison during your evaluations. + +Supported indexes +================= + +cuVS supports many of the standard index types with the list continuing to grow and stay current with the state-of-the-art. Please refer to our :doc:`vector search index guide ` for to learn more about each individual index type, when they can be useful on the GPU, the tuning knobs they offer to trade off performance and quality. + +The primary goal of cuVS is to enable speed, scale, and flexibility (in that order)- and one of the important value propositions is to enhance existing software deployments with extensible GPU capabilities to improve pain points while not interrupting parts of the system that work well today with CPU. + + +Using cuVS APIs =============== -This guide provides an initial starting point of the basic concepts and using the various APIs in the cuVS software development kit. +cuVS is a C++ library at its core, which is wrapped with a C library and exposed further through various different languages. cuVS currently provides APIs and documentation for :doc:`C `, :doc:`C++ `, :doc:`Python `, and :doc:`Rust ` with more languages in the works. our :doc:`API basics ` provides some background and context about the important paradigms and vocabulary types you'll encounter when working with cuVS types. + +Please refer to the :doc:`guide on API interoperability ` for more information on how cuVS can work seamlessly with other libraries like numpy, cupy, tensorflow, and pytorch, even without having to copy device memory. + + +Where to next? +============== + +cuVS is free and open source software, licesed under Apache 2.0 Once you are familiar with and/or have used cuVS, you can access the developer community most easily through `Github `_. Please open Github issues for any bugs, questions or feature requests. + +Social media +------------ + +You can access the RAPIDS community through `Slack `_ , `Stack Overflow `_ and `X `_ + +Blogs +----- + +We frequently publish blogs on GPU-enabled vector search, which can provide great deep dives into various important topics and breakthroughs: + +#. `Accelerated Vector Search: Approximating with cuVS IVF-Flat `_ +#. `Accelerating Vector Search with cuVS IVF-PQ `_ + +Research +-------- + +For the interested reader, many of the accelerated implementations in cuVS are also based on research papers which can provide a lot more background. We also ask you to please cite the corresponding algorithms by referencing them in your own research. + +#. `CAGRA: Highly Parallel Graph Construction and Approximate Nearest Neighbor Search `_ +#. `Top-K Algorithms on GPU: A Comprehensive Study and New Methods `_ +#. `Fast K-NN Graph Construction by GPU Based NN-Descent `_ +#. `cuSLINK: Single-linkage Agglomerative Clustering on the GPU `_ +#. `GPU Semiring Primitives for Sparse Neighborhood Methods `_ + + +Get involved +------------ + +We always welcome patches for new features and bug fixes. Please read our `contributing guide `_ for more information on contributing patches to cuVS. + + .. toctree:: - :maxdepth: 1 - :caption: Contents: - - basics.rst - interoperability.rst - working_with_ann_indexes.rst \ No newline at end of file + :hidden: + + choosing_and_configuring_indexes.rst + vector_databases_vs_vector_search.rst + tuning_guide.rst + comparing_indexes.rst + indexes/indexes.rst + api_basics.rst + api_interoperability.rst \ No newline at end of file diff --git a/docs/source/images/build_benchmarks.png b/docs/source/images/build_benchmarks.png new file mode 100644 index 0000000000000000000000000000000000000000..e9596b4894e1ce5211bd35407ab3a8e7667e2f9a GIT binary patch literal 43332 zcmeFZc{G;o|1PY#MN^ZX3QaeR*R@=;Mz*htr|C#%Lcyq=eaW-rZo+0$xH&xhNZE!iEPb}m@Tj)qmc?GMu~ zm3tz4-YBFurA1weqTciCyGT;qK+@@TQVf#5u`!)ScwjU! zk%K9IZRZ(+}CY1f6vkIHH9&TF&1r( z?fx;h^hMQ9hr)Pf^S%e$&TO_eNh}&$hrg`;YeN5g=V9W@_*cU7_3r=q(C7aze0gfd zji&pDa{)(zE`yxvJFOIM-(P2nlqvQSk@PgoejEHs@y{_$mh$+a`BW;m@BLE!)9MZV zq8hnx>qi{wM7Ab3m<0O7-?q!sp?RZmG|4%wLoKQ|oMUm+_@@85Q(4qf{nQ&7pQ8(j z_4}0NBe_&?0Kd)a%sn+8uc}^sS6B9+^2sxvMWpn~&!1^iH2mu7RJ$i;w=jq*pP|^B zWUw7Qdi1+V#{Mi-rVV**N_)5MWvB0%a!zeF)0@l7YvaSW)p&N6m6x-!v#)=l&6l2= z>)T+`TOB4myR@9({xtr!VY+5!X6Cq)q<=twpn!nY@O0VKYmH=OIwyw9OdAsF&vOO8 zpbVvEWXK)Zep6q+d-u+YEyTt@+;wqnQRst-uggPvE8*u3+^_Bb*fWv;ZcO-oa*)jO zvw{Mt_B;K1^i!L}4vilTt#bWcr(h_=s-`Z*^od22k4&kWofQw|*CW~4G3B)_hZN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CIrfSgsZ{(p`|35hL{C}heetlDkPV}-(mge{t{O86M L8S#|Mnos^OLj>tJ literal 0 HcmV?d00001 diff --git a/docs/source/images/index_recalls.png b/docs/source/images/index_recalls.png new file mode 100644 index 0000000000000000000000000000000000000000..5e1bbda55a2b85e670c9e98ab294a2616c01de37 GIT binary patch literal 148929 zcmeFYRaBc@)G%0u7AeKuihFT~BE_Y+LveT4lv1F0aknDDDFkfWF{^?bY0 zdn%v3a+j3XeDm}Rcw_PNsZH$hS=U3u*~-J))XnmlwUe`>C7Zjso28|byN$EQ@ykxJ zr%7!8CP}$jntIqeJ5g!cI$A!{^t7bn;-S*8bfMz<_*D5QD8$Vx#LY(~p-lBzTJy(@ z^V2b?p2LwEL(eMPA_zwKBlLSC|S`bYrc5P``+)k9bHZMkpbnrY0ok{6X%xy^;2l9|!d6j+*GrtJl@dw{E#B`scy!SAwlsxHBT4%;F^V zH`G7gOa3c9f4cT2{Pce|dy$IYRsOFLng753AB6tD3WxraC(PepCJCof!T{lY!m(>@ z`{fs!4!0jU#FxqO0pGppm8g2kKWwa!N&PB%gMNnjNUQ?ZNa_8=x7#Q2Y9SN>A!H)rpi{n5sZ?mFFii?L>0@m z)J1t4XDie?3(7Q^*I2?Lawbx{t@y zD-sO3-ax49UA(XBODP?5x!}EoY3q zLc|vHsH$8XFNK0w4cjS;9y&uKeo?q*V8Q$ny$%;9Is*M=q60E%2+beQ0(g{r_9$f* z*|XnXoKXp~#g|9yHWq29pvv-bY@7}}d@k3n+*x#f!{U{Fi+pC-EGJfSxD;|tr$&RKJ~EvGR8OrA?U2d3{c9-=p={%1 zMiW)#2PcrisO#1WH-n%|`;}bM8INztTlA|H?Xl?d&axD(7s;|iBz7l2Kc8SkZj-?cUi|252uCf7oWEwzuDW11XMP5^P+RAPrdZ^4wn$xnW zbWA2H)ovP)B!r)u0#LR(sj(F4XRc*mdG65l^rrvGo{|i zG|!Gw6tP-iO$V*&dS1%lZe{WoH=cd;Ei-lo0F#ERt~k;w6z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wD)`uP_AHye1A<6K`x~p+g>jR2-6#2)(MURMRj|L(==(6=J3RC z5fhM6Ma&rRo6I~3I6XUaZWYsI%a@W0GZ#FhjTt|r=j?oG{Q5o6i|?{_uhZ(0{=ZmP z^We>5%SZq+?UNlT1qQ46g?D2Fjmgt}Nw`n@Nxa>=tQu9CjCQaL8~?@Rk+>vX3EJIf zD@t0?I@~UaKr0(cHG;*WK1z0eb%6YnG1qVZv7|9*rQ*H~(EqywF=%aKpZ&!M|3TaS dpSDLH(M9g&gRbL~R#1>Xd1)1?YDtse{{zdI>z@Ds literal 0 HcmV?d00001 diff --git a/docs/source/images/recall_buckets.png b/docs/source/images/recall_buckets.png new file mode 100644 index 0000000000000000000000000000000000000000..3589e4e6ea94f7ddf9afb2061c0374a7673b5338 GIT binary patch literal 70402 zcmeFYRa6{X)HO;Vf#4yyhY;M|X(YG>cXxNU00}O^9fG^NySvjsBaJ(aO9MaWobMa= z`G2|h<@Q7Mu02-OsM>4oz1Ez2R@e`D2~;EkBp4VNR4K{tN-!{RelRfaRzAYN_2~1Z z54`=ocNURS`S|wp`DhaQc8>2Nrs1M&Z|34|=wu3GZf9?6%HVA5WNK>XY+>(m4%a34 zX2kH1k*JfYp^K%x-4_*0TT>VnSJN-7>|c~k9lo$KzcrY7c-c63Ihel)%Y701uELT> ziU0%i1xD(-u!={<3CP?7TWqx(@|u;j4u|;b*Sa_27r8&tKY#uVWydIxjAcaEE&WiF zr}2jpC+$l(RxItT_qmiL?BQ;HhO^r`dRV~6aD~r_TvN|&l|I8~Cnw`)Jl?nKshKkg zN=RhCK8bvMJN!=C+F<qS@qRy@fN!UC`d0;+XxyGZZlQybl;7C#9k8ekPS4A z-f6ZFk9kGE<12s-C5!1x$he1kd+?xNe2N36r~H$Ml-h)Pk?>yKD$I$U|<{=lH`>njg22!4%`DuT}^Y=JV#MY56* zz5=B`X?SB>+eI4JyXq&PnkcWtz}KzWccVQm+fSMg18(bH&hMxPfcl(}IR^VZ+4PI4 zWQl*m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1VJL2Gh=U3k~9q7J=Y$9x%e zbgf*`_h$msw||a(27g@ekcT28BD|Eu5Y5A+$D`T)yZ{qzeCB$3a^xE@AOYLCdl1%V z!>m#dXGaQo9^8ZF*j#p$Dbe$WD%mK46C*I_jhMYILC^bVX01mp4i^qO!~9tZ+%-nc zrsppa0&Db%V1EQKD5{$|Qo<#~UwnDfwBNh$f_?M~xVkpc$;nC03I#xL9FP0<59VhJ z*r`v<^5Mlsmx>kHozHWBY^zQ)A{3<8FGIAO;uc^7b-$hX37RaBUrG+dH`{9kPVyoF zAOtfs$Ao4Mn!Gq%6dbgihhOkD<{Fd(!p|o6aCU6l*#t{`WgX$pe75F=2#3T+FwnNN z)LrkJdFY9&+wqnEKyTo>mya&^F@XJ)lEiylGy8+K>c3#gH3CbfP!}dy^S-w{#-`. + +There are several benefits to using cuVS and GPUs for vector search, including + +#. Fast index build +#. Latency critical and high throughput search +#. Parameter tuning +#. Cost savings +#. Interoperability (build on GPU, deploy on CPU) +#. Multiple language support +#. Building blocks for composing new or accelerating existing algorithms + Useful Resources ################ .. _cuvs_reference: https://docs.rapids.ai/api/cuvs/stable/ -- `Example Notebooks `_: Self-contained Code examples +- `Example Notebooks `_: Example notebooks +- `Code Examples `_: Self-contained code examples - `RAPIDS Community `_: Get help, contribute, and collaborate. - `GitHub repository `_: Download the cuVS source code. - `Issue tracker `_: Report issues or request features. -What is cuVS? -############# - -cuVS is a library for vector search and clustering on the GPU. +Contents +######## .. toctree:: - :maxdepth: 1 - :caption: Contents: + :maxdepth: 4 + build.rst getting_started.rst - build.md integrations.rst + cuvs_bench/index.rst api_docs.rst contributing.md - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/source/indexes/bruteforce.rst b/docs/source/indexes/bruteforce.rst new file mode 100644 index 000000000..0bd17dbf1 --- /dev/null +++ b/docs/source/indexes/bruteforce.rst @@ -0,0 +1,62 @@ +Brute-force +=========== + +Brute-force, or flat index, is the most simple index type, as it ultimately boils down to an exhaustive matrix multiplication. + +While it scales with :math:`O(N^2*D)`, brute-force can be a great choice when + +1. exact nearest neighbors are required, and +2. when the number of vectors is relatively small (a few thousand to a few million) + +Brute-force can also be a good choice for heavily filtered queries where other algorithms might struggle returning the expected results. For example, +when filtering out 90%-95% of the vectors from a search, the IVF methods could struggle to return anything at all with smaller number of probes and +graph-based algorithms with limited hash table memory could end up skipping over important unfiltered entries. + +[ :doc:`C API <../c_api/neighbors_bruteforce_c>` | :doc:`C++ API <../cpp_api/neighbors_bruteforce>` | :doc:`Python API <../python_api/neighbors_bruteforce>` | :doc:`Rust API <../rust_api/index>` ] + +Filtering considerations +------------------------ + +Because it is exhaustive, brute-force can quickly become the slowest, albeit most accurate form of search. However, even +when the number of vectors in an index are very large, brute-force can still be used to search vectors efficiently with a filter. + +This is especially true for cases where the filter is excluding 90%-99% of the vectors in the index where the partitioning +inherent in other approximate algorithms would simply not include expected vectors in the results. In the case of pre-filtered +brute-force, the computation is inverted so distances are only computed between vectors that pass the filter, significantly reducing +the amount of computation required. + +Configuration parameters +------------------------ + +Build parameters +~~~~~~~~~~~~~~~~ + +None + +Search Parameters +~~~~~~~~~~~~~~~~~ + +None + + +Tuning Considerations +--------------------- + +Brute-force is exact but that doesn't always mean it's deterministic. For example, when there are many nearest neighbors with +the same distances it's possible they might be ordered differently across different runs. This especially becomes apparent in +cases where there are points with the same distance right near the cutoff of `k`, which can cause the final list of neighbors +to differ from ground truth. This is not often a problem in practice and can usually be mitigated by increasing `k`. + + +Memory footprint +---------------- + +:math:`precision` is the number of bytes in each element of each vector (e.g. 32-bit = 4-bytes) + + +Index footprint +~~~~~~~~~~~~~~~ + +Raw vectors: :math:`n_vectors * n_dimensions * precision` + +Vector norms (for distances which require them): :math:`n_vectors * precision` diff --git a/docs/source/indexes/cagra.rst b/docs/source/indexes/cagra.rst new file mode 100644 index 000000000..de8821e74 --- /dev/null +++ b/docs/source/indexes/cagra.rst @@ -0,0 +1,149 @@ +CAGRA +===== + +CAGRA, or (C)UDA (A)NN (GRA)ph-based, is a graph-based index that is based loosely on the popular navigable small-world graph (NSG) algorithm, but which has been +built from the ground-up specifically for the GPU. CAGRA constructs a flat graph representation by first building a kNN graph +of the training points and then removing redundant paths between neighbors. + +The CAGRA algorithm has two basic steps- +* 1. Construct a kNN graph +* 2. Prune redundant routes from the kNN graph. + +I-force could be used to construct the initial kNN graph. This would yield the most accurate graph but would be very slow and +we find that in practice the kNN graph does not need to be very accurate since the pruning step helps to boost the overall recall of +the index. cuVS provides IVF-PQ and NN-Descent strategies for building the initial kNN graph and these can be selected in index params object during index construction. + +[ :doc:`C API <../c_api/neighbors_cagra_c>` | :doc:`C++ API <../cpp_api/neighbors_cagra>` | :doc:`Python API <../python_api/neighbors_cagra>` | :doc:`Rust API <../rust_api/index>` ] + +Interoperability with HNSW +-------------------------- + +cuVS provides the capability to convert a CAGRA graph to an HNSW graph, which enables the GPU to be used only for building the index +while the CPU can be leveraged for search. + +Filtering considerations +------------------------ + +CAGRA supports filtered search which can work well for moderately small filters (such as filtering out only a small percentage of the vectors in the index (e.g. <<50%). + +When a filter is expected to remove 80%-99% of the vectors in the index, it is preferred to use brute-force with pre-filtering instead, as that will compute only those distances +between the vectors not being filtered out. By default, CAGRA will pass the filter to the pre-filtered brute-force when the number of vevtors being filtered out is >90% of the vectors in the index. + +Configuration parameters +------------------------ + +Build parameters +~~~~~~~~~~~~~~~~ + +.. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - Name + - Default + - Description + * - compression + - None + - For large datasets, the raw vectors can be compressed using product quantization so they can be placed on device. This comes at the cost of lowering recall, though a refinement reranking step can be used to make up the lost recall after search. + * - graph_build_algo + - 'IVF_PQ' + - The graph build algorithm to use for building + * - graph_build_params + - None + - Specify explicit build parameters for the corresponding graph build algorithms + * - graph_degree + - 32 + - The degree of the final CAGRA graph. All vertices in the graph will have this degree. During search, a larger graph degree allows for more exploration of the search space and improves recall but at the expense of searching more vertices. + * - intermediate_graph_degree + - 64 + - The degree of the initial knn graph before it is optimized into the final CAGRA graph. A larger value increases connectivity of the initial graph so that it performs better once pruned. Larger values come at the cost of increased device memory usage and increases the time of initial knn graph construction. + * - guarantee_connectivity + - False + - Uses a degree-constrained minimum spanning tree to guarantee the initial knn graph is connected. This can improve recall on some datasets. + * - attach_data_on_build + - True + - Should the dataset be attached to the index after the index is built? Setting this to `False` can improve memory usage and performance, for example if the graph is being serialized to disk or converted to HNSW right after building it. + +Search parameters +~~~~~~~~~~~~~~~~~ + +.. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - Name + - Default + - Description + * - itopk_size + - 64 + - Number of intermediate search results retained during search. This value needs to be >=k. This is the main knob to tweak search performance. + * - max_iterations + - 0 + - The maximum number of iterations during search. Default is to auto-select. + * - max_queries + - 0 + - Max number of search queries to perform concurrently (batch size). Default is to auto-select. + * - team_size + - 0 + - Number of CUDA threads for calculating each distance. Can be 4, 8, 16, or 32. Default is to auto-select. + * - search_width + - 1 + - Number of vertices to select as the starting point for the search in each iteration. + * - min_iterations + - 0 + - Minimum number of search iterations to perform + +Tuning Considerations +--------------------- + +The 3 hyper-parameters that are most often tuned are `graph_degree`, `intermediate_graph_degree`, and `itopk_size`. + +Memory footprint +---------------- + +CAGRA builds a graph that ultimately ends up on the host while it needs to keep the original dataset around (can be on host or device). + +IVFPQ or NN-DESCENT can be used to build the graph (additions to the peak memory usage calculated as in the respective build algo above). + +Dataset on device (graph on host): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Index memory footprint (device): :math:`n_index_vectors * n_dims * sizeof(T)` + +Index memory footprint (host): :math:`graph_degree * n_index_vectors * sizeof(T)`` + +Dataset on host (graph on host): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Index memory footprint (host): :math:`n_index_vectors * n_dims * sizeof(T) + graph_degree * n_index_vectors * sizeof(T)` + +Build peak memory usage: +~~~~~~~~~~~~~~~~~~~~~~~~ + +When built using NN-descent / IVF-PQ, the build process consists of two phases: (1) building an initial/(intermediate) graph and then (2) optimizing the graph. Key input parameters are n_vectors, intermediate_graph_degree, graph_degree. +The memory usage in the first phase (building) depends on the chosen method. The biggest allocation is the graph (n_vectors*intermediate_graph_degree), but it’s stored in the host memory. +Usually, the second phase (optimize) uses the most device memory. The peak memory usage is achieved during the pruning step (graph_core.cuh/optimize) +Optimize: formula for peak memory usage (device): :math:`n_vectors * (4 + (sizeof(IdxT) + 1) * intermediate_degree)`` + +Build with out-of-core IVF-PQ peak memory usage: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Out-of-core CAGA build consists of IVF-PQ build, IVF-PQ search, CAGRA optimization. Note that these steps are performed sequentially, so they are not additive. + +IVF-PQ Build: + +.. math:: + + n_vectors / train_set_ratio * dim * sizeof(float) // trainset, may be in managed mem + + n_vectors / train_set_ratio * sizeof(uint32_t) // labels, may be in managed mem + + n_clusters * n_dim * sizeof(float) // cluster centers + +IVF-PQ Search (max batch size 1024 vectors on device at a time): + +.. math:: + + [n_vectors * (pq_dim * pq_bits / 8 + sizeof(int64_t)) + O(n_clusters)] + + [batch_size * n_dim * sizeof(float)] + [batch_size * intermediate_degree * sizeof(uint32_t)] + + [batch_size * intermediate_degree * sizeof(float)] + + diff --git a/docs/source/indexes/indexes.rst b/docs/source/indexes/indexes.rst new file mode 100644 index 000000000..a2fb1434a --- /dev/null +++ b/docs/source/indexes/indexes.rst @@ -0,0 +1,19 @@ +Nearest Neighbor Indexes +======================== + +.. toctree:: + :maxdepth: 3 + :caption: Contents: + + bruteforce.rst + cagra.rst + ivfflat.rst + ivfpq.rst + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` \ No newline at end of file diff --git a/docs/source/indexes/ivfflat.rst b/docs/source/indexes/ivfflat.rst new file mode 100644 index 000000000..14dd1798c --- /dev/null +++ b/docs/source/indexes/ivfflat.rst @@ -0,0 +1,116 @@ +IVF-Flat +======== + +IVF-Flat is an inverted file index (IVF) algorithm, which in the context of nearest neighbors means that data points are +partitioned into clusters. At search time, brute-force is performed only in a (user-defined) subset of the closest clusters. +In practice, this algorithm can search the index much faster than brute-force and often still maintain an acceptable +recall, though this comes with the drawback that the index itself copies the original training vectors into a memory layout +that is optimized for fast memory reads and adds some additional memory storage overheads. Once the index is trained, +this algorithm no longer requires the original raw training vectors. + +IVF-Flat tends to be a great choice when + +1. like brute-force, there is enough device memory available to fit all of the vectors +in the index, and +2. exact recall is not needed. as with the other index types, the tuning parameters are used to trade-off recall for search latency / throughput. + +[ :doc:`C API <../c_api/neighbors_ivf_flat_c>` | :doc:`C++ API <../cpp_api/neighbors_ivf_flat>` | :doc:`Python API <../python_api/neighbors_ivf_flat>` | :doc:`Rust API <../rust_api/index>` ] + +Filtering considerations +------------------------ + +IVF methods only apply filters to the lists which are probed for each query point. As a result, the results of a filtered query will likely differ signficiantly from the results of a filtering applid to an exact method like brute-force. For example. imagine you have 3 IVF lists each containing 2 vectors and you perform a query against only the closest 2 lists but you filter out all but 1 element. If that remaining element happens to be in one of the lists which was not proved, it will not be considered at all in the search results. It's important to consider this when using any of the IVF methods in your applications. + + +Configuration parameters +------------------------ + +Build parameters +~~~~~~~~~~~~~~~~ + +.. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - Name + - Default + - Description + * - n_lists + - sqrt(n) + - Number of coarse clusters used to partition the index. A good heuristic for this value is sqrt(n_vectors_in_index) + * - add_data_on_build + - True + - Should the training points be added to the index after the index is built? + * - kmeans_train_iters + - 20 + - Max number of iterations for k-means training before convergence is assumed. Note that convergence could happen before this number of iterations. + * - kmeans_trainset_fraction + - 0.5 + - Fraction of points that should be subsampled from the original dataset to train the k-means clusters. Default is 1/2 the training dataset. This can often be reduced for very large datasets to improve both cluster quality and the build time. + * - adaptive_centers + - false + - Should the existing trained centroids adapt to new points that are added to the index? This provides a trade-off between improving recall at the expense of having to compute new centroids for clusters when new points are added. When points are added in large batches, the performance cost may not be noticeable. + * - conservative_memory_allocation + - false + - To support dynamic indexes, where points are expected to be added later, the individual IVF lists can be imtentionally overallocated up front to reduce the amount and impact of increasing list sizes, which requires allocating more memory and copying the old list to the new, larger, list. + + +Search parameters +~~~~~~~~~~~~~~~~~ + +.. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - Name + - Default + - Description + * - n_probes + - 20 + - Number of closest IVF lists to scan for each query point. + +Tuning Considerations +--------------------- + +Since IVF methods use clustering to establish spatial locality and partition data points into individual lists, there's an inherent +assumption that the number of lists, and thus the max size of the data in the index is known up front. For some use-cases, this +might not matter. For example, most vector databases build many smaller physical approximate nearest neighbors indexes, each from +fixed-size or maximum-sized immutable segments and so the number of lists can be tuned based on the number of vectors in the indexes. + +Empirically, we've found :math:`\sqrt{n\_index\_vectors}` to be a good starting point for the :math:`n\_lists` hyper-parameter. Remember, having more +lists means less points to search within each list, but it could also mean more :math:`n\_probes` are needed at search time to reach an acceptable +recall. + + +Memory footprint +---------------- + +Each cluster is padded to at least 32 vectors (but potentially up to 1024). Assuming uniform random distribution of vectors/list, we would have +:math:`cluster\_overhead = (conservative\_memory\_allocation ? 16 : 512 ) * dim * sizeof_{float})` + +Note that each cluster is allocated as a separate allocation. If we use a `cuda_memory_resource`, that would grab memory in 1 MiB chunks, so on average we might have 0.5 MiB overhead per cluster. If we us 10s of thousands of clusters, it becomes essential to use pool allocator to avoid this overhead. + +:math:`cluster\_overhead = 0.5 MiB` // if we do not use pool allocator + + +Index (device memory): +~~~~~~~~~~~~~~~~~~~~~~ + +.. math:: + + n\_vectors * n\_dimensions * sizeof(T) + + + n\_vectors * sizeof(int_type) + + + n\_clusters * n\_dimensions * sizeof(T) + + + n\_clusters * cluster_overhead` + + +Peak device memory usage for index build: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:math:`workspace = min(1GB, n\_queries * [(n\_lists + 1 + n\_probes * (k + 1)) * sizeof_{float}) + n\_probes * k * sizeof_{idx}])` + +:math:`index\_size + workspace` + diff --git a/docs/source/indexes/ivfpq.rst b/docs/source/indexes/ivfpq.rst new file mode 100644 index 000000000..e4bd81395 --- /dev/null +++ b/docs/source/indexes/ivfpq.rst @@ -0,0 +1,140 @@ +IVF-PQ +====== + +IVF-PQ is an inverted file index (IVF) algorithm, which is an extension to the IVF-Flat algorithm (e.g. data points are first +partitioned into clusters) where product quantization is performed within each cluster in order to shrink the memory footprint +of the index. Product quantization is a lossy compression method and it is capable of storing larger number of vectors +on the GPU by offloading the original vectors to main memory, however higher compression levels often lead to reduced recall. +Often a strategy called refinement reranking is employed to make up for the lost recall by querying the IVF-PQ index for a larger +`k` than desired and performing a reordering and reduction to `k` based on the distances from the unquantized vectors. Unfortunately, +this does mean that the unquantized raw vectors need to be available and often this can be done efficiently using multiple CPU threads. + +[ :doc:`C API <../c_api/neighbors_ivf_pq_c>` | :doc:`C++ API <../cpp_api/neighbors_ivf_pq>` | :doc:`Python API <../python_api/neighbors_ivf_pq>` | :doc:`Rust API <../rust_api/index>` ] + + +Configuration parameters +------------------------ + +Build parameters +~~~~~~~~~~~~~~~~ + +.. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - Name + - Default + - Description + * - n_lists + - sqrt(n) + - Number of coarse clusters used to partition the index. A good heuristic for this value is sqrt(n_vectors_in_index) + * - kmeans_n_iters + - 20 + - The number of iterations when searching for k-means centers + * - kmeans_trainset_fraction + - 0.5 + - The fraction of training data to use for iterative k-means building + * - pq_bits + - 8 + - The bit length of each vector element after compressing with PQ. Possible values are any integer between 4 and 8. + * - pq_dim + - 0 + - The dimensionality of each vector after compressing with PQ. When 0, the dim is set heuristically. + * - codebook_kind + - per_subspace + - How codebooks are created. `per_subspace` trains kmeans on some number of sub-dimensions while `per_cluster` + * - force_random_rotation + - false + - Apply a random rotation matrix on the input data and queries even if `dim % pq_dim == 0` + * - conservative_memory_allocation + - false + - To support dynamic indexes, where points are expected to be added later, the individual IVF lists can be imtentionally overallocated up front to reduce the amount and impact of increasing list sizes, which requires allocating more memory and copying the old list to the new, larger, list. + * - add_data_on_build + - True + - Should the training points be added to the index after the index is built? + * - max_train_points_per_pq_code + - 256 + - The max number of data points to use per PQ code during PQ codebook training. + + +Search parameters +~~~~~~~~~~~~~~~~ + +.. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - Name + - Default + - Description + * - n_probes + - 20 + - Number of closest IVF lists to scan for each query point. + * - lut_dtype + - cuda_r_32f + - Datatype to store the pq lookup tables. Can also use cuda_r_16f for half-precision and cuda_r_8u for 8-bit precision. Smaller lookup tables can fit into shared memory and significantly improve search times. + * - internal_distance_dtype + - cuda_r_32f + - Storage data type for distance/similarity computed at search time. Can also use cuda_r_16f for half-precision. + * - preferred_smem_carveout + - 1.0 + - Preferred fraction of SM's unified memory / L1 cache to be used as shared memory. Default is 100% + +Tuning Considerations +--------------------- + +IVF-PQ has similar tuning considerations to IVF-flat, though the PQ compression ratio adds an additional variable to trade-off index size for search quality. + +It's important to note that IVF-PQ becomes very lossy very quickly, and so refinement reranking is often needed to get a reasonable recall. This step usually consists of searching initially for more k-neighbors than needed and then reducing the resulting neighborhoods down to k by computing exact distances. This step can be performed efficiently on CPU or GPU and generally has only a marginal impact on search latency. + +Memory footprint +---------------- + +Index (device memory): +~~~~~~~~~~~~~~~~~~~~~~ + +Simple approximate formula: :math:`n\_vectors * (pq\_dim * \frac{pq\_bits}{8} + sizeof_{idx}) + n\_clusters` + +The IVF lists end up being represented by a sparse data structure that stores the pointers to each list, an indices array that contains the indexes of each vector in each list, and an array with the encoded (and interleaved) data for each list. + +IVF list pointers: :math:`n\_clusters * sizeof_{uint32_t}` + +Indices: :math:`n\_vectors * sizeof_{idx}`` + +Encoded data (interleaved): :math:`n\_vectors * pq\_dim * \frac{pq\_bits}{8}` + +Per subspace method: :math:`4 * pq\_dim * pq\_len * 2^pq\_bits` + +Per cluster method: :math:`4 * n\_clusters * pq\_len * 2^pq\_bits` + +Extras: :math:`n\_clusters * (20 + 8 * dim)` + +Index (host memory): +~~~~~~~~~~~~~~~~~~~~ + +When refinement is used with the dataset on host, the original raw vectors are needed: :math:`n\_vectors * dims * sizeof_{Tloat}` + +Search peak memory usage (device); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Total usage: :math:`index + queries + output\_indices + output\_distances + workspace` + +Workspace size is not trivial, a heuristic controls the batch size to make sure the workspace fits the `raft::resource::get_workspace_free_bytes(res)``. + +Build peak memory usage (device): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. math:: + + \frac{n\_vectors}{trainset\_ratio * dims * sizeof_{float}} + + + \frac{n\_vectors}{trainset\_ratio * sizeof_{uint32_t}} + + + n\_clusters * dim * sizeof_{float} + +Note, if there’s not enough space left in the workspace memory resource, IVF-PQ build automatically switches to the managed memory for the training set and labels. + + + + + diff --git a/docs/source/integrations.rst b/docs/source/integrations.rst index 19d72fd90..760892a98 100644 --- a/docs/source/integrations.rst +++ b/docs/source/integrations.rst @@ -1,50 +1,13 @@ +============ Integrations ============ -Aside from using cuVS directly, it can be consumed through a number of sdk and vector database integrations. - -- `FAISS`_ -- `Milvus`_ -- `Lucene`_ -- `Kinetica`_ - - -FAISS ------ - -FAISS v1.8 provides a special conda package that enables a RAFT backend for the Flat, IVF-Flat and IVF-PQ indexes on the GPU. Like the classical FAISS GPU indexes, the RAFT backend also enables interoperability between FAISS CPU indexes, allowing an index to be trained on GPU, searched on CPU, and vice versa. - -The RAFT backend can be enabled by building FAISS from source with the `FAISS_USE_RAFT` cmake flag enabled and setting the `use_raft` configuration option for the RAFT-enabled GPU indexes. - -A pre-compiled conda package can also be installed using the following command: - -.. code-block:: bash - - conda install -c conda-forge -c pytorch -c rapidsai -c nvidia -c "nvidia/label/cuda-11.8.0" faiss-gpu-raft - -The next release of FAISS will feature cuVS support as we continue to migrate the vector search algorithms from RAFT to cuVS. - -Milvus ------- - -In version 2.3, Milvus released support for IVF-Flat and IVF-PQ indexes on the GPU through RAFT. Version 2.4 adds support for brute-force and the graph-based CAGRA index on the GPU. Please refer to the `Milvus documentation `_ to install Milvus with GPU support. - -The GPU indexes can be enabled by using the index types prefixed with `GPU_`, as outlined in the `Milvus index build guide `_. - -Milvus will be migrating their GPU support from RAFT to cuVS as we continue to move the vector search algorithms out of RAFT and into cuVS. - - -Lucene ------- - -An experimental Lucene connector for cuVS enables GPU-accelerated vector search indexes through Lucene. Initial benchmarks are showing that this connector can drastically improve the performance of both indexing and search in Lucene. This connector will continue to be improved over time and any interested developers are encouraged to contribute. - -Install and evaluate the `lucene-cuvs` connector on `Github `_. - - -Kinetica --------- +Aside from using cuVS standalone, it can be consumed through a number of sdk and vector database integrations. -Starting with release 7.2, Kinetica supports the graph-based the CAGRA algorithm from RAFT. Kinetica will continue to improve its support over coming versions, while also migrating to cuVS as we work to move the vector search algorithms out of RAFT and into cuVS. +.. toctree:: + :maxdepth: 4 -Kinetica currently offers the ability to create a CAGRA index in a SQL `CREATE_TABLE` statement, as outlined in their `vector search indexing docs `_. Kinetica is not open source, but the RAFT indexes can be enabled in the developer edition, which can be installed `here `_. + integrations/faiss.rst + integrations/milvus.rst + integrations/lucene.rst + integrations/kinetica.rst diff --git a/docs/source/integrations/faiss.rst b/docs/source/integrations/faiss.rst new file mode 100644 index 000000000..bf8be8225 --- /dev/null +++ b/docs/source/integrations/faiss.rst @@ -0,0 +1,14 @@ +FAISS +----- + +FAISS v1.8 provides a special conda package that enables a RAFT backend for the Flat, IVF-Flat and IVF-PQ indexes on the GPU. Like the classical FAISS GPU indexes, the RAFT backend also enables interoperability between FAISS CPU indexes, allowing an index to be trained on GPU, searched on CPU, and vice versa. + +The RAFT backend can be enabled by building FAISS from source with the `FAISS_USE_RAFT` cmake flag enabled and setting the `use_raft` configuration option for the RAFT-enabled GPU indexes. + +A pre-compiled conda package can also be installed using the following command: + +.. code-block:: bash + + conda install -c conda-forge -c pytorch -c rapidsai -c nvidia -c "nvidia/label/cuda-11.8.0" faiss-gpu-raft + +The next release of FAISS will feature cuVS support as we continue to migrate the vector search algorithms from RAFT to cuVS. diff --git a/docs/source/integrations/kinetica.rst b/docs/source/integrations/kinetica.rst new file mode 100644 index 000000000..e74cfe82f --- /dev/null +++ b/docs/source/integrations/kinetica.rst @@ -0,0 +1,6 @@ +Kinetica +-------- + +Starting with release 7.2, Kinetica supports the graph-based the CAGRA algorithm from RAFT. Kinetica will continue to improve its support over coming versions, while also migrating to cuVS as we work to move the vector search algorithms out of RAFT and into cuVS. + +Kinetica currently offers the ability to create a CAGRA index in a SQL `CREATE_TABLE` statement, as outlined in their `vector search indexing docs `_. Kinetica is not open source, but the RAFT indexes can be enabled in the developer edition, which can be installed `here `_. diff --git a/docs/source/integrations/lucene.rst b/docs/source/integrations/lucene.rst new file mode 100644 index 000000000..d20052545 --- /dev/null +++ b/docs/source/integrations/lucene.rst @@ -0,0 +1,6 @@ +Lucene +------ + +An experimental Lucene connector for cuVS enables GPU-accelerated vector search indexes through Lucene. Initial benchmarks are showing that this connector can drastically improve the performance of both indexing and search in Lucene. This connector will continue to be improved over time and any interested developers are encouraged to contribute. + +Install and evaluate the `lucene-cuvs` connector on `Github `_. diff --git a/docs/source/integrations/milvus.rst b/docs/source/integrations/milvus.rst new file mode 100644 index 000000000..4139cca52 --- /dev/null +++ b/docs/source/integrations/milvus.rst @@ -0,0 +1,8 @@ +Milvus +------ + +In version 2.3, Milvus released support for IVF-Flat and IVF-PQ indexes on the GPU through RAFT. Version 2.4 adds support for brute-force and the graph-based CAGRA index on the GPU. Please refer to the `Milvus documentation `_ to install Milvus with GPU support. + +The GPU indexes can be enabled by using the index types prefixed with `GPU_`, as outlined in the `Milvus index build guide `_. + +Milvus will be migrating their GPU support from RAFT to cuVS as we continue to move the vector search algorithms out of RAFT and into cuVS. diff --git a/docs/source/python_api/neighbors.rst b/docs/source/python_api/neighbors.rst index 022c50de3..cd4f2609c 100644 --- a/docs/source/python_api/neighbors.rst +++ b/docs/source/python_api/neighbors.rst @@ -11,5 +11,6 @@ Nearest Neighbors neighbors_brute_force.rst neighbors_cagra.rst + neighbors_hnsw.rst neighbors_ivf_flat.rst neighbors_ivf_pq.rst diff --git a/docs/source/python_api/neighbors_hnsw.rst b/docs/source/python_api/neighbors_hnsw.rst new file mode 100644 index 000000000..9922805b3 --- /dev/null +++ b/docs/source/python_api/neighbors_hnsw.rst @@ -0,0 +1,30 @@ +HNSW +==== + +This is a wrapper for hnswlib, to load a CAGRA index as an immutable HNSW index. The loaded HNSW index is only compatible in cuVS, and can be searched using wrapper functions. + +.. role:: py(code) + :language: python + :class: highlight + +Index search parameters +####################### + +.. autoclass:: cuvs.neighbors.hnsw.SearchParams + :members: + +Index +##### + +.. autoclass:: cuvs.neighbors.hnsw.Index + :members: + +Index Conversion +################ + +.. autofunction:: cuvs.neighbors.hnsw.from_cagra + +Index search +############ + +.. autofunction:: cuvs.neighbors.hnsw.search diff --git a/docs/source/tuning_guide.rst b/docs/source/tuning_guide.rst new file mode 100644 index 000000000..26cb2a701 --- /dev/null +++ b/docs/source/tuning_guide.rst @@ -0,0 +1,56 @@ +~~~~~~~~~~~~~~~~~~~~~~ +Automated tuning Guide +~~~~~~~~~~~~~~~~~~~~~~ + +Introduction +============ + +A Method for tuning and evaluating Vector Search Indexes At Scale in Locally Indexed Vector Databases. For more information on the differences between locally and globally indexed vector databases, please see :doc:`this guide `. The goal of this guide is to give users a scalable and effective approach for tuning a vector search index, no matter how large. Evaluation of a vector search index “model” that measures recall in proportion to build time so that it penalizes the recall when the build time is really high (should ultimately optimize for finding a lower build time and higher recall). + +For more information on the various different types of vector search indexes, please see our :doc:`guide to choosing vector search indexes ` + +Why automated tuning? +===================== + +As much as 75% of users have told us they will not be able to tune a vector database beyond one or two simple knobs and we suggest that an ideal “knob” would be to balance training time and search time with search quality. The more time, the higher the quality, and the more needed to find an acceptable search performance. Even the 25% of users that want to tune are still asking for simple tools for doing so. These users also ask for some simple guidelines for setting tuning parameters, like :doc:`this guide `. + +Since vector search indexes are more closely related to machine learning models than traditional databases indexes, one option for easing the parameter tuning burden is to use hyper-parameter optimization tools like `Ray Tune `_ and `Optuna `_. to verify this. + +How to tune? +============ + +But how would this work when we have an index that's massively large- like 1TB? + +One benefit to locally indexed vector databases is that they often scale by breaking the larger set of vectors down into a smaller set by uniformly random subsampling and training smaller vector search index models on the sub-samples. Most often, the same set of tuning parameters are applied to all of the smaller sub-index models, rather than trying to set them individually for each one. During search, the query vectors are often sent to all of the sub-indexes and the resulting neighbors list reduced down to `k` based on the closest distances (or similarities). + +Because many databases use this sub-sampling trick, it's possible to perform an automated parameter tuning on the larger index just by randomly samplnig some number of vectors from it, splitting them into disjoint train/test/eval datasets, computing ground truth with brute-force, and then performing a hyper-parameter optimization on it. This procedure can also be repeated multiple times to simulate a monte-carlo cross validation. + +GPUs are naturally great at performing massively parallel tasks, especially when they are largely independent tasks, such as training and evaluating models with different hyper-parameter settings in parallel. Hyper-parameter optimization also lends itself well to distributed processing, such as multi-node multi-GPU operation. + +Steps to achieve automated tuning +================================= + +More formally, an automated parameter tuning workflow with monte-carlo cross-validaton looks likes something like this: + +#. Ingest a large dataset into the vector database of your choice + +#. Choose an index size based on number of vectors. This should usually align with the average number of vectors the database will end up putting in a single ANN sub-index model. + +#. Uniformly random sample the number of vectors specified above from the database for a training set. This is often accomplished by generating some number of random (unique) numbers up to the dataset size. + +#. Uniformly sample some number of vectors for a test set and do this again for an evaluation set. 1-10% of the vectors in the training set. + +#. Use the test set to compute ground truth on the vectors from prior step against all vectors in the training set. + +#. Start the HPO tuning process for the training set, using the test vectors for the query set. It's important to make sure your HPO is multi-objective and optimizes for: a) low build time, b) high throughput or low latency sarch (depending on needs), and c) acceptable recall. + +#. Use the evaluation dataset to test that the optimal hyper-parameters generalize to unseen points that were not used in the optimization process. + +#. Optionally, the above steps multiple times on different uniform sub-samplings. Optimal parameters can then be combined over the multiple monte-carlo optimization iterations. For example, many hyper-parameters can simply be averaged but care might need to be taken for other parameters. + +#. Create a new index in the database using the ideal params from above that meet the target constraints (e.g. build vs search vs quality) + +Conclusion +========== + +By the end of this process, you should have a set of parameters that meet your target constraints while demonstrating how well the optimal hyper-parameters generalize across the dataset. The major benefit to this approach is that it breaks a potentially unbounded dataset size down into manageable chunks and accelerates tuning on those chunks. We see this process as a major value add for vector search on the GPU. diff --git a/docs/source/vector_databases_vs_vector_search.rst b/docs/source/vector_databases_vs_vector_search.rst new file mode 100644 index 000000000..446737c11 --- /dev/null +++ b/docs/source/vector_databases_vs_vector_search.rst @@ -0,0 +1,57 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Vector search indexes vs vector databases +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This guide provides information on the differences between vector search indexes and fully-fledged vector databases. For more information on selecting and configuring vector search indexes, please refer to our :doc:`guide on choosing and configuring indexes ` + +One of the primary differences between vector database indexes and traditional database indexes is that vector search often uses approximations to trade-off accuracy of the results for speed. Because of this, while many mature databases offer mechanisms to tune their indexes and achieve better performance, vector database indexes can return completely garbage results if they aren’t tuned for a reasonable level of search quality in addition to performance tuning. This is because vector database indexes are more closely related to machine learning models than they are to traditional database indexes. + +What are the differences between vector databases and vector search indexes? +============================================================================ + +Vector search in and of itself refers to the objective of finding the closest vectors in an index around a given set of query vectors. At the lowest level, vector search indexes are just machine learning models, which have a build, search, and recall performance that can be traded off, depending on the algorithm and various hyper-parameters. + +Vector search indexes alone are considered building blocks that enable, but are not considered by themselves to be, a fully-fledged vector database. Vector databases provide more production-level features that often use vector search algorithms in concert with other popular database design techniques to add important capabilities like durability, fault tolerance, vertical scalability, partition tolerance, and horizontal scalability. + +In the world of vector databases, there are special purpose-built databases that focus primarily on vector search but might also provide some small capability of more general-purpose databases, like being able to perform a hybrid search across both vectors and metadata. Many general-purpose databases, both relational and nosql / document databases for example, are beginning to add first-class vector types also. + +So what does all this mean to you? Sometimes a simple standalone vector search index is enough. Usually they can be trained and serialized to a file for later use, and often provide a capability to filter out specific vectors during search. Sometimes they even provide a mechanism to scale up to utilize multiple GPUs, for example, but they generally stop there- and suggest either using your own distributed system (like Spark or Dask) or a fully-fledged vector database to scale out. + +FAISS and cuVS are examples of standalone vector search libraries, which again are more closely related to machine learning libraries than to fully-fledged databases. Milvus is an example of a special-purpose vector database and Elastic, MongoDB, and OpenSearch are examples of general-purpose databases that have added vector search capabilities. + +How is vector search used by vector databases? +============================================== + +Within the context of vector databases, there are two primary ways in which vector search indexes are used and it’s important to understand which you are working with because it can have an effect on the behavior of the parameters with respect to the data. + +Many vector search algorithms improve scalability while reducing the number of distances by partitioning the vector space into smaller pieces, often through the use of clustering, hashing, trees, and other techniques. Another popular technique is to reduce the width or dimensionality of the space in order to decrease the cost of computing each distance. In contrast, databases often partition the data, but may only do so to improve things like io performance, partition tolerance, or scale, without regards to the underlying data distributions which are ultimately going to be used for vector search. + +This leads us to two core architectural designs that we encounter in vector databases: + +Locally partitioned vector search indexes +----------------------------------------- + +Most databases follow this design, and vectors are often first written to a write-ahead log for durability. After some number of vectors are written, the write-ahead logs become immutable and may be merged with other write-ahead logs before eventually being converted to a new vector search index. + +The search is generally done over each locally partitioned index and the results combined. When setting hyperparameters, only the local vector search indexes need to be considered, though the same hyperparameters are going to be used across all of the local partitions. So, for example, if you’ve ingested 100M vectors but each partition only contains about 10M vectors, the size of the index only needs to consider its local 10M vectors. Details like number of vectors in the index are important, for example, when setting the number of clusters in an IVF-based (inverted file index) method, as I’ll cover below. + + +Globally partitioned vector search indexes +------------------------------------------ + +Some special-purpose vector databases follow this design, such as Yahoo’s Vespa and Google’s Spanner. A global index is trained to partition the entire database’s vectors up front as soon as there are enough vectors to do so (usually these databases are at a large enough scale that a significant number of vectors are bootstrapped initially and so it avoids the cold start problem). Ingested vectors are first run through the global index (clustering, for example, but tree- and graph-based methods have also been used) to determine which partition they belong to and the vectors are then (sent to, and) written directly to that partition. The individual partitions can contain a graph, tree, or a simple IVF list. These types of indexes have been able to scale to hundreds of billions to trillions of vectors, and since the partitions are themselves often implicitly based on neighborhoods, rather than being based on uniformly random distributed vectors like the locally partitioned architectures, the partitions can be grouped together or intentionally separated to support localized searches or load balancing, depending upon the needs of the system. + +The challenge when setting hyper-parameters for globally partitioned indexes is that they need to account for the entire set of vectors, and thus the hyperparameters of the global index generally account for all of the vectors in the database, rather than any local partition. + +Of course, the two approaches outlined above can also be used together (e.g. training a global “coarse” index and then creating localized vector search indexes within each of the global indexes) but to my knowledge, no such architecture has implemented this pattern. + +A challenge with GPUs in vector databases today is that the resulting vector indexes are expected to fit into the memory of available GPUs for fast search. That is to say, there doesn’t exist today an efficient mechanism for offloading or swapping GPU indexes so they can be cached from disk or host memory, for example. We are working on mechanisms to do this, and to also utilize technologies like GPUDirect Storage and GPUDirect RDMA to improve the IO performance further. + +Tuning and hyperparameter optimization +====================================== + +Unfortunately, for large datasets, doing a hyper-parameter optimization on the whole dataset is not always feasible and this is actually where the locally partitioned vector search indexes have an advantage because you can think of each smaller segment of the larger index as a uniform random sample of the total vectors in the dataset. This means that it is possible to perform a hyperparameter optimization on the smaller subsets and find reasonably acceptable parameters that should generalize fairly well to the entire dataset. Generally this hyperparameter optimization will require computing a ground truth on the subset with an exact method like brute-force and then using it to evaluate several searches on randomly sampled vectors. + +Full hyper-parameter optimization may also not always be necessary- for example, once you have built a ground truth dataset on a subset, many times you can start by building an index with the default build parameters and then playing around with different search parameters until you get the desired quality and search performance. For massive indexes that might be multiple terabytes, you could also take this subsampling of, say, 10M vectors, train an index and then tune the search parameters from there. While there might be a small margin of error, the chosen build/search parameters should generalize fairly well for the databases that build locally partitioned indexes. + +Refer to our :doc:`tuning guide ` for more information and examples on how to efficiently and automatically tune your vector search indexes based on your needs. \ No newline at end of file diff --git a/python/cuvs/cuvs/neighbors/CMakeLists.txt b/python/cuvs/cuvs/neighbors/CMakeLists.txt index 21c3db5da..f68bbea53 100644 --- a/python/cuvs/cuvs/neighbors/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/CMakeLists.txt @@ -14,6 +14,7 @@ add_subdirectory(brute_force) add_subdirectory(cagra) +add_subdirectory(hnsw) add_subdirectory(ivf_flat) add_subdirectory(ivf_pq) add_subdirectory(filters) diff --git a/python/cuvs/cuvs/neighbors/cagra/cagra.pxd b/python/cuvs/cuvs/neighbors/cagra/cagra.pxd index b23c2a4b3..bba5a91a8 100644 --- a/python/cuvs/cuvs/neighbors/cagra/cagra.pxd +++ b/python/cuvs/cuvs/neighbors/cagra/cagra.pxd @@ -17,6 +17,7 @@ from libc.stdint cimport ( int8_t, + int32_t, int64_t, uint8_t, uint32_t, @@ -100,6 +101,8 @@ cdef extern from "cuvs/neighbors/cagra.h" nogil: cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) + cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int32_t* dim) + cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams* params, DLManagedTensor* dataset, @@ -117,6 +120,20 @@ cdef extern from "cuvs/neighbors/cagra.h" nogil: cuvsCagraIndex_t index, bool include_dataset) except + + cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, + const char * filename, + cuvsCagraIndex_t index) except + + cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char * filename, cuvsCagraIndex_t index) except + + +cdef class Index: + """ + CAGRA index object. This object stores the trained CAGRA index state + which can be used to perform nearest neighbors searches. + """ + + cdef cuvsCagraIndex_t index + cdef bool trained + cdef str active_index_type diff --git a/python/cuvs/cuvs/neighbors/cagra/cagra.pyx b/python/cuvs/cuvs/neighbors/cagra/cagra.pyx index f940ab8bf..95209dbeb 100644 --- a/python/cuvs/cuvs/neighbors/cagra/cagra.pyx +++ b/python/cuvs/cuvs/neighbors/cagra/cagra.pyx @@ -36,6 +36,7 @@ from pylibraft.neighbors.common import _check_input_array from libc.stdint cimport ( int8_t, + int32_t, int64_t, uint8_t, uint32_t, @@ -206,16 +207,9 @@ cdef class IndexParams: cdef class Index: - """ - CAGRA index object. This object stores the trained CAGRA index state - which can be used to perform nearest neighbors searches. - """ - - cdef cuvsCagraIndex_t index - cdef bool trained - def __cinit__(self): self.trained = False + self.active_index_type = None check_cuvs(cuvsCagraIndexCreate(&self.index)) def __dealloc__(self): @@ -226,6 +220,12 @@ cdef class Index: def trained(self): return self.trained + @property + def dim(self): + cdef int32_t dim + check_cuvs(cuvsCagraIndexGetDims(self.index, &dim)) + return dim + def __repr__(self): # todo(dgd): update repr as we expose data through C API attr_str = [] @@ -299,6 +299,7 @@ def build(IndexParams index_params, dataset, resources=None): idx.index )) idx.trained = True + idx.active_index_type = dataset_ai.dtype.name return idx diff --git a/python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt b/python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt new file mode 100644 index 000000000..1f9c422ca --- /dev/null +++ b/python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt @@ -0,0 +1,24 @@ +# ============================================================================= +# 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. +# ============================================================================= + +# Set the list of Cython files to build +set(cython_sources hnsw.pyx) +set(linked_libraries cuvs::cuvs cuvs::c_api) + +# Build all of the Cython targets +rapids_cython_create_modules( + CXX + SOURCE_FILES "${cython_sources}" + LINKED_LIBRARIES "${linked_libraries}" ASSOCIATED_TARGETS cuvs MODULE_PREFIX neighbors_hnsw_ +) diff --git a/python/cuvs/cuvs/neighbors/hnsw/__init__.pxd b/python/cuvs/cuvs/neighbors/hnsw/__init__.pxd new file mode 100644 index 000000000..e69de29bb diff --git a/python/cuvs/cuvs/neighbors/hnsw/__init__.py b/python/cuvs/cuvs/neighbors/hnsw/__init__.py new file mode 100644 index 000000000..5efcdf68b --- /dev/null +++ b/python/cuvs/cuvs/neighbors/hnsw/__init__.py @@ -0,0 +1,25 @@ +# 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. + + +from .hnsw import Index, SearchParams, from_cagra, load, save, search + +__all__ = [ + "Index", + "SearchParams", + "load", + "save", + "search", + "from_cagra", +] diff --git a/python/cuvs/cuvs/neighbors/hnsw/hnsw.pxd b/python/cuvs/cuvs/neighbors/hnsw/hnsw.pxd new file mode 100644 index 000000000..1cdc97406 --- /dev/null +++ b/python/cuvs/cuvs/neighbors/hnsw/hnsw.pxd @@ -0,0 +1,53 @@ +# +# 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. +# +# cython: language_level=3 + +from libc.stdint cimport int32_t, uintptr_t + +from cuvs.common.c_api cimport cuvsError_t, cuvsResources_t +from cuvs.common.cydlpack cimport DLDataType, DLManagedTensor +from cuvs.distance_type cimport cuvsDistanceType + + +cdef extern from "cuvs/neighbors/hnsw.h" nogil: + ctypedef struct cuvsHnswSearchParams: + int32_t ef + int32_t numThreads + + ctypedef cuvsHnswSearchParams* cuvsHnswSearchParams_t + + ctypedef struct cuvsHnswIndex: + uintptr_t addr + DLDataType dtype + + ctypedef cuvsHnswIndex* cuvsHnswIndex_t + + cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t* index) + + cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) + + cuvsError_t cuvsHnswSearch(cuvsResources_t res, + cuvsHnswSearchParams* params, + cuvsHnswIndex_t index, + DLManagedTensor* queries, + DLManagedTensor* neighbors, + DLManagedTensor* distances) except + + + cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, + const char * filename, + int32_t dim, + cuvsDistanceType metric, + cuvsHnswIndex_t index) except + diff --git a/python/cuvs/cuvs/neighbors/hnsw/hnsw.pyx b/python/cuvs/cuvs/neighbors/hnsw/hnsw.pyx new file mode 100644 index 000000000..018fcfef9 --- /dev/null +++ b/python/cuvs/cuvs/neighbors/hnsw/hnsw.pyx @@ -0,0 +1,380 @@ +# +# 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. +# +# cython: language_level=3 + +from libc.stdint cimport uint32_t +from libcpp cimport bool +from libcpp.string cimport string + +from cuvs.common.exceptions import check_cuvs +from cuvs.common.resources import auto_sync_resources + +from cuvs.common cimport cydlpack + +import numpy as np + +from cuvs.distance import DISTANCE_TYPES + +from cuvs.neighbors.cagra cimport cagra + +import os +import uuid + +from pylibraft.common import auto_convert_output +from pylibraft.common.cai_wrapper import wrap_array +from pylibraft.common.interruptible import cuda_interruptible +from pylibraft.neighbors.common import _check_input_array + + +cdef class SearchParams: + """ + HNSW search parameters + + Parameters + ---------- + ef: int, default = 200 + Maximum number of candidate list size used during search. + num_threads: int, default = 0 + Number of CPU threads used to increase search parallelism. + When set to 0, the number of threads is automatically determined + using OpenMP's `omp_get_max_threads()`. + """ + + cdef cuvsHnswSearchParams params + + def __init__(self, *, + ef=200, + num_threads=0): + self.params.ef = ef + self.params.numThreads = num_threads + + def __repr__(self): + attr_str = [attr + "=" + str(getattr(self, attr)) + for attr in [ + "ef", "num_threads"]] + return "SearchParams(type=HNSW, " + (", ".join(attr_str)) + ")" + + @property + def ef(self): + return self.params.ef + + @property + def num_threads(self): + return self.params.numThreads + + +cdef class Index: + """ + HNSW index object. This object stores the trained HNSW index state + which can be used to perform nearest neighbors searches. + """ + + cdef cuvsHnswIndex_t index + cdef bool trained + + def __cinit__(self): + self.trained = False + check_cuvs(cuvsHnswIndexCreate(&self.index)) + + def __dealloc__(self): + if self.index is not NULL: + check_cuvs(cuvsHnswIndexDestroy(self.index)) + + @property + def trained(self): + return self.trained + + def __repr__(self): + # todo(dgd): update repr as we expose data through C API + attr_str = [] + return "Index(type=HNSW, metric=L2" + (", ".join(attr_str)) + ")" + + +@auto_sync_resources +def save(filename, cagra.Index index, resources=None): + """ + Saves the CAGRA index to a file as an hnswlib index. + The saved index is immutable and can only be searched by the hnswlib + wrapper in cuVS, as the format is not compatible with the original + hnswlib. + + Saving / loading the index is experimental. The serialization format is + subject to change. + + Parameters + ---------- + filename : string + Name of the file. + index : Index + Trained CAGRA index. + {resources_docstring} + + Examples + -------- + >>> import cupy as cp + >>> from cuvs.neighbors import cagra + >>> n_samples = 50000 + >>> n_features = 50 + >>> dataset = cp.random.random_sample((n_samples, n_features), + ... dtype=cp.float32) + >>> # Build index + >>> index = cagra.build(cagra.IndexParams(), dataset) + >>> # Serialize and deserialize the cagra index built + >>> hnsw.save("my_index.bin", index) + """ + cdef string c_filename = filename.encode('utf-8') + cdef cuvsResources_t res = resources.get_c_obj() + check_cuvs(cagra.cuvsCagraSerializeToHnswlib(res, + c_filename.c_str(), + index.index)) + + +@auto_sync_resources +def load(filename, dim, dtype, metric="sqeuclidean", resources=None): + """ + Loads base-layer-only hnswlib index from file, which was originally + saved as a built CAGRA index. The loaded index is immutable and can only + be searched by the hnswlib wrapper in cuVS, as the format is not + compatible with the original hnswlib. + + Saving / loading the index is experimental. The serialization format is + subject to change, therefore loading an index saved with a previous + version of cuVS is not guaranteed to work. + + Parameters + ---------- + filename : string + Name of the file. + dim : int + Dimensions of the training dataest + dtype : np.dtype of the saved index + Valid values for dtype: [np.float32, np.byte, np.ubyte] + metric : string denoting the metric type, default="sqeuclidean" + Valid values for metric: ["sqeuclidean", "inner_product"], where + - sqeuclidean is the euclidean distance without the square root + operation, i.e.: distance(a,b) = \\sum_i (a_i - b_i)^2, + - inner_product distance is defined as + distance(a, b) = \\sum_i a_i * b_i. + {resources_docstring} + + Returns + ------- + index : HnswIndex + + Examples + -------- + >>> import cupy as cp + >>> from cuvs.neighbors import cagra + >>> from cuvs.neighbors import hnsw + >>> n_samples = 50000 + >>> n_features = 50 + >>> dataset = cp.random.random_sample((n_samples, n_features), + ... dtype=cp.float32) + >>> # Build index + >>> index = cagra.build(cagra.IndexParams(), dataset) + >>> # Serialize the CAGRA index to hnswlib base layer only index format + >>> hnsw.save("my_index.bin", index) + >>> index = hnsw.load("my_index.bin", n_features, np.float32, + ... "sqeuclidean") + """ + cdef Index idx = Index() + cdef cuvsResources_t res = resources.get_c_obj() + cdef string c_filename = filename.encode('utf-8') + cdef cydlpack.DLDataType dl_dtype + if dtype == np.float32: + dl_dtype.code = cydlpack.kDLFloat + dl_dtype.bits = 32 + dl_dtype.lanes = 1 + elif dtype == np.ubyte: + dl_dtype.code = cydlpack.kDLUInt + dl_dtype.bits = 8 + dl_dtype.lanes = 1 + elif dtype == np.byte: + dl_dtype.code = cydlpack.kDLInt + dl_dtype.bits = 8 + dl_dtype.lanes = 1 + else: + raise ValueError("Only float32 is supported for dtype") + + idx.index.dtype = dl_dtype + cdef cuvsDistanceType distance_type = DISTANCE_TYPES[metric] + + check_cuvs(cuvsHnswDeserialize( + res, + c_filename.c_str(), + dim, + distance_type, + idx.index + )) + idx.trained = True + return idx + + +@auto_sync_resources +def from_cagra(cagra.Index index, temporary_index_path=None, resources=None): + """ + Returns an hnsw base-layer-only index from a CAGRA index. + + NOTE: This method uses the filesystem to write the CAGRA index in + `/tmp/.bin` or the parameter `temporary_index_path` + if not None before reading it as an hnsw index, + then deleting the temporary file. The returned index is immutable + and can only be searched by the hnsw wrapper in cuVS, as the + format is not compatible with the original hnswlib library. + By `base_layer_only`, we mean that the hnsw index is created + without the additional layers that are used for the hierarchical + search in hnswlib. Instead, the base layer is used for the search. + + Saving / loading the index is experimental. The serialization format is + subject to change. + + Parameters + ---------- + index : Index + Trained CAGRA index. + temporary_index_path : string, default = None + Path to save the temporary index file. If None, the temporary file + will be saved in `/tmp/.bin`. + {resources_docstring} + + Examples + -------- + >>> import cupy as cp + >>> from cuvs.neighbors import cagra + >>> from cuvs.neighbors import hnsw + >>> n_samples = 50000 + >>> n_features = 50 + >>> dataset = cp.random.random_sample((n_samples, n_features), + ... dtype=cp.float32) + >>> # Build index + >>> index = cagra.build(cagra.IndexParams(), dataset) + >>> # Serialize the CAGRA index to hnswlib base layer only index format + >>> hnsw_index = hnsw.from_cagra(index) + """ + uuid_num = uuid.uuid4() + filename = temporary_index_path if temporary_index_path else \ + f"/tmp/{uuid_num}.bin" + save(filename, index, resources=resources) + hnsw_index = load(filename, index.dim, np.dtype(index.active_index_type), + "sqeuclidean", resources=resources) + os.remove(filename) + return hnsw_index + + +@auto_sync_resources +@auto_convert_output +def search(SearchParams search_params, + Index index, + queries, + k, + neighbors=None, + distances=None, + resources=None): + """ + Find the k nearest neighbors for each query. + + Parameters + ---------- + search_params : SearchParams + index : Index + Trained CAGRA index. + queries : CUDA array interface compliant matrix shape (n_samples, dim) + Supported dtype [float, int] + k : int + The number of neighbors. + neighbors : Optional CUDA array interface compliant matrix shape + (n_queries, k), dtype uint64_t. If supplied, neighbor + indices will be written here in-place. (default None) + distances : Optional CUDA array interface compliant matrix shape + (n_queries, k) If supplied, the distances to the + neighbors will be written here in-place. (default None) + {resources_docstring} + + Examples + -------- + >>> import cupy as cp + >>> from cuvs.neighbors import cagra, hnsw + >>> n_samples = 50000 + >>> n_features = 50 + >>> n_queries = 1000 + >>> dataset = cp.random.random_sample((n_samples, n_features), + ... dtype=cp.float32) + >>> # Build index + >>> index = cagra.build(cagra.IndexParams(), dataset) + >>> # Search using the built index + >>> queries = cp.random.random_sample((n_queries, n_features), + ... dtype=cp.float32) + >>> k = 10 + >>> search_params = hnsw.SearchParams( + ... ef=200, + ... num_threads=0 + ... ) + >>> # Convert CAGRA index to HNSW + >>> hnsw_index = hnsw.from_cagra(index) + >>> # Using a pooling allocator reduces overhead of temporary array + >>> # creation during search. This is useful if multiple searches + >>> # are performed with same query size. + >>> distances, neighbors = hnsw.search(search_params, index, queries, + ... k) + >>> neighbors = cp.asarray(neighbors) + >>> distances = cp.asarray(distances) + """ + if not index.trained: + raise ValueError("Index needs to be built before calling search.") + + # todo(dgd): we can make the check of dtype a parameter of wrap_array + # in RAFT to make this a single call + queries_ai = wrap_array(queries) + _check_input_array(queries_ai, [np.dtype('float32'), + np.dtype('uint8'), + np.dtype('int8')]) + + cdef uint32_t n_queries = queries_ai.shape[0] + + if neighbors is None: + neighbors = np.empty((n_queries, k), dtype='uint64') + + neighbors_ai = wrap_array(neighbors) + _check_input_array(neighbors_ai, [np.dtype('uint64')], + exp_rows=n_queries, exp_cols=k) + + if distances is None: + distances = np.empty((n_queries, k), dtype='float32') + + distances_ai = wrap_array(distances) + _check_input_array(distances_ai, [np.dtype('float32')], + exp_rows=n_queries, exp_cols=k) + + cdef cuvsHnswSearchParams* params = &search_params.params + cdef cydlpack.DLManagedTensor* queries_dlpack = \ + cydlpack.dlpack_c(queries_ai) + cdef cydlpack.DLManagedTensor* neighbors_dlpack = \ + cydlpack.dlpack_c(neighbors_ai) + cdef cydlpack.DLManagedTensor* distances_dlpack = \ + cydlpack.dlpack_c(distances_ai) + cdef cuvsResources_t res = resources.get_c_obj() + + with cuda_interruptible(): + check_cuvs(cuvsHnswSearch( + res, + params, + index.index, + queries_dlpack, + neighbors_dlpack, + distances_dlpack + )) + + return (distances, neighbors) diff --git a/python/cuvs/cuvs/test/test_hnsw.py b/python/cuvs/cuvs/test/test_hnsw.py new file mode 100644 index 000000000..0ae97266b --- /dev/null +++ b/python/cuvs/cuvs/test/test_hnsw.py @@ -0,0 +1,97 @@ +# 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 +# +# h ttp://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. +# + +import numpy as np +import pytest +from sklearn.neighbors import NearestNeighbors +from sklearn.preprocessing import normalize + +from cuvs.neighbors import cagra, hnsw +from cuvs.test.ann_utils import calc_recall, generate_data + + +def run_hnsw_build_search_test( + n_rows=1000, + n_cols=10, + n_queries=100, + k=10, + dtype=np.float32, + metric="sqeuclidean", + build_algo="ivf_pq", + intermediate_graph_degree=128, + graph_degree=64, + search_params={}, +): + dataset = generate_data((n_rows, n_cols), dtype) + if metric == "inner_product": + dataset = normalize(dataset, norm="l2", axis=1) + if dtype in [np.int8, np.uint8]: + pytest.skip( + "inner_product metric is not supported for int8/uint8 data" + ) + if build_algo == "nn_descent": + pytest.skip("inner_product metric is not supported for nn_descent") + + build_params = cagra.IndexParams( + metric=metric, + intermediate_graph_degree=intermediate_graph_degree, + graph_degree=graph_degree, + build_algo=build_algo, + ) + + index = cagra.build(build_params, dataset) + + assert index.trained + + hnsw_index = hnsw.from_cagra(index) + + queries = generate_data((n_queries, n_cols), dtype) + + search_params = hnsw.SearchParams(**search_params) + + out_dist, out_idx = hnsw.search(search_params, hnsw_index, queries, k) + + # Calculate reference values with sklearn + skl_metric = { + "sqeuclidean": "sqeuclidean", + "inner_product": "cosine", + "euclidean": "euclidean", + }[metric] + nn_skl = NearestNeighbors( + n_neighbors=k, algorithm="brute", metric=skl_metric + ) + nn_skl.fit(dataset) + skl_dist, skl_idx = nn_skl.kneighbors(queries, return_distance=True) + + recall = calc_recall(out_idx, skl_idx) + assert recall > 0.95 + + +@pytest.mark.parametrize("dtype", [np.float32, np.int8, np.uint8]) +@pytest.mark.parametrize("k", [10, 20]) +@pytest.mark.parametrize("ef", [30, 40]) +@pytest.mark.parametrize("num_threads", [2, 4]) +@pytest.mark.parametrize("metric", ["sqeuclidean"]) +@pytest.mark.parametrize("build_algo", ["ivf_pq", "nn_descent"]) +def test_hnsw(dtype, k, ef, num_threads, metric, build_algo): + # Note that inner_product tests use normalized input which we cannot + # represent in int8, therefore we test only sqeuclidean metric here. + run_hnsw_build_search_test( + dtype=dtype, + k=k, + metric=metric, + build_algo=build_algo, + search_params={"ef": ef, "num_threads": num_threads}, + ) diff --git a/python/cuvs_bench/cuvs_bench/VERSION b/python/cuvs_bench/cuvs_bench/VERSION deleted file mode 100644 index 83ac26b20..000000000 --- a/python/cuvs_bench/cuvs_bench/VERSION +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION diff --git a/python/cuvs_bench/cuvs_bench/VERSION b/python/cuvs_bench/cuvs_bench/VERSION new file mode 120000 index 000000000..558194c5a --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/VERSION @@ -0,0 +1 @@ +../../VERSION \ No newline at end of file diff --git a/python/cuvs_bench/cuvs_bench/config/algorithms.yaml b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml index 53ef55dd8..4d10b4fac 100644 --- a/python/cuvs_bench/cuvs_bench/config/algorithms.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml @@ -31,6 +31,15 @@ cuvs_cagra: cuvs_brute_force: executable: CUVS_BRUTE_FORCE_ANN_BENCH requires_gpu: true +cuvs_mg_ivf_flat: + executable: CUVS_MG_ANN_BENCH + requires_gpu: true +cuvs_mg_ivf_pq: + executable: CUVS_MG_ANN_BENCH + requires_gpu: true +cuvs_mg_cagra: + executable: CUVS_MG_ANN_BENCH + requires_gpu: true ggnn: executable: GGNN_ANN_BENCH requires_gpu: true diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_cagra.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_cagra.yaml new file mode 100644 index 000000000..d730e33fb --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_cagra.yaml @@ -0,0 +1,13 @@ +name: cuvs_mg_cagra +constraints: + build: cuvs_bench.config.algos.constraints.cuvs_cagra_build + search: cuvs_bench.config.algos.constraints.cuvs_cagra_search +groups: + base: + build: + graph_degree: [32, 64, 96, 128] + intermediate_graph_degree: [32, 64, 96, 128] + graph_build_algo: ["NN_DESCENT"] + search: + itopk: [32, 64, 128, 256, 512] + search_width: [1, 2, 4, 8, 16, 32, 64] diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_flat.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_flat.yaml new file mode 100644 index 000000000..317e615e5 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_flat.yaml @@ -0,0 +1,9 @@ +name: cuvs_mg_ivf_flat +groups: + base: + build: + nlist: [1024, 2048, 4096, 8192, 16384, 32000, 64000] + ratio: [1, 2, 4] + niter: [20, 25] + search: + nprobe: [1, 5, 10, 50, 100, 200, 500, 1000, 2000] diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_pq.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_pq.yaml new file mode 100644 index 000000000..7213968f4 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_mg_ivf_pq.yaml @@ -0,0 +1,41 @@ +name: cuvs_mg_ivf_pq +constraints: + build: cuvs_bench.config.algos.constraints.cuvs_ivf_pq_build + search: cuvs_bench.config.algos.constraints.cuvs_ivf_pq_search +groups: + base: + build: + nlist: [1024, 2048, 4096, 8192] + pq_dim: [64, 32, 16] + pq_bits: [8, 6, 5, 4] + ratio: [10] + niter: [25] + search: + nprobe: [1, 5, 10, 50, 100, 200] + internalDistanceDtype: ["float"] + smemLutDtype: ["float", "fp8", "half"] + refine_ratio: [1, 2, 4] + large: + build: + nlist: [8192, 16384, 32768, 65536] + pq_dim: [48, 32, 16] + pq_bits: [8, 6, 5, 4] + ratio: [4] + niter: [20] + search: + nprobe: [20, 30, 40, 50, 100, 200, 500, 1000] + internalDistanceDtype: ["float"] + smemLutDtype: ["float", "fp8", "half"] + refine_ratio: [1, 2, 4] + 100M: + build: + nlist: [50000] + pq_dim: [48] + pq_bits: [8, 6, 5, 4] + ratio: [10] + niter: [10] + search: + nprobe: [20, 30, 40, 50, 100, 200, 500, 1000] + internalDistanceDtype: ["float"] + smemLutDtype: ["float", "fp8", "half"] + refine_ratio: [1] diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml index 13055ce2e..1ab01683e 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml @@ -5,8 +5,9 @@ groups: base: build: R: [64, 96] - L_build: [64, 128, 256, 384] - alpha: [1.0, 1.2] + L_build: [100, 200, 300] + alpha: [1.2] + num_threads: [32] search: num_threads: [32] L_search: [10, 20, 30, 40, 50, 100, 200, 300] diff --git a/python/cuvs_bench/cuvs_bench/generate_groundtruth/__main__.py b/python/cuvs_bench/cuvs_bench/generate_groundtruth/__main__.py new file mode 100644 index 000000000..2b4213016 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/generate_groundtruth/__main__.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python +# +# 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. +# +import argparse +import os +import sys + +import cupy as cp +import numpy as np +import rmm +from pylibraft.common import DeviceResources +from rmm.allocators.cupy import rmm_cupy_allocator + +from cuvs.neighbors.brute_force import knn + +from .utils import memmap_bin_file, suffix_from_dtype, write_bin + + +def generate_random_queries(n_queries, n_features, dtype=np.float32): + print("Generating random queries") + if np.issubdtype(dtype, np.integer): + queries = cp.random.randint( + 0, 255, size=(n_queries, n_features), dtype=dtype + ) + else: + queries = cp.random.uniform(size=(n_queries, n_features)).astype(dtype) + return queries + + +def choose_random_queries(dataset, n_queries): + print("Choosing random vector from dataset as query vectors") + query_idx = np.random.choice( + dataset.shape[0], size=(n_queries,), replace=False + ) + return dataset[query_idx, :] + + +def calc_truth(dataset, queries, k, metric="sqeuclidean"): + handle = DeviceResources() + n_samples = dataset.shape[0] + n = 500000 # batch size for processing neighbors + i = 0 + indices = None + distances = None + queries = cp.asarray(queries, dtype=cp.float32) + + while i < n_samples: + print("Step {0}/{1}:".format(i // n, n_samples // n)) + n_batch = n if i + n <= n_samples else n_samples - i + + X = cp.asarray(dataset[i : i + n_batch, :], cp.float32) + + D, Ind = knn(X, queries, k, metric=metric, handle=handle) + handle.sync() + + D, Ind = cp.asarray(D), cp.asarray(Ind) + Ind += i # shift neighbor index by offset i + + if distances is None: + distances = D + indices = Ind + else: + distances = cp.concatenate([distances, D], axis=1) + indices = cp.concatenate([indices, Ind], axis=1) + idx = cp.argsort(distances, axis=1)[:, :k] + distances = cp.take_along_axis(distances, idx, axis=1) + indices = cp.take_along_axis(indices, idx, axis=1) + + i += n_batch + + return distances, indices + + +def main(): + pool = rmm.mr.PoolMemoryResource( + rmm.mr.CudaMemoryResource(), initial_pool_size=2**30 + ) + rmm.mr.set_current_device_resource(pool) + cp.cuda.set_allocator(rmm_cupy_allocator) + + parser = argparse.ArgumentParser( + prog="generate_groundtruth", + description="Generate true neighbors using exact NN search. " + "The input and output files are in big-ann-benchmark's binary format.", + epilog="""Example usage + # With existing query file + python -m cuvs_bench.generate_groundtruth --dataset /dataset/base.\ +fbin --output=groundtruth_dir --queries=/dataset/query.public.10K.fbin + + # With randomly generated queries + python -m cuvs_bench.generate_groundtruth --dataset /dataset/base.\ +fbin --output=groundtruth_dir --queries=random --n_queries=10000 + + # Using only a subset of the dataset. Define queries by randomly + # selecting vectors from the (subset of the) dataset. + python -m cuvs_bench.generate_groundtruth --dataset /dataset/base.\ +fbin --nrows=2000000 --cols=128 --output=groundtruth_dir \ +--queries=random-choice --n_queries=10000 + """, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + + parser.add_argument("dataset", type=str, help="input dataset file name") + parser.add_argument( + "--queries", + type=str, + default="random", + help="Queries file name, or one of 'random-choice' or 'random' " + "(default). 'random-choice': select n_queries vectors from the input " + "dataset. 'random': generate n_queries as uniform random numbers.", + ) + parser.add_argument( + "--output", + type=str, + default="", + help="output directory name (default current dir)", + ) + + parser.add_argument( + "--n_queries", + type=int, + default=10000, + help="Number of quries to generate (if no query file is given). " + "Default: 10000.", + ) + + parser.add_argument( + "-N", + "--rows", + default=None, + type=int, + help="use only first N rows from dataset, by default the whole " + "dataset is used", + ) + parser.add_argument( + "-D", + "--cols", + default=None, + type=int, + help="number of features (dataset columns). " + "Default: read from dataset file.", + ) + parser.add_argument( + "--dtype", + type=str, + help="Dataset dtype. When not specified, then derived from extension." + " Supported types: 'float32', 'float16', 'uint8', 'int8'", + ) + + parser.add_argument( + "-k", + type=int, + default=100, + help="Number of neighbors (per query) to calculate", + ) + parser.add_argument( + "--metric", + type=str, + default="sqeuclidean", + help="Metric to use while calculating distances. Valid metrics are " + "those that are accepted by cuvs.neighbors.brute_force.knn. Most" + " commonly used with cuVS are 'sqeuclidean' and 'inner_product'", + ) + + if len(sys.argv) == 1: + parser.print_help() + sys.exit(1) + args = parser.parse_args() + + if args.rows is not None: + print("Reading subset of the data, nrows=", args.rows) + else: + print("Reading whole dataset") + + # Load input data + dataset = memmap_bin_file( + args.dataset, args.dtype, shape=(args.rows, args.cols) + ) + n_features = dataset.shape[1] + dtype = dataset.dtype + + print( + "Dataset size {:6.1f} GB, shape {}, dtype {}".format( + dataset.size * dataset.dtype.itemsize / 1e9, + dataset.shape, + np.dtype(dtype), + ) + ) + + if len(args.output) > 0: + os.makedirs(args.output, exist_ok=True) + + if args.queries == "random" or args.queries == "random-choice": + if args.n_queries is None: + raise RuntimeError( + "n_queries must be given to generate random queries" + ) + if args.queries == "random": + queries = generate_random_queries( + args.n_queries, n_features, dtype + ) + elif args.queries == "random-choice": + queries = choose_random_queries(dataset, args.n_queries) + + queries_filename = os.path.join( + args.output, "queries" + suffix_from_dtype(dtype) + ) + print("Writing queries file", queries_filename) + write_bin(queries_filename, queries) + else: + print("Reading queries from file", args.queries) + queries = memmap_bin_file(args.queries, dtype) + + print("Calculating true nearest neighbors") + distances, indices = calc_truth(dataset, queries, args.k, args.metric) + + write_bin( + os.path.join(args.output, "groundtruth.neighbors.ibin"), + indices.astype(np.uint32), + ) + write_bin( + os.path.join(args.output, "groundtruth.distances.fbin"), + distances.astype(np.float32), + ) + + +if __name__ == "__main__": + main() diff --git a/python/cuvs_bench/cuvs_bench/generate_groundtruth/utils.py b/python/cuvs_bench/cuvs_bench/generate_groundtruth/utils.py new file mode 100644 index 000000000..a969b3d89 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/generate_groundtruth/utils.py @@ -0,0 +1,101 @@ +# +# 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. +# + +import os + +import numpy as np + + +def dtype_from_filename(filename): + ext = os.path.splitext(filename)[1] + if ext == ".fbin": + return np.float32 + if ext == ".hbin": + return np.float16 + elif ext == ".ibin": + return np.int32 + elif ext == ".u8bin": + return np.ubyte + elif ext == ".i8bin": + return np.byte + else: + raise RuntimeError("Not supported file extension" + ext) + + +def suffix_from_dtype(dtype): + if dtype == np.float32: + return ".fbin" + if dtype == np.float16: + return ".hbin" + elif dtype == np.int32: + return ".ibin" + elif dtype == np.ubyte: + return ".u8bin" + elif dtype == np.byte: + return ".i8bin" + else: + raise RuntimeError("Not supported dtype extension" + dtype) + + +def memmap_bin_file( + bin_file, dtype, shape=None, mode="r", size_dtype=np.uint32 +): + extent_itemsize = np.dtype(size_dtype).itemsize + offset = int(extent_itemsize) * 2 + if bin_file is None: + return None + if dtype is None: + dtype = dtype_from_filename(bin_file) + + if mode[0] == "r": + a = np.memmap(bin_file, mode=mode, dtype=size_dtype, shape=(2,)) + if shape is None: + shape = (a[0], a[1]) + else: + shape = tuple( + [ + aval if sval is None else sval + for aval, sval in zip(a, shape) + ] + ) + + return np.memmap( + bin_file, mode=mode, dtype=dtype, offset=offset, shape=shape + ) + elif mode[0] == "w": + if shape is None: + raise ValueError("Need to specify shape to map file in write mode") + + print("creating file", bin_file) + dirname = os.path.dirname(bin_file) + if len(dirname) > 0: + os.makedirs(dirname, exist_ok=True) + a = np.memmap(bin_file, mode=mode, dtype=size_dtype, shape=(2,)) + a[0] = shape[0] + a[1] = shape[1] + a.flush() + del a + fp = np.memmap( + bin_file, mode="r+", dtype=dtype, offset=offset, shape=shape + ) + return fp + + +def write_bin(fname, data): + print("writing", fname, data.shape, data.dtype, "...") + with open(fname, "wb") as f: + np.asarray(data.shape, dtype=np.uint32).tofile(f) + data.tofile(f) diff --git a/python/cuvs_bench/cuvs_bench/get_dataset/__main__.py b/python/cuvs_bench/cuvs_bench/get_dataset/__main__.py new file mode 100644 index 000000000..a6b154ef2 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/get_dataset/__main__.py @@ -0,0 +1,115 @@ +# +# 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. + +import argparse +import os +import subprocess +import sys +from urllib.request import urlretrieve + + +def get_dataset_path(name, ann_bench_data_path): + if not os.path.exists(ann_bench_data_path): + os.mkdir(ann_bench_data_path) + return os.path.join(ann_bench_data_path, f"{name}.hdf5") + + +def download_dataset(url, path): + if not os.path.exists(path): + print(f"downloading {url} -> {path}...") + urlretrieve(url, path) + + +def convert_hdf5_to_fbin(path, normalize): + scripts_path = os.path.dirname(os.path.realpath(__file__)) + ann_bench_scripts_path = os.path.join(scripts_path, "hdf5_to_fbin.py") + print(f"calling script {ann_bench_scripts_path}") + if normalize and "angular" in path: + subprocess.run( + ["python", ann_bench_scripts_path, "-n", "%s" % path], check=True + ) + else: + subprocess.run( + ["python", ann_bench_scripts_path, "%s" % path], check=True + ) + + +def move(name, ann_bench_data_path): + if "angular" in name: + new_name = name.replace("angular", "inner") + else: + new_name = name + new_path = os.path.join(ann_bench_data_path, new_name) + if not os.path.exists(new_path): + os.mkdir(new_path) + for bin_name in [ + "base.fbin", + "query.fbin", + "groundtruth.neighbors.ibin", + "groundtruth.distances.fbin", + ]: + os.rename( + f"{ann_bench_data_path}/{name}.{bin_name}", + f"{new_path}/{bin_name}", + ) + + +def download(name, normalize, ann_bench_data_path): + path = get_dataset_path(name, ann_bench_data_path) + try: + url = f"http://ann-benchmarks.com/{name}.hdf5" + download_dataset(url, path) + + convert_hdf5_to_fbin(path, normalize) + + move(name, ann_bench_data_path) + except Exception: + print(f"Cannot download {url}") + raise + + +def main(): + call_path = os.getcwd() + if "RAPIDS_DATASET_ROOT_DIR" in os.environ: + default_dataset_path = os.getenv("RAPIDS_DATASET_ROOT_DIR") + else: + default_dataset_path = os.path.join(call_path, "datasets/") + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + parser.add_argument( + "--dataset", help="dataset to download", default="glove-100-angular" + ) + parser.add_argument( + "--dataset-path", + help="path to download dataset", + default=default_dataset_path, + ) + parser.add_argument( + "--normalize", + help="normalize cosine distance to inner product", + action="store_true", + ) + + if len(sys.argv) == 1: + parser.print_help() + sys.exit(1) + args = parser.parse_args() + + download(args.dataset, args.normalize, args.dataset_path) + + +if __name__ == "__main__": + main() diff --git a/python/cuvs_bench/cuvs_bench/get_dataset/fbin_to_f16bin.py b/python/cuvs_bench/cuvs_bench/get_dataset/fbin_to_f16bin.py new file mode 100644 index 000000000..1255e42dc --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/get_dataset/fbin_to_f16bin.py @@ -0,0 +1,49 @@ +# +# 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. + + +from __future__ import absolute_import, division, print_function + +import sys + +import numpy as np + + +def read_fbin(fname): + shape = np.fromfile(fname, dtype=np.uint32, count=2) + if float(shape[0]) * shape[1] * 4 > 2_000_000_000: + data = np.memmap(fname, dtype=np.float32, offset=8, mode="r").reshape( + shape + ) + else: + data = np.fromfile(fname, dtype=np.float32, offset=8).reshape(shape) + return data + + +def write_bin(fname, data): + with open(fname, "wb") as f: + np.asarray(data.shape, dtype=np.uint32).tofile(f) + data.tofile(f) + + +if len(sys.argv) != 3: + print( + "usage: %s input.fbin output.f16bin" % (sys.argv[0]), + file=sys.stderr, + ) + sys.exit(-1) + +data = read_fbin(sys.argv[1]).astype(np.float16) +write_bin(sys.argv[2], data) diff --git a/python/cuvs_bench/cuvs_bench/get_dataset/hdf5_to_fbin.py b/python/cuvs_bench/cuvs_bench/get_dataset/hdf5_to_fbin.py new file mode 100644 index 000000000..317051aa2 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/get_dataset/hdf5_to_fbin.py @@ -0,0 +1,90 @@ +# +# 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. + + +import sys + +import h5py +import numpy as np + + +def normalize(x): + norm = np.linalg.norm(x, axis=1) + return (x.T / norm).T + + +def write_bin(fname, data): + with open(fname, "wb") as f: + np.asarray(data.shape, dtype=np.uint32).tofile(f) + data.tofile(f) + + +if __name__ == "__main__": + if len(sys.argv) != 2 and len(sys.argv) != 3: + print( + "usage: %s [-n] .hdf5\n" % (sys.argv[0]), + " -n: normalize base/query set\n", + "outputs: .base.fbin\n", + " .query.fbin\n", + " .groundtruth.neighbors.ibin\n", + " .groundtruth.distances.fbin", + file=sys.stderr, + ) + sys.exit(-1) + + need_normalize = False + if len(sys.argv) == 3: + assert sys.argv[1] == "-n" + need_normalize = True + fname_prefix = sys.argv[-1] + assert fname_prefix.endswith(".hdf5") + fname_prefix = fname_prefix[:-5] + + hdf5 = h5py.File(sys.argv[-1], "r") + assert ( + hdf5.attrs["distance"] == "angular" + or hdf5.attrs["distance"] == "euclidean" + ) + assert hdf5["train"].dtype == np.float32 + assert hdf5["test"].dtype == np.float32 + assert hdf5["neighbors"].dtype == np.int32 + assert hdf5["distances"].dtype == np.float32 + + base = hdf5["train"][:] + query = hdf5["test"][:] + if need_normalize: + base = normalize(base) + query = normalize(query) + elif hdf5.attrs["distance"] == "angular": + print( + "warning: input has angular distance, ", + "specify -n to normalize base/query set!\n", + ) + + output_fname = fname_prefix + ".base.fbin" + print("writing", output_fname, "...") + write_bin(output_fname, base) + + output_fname = fname_prefix + ".query.fbin" + print("writing", output_fname, "...") + write_bin(output_fname, query) + + output_fname = fname_prefix + ".groundtruth.neighbors.ibin" + print("writing", output_fname, "...") + write_bin(output_fname, hdf5["neighbors"][:]) + + output_fname = fname_prefix + ".groundtruth.distances.fbin" + print("writing", output_fname, "...") + write_bin(output_fname, hdf5["distances"][:]) diff --git a/python/cuvs_bench/cuvs_bench/run/__main__.py b/python/cuvs_bench/cuvs_bench/run/__main__.py index bf9f8586d..58fc5291b 100644 --- a/python/cuvs_bench/cuvs_bench/run/__main__.py +++ b/python/cuvs_bench/cuvs_bench/run/__main__.py @@ -19,8 +19,9 @@ from typing import Optional import click -from data_export import convert_json_to_csv_build, convert_json_to_csv_search -from run import run_benchmark + +from .data_export import convert_json_to_csv_build, convert_json_to_csv_search +from .run import run_benchmark @click.command() diff --git a/python/cuvs_bench/cuvs_bench/run/run.py b/python/cuvs_bench/cuvs_bench/run/run.py index a65d4b5fe..0159d2c19 100644 --- a/python/cuvs_bench/cuvs_bench/run/run.py +++ b/python/cuvs_bench/cuvs_bench/run/run.py @@ -21,7 +21,8 @@ from typing import Any, Dict, Optional, Tuple import yaml -from runners import cuvs_bench_cpp + +from .runners import cuvs_bench_cpp def rmm_present() -> bool: diff --git a/python/cuvs_bench/cuvs_bench/split_groundtruth/__main__.py b/python/cuvs_bench/cuvs_bench/split_groundtruth/__main__.py new file mode 100644 index 000000000..7fee30e42 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/split_groundtruth/__main__.py @@ -0,0 +1,57 @@ +# +# 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. + +import argparse +import os +import subprocess +import sys + + +def split_groundtruth(groundtruth_filepath): + ann_bench_scripts_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), "split_groundtruth.pl" + ) + pwd = os.getcwd() + path_to_groundtruth = os.path.normpath(groundtruth_filepath).split(os.sep) + if len(path_to_groundtruth) > 1: + os.chdir(os.path.join(*path_to_groundtruth[:-1])) + groundtruth_filename = path_to_groundtruth[-1] + subprocess.run( + [ann_bench_scripts_path, groundtruth_filename, "groundtruth"], + check=True, + ) + os.chdir(pwd) + + +def main(): + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + parser.add_argument( + "--groundtruth", + help="Path to billion-scale dataset groundtruth file", + required=True, + ) + + if len(sys.argv) == 1: + parser.print_help() + sys.exit(1) + args = parser.parse_args() + + split_groundtruth(args.groundtruth) + + +if __name__ == "__main__": + main() diff --git a/python/cuvs_bench/cuvs_bench/split_groundtruth/split_groundtruth.pl b/python/cuvs_bench/cuvs_bench/split_groundtruth/split_groundtruth.pl new file mode 100644 index 000000000..b0a59f806 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/split_groundtruth/split_groundtruth.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl + +# ============================================================================= +# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. 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 warnings; +use strict; +use autodie qw(open close); + + +@ARGV == 2 + or die "usage: $0 input output_prefix\n"; + +open my $fh, '<:raw', $ARGV[0]; + +my $raw; +read($fh, $raw, 8); +my ($nrows, $dim) = unpack('LL', $raw); + +my $expected_size = 8 + $nrows * $dim * (4 + 4); +my $size = (stat($fh))[7]; +$size == $expected_size + or die("error: expected size is $expected_size, but actual size is $size\n"); + + +open my $fh_out1, '>:raw', "$ARGV[1].neighbors.ibin"; +open my $fh_out2, '>:raw', "$ARGV[1].distances.fbin"; + +print {$fh_out1} $raw; +print {$fh_out2} $raw; + +read($fh, $raw, $nrows * $dim * 4); +print {$fh_out1} $raw; +read($fh, $raw, $nrows * $dim * 4); +print {$fh_out2} $raw; From 3a56402135e01f45541d0b1989bee47a35436d66 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 14 Oct 2024 17:37:43 -0700 Subject: [PATCH 23/58] ssd wrapper working, cuvs_vamana DOES NOT BUILD --- cpp/bench/ann/CMakeLists.txt | 7 ++ cpp/bench/ann/src/common/benchmark.hpp | 11 +- cpp/bench/ann/src/cuvs/cuvs_vamana.cpp | 95 ++++++++++++++ cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h | 117 ++++++++++++++++++ cpp/bench/ann/src/diskann/diskann_wrapper.h | 93 ++++++++++---- .../cuvs_bench/config/algorithms.yaml | 5 +- .../cuvs_bench/config/algos/cuvs_vamana.yaml | 10 ++ .../cuvs_bench/config/algos/diskann_ssd.yaml | 6 +- 8 files changed, 314 insertions(+), 30 deletions(-) create mode 100644 cpp/bench/ann/src/cuvs/cuvs_vamana.cpp create mode 100644 cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h create mode 100644 python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index ca77a4a4a..02919c72a 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -33,6 +33,7 @@ option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW searc option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON) +option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_MG "Include cuVS ann mg algorithm in benchmark" ${BUILD_MG_ALGOS}) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF @@ -304,6 +305,12 @@ if(CUVS_ANN_BENCH_USE_DISKANN) ) endif() +if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) + ConfigureAnnBench( + NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cpp LINKS cuvs diskann::diskann + ) +endif() + # ################################################################################################## # * Dynamically-loading ANN_BENCH executable ------------------------------------------------------- if(CUVS_ANN_BENCH_SINGLE_EXE) diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 96115be7e..7ed7172a8 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -216,11 +216,20 @@ void bench_search(::benchmark::State& state, const T* query_set = nullptr; - if (!file_exists(index.file)) { + std::string filename; + std::cout << "index.algo " << index.algo << std::endl; + if (index.algo != "diskann_ssd") + filename = index.file; + else + filename = index.file + "_disk.index"; + std::cout << "filename " << filename << std::endl; + if (!file_exists(filename)) { state.SkipWithError("Index file is missing. Run the benchmark in the build mode first."); return; } + std::cout << "state.threads" << state.threads() << std::endl; + /** * Make sure the first thread loads the algo and dataset */ diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp b/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp new file mode 100644 index 000000000..08eb4cd75 --- /dev/null +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp @@ -0,0 +1,95 @@ +/* + * 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 "cuvs_vamana_wrapper.h" + +#include +#include +#include + +namespace cuvs::bench { + +template +void parse_build_param(const nlohmann::json& conf, + typename cuvs::bench::cuvs_vamana::build_param& param) +{ + if (conf.contains("graph_degree")) { param.graph_degree = conf.at("graph_degree"); } + if (conf.contains("visited_size")) { param.visited_size = conf.at("visited_size"); } + if (conf.contains("alpha")) { param.alpha = conf.at("alpha"); } +} + +template +void parse_search_param(const nlohmann::json& conf, + typename cuvs::bench::cuvs_vamana::search_param& param) +{ + param.R = conf.at("R"); + if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } + if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); } + if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } +} + +template +auto create_algo(const std::string& algo_name, + const std::string& distance, + int dim, + const nlohmann::json& conf) -> std::unique_ptr> +{ + [[maybe_unused]] cuvs::bench::Metric metric = parse_metric(distance); + std::unique_ptr> a; + + if constexpr (std::is_same_v or std::is_same_v) { + if (algo_name == "cuvs_vamana") { + typename cuvs::bench::cuvs_vamana::build_param param; + parse_build_param(conf, param); + a = std::make_unique>(metric, dim, param); + } + } + + if (!a) { throw std::runtime_error("invalid algo: '" + algo_name + "'"); } + + return a; +} + +template +std::unique_ptr::search_param> create_search_param(const std::string& algo_name, const nlohmann::json& conf) +{ + if (algo_name == "cuvs_vamana") { + auto param = + std::make_unique::search_param>(); + parse_search_param(conf, *param); + return param; + } + + throw std::runtime_error("invalid algo: '" + algo_name + "'"); +} + +} // namespace cuvs::bench + +REGISTER_ALGO_INSTANCE(float); + +#ifdef ANN_BENCH_BUILD_MAIN +#include "../common/benchmark.hpp" +/* +[NOTE] Dear developer, + +Please don't modify the content of the `main` function; this will make the behavior of the benchmark +executable differ depending on the cmake flags and will complicate the debugging. In particular, +don't try to setup an RMM memory resource here; it will anyway be modified by the memory resource +set on per-algorithm basis. For example, see `cuvs/cuvs_ann_bench_utils.h`. +*/ +int main(int argc, char** argv) { return cuvs::bench::run_main(argc, argv); } +#endif diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h new file mode 100644 index 000000000..85448866e --- /dev/null +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h @@ -0,0 +1,117 @@ +/* + * 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 "../diskann/diskann_wrapper.h" +#include "cuvs_ann_bench_utils.h" +#include + +#include +#include +#include + +namespace cuvs::bench { + +template +class cuvs_vamana : public algo, public algo_gpu { + public: + using build_param = typename cuvs::neighbors::experimental::vamana::index_params; + using search_param_base = typename algo::search_param; + + using search_param = typename diskann_memory::search_param; + + cuvs_vamana(Metric metric, int dim, const build_param& param); + + void build(const T* dataset, size_t nrow) final; + + void set_search_param(const search_param_base& param) override; + + void search(const T* queries, + int batch_size, + int k, + algo_base::index_type* neighbors, + float* distances) const override; + + // to enable dataset access from GPU memory + [[nodiscard]] auto get_preference() const -> algo_property override + { + algo_property property; + property.dataset_memory_type = MemoryType::kHostMmap; + property.query_memory_type = MemoryType::kHost; + return property; + } + + void save(const std::string& file) const override; + void load(const std::string&) override; + std::unique_ptr> copy() override { return std::make_unique>(*this); } + + private: + std::shared_ptr> vamana_index_; + diskann_memory diskann_memory_search_; + configured_raft_resources handle_{}; + build_param vamana_index_params_; +}; + +template +cuvs_vamana::cuvs_vamana(Metric metric, int dim, const build_param& param) + : algo(metric, dim) +{ + this->vamana_index_params_ = param; +} + +template +void cuvs_vamana::build(const T* dataset, size_t nrow) +{ + auto dataset_view_host = raft::make_mdspan( + dataset, raft::make_extents(nrow, this->dim_)); + auto dataset_view_device = raft::make_mdspan( + dataset, raft::make_extents(nrow, this->dim_)); + bool dataset_is_on_host = raft::get_device_for_address(dataset) == -1; + + vamana_index_ = std::make_shared>( + std::move(dataset_is_on_host ? cuvs::neighbors::experimental::vamana::index::build( + handle_, vamana_index_params_, dataset_view_host) + : cuvs::neighbors::experimental::vamana::index::build( + handle_, vamana_index_params_, dataset_view_device))); +} + +template +void cuvs_vamana::set_search_param(const search_param_base& param_) +{ + diskann_memory_search_->set_search_param(param_); +} + +template +void cuvs_vamana::save(const std::string& file) const +{ + cuvs::neighbors::experimental::vamana::serialize(handle_, file, *vamana_index_); +} + +template +void cuvs_vamana::load(const std::string& file) +{ + diskann_memory_search_->load(file); +} + +template +void cuvs_vamana::search( + const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const +{ + diskann_memory_search_->search(queries, batch_size, k, neighbors, distances); +} + +} // namespace cuvs::bench diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 25dfd8adf..c6f2de218 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -66,20 +66,20 @@ class diskann_memory : public algo { diskann_memory(Metric metric, int dim, const build_param& param); - virtual void build(const T* dataset, size_t nrow) override; + void build(const T* dataset, size_t nrow) override; void set_search_param(const search_param_base& param) override; - virtual void search(const T* queries, + void search(const T* queries, int batch_size, int k, algo_base::index_type* indices, float* distances) const override; - virtual void save(const std::string& path_to_index) const override; - virtual void load(const std::string& path_to_index) override; + void save(const std::string& path_to_index) const override; + void load(const std::string& path_to_index) override; diskann_memory(const diskann_memory& other) = default; - virtual std::unique_ptr> copy() override + std::unique_ptr> copy() override { return std::make_unique>(*this); } @@ -92,19 +92,16 @@ class diskann_memory : public algo { return property; } - protected: + private: std::shared_ptr diskann_index_write_params_{nullptr}; uint32_t max_points_; uint32_t build_pq_bytes_ = 0; int num_threads_; - uint32_t L_search_; Mode bench_mode_; int num_search_threads_; std::shared_ptr thread_pool_; std::string index_path_prefix_; - - private: std::shared_ptr> mem_index_{nullptr}; void initialize_index_(size_t max_points); }; @@ -200,14 +197,23 @@ void diskann_memory::load(const std::string& path_to_index) } template -class diskann_ssd : public diskann_memory { +class diskann_ssd : public algo { public: - struct build_param : diskann_memory::build_param { - uint32_t QD = 512; + struct build_param { + uint32_t R; + uint32_t L_build; + uint32_t build_pq_bytes = 0; + float alpha = 1.2; + int num_threads = omp_get_num_procs(); + uint32_t QD = 192; }; using search_param_base = typename algo::search_param; - struct search_param : diskann_memory::search_param { - uint32_t num_nodes_to_cache = 512; + + struct search_param : public search_param_base { + uint32_t L_search; + uint32_t num_threads = omp_get_num_procs(); + uint32_t num_nodes_to_cache = 10000; + // Mode metric_objective; }; diskann_ssd(Metric metric, int dim, const build_param& param); @@ -217,6 +223,8 @@ class diskann_ssd : public diskann_memory { // do nothing. will not be used. }; + void set_search_param(const search_param_base& param) override; + void search(const T* queries, int batch_size, int k, @@ -228,18 +236,35 @@ class diskann_ssd : public diskann_memory { diskann_ssd(const diskann_ssd& other) = default; std::unique_ptr> copy() override { return std::make_unique>(*this); } + [[nodiscard]] auto get_preference() const -> algo_property override + { + algo_property property; + property.dataset_memory_type = MemoryType::kHost; + property.query_memory_type = MemoryType::kHost; + return property; + } + private: std::string index_build_params_str; std::shared_ptr> p_flash_index_; uint32_t num_nodes_to_cache_ = 10000; + uint32_t num_search_threads_; - std::shared_ptr> mem_index_{nullptr}; + // mem index params + uint32_t max_points_; + uint32_t build_pq_bytes_ = 0; + int num_threads_; + uint32_t L_search_; + Mode bench_mode_; + std::shared_ptr thread_pool_; + std::string index_path_prefix_; + std::shared_ptr reader = nullptr; }; template diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) - : diskann_memory(metric, dim, param) + : algo(metric, dim) { // Currently set the indexing RAM budget and the search RAM budget to max value avoid sharding uint32_t build_dram_budget = std::numeric_limits::max(); @@ -271,24 +296,35 @@ void diskann_ssd::build_from_bin(std::string dataset_path, static_cast(0)); } +template +void diskann_ssd::set_search_param(const search_param_base& param_) +{ + auto param = dynamic_cast(param_); + L_search_ = param.L_search; + num_search_threads_ = param.num_threads; + num_nodes_to_cache_ = param.num_nodes_to_cache; + + // only latency mode supported with thread pool + bench_mode_ = Mode::kLatency; + + bool create_pool = (bench_mode_ == Mode::kLatency && num_search_threads_ > 1 && !thread_pool_); + if (create_pool) { thread_pool_ = std::make_shared(num_search_threads_); } +} + template void diskann_ssd::search( const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const { - std::vector node_list; - p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); - p_flash_index_->load_cache_list(node_list); - node_list.clear(); - node_list.shrink_to_fit(); - auto f = [&](int i) { // diskann ssd index can only handle a single vector at a time. p_flash_index_->cached_beam_search(queries + (i * this->dim_), static_cast(k), this->L_search_, - reinterpret_cast(neighbors + i * k), + reinterpret_cast(neighbors + i * k), distances + i * k, - 2); + 1, + false, + nullptr); }; if (this->bench_mode_ == Mode::kLatency && this->num_search_threads_ > 1) { this->thread_pool_->submit(f, batch_size); @@ -308,8 +344,13 @@ void diskann_ssd::save(const std::string& path_to_index) const template void diskann_ssd::load(const std::string& path_to_index) { - std::shared_ptr reader = nullptr; reader.reset(new LinuxAlignedFileReader()); - int result = p_flash_index_->load(this->num_search_threads_, path_to_index.c_str()); + p_flash_index_ = std::make_shared>(reader, parse_metric_to_diskann(this->metric_)); + int result = p_flash_index_->load(num_search_threads_, path_to_index.c_str()); + std::vector node_list; + p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); + p_flash_index_->load_cache_list(node_list); + node_list.clear(); + node_list.shrink_to_fit(); } }; // namespace cuvs::bench diff --git a/python/cuvs_bench/cuvs_bench/config/algorithms.yaml b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml index 4d10b4fac..a5f79ff78 100644 --- a/python/cuvs_bench/cuvs_bench/config/algorithms.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algorithms.yaml @@ -51,7 +51,10 @@ cuvs_cagra_hnswlib: requires_gpu: true diskann_memory: executable: DISKANN_MEMORY_ANN_BENCH - requires_gpu: true + requires_gpu: false diskann_ssd: executable: DISKANN_SSD_ANN_BENCH + requires_gpu: false +cuvs_vamana: + executable: CUVS_VAMANA_ANN_BENCH requires_gpu: true diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml new file mode 100644 index 000000000..b6af32c30 --- /dev/null +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml @@ -0,0 +1,10 @@ +name: cuvs_vamana +groups: + base: + build: + graph_degree: [64, 96] + visited_size: [100, 200, 300] + alpha: [1.2] + search: + L_search: [10, 20, 30, 40, 50, 100, 200, 300] + num_threads: [32] \ No newline at end of file diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml index 510d8c106..e695a8548 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml @@ -5,7 +5,9 @@ groups: base: build: R: [64, 96] - L_build: [64, 128, 256, 384] + L_build: [100, 200, 300] QD: [192] + num_threads: [32] search: - L_search: [10, 20, 30, 40, 50, 100, 200, 300] \ No newline at end of file + L_search: [10, 20, 30, 40, 50, 100, 200, 300] + num_threads: [32] \ No newline at end of file From 92ec47405e37d6f784291413c671b3e1a36c5824 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 15 Oct 2024 14:09:27 -0700 Subject: [PATCH 24/58] builds now --- cpp/bench/ann/CMakeLists.txt | 4 +-- cpp/bench/ann/src/cuvs/cuvs_vamana.cpp | 14 ++++----- cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h | 20 +++++++----- cpp/bench/ann/src/diskann/diskann_wrapper.h | 33 +++++++++----------- 4 files changed, 35 insertions(+), 36 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 02919c72a..197d3459d 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -306,9 +306,7 @@ if(CUVS_ANN_BENCH_USE_DISKANN) endif() if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) - ConfigureAnnBench( - NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cpp LINKS cuvs diskann::diskann - ) + ConfigureAnnBench(NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cpp LINKS cuvs diskann::diskann) endif() # ################################################################################################## diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp b/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp index 08eb4cd75..b3138b736 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp @@ -36,9 +36,7 @@ template void parse_search_param(const nlohmann::json& conf, typename cuvs::bench::cuvs_vamana::search_param& param) { - param.R = conf.at("R"); - if (conf.contains("L_build")) { param.L_build = conf.at("L_build"); } - if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); } + if (conf.contains("L_search")) { param.L_search = conf.at("L_build"); } if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } } @@ -64,13 +62,13 @@ auto create_algo(const std::string& algo_name, return a; } -template -std::unique_ptr::search_param> create_search_param(const std::string& algo_name, const nlohmann::json& conf) +template +auto create_search_param(const std::string& algo_name, const nlohmann::json& conf) + -> std::unique_ptr::search_param> { if (algo_name == "cuvs_vamana") { - auto param = - std::make_unique::search_param>(); - parse_search_param(conf, *param); + auto param = std::make_unique::search_param>(); + parse_search_param(conf, *param); return param; } diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h index 85448866e..d6c2867f1 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h @@ -29,10 +29,9 @@ namespace cuvs::bench { template class cuvs_vamana : public algo, public algo_gpu { public: - using build_param = typename cuvs::neighbors::experimental::vamana::index_params; + using build_param = cuvs::neighbors::experimental::vamana::index_params; using search_param_base = typename algo::search_param; - - using search_param = typename diskann_memory::search_param; + using search_param = typename diskann_memory::search_param; cuvs_vamana(Metric metric, int dim, const build_param& param); @@ -46,11 +45,16 @@ class cuvs_vamana : public algo, public algo_gpu { algo_base::index_type* neighbors, float* distances) const override; + [[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override + { + return handle_.get_sync_stream(); + } + // to enable dataset access from GPU memory [[nodiscard]] auto get_preference() const -> algo_property override { algo_property property; - property.dataset_memory_type = MemoryType::kHostMmap; + property.dataset_memory_type = MemoryType::kDevice; property.query_memory_type = MemoryType::kHost; return property; } @@ -61,7 +65,7 @@ class cuvs_vamana : public algo, public algo_gpu { private: std::shared_ptr> vamana_index_; - diskann_memory diskann_memory_search_; + std::shared_ptr> diskann_memory_search_; configured_raft_resources handle_{}; build_param vamana_index_params_; }; @@ -71,6 +75,8 @@ cuvs_vamana::cuvs_vamana(Metric metric, int dim, const build_param& par : algo(metric, dim) { this->vamana_index_params_ = param; + diskann_memory_search_ = std::make_shared>( + metric, dim, typename diskann_memory::build_param{param.graph_degree, param.visited_size}); } template @@ -83,9 +89,9 @@ void cuvs_vamana::build(const T* dataset, size_t nrow) bool dataset_is_on_host = raft::get_device_for_address(dataset) == -1; vamana_index_ = std::make_shared>( - std::move(dataset_is_on_host ? cuvs::neighbors::experimental::vamana::index::build( + std::move(dataset_is_on_host ? cuvs::neighbors::experimental::vamana::build( handle_, vamana_index_params_, dataset_view_host) - : cuvs::neighbors::experimental::vamana::index::build( + : cuvs::neighbors::experimental::vamana::build( handle_, vamana_index_params_, dataset_view_device))); } diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index c6f2de218..9155cc5f6 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -71,18 +71,15 @@ class diskann_memory : public algo { void set_search_param(const search_param_base& param) override; void search(const T* queries, - int batch_size, - int k, - algo_base::index_type* indices, - float* distances) const override; + int batch_size, + int k, + algo_base::index_type* indices, + float* distances) const override; void save(const std::string& path_to_index) const override; void load(const std::string& path_to_index) override; diskann_memory(const diskann_memory& other) = default; - std::unique_ptr> copy() override - { - return std::make_unique>(*this); - } + std::unique_ptr> copy() override { return std::make_unique>(*this); } [[nodiscard]] auto get_preference() const -> algo_property override { @@ -149,11 +146,11 @@ template void diskann_memory::set_search_param(const search_param_base& param_) { auto param = dynamic_cast(param_); - L_search_ = param.L_search; + L_search_ = param.L_search; num_search_threads_ = param.num_threads; // only latency mode supported with thread pool - bench_mode_ = Mode::kLatency; + bench_mode_ = Mode::kLatency; // Create a pool if multiple query threads have been set and the pool hasn't been created already initialize_index_(0); @@ -205,13 +202,13 @@ class diskann_ssd : public algo { uint32_t build_pq_bytes = 0; float alpha = 1.2; int num_threads = omp_get_num_procs(); - uint32_t QD = 192; + uint32_t QD = 192; }; using search_param_base = typename algo::search_param; - + struct search_param : public search_param_base { uint32_t L_search; - uint32_t num_threads = omp_get_num_procs(); + uint32_t num_threads = omp_get_num_procs(); uint32_t num_nodes_to_cache = 10000; // Mode metric_objective; }; @@ -263,8 +260,7 @@ class diskann_ssd : public algo { }; template -diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) - : algo(metric, dim) +diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) : algo(metric, dim) { // Currently set the indexing RAM budget and the search RAM budget to max value avoid sharding uint32_t build_dram_budget = std::numeric_limits::max(); @@ -300,12 +296,12 @@ template void diskann_ssd::set_search_param(const search_param_base& param_) { auto param = dynamic_cast(param_); - L_search_ = param.L_search; + L_search_ = param.L_search; num_search_threads_ = param.num_threads; num_nodes_to_cache_ = param.num_nodes_to_cache; // only latency mode supported with thread pool - bench_mode_ = Mode::kLatency; + bench_mode_ = Mode::kLatency; bool create_pool = (bench_mode_ == Mode::kLatency && num_search_threads_ > 1 && !thread_pool_); if (create_pool) { thread_pool_ = std::make_shared(num_search_threads_); } @@ -345,7 +341,8 @@ template void diskann_ssd::load(const std::string& path_to_index) { reader.reset(new LinuxAlignedFileReader()); - p_flash_index_ = std::make_shared>(reader, parse_metric_to_diskann(this->metric_)); + p_flash_index_ = + std::make_shared>(reader, parse_metric_to_diskann(this->metric_)); int result = p_flash_index_->load(num_search_threads_, path_to_index.c_str()); std::vector node_list; p_flash_index_->cache_bfs_levels(num_nodes_to_cache_, node_list); From a13bf1ad982a57cf898ccac42bb2286d63f5f4f9 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 15 Oct 2024 14:44:45 -0700 Subject: [PATCH 25/58] rm bug --- cpp/bench/ann/CMakeLists.txt | 5 +++++ cpp/bench/ann/src/common/benchmark.hpp | 2 -- cpp/bench/ann/src/cuvs/cuvs_vamana.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 197d3459d..77f389931 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -71,10 +71,15 @@ if(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ OR CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB OR CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE OR CUVS_ANN_BENCH_USE_CUVS_MG + OR CUVS_ANN_BENCH_USE_CUVS_VAMANA ) set(CUVS_ANN_BENCH_USE_CUVS ON) endif() +if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) + set(CUVS_ANN_BENCH_USE_DISKANN ON) +endif() + # ################################################################################################## # * Fetch requirements ------------------------------------------------------------- diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 53d58d2a6..ad1eab8e2 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -232,12 +232,10 @@ void bench_search(::benchmark::State& state, const T* query_set = nullptr; std::string filename; - std::cout << "index.algo " << index.algo << std::endl; if (index.algo != "diskann_ssd") filename = index.file; else filename = index.file + "_disk.index"; - std::cout << "filename " << filename << std::endl; if (!file_exists(filename)) { state.SkipWithError("Index file is missing. Run the benchmark in the build mode first."); return; diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp b/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp index b3138b736..7c30a5420 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp @@ -36,7 +36,7 @@ template void parse_search_param(const nlohmann::json& conf, typename cuvs::bench::cuvs_vamana::search_param& param) { - if (conf.contains("L_search")) { param.L_search = conf.at("L_build"); } + if (conf.contains("L_search")) { param.L_search = conf.at("L_search"); } if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } } From df549391414ee444e9c83a479e8970ee065058ee Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 15 Oct 2024 15:02:15 -0700 Subject: [PATCH 26/58] add beam_width, rm dbg statements --- cpp/bench/ann/src/common/benchmark.hpp | 2 -- .../ann/src/diskann/diskann_benchmark.cpp | 3 +++ cpp/bench/ann/src/diskann/diskann_wrapper.h | 18 ++++++++++-------- .../cuvs_bench/config/algos/cuvs_vamana.yaml | 4 ++-- .../config/algos/diskann_memory.yaml | 2 +- .../cuvs_bench/config/algos/diskann_ssd.yaml | 4 ++-- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index ad1eab8e2..83d57ccd5 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -241,8 +241,6 @@ void bench_search(::benchmark::State& state, return; } - std::cout << "state.threads" << state.threads() << std::endl; - /** * Make sure the first thread loads the algo and dataset */ diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp index bc6cfca6a..fd13ab014 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -68,6 +68,9 @@ void parse_search_param(const nlohmann::json& conf, if (conf.contains("num_nodes_to_cache")) { param.num_nodes_to_cache = conf.at("num_nodes_to_cache"); } + if (conf.contains("beam_width")) { + param.beam_width = conf.at("beam_width"); + } } template class Algo> diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 9155cc5f6..c9eff2ea8 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -210,13 +210,14 @@ class diskann_ssd : public algo { uint32_t L_search; uint32_t num_threads = omp_get_num_procs(); uint32_t num_nodes_to_cache = 10000; + int beam_width = 2; // Mode metric_objective; }; diskann_ssd(Metric metric, int dim, const build_param& param); void build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) override; - void build(const T* dataset, size_t nrow) override{ + void build(const T* dataset, size_t nrow) override { // do nothing. will not be used. }; @@ -244,14 +245,14 @@ class diskann_ssd : public algo { private: std::string index_build_params_str; std::shared_ptr> p_flash_index_; + int beam_width_; + uint32_t num_nodes_to_cache_; - uint32_t num_nodes_to_cache_ = 10000; - uint32_t num_search_threads_; - - // mem index params - uint32_t max_points_; + // in-memory index params uint32_t build_pq_bytes_ = 0; + uint32_t max_points_; int num_threads_; + int num_search_threads_; uint32_t L_search_; Mode bench_mode_; std::shared_ptr thread_pool_; @@ -299,6 +300,7 @@ void diskann_ssd::set_search_param(const search_param_base& param_) L_search_ = param.L_search; num_search_threads_ = param.num_threads; num_nodes_to_cache_ = param.num_nodes_to_cache; + beam_width_ = param.beam_width; // only latency mode supported with thread pool bench_mode_ = Mode::kLatency; @@ -315,10 +317,10 @@ void diskann_ssd::search( // diskann ssd index can only handle a single vector at a time. p_flash_index_->cached_beam_search(queries + (i * this->dim_), static_cast(k), - this->L_search_, + L_search_, reinterpret_cast(neighbors + i * k), distances + i * k, - 1, + beam_width_, false, nullptr); }; diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml index b6af32c30..6e64b61ca 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml @@ -3,8 +3,8 @@ groups: base: build: graph_degree: [64, 96] - visited_size: [100, 200, 300] + visited_size: [128, 256, 512] alpha: [1.2] search: L_search: [10, 20, 30, 40, 50, 100, 200, 300] - num_threads: [32] \ No newline at end of file + num_threads: [32] diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml index 1ab01683e..faf122465 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_memory.yaml @@ -5,7 +5,7 @@ groups: base: build: R: [64, 96] - L_build: [100, 200, 300] + L_build: [128, 256, 384] alpha: [1.2] num_threads: [32] search: diff --git a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml index e695a8548..40afc6fce 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/diskann_ssd.yaml @@ -5,9 +5,9 @@ groups: base: build: R: [64, 96] - L_build: [100, 200, 300] + L_build: [128, 256, 384] QD: [192] num_threads: [32] search: L_search: [10, 20, 30, 40, 50, 100, 200, 300] - num_threads: [32] \ No newline at end of file + num_threads: [32] From 93b262049d4c0d447a9e8555e734803bac4af719 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 15 Oct 2024 15:05:38 -0700 Subject: [PATCH 27/58] style --- cpp/bench/ann/src/diskann/diskann_benchmark.cpp | 4 +--- cpp/bench/ann/src/diskann/diskann_wrapper.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp index fd13ab014..0d7ca4007 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -68,9 +68,7 @@ void parse_search_param(const nlohmann::json& conf, if (conf.contains("num_nodes_to_cache")) { param.num_nodes_to_cache = conf.at("num_nodes_to_cache"); } - if (conf.contains("beam_width")) { - param.beam_width = conf.at("beam_width"); - } + if (conf.contains("beam_width")) { param.beam_width = conf.at("beam_width"); } } template class Algo> diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index c9eff2ea8..e4d53a8e7 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -217,7 +217,7 @@ class diskann_ssd : public algo { diskann_ssd(Metric metric, int dim, const build_param& param); void build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) override; - void build(const T* dataset, size_t nrow) override { + void build(const T* dataset, size_t nrow) override{ // do nothing. will not be used. }; From 54385ab3c8ac36ad484dd78b080c655b6b2a91a8 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 16 Oct 2024 14:57:49 -0700 Subject: [PATCH 28/58] updates after PR reviews, replace thread_pool with omp pragma --- cpp/bench/ann/src/common/ann_types.hpp | 2 - cpp/bench/ann/src/common/benchmark.hpp | 17 +++-- .../ann/src/diskann/diskann_benchmark.cpp | 2 + cpp/bench/ann/src/diskann/diskann_wrapper.h | 72 +++++++------------ 4 files changed, 36 insertions(+), 57 deletions(-) diff --git a/cpp/bench/ann/src/common/ann_types.hpp b/cpp/bench/ann/src/common/ann_types.hpp index 16ab3773d..c2f85e539 100644 --- a/cpp/bench/ann/src/common/ann_types.hpp +++ b/cpp/bench/ann/src/common/ann_types.hpp @@ -130,8 +130,6 @@ class algo : public algo_base { virtual void build(const T* dataset, size_t nrow) = 0; - virtual void build_from_bin(std::string dataset_file, std::string path_to_index, size_t nrow){}; - virtual void set_search_param(const search_param& param) = 0; // TODO(snanditale): this assumes that an algorithm can always return k results. // This is not always possible. diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 83d57ccd5..7f507cd22 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -135,6 +135,12 @@ void bench_build(::benchmark::State& state, } } + if (index.algo == "diskann_ssd") { + make_sure_parent_dir_exists(index.file); + index.build_param["dataset_file"] = dataset->base_filename(); + index.build_param["path_to_index"] = index.file; + } + std::unique_ptr> algo; try { algo = create_algo(index.algo, dataset->distance(), dataset->dim(), index.build_param); @@ -144,10 +150,8 @@ void bench_build(::benchmark::State& state, const auto algo_property = parse_algo_property(algo->get_preference(), index.build_param); - bool parse_base_file = index.algo == "diskann_ssd"; - const T* base_set = nullptr; - if (!parse_base_file) base_set = dataset->base_set(algo_property.dataset_memory_type); + if (index.algo != "diskann_ssd") base_set = dataset->base_set(algo_property.dataset_memory_type); std::size_t index_size = dataset->base_set_size(); cuda_timer gpu_timer{algo}; @@ -170,12 +174,7 @@ void bench_build(::benchmark::State& state, [[maybe_unused]] auto ntx_lap = nvtx.lap(); [[maybe_unused]] auto gpu_lap = gpu_timer.lap(!no_lap_sync); try { - if (!parse_base_file) { - algo->build(base_set, index_size); - } else { - make_sure_parent_dir_exists(index.file); - algo->build_from_bin(dataset->base_filename(), index.file, index_size); - } + algo->build(base_set, index_size); } catch (const std::exception& e) { state.SkipWithError(std::string(e.what())); } diff --git a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp index 0d7ca4007..ca8a94048 100644 --- a/cpp/bench/ann/src/diskann/diskann_benchmark.cpp +++ b/cpp/bench/ann/src/diskann/diskann_benchmark.cpp @@ -49,6 +49,8 @@ void parse_build_param(const nlohmann::json& conf, if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); } if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); } if (conf.contains("QD")) { param.QD = conf.at("QD"); } + if (conf.contains("dataset_file")) { param.dataset_file = conf.at("dataset_file"); } + if (conf.contains("path_to_index")) { param.path_to_index = conf.at("path_to_index"); } } template diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index e4d53a8e7..94a0199ee 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -16,17 +16,14 @@ #pragma once #include "../common/ann_types.hpp" -#include "../common/thread_pool.hpp" #include -#include #include #include #include #include #include -#include #include #include @@ -97,7 +94,6 @@ class diskann_memory : public algo { uint32_t L_search_; Mode bench_mode_; int num_search_threads_; - std::shared_ptr thread_pool_; std::string index_path_prefix_; std::shared_ptr> mem_index_{nullptr}; void initialize_index_(size_t max_points); @@ -149,34 +145,26 @@ void diskann_memory::set_search_param(const search_param_base& param_) L_search_ = param.L_search; num_search_threads_ = param.num_threads; - // only latency mode supported with thread pool + // only latency mode supported. Use the num_threads search param to run search with multiple + // threads bench_mode_ = Mode::kLatency; // Create a pool if multiple query threads have been set and the pool hasn't been created already initialize_index_(0); this->mem_index_->load(index_path_prefix_.c_str(), num_search_threads_, L_search_); - bool create_pool = (bench_mode_ == Mode::kLatency && num_search_threads_ > 1 && !thread_pool_); - if (create_pool) { thread_pool_ = std::make_shared(num_search_threads_); } } template void diskann_memory::search( const T* queries, int batch_size, int k, algo_base::index_type* indices, float* distances) const { - auto f = [&](int i) { - // diskann in-memory index can only handle a single vector at a time. +#pragma omp parallel for schedule(dynamic, 1) + for (int i = 0; i < batch_size; i++) { mem_index_->search(queries + i * this->dim_, static_cast(k), L_search_, reinterpret_cast(indices + i * k), distances + i * k); - }; - if (bench_mode_ == Mode::kLatency && num_search_threads_ > 1) { - thread_pool_->submit(f, batch_size); - } else { - for (int i = 0; i < batch_size; i++) { - f(i); - } } } @@ -199,16 +187,18 @@ class diskann_ssd : public algo { struct build_param { uint32_t R; uint32_t L_build; - uint32_t build_pq_bytes = 0; - float alpha = 1.2; - int num_threads = omp_get_num_procs(); - uint32_t QD = 192; + uint32_t build_pq_bytes = 0; + float alpha = 1.2; + int num_threads = omp_get_num_procs(); + uint32_t QD = 192; + std::string dataset_file = ""; + std::string path_to_index = ""; }; using search_param_base = typename algo::search_param; struct search_param : public search_param_base { uint32_t L_search; - uint32_t num_threads = omp_get_num_procs(); + uint32_t num_threads = omp_get_num_procs() / 2; uint32_t num_nodes_to_cache = 10000; int beam_width = 2; // Mode metric_objective; @@ -216,10 +206,7 @@ class diskann_ssd : public algo { diskann_ssd(Metric metric, int dim, const build_param& param); - void build_from_bin(std::string dataset_path, std::string path_to_index, size_t nrow) override; - void build(const T* dataset, size_t nrow) override{ - // do nothing. will not be used. - }; + void build(const T* dataset, size_t nrow) override; void set_search_param(const search_param_base& param) override; @@ -251,11 +238,14 @@ class diskann_ssd : public algo { // in-memory index params uint32_t build_pq_bytes_ = 0; uint32_t max_points_; - int num_threads_; - int num_search_threads_; - uint32_t L_search_; + // for safe scratch space allocs, set the defualt to half the number of procs for loading the + // index. User must ensure that the number of search threads is less than or equal to this value + int num_search_threads_ = omp_get_num_procs() / 2; + // L_search is hardcoded to the maximum visited list size in the search params. This default is + // for loading the index + uint32_t L_search_ = 384; Mode bench_mode_; - std::shared_ptr thread_pool_; + std::string base_file_; std::string index_path_prefix_; std::shared_ptr reader = nullptr; }; @@ -273,15 +263,15 @@ diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) : std::string(std::to_string(param.num_threads)) + " " + std::string(std::to_string(false)) + " " + std::string(std::to_string(false)) + " " + std::string(std::to_string(0)) + " " + std::string(std::to_string(param.QD)); + base_file_ = param.dataset_file; + index_path_prefix_ = param.path_to_index; } template -void diskann_ssd::build_from_bin(std::string dataset_path, - std::string path_to_index, - size_t nrow) +void diskann_ssd::build(const T* dataset, size_t nrow) { - diskann::build_disk_index(dataset_path.c_str(), - path_to_index.c_str(), + diskann::build_disk_index(base_file_.c_str(), + index_path_prefix_.c_str(), index_build_params_str.c_str(), parse_metric_to_diskann(this->metric_), false, @@ -304,17 +294,14 @@ void diskann_ssd::set_search_param(const search_param_base& param_) // only latency mode supported with thread pool bench_mode_ = Mode::kLatency; - - bool create_pool = (bench_mode_ == Mode::kLatency && num_search_threads_ > 1 && !thread_pool_); - if (create_pool) { thread_pool_ = std::make_shared(num_search_threads_); } } template void diskann_ssd::search( const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const { - auto f = [&](int i) { - // diskann ssd index can only handle a single vector at a time. +#pragma omp parallel for schedule(dynamic, 1) + for (int64_t i = 0; i < (int64_t)batch_size; i++) { p_flash_index_->cached_beam_search(queries + (i * this->dim_), static_cast(k), L_search_, @@ -323,13 +310,6 @@ void diskann_ssd::search( beam_width_, false, nullptr); - }; - if (this->bench_mode_ == Mode::kLatency && this->num_search_threads_ > 1) { - this->thread_pool_->submit(f, batch_size); - } else { - for (int i = 0; i < batch_size; i++) { - f(i); - } } } From c35d89914e88a2348dcc0adfa164450b33be8a29 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 16 Oct 2024 14:59:52 -0700 Subject: [PATCH 29/58] codespell --- cpp/bench/ann/src/diskann/diskann_wrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 94a0199ee..a4827c470 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -238,7 +238,7 @@ class diskann_ssd : public algo { // in-memory index params uint32_t build_pq_bytes_ = 0; uint32_t max_points_; - // for safe scratch space allocs, set the defualt to half the number of procs for loading the + // for safe scratch space allocs, set the default to half the number of procs for loading the // index. User must ensure that the number of search threads is less than or equal to this value int num_search_threads_ = omp_get_num_procs() / 2; // L_search is hardcoded to the maximum visited list size in the search params. This default is From 31d846affc66e35dee384aff543ef3da6cc8acf5 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 16 Oct 2024 15:10:54 -0700 Subject: [PATCH 30/58] sync stream in vamana serialize --- cpp/src/neighbors/detail/vamana/vamana_serialize.cuh | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index a554464f6..7a42ed025 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -75,6 +75,7 @@ void serialize(raft::resources const& res, d_graph.data_handle(), d_graph.size(), raft::resource::get_cuda_stream(res)); + raft::resource::sync_stream(res); size_t total_edges = 0; size_t num_sparse = 0; From 61e00c7baa528c86781497f0f4ef44bc12d710cb Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 16 Oct 2024 19:02:19 -0700 Subject: [PATCH 31/58] re-enable warnings --- cpp/cmake/modules/ConfigureCUDA.cmake | 10 ++++++---- python/cuvs_bench/LICENSE | 2 +- python/cuvs_bench/cuvs_bench/VERSION | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) mode change 100644 => 120000 python/cuvs_bench/LICENSE diff --git a/cpp/cmake/modules/ConfigureCUDA.cmake b/cpp/cmake/modules/ConfigureCUDA.cmake index 39a3b35f8..74da25660 100644 --- a/cpp/cmake/modules/ConfigureCUDA.cmake +++ b/cpp/cmake/modules/ConfigureCUDA.cmake @@ -22,11 +22,13 @@ endif() # Be very strict when compiling with GCC as host compiler (and thus more lenient when compiling with # clang) if(CMAKE_COMPILER_IS_GNUCXX) - list(APPEND CUVS_CXX_FLAGS -Wall -Wno-unknown-pragmas -Wno-error=deprecated-declarations) - list(APPEND CUVS_CUDA_FLAGS -Xcompiler=-Wall,-Wno-error=deprecated-declarations) + list(APPEND CUVS_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations) + list(APPEND CUVS_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations) - # set warnings as errors if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2.0) list(APPEND - # CUVS_CUDA_FLAGS -Werror=all-warnings) endif() + # set warnings as errors + if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2.0) + list(APPEND CUVS_CUDA_FLAGS -Werror=all-warnings) + endif() endif() if(CUDA_LOG_COMPILE_TIME) diff --git a/python/cuvs_bench/LICENSE b/python/cuvs_bench/LICENSE deleted file mode 100644 index fd50777c3..000000000 --- a/python/cuvs_bench/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE diff --git a/python/cuvs_bench/LICENSE b/python/cuvs_bench/LICENSE new file mode 120000 index 000000000..30cff7403 --- /dev/null +++ b/python/cuvs_bench/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/python/cuvs_bench/cuvs_bench/VERSION b/python/cuvs_bench/cuvs_bench/VERSION index 558194c5a..d62dc733e 120000 --- a/python/cuvs_bench/cuvs_bench/VERSION +++ b/python/cuvs_bench/cuvs_bench/VERSION @@ -1 +1 @@ -../../VERSION \ No newline at end of file +../../../VERSION \ No newline at end of file From 0a6b09453d96e60bc925d1741cc1974169b11b6e Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 17 Oct 2024 09:24:30 -0700 Subject: [PATCH 32/58] deps in conda recipe --- conda/recipes/cuvs_bench/meta.yaml | 3 +++ conda/recipes/cuvs_bench_cpu/meta.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/conda/recipes/cuvs_bench/meta.yaml b/conda/recipes/cuvs_bench/meta.yaml index 67d66efce..36284ab2a 100644 --- a/conda/recipes/cuvs_bench/meta.yaml +++ b/conda/recipes/cuvs_bench/meta.yaml @@ -91,9 +91,12 @@ requirements: - libcublas {% endif %} - glog {{ glog_version }} + - libaio + - libboost-devel - libcuvs {{ version }} - h5py {{ h5py_version }} - matplotlib + - mkl-devel - pandas - pyyaml # rmm is needed to determine if package is gpu-enabled diff --git a/conda/recipes/cuvs_bench_cpu/meta.yaml b/conda/recipes/cuvs_bench_cpu/meta.yaml index 95bea92ef..1bb7b69bd 100644 --- a/conda/recipes/cuvs_bench_cpu/meta.yaml +++ b/conda/recipes/cuvs_bench_cpu/meta.yaml @@ -58,7 +58,10 @@ requirements: - click - glog {{ glog_version }} - h5py {{ h5py_version }} + - libaio + - libboost-devel - matplotlib + - mkl-devel - pandas - pyyaml - python From 645d84b332d8ed40dcde4358825a66c6527df8ce Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 17 Oct 2024 12:53:25 -0700 Subject: [PATCH 33/58] host deps --- conda/recipes/cuvs_bench/meta.yaml | 6 +++--- conda/recipes/cuvs_bench_cpu/meta.yaml | 6 +++--- dependencies.yaml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conda/recipes/cuvs_bench/meta.yaml b/conda/recipes/cuvs_bench/meta.yaml index 36284ab2a..dba097009 100644 --- a/conda/recipes/cuvs_bench/meta.yaml +++ b/conda/recipes/cuvs_bench/meta.yaml @@ -72,7 +72,10 @@ requirements: - libcublas-dev {% endif %} - glog {{ glog_version }} + - libaio + - libboost-devel - libcuvs {{ version }} + - mkl-devel - nlohmann_json {{ nlohmann_json_version }} - openblas # rmm is needed to determine if package is gpu-enabled @@ -91,12 +94,9 @@ requirements: - libcublas {% endif %} - glog {{ glog_version }} - - libaio - - libboost-devel - libcuvs {{ version }} - h5py {{ h5py_version }} - matplotlib - - mkl-devel - pandas - pyyaml # rmm is needed to determine if package is gpu-enabled diff --git a/conda/recipes/cuvs_bench_cpu/meta.yaml b/conda/recipes/cuvs_bench_cpu/meta.yaml index 1bb7b69bd..968b525aa 100644 --- a/conda/recipes/cuvs_bench_cpu/meta.yaml +++ b/conda/recipes/cuvs_bench_cpu/meta.yaml @@ -47,6 +47,9 @@ requirements: - benchmark - fmt {{ fmt_version }} - glog {{ glog_version }} + - libaio + - libboost-devel + - mkl-devel - nlohmann_json {{ nlohmann_json_version }} - openblas - python @@ -58,10 +61,7 @@ requirements: - click - glog {{ glog_version }} - h5py {{ h5py_version }} - - libaio - - libboost-devel - matplotlib - - mkl-devel - pandas - pyyaml - python diff --git a/dependencies.yaml b/dependencies.yaml index 7d2894ec7..c4e965d98 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -476,8 +476,8 @@ dependencies: - h5py>=3.8.0 - benchmark>=1.8.2 - openblas - - libboost-devel - libaio + - libboost-devel - mkl-devel bench_python: common: From 396a589a423b6e8b2c2dd99428420eaf6beed4e4 Mon Sep 17 00:00:00 2001 From: Tarang Jain <40517122+tarang-jain@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:30:58 -0700 Subject: [PATCH 34/58] Update conda/recipes/cuvs_bench/meta.yaml Co-authored-by: Bradley Dice --- conda/recipes/cuvs_bench/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipes/cuvs_bench/meta.yaml b/conda/recipes/cuvs_bench/meta.yaml index dba097009..f0e0a3e18 100644 --- a/conda/recipes/cuvs_bench/meta.yaml +++ b/conda/recipes/cuvs_bench/meta.yaml @@ -75,7 +75,7 @@ requirements: - libaio - libboost-devel - libcuvs {{ version }} - - mkl-devel + - mkl-devel # [linux64] - nlohmann_json {{ nlohmann_json_version }} - openblas # rmm is needed to determine if package is gpu-enabled From d325698a92b30c2c85baf46b8300a74f6054db45 Mon Sep 17 00:00:00 2001 From: Tarang Jain <40517122+tarang-jain@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:31:06 -0700 Subject: [PATCH 35/58] Update conda/recipes/cuvs_bench_cpu/meta.yaml Co-authored-by: Bradley Dice --- conda/recipes/cuvs_bench_cpu/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipes/cuvs_bench_cpu/meta.yaml b/conda/recipes/cuvs_bench_cpu/meta.yaml index 968b525aa..9dde91d55 100644 --- a/conda/recipes/cuvs_bench_cpu/meta.yaml +++ b/conda/recipes/cuvs_bench_cpu/meta.yaml @@ -49,7 +49,7 @@ requirements: - glog {{ glog_version }} - libaio - libboost-devel - - mkl-devel + - mkl-devel # [linux64] - nlohmann_json {{ nlohmann_json_version }} - openblas - python From 03a1e0986dfefc0c8871a510e34dccda29355255 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 18 Oct 2024 14:47:57 -0700 Subject: [PATCH 36/58] arch dependendent diskann deps --- dependencies.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index c4e965d98..726b692d4 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -476,9 +476,15 @@ dependencies: - h5py>=3.8.0 - benchmark>=1.8.2 - openblas - - libaio - - libboost-devel - - mkl-devel + specific: + - output_types: conda + matrices: + - matrix: + arch: x86_64 + packages: + - mkl-devel + - libaio + - libboost-devel bench_python: common: - output_types: [conda, pyproject, requirements] From f95aec7129e03cbd9dc0ccb4373b608b71f75d95 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 18 Oct 2024 15:10:14 -0700 Subject: [PATCH 37/58] arch specific deps --- conda/environments/bench_ann_cuda-118_arch-aarch64.yaml | 3 --- conda/environments/bench_ann_cuda-125_arch-aarch64.yaml | 3 --- dependencies.yaml | 3 +++ 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml index 8911baf5a..a73839457 100644 --- a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml @@ -25,8 +25,6 @@ dependencies: - glog>=0.6.0 - h5py>=3.8.0 - hnswlib=0.6.2 -- libaio -- libboost-devel - libcublas-dev=11.11.3.6 - libcublas=11.11.3.6 - libcurand-dev=10.3.0.86 @@ -37,7 +35,6 @@ dependencies: - libcusparse=11.7.5.86 - librmm==24.12.*,>=0.0.0a0 - matplotlib -- mkl-devel - nccl>=2.19 - ninja - nlohmann_json>=3.11.2 diff --git a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml index 339ce4a20..407fb6058 100644 --- a/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-125_arch-aarch64.yaml @@ -26,15 +26,12 @@ dependencies: - glog>=0.6.0 - h5py>=3.8.0 - hnswlib=0.6.2 -- libaio -- libboost-devel - libcublas-dev - libcurand-dev - libcusolver-dev - libcusparse-dev - librmm==24.12.*,>=0.0.0a0 - matplotlib -- mkl-devel - nccl>=2.19 - ninja - nlohmann_json>=3.11.2 diff --git a/dependencies.yaml b/dependencies.yaml index 726b692d4..48004b321 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -485,6 +485,9 @@ dependencies: - mkl-devel - libaio - libboost-devel + - matrix: + arch: aarch64 + packages: null bench_python: common: - output_types: [conda, pyproject, requirements] From b667786ca984f5d7e967a33eee6fedd2bf61ef83 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 18 Oct 2024 15:49:21 -0700 Subject: [PATCH 38/58] CMAKE_SYSTEM_PROCESSOR check --- cpp/bench/ann/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 77f389931..176fe9ae6 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -34,6 +34,10 @@ option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" ON) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch64)$") + option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" OFF) + option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" OFF) +endif() option(CUVS_ANN_BENCH_USE_CUVS_MG "Include cuVS ann mg algorithm in benchmark" ${BUILD_MG_ALGOS}) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF From 4aa513f53183bd131c5077c7029daf205d1a75e9 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 18 Oct 2024 21:44:58 -0700 Subject: [PATCH 39/58] update cmake flags --- cpp/bench/ann/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 176fe9ae6..d7e8b7b06 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -80,10 +80,6 @@ if(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ set(CUVS_ANN_BENCH_USE_CUVS ON) endif() -if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) - set(CUVS_ANN_BENCH_USE_DISKANN ON) -endif() - # ################################################################################################## # * Fetch requirements ------------------------------------------------------------- @@ -101,7 +97,7 @@ if(CUVS_ANN_BENCH_USE_FAISS) include(cmake/thirdparty/get_faiss) endif() -if(CUVS_ANN_BENCH_USE_DISKANN) +if(CUVS_ANN_BENCH_USE_DISKANN OR CUVS_ANN_BENCH_USE_CUVS_VAMANA) include(cmake/thirdparty/get_diskann) endif() From 17f723e29105620278817697b7de93243ee2367d Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 18 Oct 2024 21:58:03 -0700 Subject: [PATCH 40/58] CMAKE_SYSTEM_PROCESSOR regex --- 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 d7e8b7b06..03ebba80a 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -34,7 +34,7 @@ option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" ON) -if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch64)$") +if(CMAKE_SYSTEM_PROCESSOR MATCHES "(ARM|arm|aarch64)") option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" OFF) option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" OFF) endif() From 6532914d0b152da3aa51c4875b6ddbb8ce6bf70b Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 18 Oct 2024 22:03:04 -0700 Subject: [PATCH 41/58] diskann build params --- cpp/bench/ann/src/diskann/diskann_wrapper.h | 2 +- .../cuvs_bench/config/algos/constraints/__init__.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index a4827c470..2aa08599c 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -253,7 +253,7 @@ class diskann_ssd : public algo { template diskann_ssd::diskann_ssd(Metric metric, int dim, const build_param& param) : algo(metric, dim) { - // Currently set the indexing RAM budget and the search RAM budget to max value avoid sharding + // Currently set the indexing RAM budget and the search RAM budget to max value to avoid sharding uint32_t build_dram_budget = std::numeric_limits::max(); uint32_t search_dram_budget = std::numeric_limits::max(); index_build_params_str = diff --git a/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py index 2200759cb..dd521bec2 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py +++ b/python/cuvs_bench/cuvs_bench/config/algos/constraints/__init__.py @@ -108,8 +108,6 @@ def hnswlib_search(params, build_params, k, batch_size): def diskann_memory_build(params, dim): ret = True - if "cagra_intermediate_graph_degree" in params: - ret = params["R"] <= params["cagra_intermediate_graph_degree"] if "R" in params and "L_build" in params: ret = params["R"] <= params["L_build"] return ret @@ -117,8 +115,6 @@ def diskann_memory_build(params, dim): def diskann_ssd_build(params, dim): ret = True - if "cagra_intermediate_graph_degree" in params: - ret = params["R"] <= params["cagra_intermediate_graph_degree"] if "R" in params and "L_build" in params: ret = params["R"] <= params["L_build"] if "QD" in params: From 1f168a803c5be940cae7e6d510750e803a585af5 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 18 Oct 2024 23:04:14 -0700 Subject: [PATCH 42/58] dbg --- cpp/bench/ann/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 03ebba80a..bd90564f5 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -35,9 +35,10 @@ option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" ON) if(CMAKE_SYSTEM_PROCESSOR MATCHES "(ARM|arm|aarch64)") - option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" OFF) - option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" OFF) + set(CUVS_ANN_BENCH_USE_DISKANN OFF) + set(CUVS_ANN_BENCH_USE_CUVS_VAMANA OFF) endif() +message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") option(CUVS_ANN_BENCH_USE_CUVS_MG "Include cuVS ann mg algorithm in benchmark" ${BUILD_MG_ALGOS}) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF From 2a5d1fbf1afa5e9e635f9ead2d0daa4821aacd74 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 21 Oct 2024 11:54:22 -0700 Subject: [PATCH 43/58] rename script to cuvs_vamana.cu --- cpp/bench/ann/CMakeLists.txt | 6 +- .../cuvs/{cuvs_vamana.cpp => cuvs_vamana.cu} | 0 cpp/bench/ann/src/diskann/diskann_wrapper.h | 4 +- cpp/cmake/patches/diskann.diff | 137 ++++++++++++++++++ 4 files changed, 142 insertions(+), 5 deletions(-) rename cpp/bench/ann/src/cuvs/{cuvs_vamana.cpp => cuvs_vamana.cu} (100%) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index bd90564f5..28f6d2401 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -29,8 +29,8 @@ option(CUVS_ANN_BENCH_USE_CUVS_IVF_FLAT "Include cuVS ivf flat algorithm in benc option(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ "Include cuVS ivf pq algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_CAGRA "Include cuVS CAGRA in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benchmark" ON) -option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" ON) -option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) +option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" OFF) +option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" OFF) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" ON) @@ -312,7 +312,7 @@ if(CUVS_ANN_BENCH_USE_DISKANN) endif() if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) - ConfigureAnnBench(NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cpp LINKS cuvs diskann::diskann) + ConfigureAnnBench(NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cu LINKS cuvs diskann::diskann) endif() # ################################################################################################## diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana.cpp b/cpp/bench/ann/src/cuvs/cuvs_vamana.cu similarity index 100% rename from cpp/bench/ann/src/cuvs/cuvs_vamana.cpp rename to cpp/bench/ann/src/cuvs/cuvs_vamana.cu diff --git a/cpp/bench/ann/src/diskann/diskann_wrapper.h b/cpp/bench/ann/src/diskann/diskann_wrapper.h index 2aa08599c..79f207c81 100644 --- a/cpp/bench/ann/src/diskann/diskann_wrapper.h +++ b/cpp/bench/ann/src/diskann/diskann_wrapper.h @@ -279,8 +279,8 @@ void diskann_ssd::build(const T* dataset, size_t nrow) false, std::string(""), std::string(""), - static_cast(0), - static_cast(0)); + 0, + 0); } template diff --git a/cpp/cmake/patches/diskann.diff b/cpp/cmake/patches/diskann.diff index c1146f318..466b24d22 100644 --- a/cpp/cmake/patches/diskann.diff +++ b/cpp/cmake/patches/diskann.diff @@ -88,3 +88,140 @@ index 3d3d2b8..3079d12 100644 if (UNIT_TEST) enable_testing() +diff --git a/include/distance.h b/include/distance.h +index f3b1de2..d4da72e 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,7 +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; + #else +@@ -128,6 +132,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 +151,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 +161,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; + }; + +@@ -198,6 +205,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 +221,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/utils.h b/include/utils.h +index d3af5c3..417af31 100644 +--- a/include/utils.h ++++ b/include/utils.h +@@ -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/index.cpp b/src/index.cpp +index bf93344..9d8336c 100644 +--- a/src/index.cpp ++++ b/src/index.cpp +@@ -17,9 +17,7 @@ + #include "gperftools/malloc_extension.h" + #endif + +-#ifdef _WINDOWS + #include +-#endif + + #include "index.h" + +diff --git a/src/partition.cpp b/src/partition.cpp +index 570d45c..fb54cbf 100644 +--- a/src/partition.cpp ++++ b/src/partition.cpp +@@ -21,9 +21,7 @@ + #include "parameters.h" + #include "memory_mapper.h" + #include "partition.h" +-#ifdef _WINDOWS + #include +-#endif + + // block size for reading/ processing large files and matrices in blocks + #define BLOCK_SIZE 5000000 +diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp +index d9ad506..145a978 100644 +--- a/src/pq_flash_index.cpp ++++ b/src/pq_flash_index.cpp +@@ -8,6 +8,7 @@ + #include "pq_scratch.h" + #include "pq_flash_index.h" + #include "cosine_similarity.h" ++#include + + #ifdef _WINDOWS + #include "windows_aligned_file_reader.h" From 46e7728abc0200f43333ef1b1bca0e6123ad26a0 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 21 Oct 2024 14:11:54 -0700 Subject: [PATCH 44/58] rm dbg statement --- cpp/bench/ann/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index 28f6d2401..a60e83552 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -29,8 +29,8 @@ option(CUVS_ANN_BENCH_USE_CUVS_IVF_FLAT "Include cuVS ivf flat algorithm in benc option(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ "Include cuVS ivf pq algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_CAGRA "Include cuVS CAGRA in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benchmark" ON) -option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" OFF) -option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" OFF) +option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB "Include cuVS CAGRA with HNSW search in benchmark" ON) +option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON) option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF) option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON) option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" ON) @@ -38,7 +38,6 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "(ARM|arm|aarch64)") set(CUVS_ANN_BENCH_USE_DISKANN OFF) set(CUVS_ANN_BENCH_USE_CUVS_VAMANA OFF) endif() -message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") option(CUVS_ANN_BENCH_USE_CUVS_MG "Include cuVS ann mg algorithm in benchmark" ${BUILD_MG_ALGOS}) option(CUVS_ANN_BENCH_SINGLE_EXE "Make a single executable with benchmark as shared library modules" OFF From c131c526d8f777777b1cdbf977ea1a7e570da81e Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Mon, 21 Oct 2024 15:25:09 -0700 Subject: [PATCH 45/58] do not link cuvs for diskann only targets --- cpp/bench/ann/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index a60e83552..ac8eff20a 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -63,6 +63,7 @@ if(BUILD_CPU_ONLY) set(CUVS_ANN_BENCH_USE_GGNN OFF) set(CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE OFF) set(CUVS_ANN_BENCH_USE_CUVS_MG OFF) + set(CUVS_ANN_BENCH_USE_CUVS_VAMANA OFF) else() set(CUVS_FAISS_ENABLE_GPU ON) endif() @@ -303,11 +304,9 @@ endif() if(CUVS_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( - NAME DISKANN_MEMORY PATH src/diskann/diskann_benchmark.cpp LINKS cuvs diskann::diskann - ) - ConfigureAnnBench( - NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS cuvs diskann::diskann + NAME DISKANN_MEMORY PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann ) + ConfigureAnnBench(NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann) endif() if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) From 3d40d2d0654fcea0da27cb532d4a46bf34048e4b Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 24 Oct 2024 06:12:34 -0700 Subject: [PATCH 46/58] link aio --- cpp/bench/ann/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index ac8eff20a..cef5eaf55 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -304,13 +304,13 @@ endif() if(CUVS_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( - NAME DISKANN_MEMORY PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann + NAME DISKANN_MEMORY PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann aio ) - ConfigureAnnBench(NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann) + ConfigureAnnBench(NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann aio) endif() if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) - ConfigureAnnBench(NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cu LINKS cuvs diskann::diskann) + ConfigureAnnBench(NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cu LINKS cuvs diskann::diskann aio) endif() # ################################################################################################## From 6bebeb8fbd1cc73e0a9774fdd5c82454fa2d4a77 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 24 Oct 2024 06:13:58 -0700 Subject: [PATCH 47/58] style --- cpp/bench/ann/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/bench/ann/CMakeLists.txt b/cpp/bench/ann/CMakeLists.txt index cef5eaf55..daebe24ce 100644 --- a/cpp/bench/ann/CMakeLists.txt +++ b/cpp/bench/ann/CMakeLists.txt @@ -306,7 +306,9 @@ if(CUVS_ANN_BENCH_USE_DISKANN) ConfigureAnnBench( NAME DISKANN_MEMORY PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann aio ) - ConfigureAnnBench(NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann aio) + ConfigureAnnBench( + NAME DISKANN_SSD PATH src/diskann/diskann_benchmark.cpp LINKS diskann::diskann aio + ) endif() if(CUVS_ANN_BENCH_USE_CUVS_VAMANA) From 6d3b32d6dad17384f34f2454718c1342322ed02c Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 27 Nov 2024 01:00:07 -0800 Subject: [PATCH 48/58] include utils.h --- cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h index d6c2867f1..a728e0b3c 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h @@ -17,6 +17,7 @@ #include "../common/ann_types.hpp" #include "../diskann/diskann_wrapper.h" +#include #include "cuvs_ann_bench_utils.h" #include From 2506ef1f287bd97acbbe2898a439226f077479a9 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 27 Nov 2024 23:40:08 -0800 Subject: [PATCH 49/58] serialize dataset --- .../detail/vamana/vamana_serialize.cuh | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index a554464f6..fa4eea469 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -115,6 +115,39 @@ void serialize(raft::resources const& res, index_of.close(); if (!index_of) { RAFT_FAIL("Error writing output %s", file_name.c_str()); } + + // try allocating a buffer for the dataset on host + try { + auto h_dataset = raft::make_host_matrix(index_.size(), index_.dim()); + const cuvs::neighbors::strided_dataset* strided_dataset = + dynamic_cast*>( + const_cast*>(&index_.data())); + if (strided_dataset == nullptr) { + RAFT_LOG_INFO("strided_dataset is null"); + } + raft::copy(h_dataset.data_handle(), + strided_dataset->view().data_handle(), + strided_dataset->n_rows() * strided_dataset->dim(), + raft::resource::get_cuda_stream(res)); + std::string dataset_file = file_name + ".data"; + std::ofstream dataset_of(dataset_file, std::ios::out | std::ios::binary); + if (!dataset_of) { RAFT_FAIL("Cannot open file %s", dataset_file.c_str()); } + size_t dataset_file_offset = 0; + int size = static_cast(index_.size()); + int dim = static_cast(index_.dim()); + dataset_of.seekp(dataset_file_offset, dataset_of.beg); + dataset_of.write((char*)&size, sizeof(int)); + dataset_of.write((char*)&dim, sizeof(int)); + for (int i = 0; i < size; i++) { + dataset_of.write((char*)(h_dataset.data_handle() + i * h_dataset.extent(1)), dim * sizeof(T)); + } + dataset_of.close(); + if (!dataset_of) { RAFT_FAIL("Error writing output %s", dataset_file.c_str()); } + } catch (std::bad_alloc& e) { + RAFT_LOG_DEBUG("Failed to serialize dataset"); + } catch (raft::logic_error& e) { + RAFT_LOG_DEBUG("Failed to serialize dataset"); + } } } // namespace cuvs::neighbors::experimental::vamana::detail From 16f35b34ec1d8edf17dde6e67f54ba2a80266ba2 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 28 Nov 2024 00:40:24 -0800 Subject: [PATCH 50/58] debug --- cpp/src/neighbors/detail/vamana/vamana_serialize.cuh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index fa4eea469..46cf38d0d 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -139,15 +139,17 @@ void serialize(raft::resources const& res, dataset_of.write((char*)&size, sizeof(int)); dataset_of.write((char*)&dim, sizeof(int)); for (int i = 0; i < size; i++) { + std::cout << "now writing row " << i << std::endl; dataset_of.write((char*)(h_dataset.data_handle() + i * h_dataset.extent(1)), dim * sizeof(T)); } dataset_of.close(); if (!dataset_of) { RAFT_FAIL("Error writing output %s", dataset_file.c_str()); } } catch (std::bad_alloc& e) { - RAFT_LOG_DEBUG("Failed to serialize dataset"); + RAFT_LOG_INFO("Failed to serialize dataset"); } catch (raft::logic_error& e) { - RAFT_LOG_DEBUG("Failed to serialize dataset"); + RAFT_LOG_INFO("Failed to serialize dataset"); } + std::cout << "done" << std::endl; } } // namespace cuvs::neighbors::experimental::vamana::detail From 18f26a707a9dc62ef576e3f221faa0c51e9a7b4e Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 29 Nov 2024 02:03:56 -0800 Subject: [PATCH 51/58] rm debug statements --- cpp/src/neighbors/detail/vamana/vamana_serialize.cuh | 2 -- cpp/src/neighbors/vamana.cuh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index 46cf38d0d..0836b0396 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -139,7 +139,6 @@ void serialize(raft::resources const& res, dataset_of.write((char*)&size, sizeof(int)); dataset_of.write((char*)&dim, sizeof(int)); for (int i = 0; i < size; i++) { - std::cout << "now writing row " << i << std::endl; dataset_of.write((char*)(h_dataset.data_handle() + i * h_dataset.extent(1)), dim * sizeof(T)); } dataset_of.close(); @@ -149,7 +148,6 @@ void serialize(raft::resources const& res, } catch (raft::logic_error& e) { RAFT_LOG_INFO("Failed to serialize dataset"); } - std::cout << "done" << std::endl; } } // namespace cuvs::neighbors::experimental::vamana::detail diff --git a/cpp/src/neighbors/vamana.cuh b/cpp/src/neighbors/vamana.cuh index 9b9e8d271..f06b0e427 100644 --- a/cpp/src/neighbors/vamana.cuh +++ b/cpp/src/neighbors/vamana.cuh @@ -94,7 +94,7 @@ void serialize(raft::resources const& res, const std::string& file_prefix, const index& index_) { - cuvs::neighbors::experimental::vamana::detail::build(res, file_prefix, index_); + cuvs::neighbors::experimental::vamana::detail::serialize(res, file_prefix, index_); } /** @} */ // end group vamana From 663dfe027f97e2dac8cbc2f7180988f24b0972d2 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 29 Nov 2024 02:09:25 -0800 Subject: [PATCH 52/58] style --- .../detail/vamana/vamana_serialize.cuh | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index 0836b0396..c26a05e6f 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -123,26 +123,28 @@ void serialize(raft::resources const& res, dynamic_cast*>( const_cast*>(&index_.data())); if (strided_dataset == nullptr) { - RAFT_LOG_INFO("strided_dataset is null"); + RAFT_LOG_DEBUG("dynamic_cast to strided_dataset failed"); + } else { + raft::copy(h_dataset.data_handle(), + strided_dataset->view().data_handle(), + strided_dataset->n_rows() * strided_dataset->dim(), + raft::resource::get_cuda_stream(res)); + std::string dataset_file = file_name + ".data"; + std::ofstream dataset_of(dataset_file, std::ios::out | std::ios::binary); + if (!dataset_of) { RAFT_FAIL("Cannot open file %s", dataset_file.c_str()); } + size_t dataset_file_offset = 0; + int size = static_cast(index_.size()); + int dim = static_cast(index_.dim()); + dataset_of.seekp(dataset_file_offset, dataset_of.beg); + dataset_of.write((char*)&size, sizeof(int)); + dataset_of.write((char*)&dim, sizeof(int)); + for (int i = 0; i < size; i++) { + dataset_of.write((char*)(h_dataset.data_handle() + i * h_dataset.extent(1)), + dim * sizeof(T)); + } + dataset_of.close(); + if (!dataset_of) { RAFT_FAIL("Error writing output %s", dataset_file.c_str()); } } - raft::copy(h_dataset.data_handle(), - strided_dataset->view().data_handle(), - strided_dataset->n_rows() * strided_dataset->dim(), - raft::resource::get_cuda_stream(res)); - std::string dataset_file = file_name + ".data"; - std::ofstream dataset_of(dataset_file, std::ios::out | std::ios::binary); - if (!dataset_of) { RAFT_FAIL("Cannot open file %s", dataset_file.c_str()); } - size_t dataset_file_offset = 0; - int size = static_cast(index_.size()); - int dim = static_cast(index_.dim()); - dataset_of.seekp(dataset_file_offset, dataset_of.beg); - dataset_of.write((char*)&size, sizeof(int)); - dataset_of.write((char*)&dim, sizeof(int)); - for (int i = 0; i < size; i++) { - dataset_of.write((char*)(h_dataset.data_handle() + i * h_dataset.extent(1)), dim * sizeof(T)); - } - dataset_of.close(); - if (!dataset_of) { RAFT_FAIL("Error writing output %s", dataset_file.c_str()); } } catch (std::bad_alloc& e) { RAFT_LOG_INFO("Failed to serialize dataset"); } catch (raft::logic_error& e) { From 4bb2b39b1e77a948abc4b4116b970e186f960657 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 29 Nov 2024 02:18:20 -0800 Subject: [PATCH 53/58] alloc strided dim on host --- cpp/src/neighbors/detail/vamana/vamana_serialize.cuh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index c26a05e6f..c039a0441 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -118,13 +118,14 @@ void serialize(raft::resources const& res, // try allocating a buffer for the dataset on host try { - auto h_dataset = raft::make_host_matrix(index_.size(), index_.dim()); const cuvs::neighbors::strided_dataset* strided_dataset = dynamic_cast*>( const_cast*>(&index_.data())); if (strided_dataset == nullptr) { RAFT_LOG_DEBUG("dynamic_cast to strided_dataset failed"); } else { + auto h_dataset = + raft::make_host_matrix(strided_dataset->size(), strided_dataset->dim()); raft::copy(h_dataset.data_handle(), strided_dataset->view().data_handle(), strided_dataset->n_rows() * strided_dataset->dim(), From fd43711a64592f69e3b5fe96d94fcba85908385b Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 29 Nov 2024 03:58:24 -0800 Subject: [PATCH 54/58] size --- cpp/src/neighbors/detail/vamana/vamana_serialize.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index c039a0441..17af12f62 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -125,7 +125,7 @@ void serialize(raft::resources const& res, RAFT_LOG_DEBUG("dynamic_cast to strided_dataset failed"); } else { auto h_dataset = - raft::make_host_matrix(strided_dataset->size(), strided_dataset->dim()); + raft::make_host_matrix(strided_dataset->n_rows(), strided_dataset->dim()); raft::copy(h_dataset.data_handle(), strided_dataset->view().data_handle(), strided_dataset->n_rows() * strided_dataset->dim(), From a10d834e4ddbdfd139d459dafcb368f8b2c078da Mon Sep 17 00:00:00 2001 From: tarang-jain Date: Mon, 2 Dec 2024 03:17:51 -0800 Subject: [PATCH 55/58] include_dataset flag --- cpp/include/cuvs/neighbors/vamana.hpp | 9 ++++++--- cpp/src/neighbors/detail/vamana/vamana_serialize.cuh | 4 +++- cpp/src/neighbors/vamana_serialize.cuh | 5 +++-- .../cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cpp/include/cuvs/neighbors/vamana.hpp b/cpp/include/cuvs/neighbors/vamana.hpp index bec17937f..634f6fdb1 100644 --- a/cpp/include/cuvs/neighbors/vamana.hpp +++ b/cpp/include/cuvs/neighbors/vamana.hpp @@ -258,15 +258,18 @@ auto build(raft::resources const& handle, void serialize(raft::resources const& handle, const std::string& file_prefix, - const cuvs::neighbors::experimental::vamana::index& index); + const cuvs::neighbors::experimental::vamana::index& index, + bool include_dataset = true); void serialize(raft::resources const& handle, const std::string& file_prefix, - const cuvs::neighbors::experimental::vamana::index& index); + const cuvs::neighbors::experimental::vamana::index& index, + bool include_dataset = true); void serialize(raft::resources const& handle, const std::string& file_prefix, - const cuvs::neighbors::experimental::vamana::index& index); + const cuvs::neighbors::experimental::vamana::index& index, + bool include_dataset = true); /** * @} diff --git a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh index 53790df27..ad9d9d770 100644 --- a/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh +++ b/cpp/src/neighbors/detail/vamana/vamana_serialize.cuh @@ -44,13 +44,15 @@ namespace cuvs::neighbors::experimental::vamana::detail { * @param[in] res the raft resource handle * @param[in] file_name the path and name of the DiskAN index file generated * @param[in] index_ VAMANA index + * @param[in] include_dataset whether to include the dataset in the serialized output * */ template void serialize(raft::resources const& res, const std::string& file_name, - const index& index_) + const index& index_, + bool include_dataset) { // Write graph to first index file (format from MSFT DiskANN OSS) std::ofstream index_of(file_name, std::ios::out | std::ios::binary); diff --git a/cpp/src/neighbors/vamana_serialize.cuh b/cpp/src/neighbors/vamana_serialize.cuh index a49d267b3..f2cd06dec 100644 --- a/cpp/src/neighbors/vamana_serialize.cuh +++ b/cpp/src/neighbors/vamana_serialize.cuh @@ -28,10 +28,11 @@ namespace cuvs::neighbors::experimental::vamana { #define CUVS_INST_VAMANA_SERIALIZE(DTYPE) \ void serialize(raft::resources const& handle, \ const std::string& file_prefix, \ - const cuvs::neighbors::experimental::vamana::index& index_) \ + const cuvs::neighbors::experimental::vamana::index& index_, \ + bool include_dataset) \ { \ cuvs::neighbors::experimental::vamana::detail::serialize( \ - handle, file_prefix, index_); \ + handle, file_prefix, index_, include_dataset); \ }; /** @} */ // end group vamana diff --git a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml index 6e64b61ca..5252f818c 100644 --- a/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml +++ b/python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml @@ -2,8 +2,8 @@ name: cuvs_vamana groups: base: build: - graph_degree: [64, 96] - visited_size: [128, 256, 512] + graph_degree: [32, 64] + visited_size: [128, 256] alpha: [1.2] search: L_search: [10, 20, 30, 40, 50, 100, 200, 300] From f0152644ddfda74ed2a6a15a1c57bc98e00bda95 Mon Sep 17 00:00:00 2001 From: tarang-jain Date: Tue, 3 Dec 2024 20:22:29 -0800 Subject: [PATCH 56/58] rm cagra+diskann --- .../ann/src/cuvs/cuvs_cagra_diskann_wrapper.h | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h diff --git a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h deleted file mode 100644 index 566d35897..000000000 --- a/cpp/bench/ann/src/cuvs/cuvs_cagra_diskann_wrapper.h +++ /dev/null @@ -1,108 +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 "../hnswlib/hnswlib_wrapper.h" -#include "cuvs_cagra_wrapper.h" - -#include - -namespace cuvs::bench { - -template -class cuvs_cagra_diskann : public algo, public algo_gpu { - public: - using search_param_base = typename algo::search_param; - using build_param = typename cuvs_cagra::build_param; - using search_param = typename diskann_mem::search_param; - - cuvs_cagra_diskann(Metric metric, int dim, const build_param& param) - : algo(metric, dim), - cagra_build_{metric, dim, param}, - // hnsw_lib param values don't matter since we don't build with hnsw_lib - diskann_mem_search_{metric, dim, typename diskann_mem::build_param{50, 100}} - { - } - - void build(const T* dataset, size_t nrow) final; - - void set_search_param(const search_param_base& param) override; - - void search(const T* queries, - int batch_size, - int k, - algo_base::index_type* neighbors, - float* distances) const override; - - [[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override - { - return cagra_build_.get_sync_stream(); - } - - // to enable dataset access from GPU memory - [[nodiscard]] auto get_preference() const -> algo_property override - { - algo_property property; - property.dataset_memory_type = MemoryType::kHostMmap; - property.query_memory_type = MemoryType::kHost; - return property; - } - - void save(const std::string& file) const override; - void load(const std::string&) override; - std::unique_ptr> copy() override - { - return std::make_unique>(*this); - } - - private: - cuvs_cagra cagra_build_; - hnsw_lib hnswlib_search_; -}; - -template -void cuvs_cagra_hnswlib::build(const T* dataset, size_t nrow) -{ - cagra_build_.build(dataset, nrow); -} - -template -void cuvs_cagra_hnswlib::set_search_param(const search_param_base& param_) -{ - hnswlib_search_.set_search_param(param_); -} - -template -void cuvs_cagra_hnswlib::save(const std::string& file) const -{ - cagra_build_.save_to_hnswlib(file); -} - -template -void cuvs_cagra_hnswlib::load(const std::string& file) -{ - hnswlib_search_.load(file); - hnswlib_search_.set_base_layer_only(); -} - -template -void cuvs_cagra_hnswlib::search( - const T* queries, int batch_size, int k, algo_base::index_type* neighbors, float* distances) const -{ - hnswlib_search_.search(queries, batch_size, k, neighbors, distances); -} - -} // namespace cuvs::bench From b7ba35b87d3724d8abed75a316dda14031b3944b Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Tue, 10 Dec 2024 12:37:27 -0800 Subject: [PATCH 57/58] update copyright --- cpp/bench/ann/src/cuvs/cuvs_vamana.cu | 2 +- cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana.cu b/cpp/bench/ann/src/cuvs/cuvs_vamana.cu index 7c30a5420..5b9dde859 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_vamana.cu +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024, NVIDIA CORPORATION. + * 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. diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h index a728e0b3c..4c92098de 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024, NVIDIA CORPORATION. + * 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. From fd429d2b52260461a26e30869c37bf7a13ce2024 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Thu, 12 Dec 2024 12:01:19 -0800 Subject: [PATCH 58/58] style --- cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h | 2 +- cpp/test/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h index 4c92098de..76536e83d 100644 --- a/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h +++ b/cpp/bench/ann/src/cuvs/cuvs_vamana_wrapper.h @@ -17,9 +17,9 @@ #include "../common/ann_types.hpp" #include "../diskann/diskann_wrapper.h" -#include #include "cuvs_ann_bench_utils.h" #include +#include #include #include diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 4d13daaed..aa1a4cda0 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -236,7 +236,7 @@ if(BUILD_TESTS) NAME SPARSE_TEST PATH sparse/cluster/cluster_solvers.cu sparse/cluster/eigen_solvers.cu sparse/cluster/spectral.cu GPUS 1 PERCENT 100 ) - + ConfigureTest( NAME PREPROCESSING_TEST PATH preprocessing/scalar_quantization.cu GPUS 1 PERCENT 100 )