Skip to content

vector-store: parallelize diskann msg handling - #547

Open
Akvear wants to merge 3 commits into
scylladb:masterfrom
Akvear:diskann-parallel
Open

vector-store: parallelize diskann msg handling#547
Akvear wants to merge 3 commits into
scylladb:masterfrom
Akvear:diskann-parallel

Conversation

@Akvear

@Akvear Akvear commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This PR is split into 3:

  • Refactoring diskann to match usearch sync preproccess -> concurrent process
  • Adding new variants to worker
  • Using the new worker to enable concurrency in diskann

@Akvear
Akvear requested a balanced review from Copilot August 6, 2026 12:52

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

Parallelizes DiskANN message processing through the shared worker pool.

Changes:

  • Adds worker support for asynchronous tasks.
  • Refactors DiskANN into preprocessing and concurrent processing stages.
  • Introduces atomic index-size tracking.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/vector-store/src/worker.rs Adds asynchronous worker variants and thread execution support.
crates/vector-store/src/vs_index/diskann.rs Dispatches DiskANN operations concurrently.
Suppressed comments (1)

crates/vector-store/src/vs_index/diskann.rs:285

  • spawn_async_blocking only enqueues this future, and the worker has multiple consumers, so consecutive mutations for the same partition can now run concurrently or out of order. For example, an AddVector followed by RemoveVector may execute the removal first and then leave the vector indexed even though both in-progress guards complete. Gate per-partition mutations with operation permits/FIFO sequencing (as the usearch path does for conflicting operation modes) before dispatching them.
        worker.spawn_async_blocking(task).await;

Comment thread crates/vector-store/src/vs_index/diskann.rs Outdated
@Akvear
Akvear force-pushed the diskann-parallel branch from 7eeda1c to cc2662b Compare August 6, 2026 13:47
@Akvear
Akvear requested a review from ewienik August 6, 2026 14:17

@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.

Consider splitting separate commit for worker refactor and after that commit which uses new worker in diskann.
Do testing if changing tokio runtime makes panics or not.

Comment thread crates/vector-store/src/worker.rs Outdated
@Akvear
Akvear force-pushed the diskann-parallel branch from cc2662b to 197e2b4 Compare August 7, 2026 09:33
@Akvear
Akvear marked this pull request as ready for review August 7, 2026 10:15
@Akvear

Akvear commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Changes:

  • split commit into 1) worker refactor 2) using new worker in diskann
  • created a runtime in the separate offload thread
  • changed worker to accept FnOnce's that return a future instead of passing futures

@Akvear
Akvear requested review from QuerthDP and ewienik August 7, 2026 10:16
ewienik
ewienik previously approved these changes Aug 7, 2026

@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.

Seems ok. Need only rebase to master

Akvear added 3 commits August 7, 2026 18:35
Like in usearch, before comitting to parallel msg handling
we seperate into sync preprocess and process which will use worker
to spawn new tasks. To avoid having to use locks.

These changes do not change the behaviour
this is a setup for parallelism
This are not exactly async FnOnce because they are unstable and not dyn compatible, but a Boxed FnOnce returning a BoxFuture

a new runtime is built in the dedicated offload thread
thanks to changes in the previous commit, we can now spawn tasks using the worker, full parallelizing diskann execution
@Akvear

Akvear commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

rebased on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants