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

sparse vectors support #20

Merged
merged 12 commits into from
Dec 7, 2023
Merged

sparse vectors support #20

merged 12 commits into from
Dec 7, 2023

Conversation

agourlay
Copy link
Member

@agourlay agourlay commented Dec 4, 2023

This PR adds support for sparse vectors.

cargo run -- -n 10000 --dim 2048 --search --sparse-vectors --on-disk-index

--- Search timings ---
Min search time: 0.000557541
Avg search time: 0.10446536149315065
p95 search time: 0.380973509
p99 search time: 0.412968431
Max search time: 0.475767685
--- Server timings ---
Min search time: 0.000256465
Avg search time: 0.10361921244292235
p95 search time: 0.379839804
p99 search time: 0.411853914
Max search time: 0.474702047
--- RPS ---
Min rps: 21.732467847307905
Avg rps: 37.99061218217272
p95 rps: 67.7935806787728
p99 rps: 100.30751254181632
Max rps: 119.50527106181168

result from my busy laptop

Future work

  • load sparse vectors from file (maybe SLADE format as well)

@agourlay agourlay marked this pull request as ready for review December 4, 2023 15:50
@timvisee
Copy link
Member

timvisee commented Dec 5, 2023

I've changed the --on-disk-index flag from bool to Option<bool>. It makes it a bit less nice to invoke because it requires --on-disk-index true this way, but it's important to support all three variants: None, Some(true), Some(false).

@timvisee
Copy link
Member

timvisee commented Dec 5, 2023

Also, here are results on my busy machine:

$ bfb -n 10000 --dim 2048 --search --sparse-vectors --on-disk-index true
--- Search timings ---
Min search time: 0.000249218
Avg search time: 0.022734802924000017
p95 search time: 0.044381216
p99 search time: 0.046892587
Max search time: 0.073775338
--- Server timings ---
Min search time: 0.00008789
Avg search time: 0.022489696575899967
p95 search time: 0.044086216
p99 search time: 0.046608329
Max search time: 0.073426011
--- RPS ---
Min rps: 86.02060530603548
Avg rps: 88.08529494580816
p95 rps: 89.89534703227301
p99 rps: 90.0289776225274
Max rps: 1116.6270267271339

$ bfb -n 10000 --dim 2048 --search --sparse-vectors --on-disk-index false
--- Search timings ---
Min search time: 0.000220528
Avg search time: 0.02254625945380004
p95 search time: 0.044441273
p99 search time: 0.047454161
Max search time: 0.068276639
--- Server timings ---
Min search time: 0.000060349
Avg search time: 0.022295191263000034
p95 search time: 0.044145646
p99 search time: 0.047097525
Max search time: 0.067878882
--- RPS ---
Min rps: 86.89633905494993
Avg rps: 89.26247468255279
p95 rps: 93.62051455556441
p99 rps: 103.21010632830085
Max rps: 237.56436290017766

@KShivendu
Copy link
Member

Small change: #21

KShivendu and others added 2 commits December 7, 2023 14:10
fix: Display --sparse-vector SPARSITY in help to clarify the usage
@generall generall merged commit 9c33b75 into dev Dec 7, 2023
@agourlay agourlay deleted the sparse-vectors branch December 7, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants