-
Notifications
You must be signed in to change notification settings - Fork 33
Let production code read a label's stored vectors #1025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9cc97ce
8abee6d
e41b64d
d012e58
09683d8
4ededcc
0906311
6f0ef78
7e6cf99
f15ea14
9f0d52a
4a70839
ac19831
aaeafd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -799,14 +799,37 @@ class SVSIndex : public VecSimIndexAbstract<svs_details::vecsim_dt<DataType>, fl | |
| return vectors_output; | ||
| } | ||
| } | ||
| svs::logging::logger_ptr getLogger() const override { return logger_; } | ||
| #endif | ||
|
|
||
| // TODO(MOD-17706): implement, and remove the SVSIndexBase check in | ||
| // VecSimTieredIndex::getDataByLabel that currently skips the backend read for SVS entirely. | ||
| // | ||
| // What it has to produce: the vectors stored under `label`, in the form the base contract | ||
| // describes -- the *stored* elements, i.e. after whatever preprocessing an insert applied -- | ||
| // appending nothing when the label is absent, so the output size answers "is it held". | ||
| // | ||
| // Why it is empty today: SVS keeps vectors in the SVS library's own layout, quantized and for | ||
| // LeanVec dimensionality-reduced, and this wrapper has no per-label read of them. | ||
| // | ||
| // One rule to carry over from the HNSW implementations: report nothing rather than an | ||
| // approximation. They refuse when `isQuantized`, because a caller comparing a new value | ||
| // against the stored one byte for byte would read a dequantized reconstruction as a | ||
| // difference -- or worse, as a match. An SVS index that is quantized should answer the same | ||
| // way; only an unquantized one can answer truthfully. | ||
| // | ||
| // What it unblocks: the no-change-set path in RediSearch (`VectorIndex_HoldsVectors`), which | ||
| // is what serves JSON writes and background scans. Note that alone is not enough to make an | ||
| // SVS-backed vector field relabel -- `relabelVector` is also unimplemented for SVS, and both | ||
| // are needed. | ||
| void getDataByLabel( | ||
| labelType label, | ||
| std::vector<std::vector<svs_details::vecsim_dt<DataType>>> &vectors_output) const override { | ||
| assert(false && "Not implemented"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just wondering and trying to make things clear for me - what is the expected behavior for a tiered multi-value SVS index when a label is split across the frontend and backend?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed, since both the svs methods: getRelabelData & relabelVector not implemented in SVS repo. lets return an error up front and not wait for the backend svs to respond.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that the current change skips the SVS backend but still returns vectors from the frontend, so it still returns the the partial result that looks successful. Should we ust block the SVS
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose for quantized backend that's also relevant to check the backend and returning right away instead of returning results only if the vector happened to be on the frontend. Disk HNSW might behave like that (if we return from in memory rather than go to disk for this API, it's probably not decided yet)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I gated it in the tiered class : checking for svs . when I added quantizied check - claude replied that i
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dor-forer you can look now |
||
| this->log(VecSimCommonStrings::LOG_DEBUG_STRING, | ||
| "getDataByLabel: not implemented for SVS, reporting no stored vectors for " | ||
| "label %zu", | ||
| static_cast<size_t>(label)); | ||
| } | ||
|
|
||
| svs::logging::logger_ptr getLogger() const override { return logger_; } | ||
| #endif | ||
| }; | ||
|
|
||
| #ifdef BUILD_TESTS | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed existing bug