-
Notifications
You must be signed in to change notification settings - Fork 62
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
Raise diskann maximum dimension from 2K to 16K #181
Merged
Merged
+476
−56
Conversation
This file contains 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
tjgreen42
changed the title
[WIP] Extend max dimensions beyond 2K
Extend max dimensions beyond 2K
Dec 12, 2024
tjgreen42
changed the title
Extend max dimensions beyond 2K
Raise diskann maximum dimension from 2K to 16K
Dec 12, 2024
syvb
requested changes
Dec 13, 2024
syvb
previously approved these changes
Dec 16, 2024
cevian
previously approved these changes
Dec 16, 2024
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.
approved but left a few things to think about. Let me know if you decide to change anything and want another review.
cevian
approved these changes
Dec 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes #100 and raises the dimension limit for pgvectorscale's diskann index from 2000 to 16000, which is the maximum supported by the underlying pgvector
vector
type.The previous limit of 2000 was needed to ensure that all data structures could be serialized onto single 8K pages. When going beyond 2000 dimensions, so long as SBQ is used for storage, quantized vectors, neighbor lists, and other data structures will still fit on a single page; the only thing that grows too large is
SbqMeans
. (The raw vectors used for reranking remain in the source relation, where standard Postgres TOAST machinery is used to read/write them). If plain storage is used, the old limit of 2000 remains in place.To deal with
SbqMeans
, we introduce aChainTape
data structure that is similar toTape
but supports reads/writes of large buffers across pages. The chained representation is considered a property of thePageType
, and we introduce a newPageType
forSbqMeans
along with upgrade machinery from the old version. Similarly to the versionedMetaPage
, there are no unit tests for this, but I did ad-hoc testing to confirm that the upgrade path works.