@@ -10,11 +10,11 @@ All major HNSW implementation share an identical list of hyper-parameters:
10
10
11
11
The default values vary drastically.
12
12
13
- | Library | Connectivity | EF @ A | EF @ S |
14
- | :-------: | : ----------: | : ----: | : ----: |
15
- | ` hnswlib ` | 16 | 200 | 10 |
16
- | ` FAISS ` | 32 | 40 | 16 |
17
- | ` USearch ` | 16 | 128 | 64 |
13
+ | Library | Connectivity | EF @ A | EF @ S |
14
+ | :-------- | ----------- : | ----- : | - ----: |
15
+ | ` hnswlib ` | 16 | 200 | 10 |
16
+ | ` FAISS ` | 32 | 40 | 16 |
17
+ | ` USearch ` | 16 | 128 | 64 |
18
18
19
19
Below are the performance numbers for a benchmark running on the 64 cores of AWS ` c7g.metal ` "Graviton 3"-based instances.
20
20
The main columns are:
@@ -26,27 +26,27 @@ The main columns are:
26
26
### Different "connectivity"
27
27
28
28
| Vectors | Connectivity | EF @ A | EF @ S | __ Add__ , QPS | __ Search__ , QPS | __ Recall @1__ |
29
- | :--------- | : ----------: | : ----: | : ----: | : ----------: | : -------------: | ------------: |
30
- | ` f32 ` x256 | 16 | 128 | 64 | 75'640 | 131'654 | 99.3% |
31
- | ` f32 ` x256 | 12 | 128 | 64 | 81'747 | 149'728 | 99.0% |
32
- | ` f32 ` x256 | 32 | 128 | 64 | 64'368 | 104'050 | 99.4% |
29
+ | :--------- | ----------- : | ----- : | ----- : | ----------- : | - -------------: | ------------: |
30
+ | ` f32 ` x256 | 16 | 128 | 64 | 75'640 | 131'654 | 99.3% |
31
+ | ` f32 ` x256 | 12 | 128 | 64 | 81'747 | 149'728 | 99.0% |
32
+ | ` f32 ` x256 | 32 | 128 | 64 | 64'368 | 104'050 | 99.4% |
33
33
34
34
### Different "expansion factors"
35
35
36
36
| Vectors | Connectivity | EF @ A | EF @ S | __ Add__ , QPS | __ Search__ , QPS | __ Recall @1__ |
37
- | :--------- | : ----------: | : ----: | : ----: | : ----------: | : -------------: | ------------: |
38
- | ` f32 ` x256 | 16 | 128 | 64 | 75'640 | 131'654 | 99.3% |
39
- | ` f32 ` x256 | 16 | 64 | 32 | 128'644 | 228'422 | 97.2% |
40
- | ` f32 ` x256 | 16 | 256 | 128 | 39'981 | 69'065 | 99.2% |
37
+ | :--------- | ----------- : | ----- : | ----- : | ----------- : | - -------------: | ------------: |
38
+ | ` f32 ` x256 | 16 | 128 | 64 | 75'640 | 131'654 | 99.3% |
39
+ | ` f32 ` x256 | 16 | 64 | 32 | 128'644 | 228'422 | 97.2% |
40
+ | ` f32 ` x256 | 16 | 256 | 128 | 39'981 | 69'065 | 99.2% |
41
41
42
42
### Different vectors "quantization"
43
43
44
44
| Vectors | Connectivity | EF @ A | EF @ S | __ Add__ , QPS | __ Search__ , QPS | __ Recall @1__ |
45
- | :----------- | : ----------: | : ----: | : ----: | : ----------: | : -------------: | ------------: |
46
- | ` f32 ` x256 | 16 | 128 | 64 | 87'995 | 171'856 | 99.1% |
47
- | ` f16 ` x256 | 16 | 128 | 64 | 87'270 | 153'788 | 98.4% |
48
- | ` f16 ` x256 ✳️ | 16 | 128 | 64 | 71'454 | 132'673 | 98.4% |
49
- | ` i8 ` x256 | 16 | 128 | 64 | 115'923 | 274'653 | 98.9% |
45
+ | :----------- | ----------- : | ----- : | ----- : | ----------- : | - -------------: | ------------: |
46
+ | ` f32 ` x256 | 16 | 128 | 64 | 87'995 | 171'856 | 99.1% |
47
+ | ` f16 ` x256 | 16 | 128 | 64 | 87'270 | 153'788 | 98.4% |
48
+ | ` f16 ` x256 ✳️ | 16 | 128 | 64 | 71'454 | 132'673 | 98.4% |
49
+ | ` i8 ` x256 | 16 | 128 | 64 | 115'923 | 274'653 | 98.9% |
50
50
51
51
As seen on the chart, for ` f16 ` quantization, performance may differ depending on native hardware support for that numeric type.
52
52
Also worth noting, 8-bit quantization results in almost no quantization loss and may perform better than ` f16 ` .
@@ -58,9 +58,12 @@ Within this repository you will find two commonly used utilities:
58
58
- ` cpp/bench.cpp ` the produces the ` bench_cpp ` binary for broad USearch benchmarks.
59
59
- ` python/bench.py ` and ` python/bench.ipynb ` for interactive charts against FAISS.
60
60
61
+ ### C++ Benchmarking Utilities
62
+
61
63
To achieve best highest results we suggest compiling locally for the target architecture.
62
64
63
65
``` sh
66
+ git submodule update --init --recursive
64
67
cmake -USEARCH_BUILD_BENCH_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -B build_profile
65
68
cmake --build build_profile --config RelWithDebInfo -j
66
69
build_profile/bench_cpp --help
@@ -146,11 +149,20 @@ build_profile/bench_cpp \
146
149
--cos
147
150
```
148
151
149
-
150
152
> Optional parameters include ` connectivity ` , ` expansion_add ` , ` expansion_search ` .
151
153
152
154
For Python, jut open the Jupyter Notebook and start playing around.
153
155
156
+ ### Python Benchmarking Utilities
157
+
158
+ Several benchmarking suites are available for Python: approximate search, exact search, and clustering.
159
+
160
+ ``` sh
161
+ python/scripts/bench.py --help
162
+ python/scripts/bench_exact.py --help
163
+ python/scripts/bench_cluster.py --help
164
+ ```
165
+
154
166
## Datasets
155
167
156
168
BigANN benchmark is a good starting point, if you are searching for large collections of high-dimensional vectors.
0 commit comments