-
Notifications
You must be signed in to change notification settings - Fork 853
feat(format): record the requested IVF partition count on a vector index #9151
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
Draft
xuanyu-z
wants to merge
5
commits into
lance-format:main
Choose a base branch
from
xuanyu-z:format/ivf-num-partitions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+57
−0
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
89d17fc
feat(format): record the requested IVF partition count on a vector index
xuanyu-z ba20375
feat(format): name the field as a request and state its precedence
xuanyu-z 7e59a37
feat(format): define the zero case for the partition count
xuanyu-z d4cd920
docs(format): state the no-files case as a condition, not a claim
xuanyu-z ec7f710
docs(format): state the partition-count contract precisely
xuanyu-z File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,42 @@ The Lance vector index format has gone through 3 versions so far. | |
| This document currently only records version 3 which is the latest version. | ||
| The specific version of the vector index is recorded in the `index_version` field of the generic [index metadata](../index.md#loading-an-index). | ||
|
|
||
| ### Index Details | ||
|
|
||
| An index segment records its build parameters in the `index_details` field of the | ||
| generic [index metadata](../index.md#loading-an-index), as a `VectorIndexDetails` | ||
| message. These are the parameters an engine needs to rebuild the index without | ||
| reading the index files: the distance metric, the quantization scheme, and the | ||
| partitioning the index was asked for. | ||
|
|
||
| `target_num_partitions` records the IVF partition count requested for building or | ||
| rebuilding the index. The count an index actually holds may differ from it and is | ||
| read from the index files. Where a segment covers no fragments and carries no | ||
| index files, this field preserves an explicit partition-count request that has no | ||
| built index to read it from. | ||
|
|
||
| `target_partition_size` records the target number of vectors per partition, and is | ||
| 0 when unset. A positive `target_num_partitions` takes precedence over it. Absent | ||
| or zero means no explicit count is available: a rebuild uses | ||
| `target_partition_size` when that is positive, and the engine's own sizing | ||
| otherwise. Absence does not imply the original build used automatic sizing, since | ||
| a writer that predates this field records no count either way. | ||
|
|
||
| Writers record only positive, representable counts, and omit a count they cannot | ||
| represent rather than truncating it. | ||
|
|
||
| `runtime_hints` carries optional build preferences that do not affect index | ||
| structure, keyed by reverse-DNS name. Unrecognized keys must be silently ignored. | ||
|
Comment on lines
+80
to
+81
Member
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. It might be nice to give some examples here (there are examples in the protobuf message comment we can copy over) |
||
|
|
||
| <details> | ||
| <summary>Full protobuf definition</summary> | ||
|
|
||
| ```protobuf | ||
| %%% proto.message.VectorIndexDetails %%% | ||
| ``` | ||
|
|
||
| </details> | ||
|
|
||
| ## Storage Layout (V3) | ||
|
|
||
| Each vector index is stored as 2 regular Lance files - index file and auxiliary file. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's odd that we use
target_num_partitionshere andnum_partitionsin all other contexts.