redisbench-admin 0.11.1__py3-none-any.whl → 0.11.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- redisbench_admin/compare/compare.py +3 -3
- redisbench_admin/deploy/deploy.py +1 -9
- redisbench_admin/export/export.py +1 -7
- redisbench_admin/profilers/perf.py +24 -24
- redisbench_admin/run/ann/pkg/.dockerignore +2 -0
- redisbench_admin/run/ann/pkg/.git +1 -0
- redisbench_admin/run/ann/pkg/.github/workflows/benchmarks.yml +100 -0
- redisbench_admin/run/ann/pkg/.gitignore +21 -0
- redisbench_admin/run/ann/pkg/LICENSE +21 -0
- redisbench_admin/run/ann/pkg/README.md +157 -0
- redisbench_admin/run/ann/pkg/algos.yaml +1294 -0
- redisbench_admin/run/ann/pkg/algosP.yaml +67 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/__init__.py +2 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/__init__.py +0 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/annoy.py +26 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/balltree.py +22 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/base.py +36 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/bruteforce.py +110 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/ckdtree.py +17 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/datasketch.py +29 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/definitions.py +187 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/diskann.py +190 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dolphinnpy.py +31 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dummy_algo.py +25 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elasticsearch.py +107 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elastiknn.py +124 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss.py +124 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_gpu.py +61 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_hnsw.py +39 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/flann.py +27 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/hnswlib.py +36 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kdtree.py +22 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kgraph.py +39 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/lshf.py +25 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/milvus.py +99 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/mrpt.py +41 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/n2.py +28 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nearpy.py +48 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nmslib.py +74 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/onng_ngt.py +100 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/opensearchknn.py +107 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/panng_ngt.py +79 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pinecone.py +39 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/puffinn.py +45 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pynndescent.py +115 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/qg_ngt.py +102 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/redisearch.py +90 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/rpforest.py +20 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/scann.py +34 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/sptag.py +28 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/subprocess.py +246 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vald.py +149 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vecsim-hnsw.py +43 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vespa.py +47 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/constants.py +1 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/data.py +48 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/datasets.py +620 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/distance.py +53 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/main.py +325 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/__init__.py +2 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/metrics.py +183 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/plot_variants.py +17 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/utils.py +165 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/results.py +71 -0
- redisbench_admin/run/ann/pkg/ann_benchmarks/runner.py +333 -0
- redisbench_admin/run/ann/pkg/create_dataset.py +12 -0
- redisbench_admin/run/ann/pkg/create_hybrid_dataset.py +147 -0
- redisbench_admin/run/ann/pkg/create_text_to_image_ds.py +117 -0
- redisbench_admin/run/ann/pkg/create_website.py +272 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile +11 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.annoy +5 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.datasketch +4 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.diskann +29 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.diskann_pq +31 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.dolphinn +5 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.elasticsearch +45 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.elastiknn +61 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.faiss +18 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.flann +10 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.hnswlib +10 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.kgraph +6 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.mih +4 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.milvus +27 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.mrpt +4 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.n2 +5 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.nearpy +5 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.ngt +13 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.nmslib +10 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.opensearchknn +43 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.puffinn +6 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.pynndescent +4 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.redisearch +18 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.rpforest +5 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.scann +5 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.scipy +4 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.sklearn +4 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.sptag +30 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.vald +8 -0
- redisbench_admin/run/ann/pkg/install/Dockerfile.vespa +17 -0
- redisbench_admin/run/ann/pkg/install.py +70 -0
- redisbench_admin/run/ann/pkg/logging.conf +34 -0
- redisbench_admin/run/ann/pkg/multirun.py +298 -0
- redisbench_admin/run/ann/pkg/plot.py +159 -0
- redisbench_admin/run/ann/pkg/protocol/bf-runner +10 -0
- redisbench_admin/run/ann/pkg/protocol/bf-runner.py +204 -0
- redisbench_admin/run/ann/pkg/protocol/ext-add-query-metric.md +51 -0
- redisbench_admin/run/ann/pkg/protocol/ext-batch-queries.md +77 -0
- redisbench_admin/run/ann/pkg/protocol/ext-prepared-queries.md +77 -0
- redisbench_admin/run/ann/pkg/protocol/ext-query-parameters.md +47 -0
- redisbench_admin/run/ann/pkg/protocol/specification.md +194 -0
- redisbench_admin/run/ann/pkg/requirements.txt +14 -0
- redisbench_admin/run/ann/pkg/requirements_py38.txt +11 -0
- redisbench_admin/run/ann/pkg/results/fashion-mnist-784-euclidean.png +0 -0
- redisbench_admin/run/ann/pkg/results/gist-960-euclidean.png +0 -0
- redisbench_admin/run/ann/pkg/results/glove-100-angular.png +0 -0
- redisbench_admin/run/ann/pkg/results/glove-25-angular.png +0 -0
- redisbench_admin/run/ann/pkg/results/lastfm-64-dot.png +0 -0
- redisbench_admin/run/ann/pkg/results/mnist-784-euclidean.png +0 -0
- redisbench_admin/run/ann/pkg/results/nytimes-256-angular.png +0 -0
- redisbench_admin/run/ann/pkg/results/sift-128-euclidean.png +0 -0
- redisbench_admin/run/ann/pkg/run.py +12 -0
- redisbench_admin/run/ann/pkg/run_algorithm.py +3 -0
- redisbench_admin/run/ann/pkg/templates/chartjs.template +102 -0
- redisbench_admin/run/ann/pkg/templates/detail_page.html +23 -0
- redisbench_admin/run/ann/pkg/templates/general.html +58 -0
- redisbench_admin/run/ann/pkg/templates/latex.template +30 -0
- redisbench_admin/run/ann/pkg/templates/summary.html +60 -0
- redisbench_admin/run/ann/pkg/test/__init__.py +0 -0
- redisbench_admin/run/ann/pkg/test/test-jaccard.py +19 -0
- redisbench_admin/run/ann/pkg/test/test-metrics.py +99 -0
- redisbench_admin/run/common.py +6 -24
- redisbench_admin/run/run.py +7 -3
- redisbench_admin/run_async/async_terraform.py +2 -10
- redisbench_admin/run_async/render_files.py +3 -3
- redisbench_admin/run_local/run_local.py +12 -12
- redisbench_admin/run_remote/run_remote.py +17 -15
- redisbench_admin/run_remote/standalone.py +5 -1
- redisbench_admin/run_remote/terraform.py +1 -5
- redisbench_admin/utils/remote.py +15 -9
- {redisbench_admin-0.11.1.dist-info → redisbench_admin-0.11.4.dist-info}/METADATA +3 -2
- redisbench_admin-0.11.4.dist-info/RECORD +242 -0
- redisbench_admin-0.11.1.dist-info/RECORD +0 -116
- {redisbench_admin-0.11.1.dist-info → redisbench_admin-0.11.4.dist-info}/LICENSE +0 -0
- {redisbench_admin-0.11.1.dist-info → redisbench_admin-0.11.4.dist-info}/WHEEL +0 -0
- {redisbench_admin-0.11.1.dist-info → redisbench_admin-0.11.4.dist-info}/entry_points.txt +0 -0
|
@@ -653,7 +653,7 @@ def get_by_strings(
|
|
|
653
653
|
comparison_str = comparison_branch
|
|
654
654
|
|
|
655
655
|
if baseline_tag is not None:
|
|
656
|
-
if
|
|
656
|
+
if baseline_covered:
|
|
657
657
|
logging.error(
|
|
658
658
|
"--baseline-branch and --baseline-tag are mutually exclusive. Pick one..."
|
|
659
659
|
)
|
|
@@ -1043,9 +1043,9 @@ def get_v_pct_change_and_largest_var(
|
|
|
1043
1043
|
if last_n < 0 or (last_n > 0 and len(comparison_values) < last_n):
|
|
1044
1044
|
comparison_values.append(tuple[1])
|
|
1045
1045
|
comparison_df = pd.DataFrame(comparison_values)
|
|
1046
|
-
comparison_median = float(comparison_df.median())
|
|
1046
|
+
comparison_median = float(comparison_df.median().iloc[0])
|
|
1047
1047
|
comparison_v = comparison_median
|
|
1048
|
-
comparison_std = float(comparison_df.std())
|
|
1048
|
+
comparison_std = float(comparison_df.std().iloc[0])
|
|
1049
1049
|
if verbose:
|
|
1050
1050
|
logging.info(
|
|
1051
1051
|
"comparison_datapoints: {} value: {}; std-dev: {}; median: {}".format(
|
|
@@ -73,15 +73,7 @@ def deploy_command_logic(args, project_name, project_version):
|
|
|
73
73
|
tf_triggering_env = "redisbench-admin-deploy"
|
|
74
74
|
logging.info("Setting an infra timeout of {} secs".format(infra_timeout_secs))
|
|
75
75
|
if args.destroy is False:
|
|
76
|
-
(
|
|
77
|
-
tf_return_code,
|
|
78
|
-
_,
|
|
79
|
-
_,
|
|
80
|
-
_,
|
|
81
|
-
_,
|
|
82
|
-
_,
|
|
83
|
-
_,
|
|
84
|
-
) = setup_remote_environment(
|
|
76
|
+
(tf_return_code, _, _, _, _, _, _,) = setup_remote_environment(
|
|
85
77
|
tf,
|
|
86
78
|
tf_github_sha,
|
|
87
79
|
tf_github_actor,
|
|
@@ -42,13 +42,7 @@ def export_command_logic(args, project_name, project_version):
|
|
|
42
42
|
deployment_name = args.deployment_name
|
|
43
43
|
deployment_type = args.deployment_type
|
|
44
44
|
results_format = args.results_format
|
|
45
|
-
(
|
|
46
|
-
_,
|
|
47
|
-
github_branch,
|
|
48
|
-
github_org,
|
|
49
|
-
github_repo,
|
|
50
|
-
_,
|
|
51
|
-
) = git_vars_crosscheck(
|
|
45
|
+
(_, github_branch, github_org, github_repo, _,) = git_vars_crosscheck(
|
|
52
46
|
None, args.github_branch, args.github_org, args.github_repo, None
|
|
53
47
|
)
|
|
54
48
|
exporter_timemetric_path = None
|
|
@@ -400,9 +400,9 @@ class Perf:
|
|
|
400
400
|
"Main THREAD Flame Graph: " + use_case, details
|
|
401
401
|
)
|
|
402
402
|
if artifact_result is True:
|
|
403
|
-
outputs[
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
outputs[
|
|
404
|
+
"Main THREAD Flame Graph {}".format(identifier)
|
|
405
|
+
] = flame_graph_output
|
|
406
406
|
result &= artifact_result
|
|
407
407
|
|
|
408
408
|
tid = self.pid
|
|
@@ -440,9 +440,9 @@ class Perf:
|
|
|
440
440
|
)
|
|
441
441
|
|
|
442
442
|
if artifact_result is True:
|
|
443
|
-
outputs[
|
|
444
|
-
|
|
445
|
-
|
|
443
|
+
outputs[
|
|
444
|
+
"perf report per dso,sym {}".format(identifier)
|
|
445
|
+
] = perf_report_artifact
|
|
446
446
|
result &= artifact_result
|
|
447
447
|
|
|
448
448
|
# generate perf report per dso,sym
|
|
@@ -460,9 +460,9 @@ class Perf:
|
|
|
460
460
|
)
|
|
461
461
|
|
|
462
462
|
if artifact_result is True:
|
|
463
|
-
outputs[
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
outputs[
|
|
464
|
+
"perf report per dso,sym with callgraph {}".format(identifier)
|
|
465
|
+
] = perf_report_artifact
|
|
466
466
|
result &= artifact_result
|
|
467
467
|
|
|
468
468
|
# generate perf report per dso,sym,srcline
|
|
@@ -487,9 +487,9 @@ class Perf:
|
|
|
487
487
|
)
|
|
488
488
|
|
|
489
489
|
if artifact_result is True:
|
|
490
|
-
outputs[
|
|
491
|
-
|
|
492
|
-
|
|
490
|
+
outputs[
|
|
491
|
+
"perf report per dso,sym,srcline {}".format(identifier)
|
|
492
|
+
] = perf_report_artifact
|
|
493
493
|
result &= artifact_result
|
|
494
494
|
|
|
495
495
|
self.logger.info(
|
|
@@ -527,9 +527,9 @@ class Perf:
|
|
|
527
527
|
)
|
|
528
528
|
|
|
529
529
|
if artifact_result is True:
|
|
530
|
-
outputs[
|
|
531
|
-
|
|
532
|
-
|
|
530
|
+
outputs[
|
|
531
|
+
"perf report top self-cpu {}".format(identifier)
|
|
532
|
+
] = perf_report_artifact
|
|
533
533
|
result &= artifact_result
|
|
534
534
|
|
|
535
535
|
# generate perf report --stdio report
|
|
@@ -546,9 +546,9 @@ class Perf:
|
|
|
546
546
|
)
|
|
547
547
|
|
|
548
548
|
if artifact_result is True:
|
|
549
|
-
outputs[
|
|
550
|
-
|
|
551
|
-
|
|
549
|
+
outputs[
|
|
550
|
+
"perf report top self-cpu (dso={})".format(binary)
|
|
551
|
+
] = perf_report_artifact
|
|
552
552
|
result &= artifact_result
|
|
553
553
|
|
|
554
554
|
if self.callgraph_mode == "dwarf":
|
|
@@ -590,9 +590,9 @@ class Perf:
|
|
|
590
590
|
)
|
|
591
591
|
result &= artifact_result
|
|
592
592
|
if artifact_result is True:
|
|
593
|
-
outputs[
|
|
594
|
-
|
|
595
|
-
|
|
593
|
+
outputs[
|
|
594
|
+
"Top entries in text form by LOC"
|
|
595
|
+
] = pprof_artifact_text_output
|
|
596
596
|
tabular_data_map["text-lines"] = tabular_data
|
|
597
597
|
self.logger.info("Generating pprof png output")
|
|
598
598
|
pprof_png_output = self.output + ".pprof.png"
|
|
@@ -604,9 +604,9 @@ class Perf:
|
|
|
604
604
|
self.output,
|
|
605
605
|
)
|
|
606
606
|
if artifact_result is True:
|
|
607
|
-
outputs[
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
outputs[
|
|
608
|
+
"Output graph image in PNG format"
|
|
609
|
+
] = pprof_artifact_png_output
|
|
610
610
|
result &= artifact_result
|
|
611
611
|
|
|
612
612
|
# save stack collapsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gitdir: ../../../../.git/modules/redisbench_admin/run/ann/pkg
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
name: ANN benchmarks
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
|
|
8
|
+
runs-on: ubuntu-20.04
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
include:
|
|
12
|
+
- library: annoy
|
|
13
|
+
dataset: random-xs-20-angular
|
|
14
|
+
- library: dolphinn
|
|
15
|
+
dataset: random-xs-20-angular
|
|
16
|
+
- library: faiss
|
|
17
|
+
dataset: random-xs-20-angular
|
|
18
|
+
- library: flann
|
|
19
|
+
dataset: random-xs-20-angular
|
|
20
|
+
- library: kgraph
|
|
21
|
+
dataset: random-xs-20-angular
|
|
22
|
+
- library: milvus
|
|
23
|
+
dataset: random-xs-20-angular
|
|
24
|
+
- library: mrpt
|
|
25
|
+
dataset: random-xs-20-angular
|
|
26
|
+
- library: n2
|
|
27
|
+
dataset: random-xs-20-angular
|
|
28
|
+
- library: nearpy
|
|
29
|
+
dataset: random-xs-20-angular
|
|
30
|
+
- library: ngt
|
|
31
|
+
dataset: random-xs-20-angular
|
|
32
|
+
- library: nmslib
|
|
33
|
+
dataset: random-xs-20-angular
|
|
34
|
+
- library: hnswlib
|
|
35
|
+
dataset: random-xs-20-angular
|
|
36
|
+
- library: puffinn
|
|
37
|
+
dataset: random-xs-20-angular
|
|
38
|
+
- library: pynndescent
|
|
39
|
+
dataset: random-xs-20-angular
|
|
40
|
+
- library: rpforest
|
|
41
|
+
dataset: random-xs-20-angular
|
|
42
|
+
- library: sklearn
|
|
43
|
+
dataset: random-xs-20-angular
|
|
44
|
+
- library: sptag
|
|
45
|
+
dataset: random-xs-20-angular
|
|
46
|
+
- library: mih
|
|
47
|
+
dataset: random-xs-16-hamming
|
|
48
|
+
- library: datasketch
|
|
49
|
+
dataset: random-s-jaccard
|
|
50
|
+
- library: scann
|
|
51
|
+
dataset: random-xs-20-angular
|
|
52
|
+
- library: elasticsearch
|
|
53
|
+
dataset: random-xs-20-angular
|
|
54
|
+
- library: elastiknn
|
|
55
|
+
dataset: random-xs-20-angular
|
|
56
|
+
- library: opensearchknn
|
|
57
|
+
dataset: random-xs-20-angular
|
|
58
|
+
- library: diskann
|
|
59
|
+
dataset: random-xs-20-angular
|
|
60
|
+
- library: puffinn
|
|
61
|
+
dataset: random-s-jaccard
|
|
62
|
+
- library: pynndescent
|
|
63
|
+
dataset: random-s-jaccard
|
|
64
|
+
- library: vespa
|
|
65
|
+
dataset: random-xs-20-angular
|
|
66
|
+
- library: scipy
|
|
67
|
+
dataset: random-xs-20-angular
|
|
68
|
+
- library: vald
|
|
69
|
+
dataset: random-xs-20-angular
|
|
70
|
+
fail-fast: false
|
|
71
|
+
|
|
72
|
+
steps:
|
|
73
|
+
- uses: actions/checkout@v2 # Pull the repository
|
|
74
|
+
|
|
75
|
+
- name: Install various apt packages
|
|
76
|
+
run: sudo apt-get install -y libhdf5-dev python3-numpy python3-scipy python3-matplotlib python3-sklearn
|
|
77
|
+
|
|
78
|
+
- name: Install dependencies
|
|
79
|
+
run: |
|
|
80
|
+
pip3 install -r requirements.txt
|
|
81
|
+
python3 install.py
|
|
82
|
+
|
|
83
|
+
env:
|
|
84
|
+
LIBRARY: ${{ matrix.library }}
|
|
85
|
+
DATASET: ${{ matrix.dataset }}
|
|
86
|
+
|
|
87
|
+
- name: Run the benchmark
|
|
88
|
+
run: |
|
|
89
|
+
python3 run.py --docker-tag ann-benchmarks-${LIBRARY} --max-n-algorithms 5 --dataset $DATASET --run-disabled --timeout 300
|
|
90
|
+
python3 run.py --docker-tag ann-benchmarks-${LIBRARY} --max-n-algorithms 5 --dataset $DATASET --run-disabled --batch --timeout 300
|
|
91
|
+
sudo chmod -R 777 results/
|
|
92
|
+
python3 plot.py --dataset $DATASET --output plot.png
|
|
93
|
+
python3 plot.py --dataset $DATASET --output plot-batch.png --batch
|
|
94
|
+
python3 -m unittest test/test-metrics.py
|
|
95
|
+
python3 -m unittest test/test-jaccard.py
|
|
96
|
+
python3 create_website.py --outputdir . --scatter --latex
|
|
97
|
+
|
|
98
|
+
env:
|
|
99
|
+
LIBRARY: ${{ matrix.library }}
|
|
100
|
+
DATASET: ${{ matrix.dataset }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Erik Bernhardsson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Benchmarking nearest neighbors
|
|
2
|
+
==============================
|
|
3
|
+
|
|
4
|
+
[](https://github.com/erikbern/ann-benchmarks/actions?query=workflow:benchmarks)
|
|
5
|
+
|
|
6
|
+
Doing fast searching of nearest neighbors in high dimensional spaces is an increasingly important problem, but so far there has not been a lot of empirical attempts at comparing approaches in an objective way.
|
|
7
|
+
|
|
8
|
+
This project contains some tools to benchmark various implementations of approximate nearest neighbor (ANN) search for different metrics. We have pregenerated datasets (in HDF5) formats and we also have Docker containers for each algorithm. There's a [test suite](https://travis-ci.org/erikbern/ann-benchmarks) that makes sure every algorithm works.
|
|
9
|
+
|
|
10
|
+
Evaluated
|
|
11
|
+
=========
|
|
12
|
+
|
|
13
|
+
* [Annoy](https://github.com/spotify/annoy)
|
|
14
|
+
* [FLANN](http://www.cs.ubc.ca/research/flann/)
|
|
15
|
+
* [scikit-learn](http://scikit-learn.org/stable/modules/neighbors.html): LSHForest, KDTree, BallTree
|
|
16
|
+
* [PANNS](https://github.com/ryanrhymes/panns)
|
|
17
|
+
* [NearPy](http://pixelogik.github.io/NearPy/)
|
|
18
|
+
* [KGraph](https://github.com/aaalgo/kgraph)
|
|
19
|
+
* [NMSLIB (Non-Metric Space Library)](https://github.com/nmslib/nmslib): SWGraph, HNSW, BallTree, MPLSH
|
|
20
|
+
* [hnswlib (a part of nmslib project)](https://github.com/nmslib/hnsw)
|
|
21
|
+
* [RPForest](https://github.com/lyst/rpforest)
|
|
22
|
+
* [FAISS](https://github.com/facebookresearch/faiss.git)
|
|
23
|
+
* [DolphinnPy](https://github.com/ipsarros/DolphinnPy)
|
|
24
|
+
* [Datasketch](https://github.com/ekzhu/datasketch)
|
|
25
|
+
* [PyNNDescent](https://github.com/lmcinnes/pynndescent)
|
|
26
|
+
* [MRPT](https://github.com/teemupitkanen/mrpt)
|
|
27
|
+
* [NGT](https://github.com/yahoojapan/NGT): ONNG, PANNG, QG
|
|
28
|
+
* [SPTAG](https://github.com/microsoft/SPTAG)
|
|
29
|
+
* [PUFFINN](https://github.com/puffinn/puffinn)
|
|
30
|
+
* [N2](https://github.com/kakao/n2)
|
|
31
|
+
* [ScaNN](https://github.com/google-research/google-research/tree/master/scann)
|
|
32
|
+
* [Elastiknn](https://github.com/alexklibisz/elastiknn)
|
|
33
|
+
* [OpenSearch KNN](https://github.com/opensearch-project/k-NN)
|
|
34
|
+
* [DiskANN](https://github.com/microsoft/diskann): Vamana, Vamana-PQ
|
|
35
|
+
* [Vespa](https://github.com/vespa-engine/vespa)
|
|
36
|
+
* [scipy](https://docs.scipy.org/doc/scipy/reference/spatial.html): cKDTree
|
|
37
|
+
* [vald](https://github.com/vdaas/vald)
|
|
38
|
+
|
|
39
|
+
Data sets
|
|
40
|
+
=========
|
|
41
|
+
|
|
42
|
+
We have a number of precomputed data sets for this. All data sets are pre-split into train/test and come with ground truth data in the form of the top 100 neighbors. We store them in a HDF5 format:
|
|
43
|
+
|
|
44
|
+
| Dataset | Dimensions | Train size | Test size | Neighbors | Distance | Download |
|
|
45
|
+
| ----------------------------------------------------------------- | ---------: | ---------: | --------: | --------: | --------- | -------------------------------------------------------------------------- |
|
|
46
|
+
| [DEEP1B](http://sites.skoltech.ru/compvision/noimi/) | 96 | 9,990,000 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/deep-image-96-angular.hdf5) (3.6GB)
|
|
47
|
+
| [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist) | 784 | 60,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/fashion-mnist-784-euclidean.hdf5) (217MB) |
|
|
48
|
+
| [GIST](http://corpus-texmex.irisa.fr/) | 960 | 1,000,000 | 1,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/gist-960-euclidean.hdf5) (3.6GB) |
|
|
49
|
+
| [GloVe](http://nlp.stanford.edu/projects/glove/) | 25 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-25-angular.hdf5) (121MB) |
|
|
50
|
+
| GloVe | 50 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-50-angular.hdf5) (235MB) |
|
|
51
|
+
| GloVe | 100 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-100-angular.hdf5) (463MB) |
|
|
52
|
+
| GloVe | 200 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-200-angular.hdf5) (918MB) |
|
|
53
|
+
| [Kosarak](http://fimi.uantwerpen.be/data/) | 27983 | 74,962 | 500 | 100 | Jaccard | [HDF5](http://ann-benchmarks.com/kosarak-jaccard.hdf5) (2.0GB) |
|
|
54
|
+
| [MNIST](http://yann.lecun.com/exdb/mnist/) | 784 | 60,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/mnist-784-euclidean.hdf5) (217MB) |
|
|
55
|
+
| [NYTimes](https://archive.ics.uci.edu/ml/datasets/bag+of+words) | 256 | 290,000 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/nytimes-256-angular.hdf5) (301MB) |
|
|
56
|
+
| [SIFT](http://corpus-texmex.irisa.fr/) | 128 | 1,000,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/sift-128-euclidean.hdf5) (501MB) |
|
|
57
|
+
| [Last.fm](https://github.com/erikbern/ann-benchmarks/pull/91) | 65 | 292,385 | 50,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/lastfm-64-dot.hdf5) (135MB) |
|
|
58
|
+
|
|
59
|
+
Results
|
|
60
|
+
=======
|
|
61
|
+
|
|
62
|
+
Interactive plots can be found at <http://ann-benchmarks.com>. These are all as of December 2021, running all benchmarks on a r5.4xlarge machine on AWS with `--parallelism 7`:
|
|
63
|
+
|
|
64
|
+
glove-100-angular
|
|
65
|
+
-----------------
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
sift-128-euclidean
|
|
70
|
+
------------------
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
fashion-mnist-784-euclidean
|
|
75
|
+
---------------------------
|
|
76
|
+
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
lastfm-64-dot
|
|
80
|
+
------------------
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
nytimes-256-angular
|
|
85
|
+
-------------------
|
|
86
|
+
|
|
87
|
+

|
|
88
|
+
|
|
89
|
+
glove-25-angular
|
|
90
|
+
----------------
|
|
91
|
+
|
|
92
|
+

|
|
93
|
+
|
|
94
|
+
Install
|
|
95
|
+
=======
|
|
96
|
+
|
|
97
|
+
The only prerequisite is Python (tested with 3.6) and Docker.
|
|
98
|
+
|
|
99
|
+
1. Clone the repo.
|
|
100
|
+
2. Run `pip install -r requirements.txt`.
|
|
101
|
+
3. Run `python install.py` to build all the libraries inside Docker containers (this can take a while, like 10-30 minutes).
|
|
102
|
+
|
|
103
|
+
Running
|
|
104
|
+
=======
|
|
105
|
+
|
|
106
|
+
1. Run `python run.py` (this can take an extremely long time, potentially days)
|
|
107
|
+
2. Run `python plot.py` or `python create_website.py` to plot results.
|
|
108
|
+
|
|
109
|
+
You can customize the algorithms and datasets if you want to:
|
|
110
|
+
|
|
111
|
+
* Check that `algos.yaml` contains the parameter settings that you want to test
|
|
112
|
+
* To run experiments on SIFT, invoke `python run.py --dataset glove-100-angular`. See `python run.py --help` for more information on possible settings. Note that experiments can take a long time.
|
|
113
|
+
* To process the results, either use `python plot.py --dataset glove-100-angular` or `python create_website.py`. An example call: `python create_website.py --plottype recall/time --latex --scatter --outputdir website/`.
|
|
114
|
+
|
|
115
|
+
Including your algorithm
|
|
116
|
+
========================
|
|
117
|
+
|
|
118
|
+
1. Add your algorithm into `ann_benchmarks/algorithms` by providing a small Python wrapper.
|
|
119
|
+
2. Add a Dockerfile in `install/` for it
|
|
120
|
+
3. Add it to `algos.yaml`
|
|
121
|
+
4. Add it to `.github/workflows/benchmarks.yml`
|
|
122
|
+
|
|
123
|
+
Principles
|
|
124
|
+
==========
|
|
125
|
+
|
|
126
|
+
* Everyone is welcome to submit pull requests with tweaks and changes to how each library is being used.
|
|
127
|
+
* In particular: if you are the author of any of these libraries, and you think the benchmark can be improved, consider making the improvement and submitting a pull request.
|
|
128
|
+
* This is meant to be an ongoing project and represent the current state.
|
|
129
|
+
* Make everything easy to replicate, including installing and preparing the datasets.
|
|
130
|
+
* Try many different values of parameters for each library and ignore the points that are not on the precision-performance frontier.
|
|
131
|
+
* High-dimensional datasets with approximately 100-1000 dimensions. This is challenging but also realistic. Not more than 1000 dimensions because those problems should probably be solved by doing dimensionality reduction separately.
|
|
132
|
+
* Single queries are used by default. ANN-Benchmarks enforces that only one CPU is saturated during experimentation, i.e., no multi-threading. A batch mode is available that provides all queries to the implementations at once. Add the flag `--batch` to `run.py` and `plot.py` to enable batch mode.
|
|
133
|
+
* Avoid extremely costly index building (more than several hours).
|
|
134
|
+
* Focus on datasets that fit in RAM. For billion-scale benchmarks, see the related [big-ann-benchmarks](https://github.com/harsha-simhadri/big-ann-benchmarks) project.
|
|
135
|
+
* We mainly support CPU-based ANN algorithms. GPU support exists for FAISS, but it has to be compiled with GPU support locally and experiments must be run using the flags `--local --batch`.
|
|
136
|
+
* Do proper train/test set of index data and query points.
|
|
137
|
+
* Note that we consider that set similarity datasets are sparse and thus we pass a **sorted** array of integers to algorithms to represent the set of each user.
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
Authors
|
|
141
|
+
=======
|
|
142
|
+
|
|
143
|
+
Built by [Erik Bernhardsson](https://erikbern.com) with significant contributions from [Martin Aumüller](http://itu.dk/people/maau/) and [Alexander Faithfull](https://github.com/ale-f).
|
|
144
|
+
|
|
145
|
+
Related Publication
|
|
146
|
+
==================
|
|
147
|
+
|
|
148
|
+
The following publication details design principles behind the benchmarking framework:
|
|
149
|
+
|
|
150
|
+
- M. Aumüller, E. Bernhardsson, A. Faithfull:
|
|
151
|
+
[ANN-Benchmarks: A Benchmarking Tool for Approximate Nearest Neighbor Algorithms](https://arxiv.org/abs/1807.05614). Information Systems 2019. DOI: [10.1016/j.is.2019.02.006](https://doi.org/10.1016/j.is.2019.02.006)
|
|
152
|
+
|
|
153
|
+
Related Projects
|
|
154
|
+
================
|
|
155
|
+
|
|
156
|
+
- [big-ann-benchmarks](https://github.com/harsha-simhadri/big-ann-benchmarks) is a benchmarking effort for billion-scale approximate nearest neighbor search as part of the [NeurIPS'21 Competition track](https://neurips.cc/Conferences/2021/CompetitionTrack).
|
|
157
|
+
|