You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "shyjsarah (via GitHub)" <gi...@apache.org> on 2026/07/28 13:12:19 UTC

[PR] [WIP] ivfpq: Reuse list tables in batch search [paimon-vector-index]

shyjsarah opened a new pull request, #65:
URL: https://github.com/apache/paimon-vector-index/pull/65

   ## Summary
   
   Reuse batch-local IVF-PQ list tables when many queries probe the same lists. The optimization applies to both filtered and unfiltered batch search and is enabled only when the estimated reuse amortizes table construction.
   
   This PR is stacked on #64. Until #64 merges, GitHub also shows the filter-scanning commit; the PR-specific commit is `ddbf60a`.
   
   ## Changes
   
   - Build the list-dependent part of residual L2 PQ tables once per active loaded list.
   - Build the query-dependent inner-product table once per active query in each loaded-list batch.
   - Combine the list and query components before scanning instead of rebuilding a full residual table for every query/list pair.
   - Apply the same optimization to `filter=None`; treat no filter as all loaded rows being active.
   - Skip ephemeral precomputation for small batches, insufficient probe reuse, empty filtered lists, unsupported metrics/layouts, or readers with persistent precomputed tables.
   - Keep ephemeral tables batch-local so they do not remain resident on the reader.
   
   ## Testing
   
   - `cargo fmt --all -- --check`
   - `cargo clippy -p paimon-vindex-core --all-targets -- -D warnings`
   - `cargo test -p paimon-vindex-core --locked`
   - Verified filtered and unfiltered batch results against individual reader searches with floating-point tolerance.
   - Covered activation for large filtered and unfiltered batches.
   - Covered fallback for small batches, single-probe work, and empty filters.
   
   ## Notes
   
   - Depends on #64.
   - Public API: unchanged.
   - The precomputed and direct residual formulas are algebraically equivalent but can differ slightly due to floating-point accumulation order.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ivfpq: Reuse list tables in batch search [paimon-vector-index]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #65:
URL: https://github.com/apache/paimon-vector-index/pull/65#issuecomment-5118929917

   
   When temporary table reuse is enabled, there is no restriction that `pq.nbits == 8`; therefore, the default `auto` setting also enters the 4-bit path and passes the newly generated f64→f32 table to the 4-bit quantization scan for processing (`core/src/ivfpq.rs:1633`).
   - This causes **4-bit Top-K to vary with batch size**: when `nq < 64`, the old path is taken, but when `nq >= 64`, reuse may be automatically enabled, resulting in behavior that no longer matches that of the `off` mode or the behavior prior to the merge.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ivfpq: Reuse list tables in batch search [paimon-vector-index]

Posted by "shyjsarah (via GitHub)" <gi...@apache.org>.
shyjsarah commented on PR #65:
URL: https://github.com/apache/paimon-vector-index/pull/65#issuecomment-5125955836

   Thanks for catching this. Fixed in `81e6170` by requiring `pq.nbits == 8` before enabling batch-local ephemeral table reuse. As a result, 4-bit `auto` and `on` keep the existing direct/resident table paths, without changing the 4-bit scan kernels.
   
   Added regression coverage that verifies:
   
   - 4-bit `auto` and `on` do not create ephemeral list tables.
   - 4-bit `auto` exactly matches `off` IDs and distances at the automatic activation threshold.
   
   The full Rust workspace, Clippy, formatting, and Java tests pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ivfpq: Reuse list tables in batch search [paimon-vector-index]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #65:
URL: https://github.com/apache/paimon-vector-index/pull/65


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ivfpq: Reuse list tables in batch search [paimon-vector-index]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #65:
URL: https://github.com/apache/paimon-vector-index/pull/65#issuecomment-5126962023

   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org