Skip to content

perf: size multivector partitions by vectors, impute from unprobed ones - #11712

Merged
Xuanwo merged 1 commit into
lance-format:mainfrom
wkalt:ticket/oss-3262/multivector-partitions-by-vectors
Dec 3, 2026
Merged

Xuanwo merged 1 commit into
lance-format:mainfrom
wkalt:ticket/oss-3262/multivector-partitions-by-vectors

Conversation

@wkalt

@wkalt wkalt commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

A multivector index took its default partition count from the row count, so a table of many-vector rows got a handful of partitions, or one, and every query scored nearly every vector. The count now comes from the vectors the rows hold.

Finer partitions exposed WARP's default imputation rank. With partitions sized for vectors the walk to t' stops inside the query token's best partition, so a document no probe observed was imputed almost the best similarity and outranked observed ones; recall fell as nprobes grew. By default the walk now covers only the partitions the query token did not probe, which is where an unobserved document's tokens are. An explicit t' still walks every partition.

Recall without refine is a few points lower than with one coarse partition, the usual IVF trade. Index build memory for rows of many vectors is unchanged here and is a follow-up.

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@wkalt

wkalt commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Benchmark, main (4685c05) vs this branch (b9119f3). Same benchmark source built on both, same data, 20 queries, k = 10, default nprobes, IVF_PQ cosine with dim / 4 sub-vectors, 32 cores. Recall@10 is against exact search; every run on both sides returns the row the query was taken from.

table partitions ms / query peak query heap recall@10
50k rows x 64 vectors, 64-d, 32-vector queries 6 -> 390 131 -> 9.8 136 -> 34 MiB 0.94 -> 0.83
same, refine_factor = 5 128 -> 13 1.00 -> 0.99
200 rows x 10,000 vectors, 512-d, 1-vector queries 1 -> 244 73 -> 5.1 63 -> 60 MiB 0.90 -> 0.86
20 rows x 100,000 vectors, 512-d, 1-vector queries 1 -> 244 86 -> 4.6 63 -> 48 MiB 0.73 -> 0.62

At nprobes = 128 the branch reaches 0.91, 0.89 and 0.62 at 29, 7.1 and 5.7 ms.

Updated after the imputation walk changed to skip probed partitions. Recall moves a few points between index builds, so to isolate that change I ran the previous revision (8c9bc13) and this one on the same built index. The 1-vector-query tables are identical. On the 64-vector table with 200 queries, recall@10 is 0.86 -> 0.85 at default nprobes, 0.84 -> 0.83 at 8 and 0.90 -> 0.91 at 128.

Data:

  • 64-vector rows: each row draws its vectors from 4 of 512 random topic centers, with uniform noise of +/-0.3 per dimension. A query is the first 32 vectors of a row plus +/-0.1 noise.
  • Large rows: each row is a path between waypoints, 500 vectors per segment (2,000 for the 100,000-vector rows), +/-0.05 noise. A waypoint is one of 512 topic centers offset by a random amount up to +/-0.5 per dimension, so rows that share a topic match by degree. A query is a row's first vector plus +/-0.1 noise.

The last table ranks 10 of only 20 rows, about 6 of them within 1% of the 10th, so its recall is a weak signal in both columns.

Without the probe ranking fix in #11707, the large-row tables miss the query's own row for 4 to 8 of 20 queries at the new partition count.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Dec 1, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[AI] rank_past_probes says an unobserved document can never be imputed a probed partition’s similarity. Probe selection uses L2, while missing_similarity walks partitions by dot product. Unequal centroid norms can put those walks in different orders.

For q = (1, 0), take centroids A = (0.6, 0) and B = (0.7, 0.7) with populations 100 and 1. With one probe, L2 selects A (closeness 0.42 versus 0.21), so a base rank of 1 rises to 101. The dot-product walk visits B first, then reaches 101 in A and returns the probed similarity, 0.6.

Could you add this unequal-norm case to the tests and describe the token-count adjustment as a heuristic? If excluding probed similarities is part of the scoring contract, the imputation walk needs to account for which partitions were probed.

@wkalt
wkalt force-pushed the ticket/oss-3262/multivector-partitions-by-vectors branch from 8c9bc13 to b9119f3 Compare December 2, 2026 06:01
@wkalt wkalt changed the title perf: size multivector partitions by vectors, impute past the probes perf: size multivector partitions by vectors, impute from unprobed ones Dec 2, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Dec 2, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Dec 2, 2026
@wkalt

wkalt commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@Xuanwo addressed

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. and removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Dec 2, 2026
@wkalt

wkalt commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Combined effect of the four multivector changes. "Before" is main without any of them; "after" is main with #11809 (merged) plus #11707, this PR and #11713. IVF_PQ, default partitions and nprobes, 100 queries, local disk; ranges are over three index builds. Every run returns the source row first.

rows partitions build peak heap build time query query peak heap recall@10
200 rows of 10,000 512-d vectors, 1-vector queries before 1 14.2 GB 34-35 s 80-82 ms 63 MiB 0.91
after 244 3.0-3.2 GB 12 s 15-17 ms 28-32 MiB 0.88-0.90
20 rows of 100,000 512-d vectors, 1-vector queries before 1 12.0 GB 64-76 s 74-88 ms 63 MiB 0.72-0.74
after 244 4.0-4.6 GB 13 s 6-17 ms 25-35 MiB 0.58-0.69
50,000 rows of 64 64-d vectors, 32-vector queries before 6 0.46 GB 1.5-1.7 s 131-170 ms 131 MiB 0.92-0.93
after 390 0.44 GB 1.8 s 9-10 ms 33-36 MiB 0.85-0.88

The 20-row table ranks 10 of 20 rows, with several within 1% of the 10th, so its recall is a weak signal.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. and removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Dec 2, 2026
@wkalt
wkalt requested a review from Xuanwo December 3, 2026 17:44
A multivector index took its default partition count from the row
count, so a table of many-vector rows got a handful of partitions, or
one, and every query scored nearly every vector. The count now comes
from the vectors the rows hold.

Finer partitions exposed WARP's default imputation rank. With
partitions sized for vectors the walk to `t'` stops inside the query
token's best partition, so a document no probe observed was imputed
almost the best similarity and outranked observed ones; recall fell as
nprobes grew. By default the walk now covers only the partitions the
query token did not probe, which is where an unobserved document's
tokens are. An explicit `t'` still walks every partition.
@wkalt
wkalt force-pushed the ticket/oss-3262/multivector-partitions-by-vectors branch from b9119f3 to 03cb97f Compare December 3, 2026 19:50
@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Dec 3, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Gate recommendation: approve with a non-blocking risk.

The earlier benchmark documents faster queries with lower unrefined recall, which the PR accepts. Recall-sensitive workloads can use refinement or tune probe counts. No blocking issues found.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Dec 3, 2026
@Xuanwo
Xuanwo merged commit d031afd into lance-format:main Dec 3, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants