Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: improve constructing dist table #3155

Merged
merged 4 commits into from
Nov 23, 2024

Conversation

BubbleCal
Copy link
Contributor

construc_dist_table: 16000,l2,PQ=96,DIM=1536
                        time:   [157.75 µs 157.97 µs 158.19 µs]
                        change: [-28.865% -28.731% -28.581%] (p = 0.00 < 0.10)
                        Performance has improved.

construc_dist_table: 16000,dot,PQ=96,DIM=1536
                        time:   [275.56 µs 276.02 µs 276.47 µs]
                        change: [-2.8930% -2.4637% -2.0839%] (p = 0.00 < 0.10)
                        Performance has improved.

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@BubbleCal
Copy link
Contributor Author

dot distance type doesn't benefit much from this optimization, any ideas? @eddyxu

@BubbleCal BubbleCal marked this pull request as ready for review November 22, 2024 11:16
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 79.31034% with 12 lines in your changes missing coverage. Please review.

Project coverage is 77.95%. Comparing base (d79e870) to head (a2a37a5).

Files with missing lines Patch % Lines
rust/lance-index/src/vector/pq.rs 60.00% 10 Missing ⚠️
rust/lance-index/src/vector/pq/distance.rs 93.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3155      +/-   ##
==========================================
- Coverage   77.95%   77.95%   -0.01%     
==========================================
  Files         242      242              
  Lines       82436    82511      +75     
  Branches    82436    82511      +75     
==========================================
+ Hits        64262    64318      +56     
- Misses      14960    14985      +25     
+ Partials     3214     3208       -6     
Flag Coverage Δ
unittests 77.95% <79.31%> (-0.01%) ⬇️

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.


🚨 Try these New Features:

@eddyxu
Copy link
Contributor

eddyxu commented Nov 22, 2024

dot distance type doesn't benefit much from this optimization, any ideas?

do we know if this is memory-bandwidth bound or just compute bound? we can look into that later.

@BubbleCal
Copy link
Contributor Author

dot distance type doesn't benefit much from this optimization, any ideas?

do we know if this is memory-bandwidth bound or just compute bound? we can look into that later.

I think it's still compute bound, because L2 is much faster than dot, I'm thinking whether the 1-dot way leads to the compiler can't generate good enough code

@BubbleCal BubbleCal merged commit 439db38 into lancedb:main Nov 23, 2024
26 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.

4 participants