Repository navigation
perf(vamana): pass query parameters directly and compact neighbor candidates - #932
Merged
Merged
Conversation
Replace per-search construction and lookup of the EF, PO and PL Params entries with a typed VamanaContext::update_query_params call. Keep generic update(Params) as an adapter to the same implementation so heap limits, automatic prefetch resolution and partial updates preserve their existing semantics. Keep parameter validation and clamping at the interface boundary. Validated with Vamana, internal-ID, refinement and lifecycle Python regression suites and interleaved same-index SIFT/Cohere measurements.
Separate visited filtering from vector address resolution in the fast greedy search loop. Use branchless bitmap compaction while retaining candidate order and the check-before-set behavior of other visit filters. Apply the prefetch budget to the compacted unvisited vectors. Validation: 258 Python/ANN tests. Exact IDs and ordering match the control in SIFT checks, with unchanged Cohere public Query IDs and recall. GCC13 -O3, no LTO or PGO, fixed indexes/parameters, three interleaved repeats: - SIFT >=99% point: 21,693 to 24,818 internal-IDs QPS (+14.4%). - Cohere public Vamana Query: +0.76% to +2.56% across tested points. - VDB CLI Vamana ef128/refine, concurrency 1/16, 30 seconds each: +1.18% / +1.17%, unchanged recall. Full comparator and R64-graph runs are tracked separately; no overall leaderboard claim is made by this commit.
luoxiaojian
approved these changes
Nov 25, 2026
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.
Vamana currently builds a three-entry
Paramsdictionary for every search and mixes visited checks with vector address resolution during neighbor expansion. This PR reduces both costs while keeping the search parameters and candidate evaluation order unchanged.VamanaContext::update_query_params; retainupdate(Params)as an adapter with the same partial-update, heap-limit and automatic-prefetch behavior.The two changes remain separate commits in this PR. Public
Queryrouting is handled separately in #933; this branch changes only four Vamana files.Performance evidence
Historical isolated measurements on SIFT1M, top-10, Xeon Platinum 8369B, GCC13
-O3, no LTO/PGO, with fixed indexes and search parameters:query_internal_idsQPS over eight settings, worst setting +0.60% (first 2,000 official queries; three interleaved repeats).The loop measurements use native C++ and all 10,000 official queries; they exclude Python request/result conversion. Eight independent process pairs were used for the one-worker run and four paired process groups for the 31-worker run. IDs, ordering and recall matched the control. These figures are independent historical deltas, not an additive combined gain or a new benchmark of current main.