You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently both IVF-Flat an IVF-PQ stores its index as a single array of all vectors. This has a drawback when we extend the index: we need to recreate the whole index to insert the new values.
The dataset could be stored in a std::vector<device_mdarray<T, extent_2d<IdxT>, row_major>>, where each cluster would have a separate mdarray to store its vectors.
Vectors are added to the dataset in the extend method.
If we store the clusters in an mdarray that have some empty rows at the end as reserve capacity, then the previous step is not needed, the new vectors can be copied directly after the existing ones (next step by build_index_kernel).
tfeher
changed the title
[FEA] Separate index into individual list arrays for IVF-Flat and IVF-PQ
[FEA] Separate index into individual list arrays for IVF-Flat
Jan 25, 2023
Is your feature request related to a problem? Please describe.
Currently both IVF-Flat an IVF-PQ stores its index as a single array of all vectors. This has a drawback when we extend the index: we need to recreate the whole index to insert the new values.
See #1170 (comment) for general background information
Describe the solution you'd like
Details: IVF-Flat
IVF-flat index structure is described
raft/cpp/include/raft/neighbors/ivf_flat_types.hpp
Lines 99 to 118 in 7c12b1e
The concatenated list of vectors are stored in data_.
We maintain the corresponding indices_ from the original dataset .
The clusters are described with sizes and offsets
Proposed changes IVF-Flat
Build
std::vector<device_mdarray<T, extent_2d<IdxT>, row_major>>
, where each cluster would have a separate mdarray to store its vectors.Search
raft/cpp/include/raft/spatial/knn/detail/ivf_flat_search.cuh
Lines 871 to 874 in 7c12b1e
raft/cpp/include/raft/spatial/knn/detail/ivf_flat_search.cuh
Line 743 in 7c12b1e
Additional steps:
Amortize costs of index growth
The text was updated successfully, but these errors were encountered: