Conversation
3c02fb5 to
3381152
Compare
3381152 to
0e5727a
Compare
|
Depends on VectorDB-NTU/RaBitQ-Library#36 |
|
@greptile |
Greptile SummaryThis PR adds comprehensive HNSW-RaBitQ support to the zvec project, implementing a vector search index that combines Hierarchical Navigable Small World (HNSW) graph structure with RaBitQ quantization for memory-efficient approximate nearest neighbor search. Major changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Class Diagram%%{init: {'theme': 'neutral'}}%%
classDiagram
class HnswRabitqIndex {
+build()
+search()
+stream()
}
class HnswRabitqBuilder {
+init()
+train()
+build()
-rabitq_converter_
}
class HnswRabitqSearcher {
+init()
+search()
-entity_
-reformer_
}
class HnswRabitqStreamer {
+init()
+add()
+search()
-entity_
-reformer_
}
class HnswRabitqAlgorithm {
+add_node()
+search()
-entity_
}
class HnswRabitqEntity {
+get_neighbors()
+update_neighbors()
-graph_structure_
}
class RabitqConverter {
+train()
+transform()
+to_reformer()
-rotator_
-centroids_
}
class RabitqReformer {
+reform()
+get_quantized()
-rotator_
-centroids_
}
class HnswRabitqContext {
+dist_calculator()
+visit_filter()
}
HnswRabitqIndex --> HnswRabitqBuilder
HnswRabitqIndex --> HnswRabitqSearcher
HnswRabitqIndex --> HnswRabitqStreamer
HnswRabitqBuilder --> RabitqConverter
HnswRabitqBuilder --> HnswRabitqAlgorithm
HnswRabitqBuilder --> HnswRabitqEntity
HnswRabitqSearcher --> HnswRabitqAlgorithm
HnswRabitqSearcher --> HnswRabitqEntity
HnswRabitqSearcher --> RabitqReformer
HnswRabitqStreamer --> HnswRabitqAlgorithm
HnswRabitqStreamer --> HnswRabitqEntity
HnswRabitqStreamer --> RabitqReformer
HnswRabitqAlgorithm --> HnswRabitqEntity
HnswRabitqAlgorithm --> HnswRabitqContext
RabitqConverter --> RabitqReformer
Last reviewed commit: 42a30d6 |
| path = thirdparty/magic_enum/magic_enum-0.9.7 | ||
| url = https://github.com/Neargye/magic_enum.git | ||
| ignore = all | ||
| [submodule "thirdparty/thirdparty/RaBitQ-Library/RaBitQ-Library-0.1"] |
There was a problem hiding this comment.
Submodule name has duplicate thirdparty/ prefix
| [submodule "thirdparty/thirdparty/RaBitQ-Library/RaBitQ-Library-0.1"] | |
| [submodule "thirdparty/RaBitQ-Library/RaBitQ-Library-0.1"] |
| float dists[size]; | ||
| const void *neighbor_vecs[size]; |
There was a problem hiding this comment.
Variable-length arrays (VLAs) are not standard C++ and won't compile with MSVC. Use std::vector instead
| float dists[size]; | |
| const void *neighbor_vecs[size]; | |
| std::vector<float> dists(size); | |
| std::vector<const void*> neighbor_vecs(size); |
| (*ctx->mutable_stats_get_neighbors())++; | ||
| } | ||
|
|
||
| node_id_t neighbor_ids[neighbors.size()]; |
There was a problem hiding this comment.
VLA not standard C++, won't compile with MSVC
| node_id_t neighbor_ids[neighbors.size()]; | |
| std::vector<node_id_t> neighbor_ids(neighbors.size()); |
| float dists[size]; | ||
| const void *neighbor_vecs[size]; |
There was a problem hiding this comment.
VLAs not standard C++, won't compile with MSVC
| float dists[size]; | |
| const void *neighbor_vecs[size]; | |
| std::vector<float> dists(size); | |
| std::vector<const void*> neighbor_vecs(size); |
| (*ctx->mutable_stats_get_neighbors())++; | ||
| } | ||
|
|
||
| node_id_t neighbor_ids[neighbors.size()]; |
There was a problem hiding this comment.
VLA not standard C++, won't compile with MSVC
| node_id_t neighbor_ids[neighbors.size()]; | |
| std::vector<node_id_t> neighbor_ids(neighbors.size()); |
resolve #42