Skip to content

vector-store: using new inmem provider in diskann - #540

Open
Akvear wants to merge 7 commits into
scylladb:masterfrom
Akvear:new-inmem-basics
Open

vector-store: using new inmem provider in diskann#540
Akvear wants to merge 7 commits into
scylladb:masterfrom
Akvear:new-inmem-basics

Conversation

@Akvear

@Akvear Akvear commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR is an alternative to #535 with the newly merged Diskann In Mem 2.0 provider.
It is more convenient to use because of arbitrary ids but it is still experimental and likely to require fixes from the DiskANN team. I think it's better to try and incorporate it rather than relying on the old provider.

Fixes: VECTOR-714

@Akvear
Akvear force-pushed the new-inmem-basics branch 2 times, most recently from bd540b4 to 39cd783 Compare July 30, 2026 10:26
@Akvear
Akvear requested a review from ewienik July 30, 2026 10:43

@ewienik ewienik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When #536 is merged diskann will need to use Worker to spawn work

Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/table/primary_id.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
@Akvear
Akvear force-pushed the new-inmem-basics branch from 39cd783 to 77553f3 Compare July 30, 2026 13:26
@Akvear

Akvear commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Changes:

  • removed unused diskann-providers
  • removed Default from PrimaryId derives
  • added partitioning straight away
  • added memory allocation subsciber

Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread Cargo.lock
Comment thread Cargo.toml
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
@Akvear
Akvear force-pushed the new-inmem-basics branch from 77553f3 to 74cdaf0 Compare July 30, 2026 15:19
@Akvear

Akvear commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

no need for review yet

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements baseline DiskANN vector operations using the new experimental in-memory provider.

Changes:

  • Adds vector insertion, deletion, ANN search, and counting.
  • Introduces partition and memory-allocation handling.
  • Updates DiskANN dependencies to the new provider revision.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
crates/vector-store/src/vs_index/diskann.rs Implements DiskANN index operations.
crates/vector-store/Cargo.toml Replaces the legacy provider dependency.
Cargo.toml Updates DiskANN revisions and provider dependency.
Cargo.lock Records resolved dependency changes.

Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs
Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs
@Akvear
Akvear force-pushed the new-inmem-basics branch from 04c207f to 885a401 Compare July 31, 2026 12:59
@Akvear

Akvear commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Changes:

  • addressed nits
  • changed counter to be per IndexId
  • used inplace_delete() instead of data_provider.delete() in remove_vector()
  • added remove partition
  • moved index creation function to impl State
  • used the first incoming vector as the starting point for the index

@Akvear
Akvear requested a review from ewienik July 31, 2026 13:13
@Akvear
Akvear marked this pull request as ready for review July 31, 2026 13:16
Akvear added 2 commits July 31, 2026 17:38
this crate was just merged into DiskANN and provides In-Mem 2.0 which has significant improvements like:
- arbitrary ExternalIds
- improved concurrency safety of insert/delete/search
On top of that there is an additional commit with fix
to compilation
this commit SHA is used to include both the changes and the fix
…ider

The new inmem provider has similar API to the current one
but comes with performance, safety and general improvements
@Akvear
Akvear force-pushed the new-inmem-basics branch from 885a401 to d506caf Compare July 31, 2026 15:41
@Akvear

Akvear commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

rebased on master

@ewienik ewienik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR needs to be rebased with master

Edit (already done :-) )

Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
Comment thread crates/vector-store/src/vs_index/diskann.rs
@Akvear
Akvear force-pushed the new-inmem-basics branch from d506caf to 13aed03 Compare July 31, 2026 15:44
Akvear added 3 commits July 31, 2026 19:06
operates on a sigle tokio worker
in inplace_delete() we pass pruned_degree as num to replace
this tells diskann engine how many replacement edges should be added
per affected (neighbour of deleted) node
index.search() outputs a vector of neighbours that need distances to be added to them, hence the State::search() helper

added space_type, l_default and beam_width to DiskannParams added to unit test
remove partition doesnt affect count, same as in usearch.
@Akvear
Akvear force-pushed the new-inmem-basics branch from 13aed03 to 7ce2bc0 Compare July 31, 2026 17:22
@Akvear

Akvear commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

changes:

  • reduced number of lookups in get_or_create_partition()
  • moved create_diskann_index() outside from impl State block to avoid issues with borrow checker

@Akvear
Akvear requested a review from ewienik July 31, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants