-
Notifications
You must be signed in to change notification settings - Fork 150
[FEA] IVF-PQ to Write Flat PQ Codes #1607
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
[FEA] IVF-PQ to Write Flat PQ Codes #1607
Conversation
|
/ok to test dc99bfb |
…with strat pattern
…into ivfpq-flat-codes
… ivfpq-flat-codes
3bf9018 to
b5cfc7e
Compare
|
/ok to test b5cfc7e |
cjnolet
left a comment
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.
LGTM, pending addressing @robertmaynard's feedback. LanceDB is chomping at the bit to try this out, so we can continue to improve over time if we need to (and also use the upcoming preprocessing API directly in IVFPQ in the future).
c/include/cuvs/neighbors/ivf_pq.h
Outdated
| * - INTERLEAVED: Codes are interleaved for optimized search performance. | ||
| * This is the default and recommended for search workloads. | ||
| */ | ||
| enum list_layout codes_layout; |
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.
Just making a note here that this is going to break the C ABI. No action needed, but we will need to track these things in the future. I'll share the POR with you (and the team) for more info.
| virtual size_type get_size() const noexcept = 0; | ||
|
|
||
| /** Set the current size (number of records). */ | ||
| virtual void set_size(size_type new_size) noexcept = 0; |
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.
I suppose as long as users are never direclty mutating this object then we shouldn't have to be too vigilent. Would be nice if we could make this internal, though, so that only cuVS funcitons are capable of changing it. Just concerned for users shooting themselves in the foot.
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.
Tracking here #1726
|
/ok to test b0ff258 |
|
/ok to test 36339c8 |
|
/merge |
… ivfpq-flat-codes
|
/ok to test 4f761fb |
|
/ok to test 400d234 |
|
/ok to test cb3fec1 |
|
/merge |
This PR brings new params to ivf_pq: an option for the user to choose the layout of the ivf lists. The lists can be flat (no interleaving) or interleaved (current default). Flat codes allows building the index in a CPU-compatible format.
[UPDATE as of 12/19/2025]:
After #1278 is merged, we can unify IVF-PQ and PQ API codepaths.
[UPDATE 01/08/2026]:
This PR can be merged before #1278. The flat code-writing can potentially be reverted once #1278 is merged (so we can later use the PQ preprocessing API directly). However that will come naturally as a part if a broader unification of IVF-PQ and PQ codepaths.
[Benchmarks 01/15/2026]:
IVF-PQ Layout Benchmark Results
Dataset: 1,000,000 vectors × 128 dimensions | pq_dim: 32