Skip to content

perf: improve 4bit PQ performance#3557

Merged
BubbleCal merged 5 commits intolance-format:mainfrom
BubbleCal:improve-4bit-pq
Mar 22, 2025
Merged

perf: improve 4bit PQ performance#3557
BubbleCal merged 5 commits intolance-format:mainfrom
BubbleCal:improve-4bit-pq

Conversation

@BubbleCal
Copy link
Copy Markdown
Contributor

@BubbleCal BubbleCal commented Mar 17, 2025

this also fixes a bug that the AddAssign impl for u8x16 is not saturated

  • 2x faster than before, so 4x faster than 8bit PQ
  • slightly improves recall

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
…4bit-pq

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 95.48872% with 6 lines in your changes missing coverage. Please review.

Project coverage is 78.91%. Comparing base (ff2ab10) to head (aa26426).
Report is 288 commits behind head on main.

Files with missing lines Patch % Lines
rust/lance-index/src/vector/pq/distance.rs 97.05% 1 Missing and 2 partials ⚠️
rust/lance-index/src/vector/flat/index.rs 80.00% 2 Missing ⚠️
rust/lance-index/src/vector/sq/storage.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3557      +/-   ##
==========================================
+ Coverage   78.81%   78.91%   +0.10%     
==========================================
  Files         256      256              
  Lines       95958    96546     +588     
  Branches    95958    96546     +588     
==========================================
+ Hits        75625    76193     +568     
- Misses      17265    17284      +19     
- Partials     3068     3069       +1     
Flag Coverage Δ
unittests 78.91% <95.48%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BubbleCal BubbleCal marked this pull request as ready for review March 20, 2025 11:56
// compute the distances for first k_hint rows
// then use the max distance as qmax to quantize the distance table
let k_hint = min(k_hint, num_vectors);
let flat_num = max(200, k_hint).min(num_vectors);
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.

Would be nice to leave a comment about why 200 was selected here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added comments for this

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@BubbleCal BubbleCal merged commit ddb3b86 into lance-format:main Mar 22, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants