From 634b756d9a7e85de95981fa63bc689d204a83aff Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Wed, 29 Jan 2025 07:16:27 -0800 Subject: [PATCH] cagra updates --- faiss/gpu/GpuIndexCagra.h | 6 +++++- faiss/gpu/impl/CuvsCagra.cuh | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/faiss/gpu/GpuIndexCagra.h b/faiss/gpu/GpuIndexCagra.h index d6fae29b58..7423ba1c6d 100644 --- a/faiss/gpu/GpuIndexCagra.h +++ b/faiss/gpu/GpuIndexCagra.h @@ -245,7 +245,11 @@ struct GpuIndexCagra : public GpuIndex { faiss::MetricType metric = faiss::METRIC_L2, GpuIndexCagraConfig config = GpuIndexCagraConfig()); - /// Trains CAGRA based on the given vector data + /// Trains CAGRA based on the given vector data. + /// NB: The use of the train function here is to build the CAGRA graph on + /// the base dataset and is currently the only function to add the full set + /// of vectors (without IDs) to the index. There is no external quantizer to + /// be trained here. void train(idx_t n, const float* x) override; /// Initialize ourselves from the given CPU index; will overwrite diff --git a/faiss/gpu/impl/CuvsCagra.cuh b/faiss/gpu/impl/CuvsCagra.cuh index c466aceec4..8e458d8be2 100644 --- a/faiss/gpu/impl/CuvsCagra.cuh +++ b/faiss/gpu/impl/CuvsCagra.cuh @@ -118,8 +118,11 @@ class CuvsCagra { const int dim_; /// Controls the underlying cuVS index if it should store the dataset in - /// device memory - bool store_dataset_; + /// device memory. Default set to true for enabling search capabilities on + /// the index. + /// NB: This is also required to be set to true for deserializing + /// an IndexHNSWCagra object. + bool store_dataset_ = true; /// Metric type of the index faiss::MetricType metric_;