-
-
Notifications
You must be signed in to change notification settings - Fork 177
Rewrite Vector Core #711
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
Open
el-yawd
wants to merge
28
commits into
HelixDB:dev
Choose a base branch
from
el-yawd:hnsw-fr
base: dev
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.
Open
Rewrite Vector Core #711
Conversation
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
18e3890 to
5a7bacc
Compare
6fafa00 to
e064e1c
Compare
Contributor
|
Skipped: This PR changes more files than the configured file change limit: ( |
the idea is to delay the HVector creation as much as possible, since its creation is expensive
Still room for improvements since it does two allocations for vector :/
Yeah, this sucks. Althought the current approach incrementally rebuilds the index, it's way more expensive than it should
Only supports Cosine for now, but we definitely want to support more distance methods
What's life but a collection of tests to pass?
get_item bound HVector to 'txn lifetime, doing zero-copy, but this complicates some traversal operations. So now, when data is required, we allocates using the arena and therefore binds HVector's lifetime to the arena
Author
|
@matthewsanetra wdyt? |
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.
Description
What began with a simple change to apply zero-copy on data end up in a saga.
This PR is entirely and unashamed based on the incredible crate hannoy, the intent with the rewrite is to make the vector core easier to work with, more performant (by reducing allocations and copies), and for free we gained future support for quantization and other distance methods. There is only three caveats:
u32for vector ids, but we useu128as a global id. To don't loose hannoy's optimizations I chose to map the "global"u128to a "local"u32id, and back-and-forth. Probably there is a better approach here, so any light on this is welcome.f64tof32, since it seems to be the default approach among vector databases.Checklist when merging to main
rustfmthelix-cli/Cargo.tomlandhelixdb/Cargo.toml