Repository navigation
feat(diskann): add configurable partitioned builds to reduce build memory - #867
Open
richyreachy wants to merge 9 commits into
Open
richyreachy wants to merge 9 commits into
richyreachy wants to merge 9 commits into
Conversation
# Conflicts: # src/core/algorithm/diskann/diskann_builder.cc # src/core/algorithm/diskann/diskann_params.h
…ed build The partitioned builder encoded PQ codes single-threaded, which dominated build time (5.5 min of 9.7 min on Cohere 1M). Stripe each batch across the builder thread pool; encode now takes ~40 s. It also picked the medoid from the first reservoir sample and used the farthest-point centers as entry points, which are outliers by construction. Searches started far from the data mass and ran ~12% slower than one-shot indexes. Accumulate the global mean while streaming the snapshot, pick the nearest vector as medoid during shard assignment (identical to DiskAnnBuilder::calculate_entry_point), and record each shard's medoid as an entry point. QPS now matches one-shot builds.
richyreachy
requested review from
Cuiyus,
chinaux,
iaojnh and
zhourrr
as code owners
November 2, 2026 03:15
…hy/zvec into feat/diskann-partitioned-build
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
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.
Summary
Add an optional partitioned build path for DiskANN to reduce peak working memory when building large indexes. Vectors are streamed to temporary storage, built into bounded subgraphs, and merged into a single disk-backed graph.
Partitioned builds are disabled by default in the public API.
Changes
partitioned_buildandbuild_memory_budget_gbthrough C++, Python, and database configuration.Example:
Test Results
1M Cohere Dataset