redisbench-admin 0.11.63__py3-none-any.whl → 0.11.65__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.
Files changed (135) hide show
  1. redisbench_admin/run/ann/pkg/.dockerignore +2 -0
  2. redisbench_admin/run/ann/pkg/.git +1 -0
  3. redisbench_admin/run/ann/pkg/.github/workflows/benchmarks.yml +100 -0
  4. redisbench_admin/run/ann/pkg/.gitignore +21 -0
  5. redisbench_admin/run/ann/pkg/LICENSE +21 -0
  6. redisbench_admin/run/ann/pkg/README.md +157 -0
  7. redisbench_admin/run/ann/pkg/algos.yaml +1294 -0
  8. redisbench_admin/run/ann/pkg/algosP.yaml +67 -0
  9. redisbench_admin/run/ann/pkg/ann_benchmarks/__init__.py +2 -0
  10. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/__init__.py +0 -0
  11. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/annoy.py +26 -0
  12. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/balltree.py +22 -0
  13. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/base.py +36 -0
  14. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/bruteforce.py +110 -0
  15. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/ckdtree.py +17 -0
  16. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/datasketch.py +29 -0
  17. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/definitions.py +187 -0
  18. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/diskann.py +190 -0
  19. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dolphinnpy.py +31 -0
  20. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dummy_algo.py +25 -0
  21. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elasticsearch.py +107 -0
  22. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elastiknn.py +124 -0
  23. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss.py +124 -0
  24. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_gpu.py +61 -0
  25. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_hnsw.py +39 -0
  26. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/flann.py +27 -0
  27. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/hnswlib.py +36 -0
  28. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kdtree.py +22 -0
  29. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kgraph.py +39 -0
  30. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/lshf.py +25 -0
  31. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/milvus.py +99 -0
  32. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/mrpt.py +41 -0
  33. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/n2.py +28 -0
  34. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nearpy.py +48 -0
  35. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nmslib.py +74 -0
  36. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/onng_ngt.py +100 -0
  37. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/opensearchknn.py +107 -0
  38. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/panng_ngt.py +79 -0
  39. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pinecone.py +39 -0
  40. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/puffinn.py +45 -0
  41. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pynndescent.py +115 -0
  42. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/qg_ngt.py +102 -0
  43. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/redisearch.py +90 -0
  44. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/rpforest.py +20 -0
  45. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/scann.py +34 -0
  46. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/sptag.py +28 -0
  47. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/subprocess.py +246 -0
  48. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vald.py +149 -0
  49. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vecsim-hnsw.py +43 -0
  50. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vespa.py +47 -0
  51. redisbench_admin/run/ann/pkg/ann_benchmarks/constants.py +1 -0
  52. redisbench_admin/run/ann/pkg/ann_benchmarks/data.py +48 -0
  53. redisbench_admin/run/ann/pkg/ann_benchmarks/datasets.py +620 -0
  54. redisbench_admin/run/ann/pkg/ann_benchmarks/distance.py +53 -0
  55. redisbench_admin/run/ann/pkg/ann_benchmarks/main.py +325 -0
  56. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/__init__.py +2 -0
  57. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/metrics.py +183 -0
  58. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/plot_variants.py +17 -0
  59. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/utils.py +165 -0
  60. redisbench_admin/run/ann/pkg/ann_benchmarks/results.py +71 -0
  61. redisbench_admin/run/ann/pkg/ann_benchmarks/runner.py +333 -0
  62. redisbench_admin/run/ann/pkg/create_dataset.py +12 -0
  63. redisbench_admin/run/ann/pkg/create_hybrid_dataset.py +147 -0
  64. redisbench_admin/run/ann/pkg/create_text_to_image_ds.py +117 -0
  65. redisbench_admin/run/ann/pkg/create_website.py +272 -0
  66. redisbench_admin/run/ann/pkg/install/Dockerfile +11 -0
  67. redisbench_admin/run/ann/pkg/install/Dockerfile.annoy +5 -0
  68. redisbench_admin/run/ann/pkg/install/Dockerfile.datasketch +4 -0
  69. redisbench_admin/run/ann/pkg/install/Dockerfile.diskann +29 -0
  70. redisbench_admin/run/ann/pkg/install/Dockerfile.diskann_pq +31 -0
  71. redisbench_admin/run/ann/pkg/install/Dockerfile.dolphinn +5 -0
  72. redisbench_admin/run/ann/pkg/install/Dockerfile.elasticsearch +45 -0
  73. redisbench_admin/run/ann/pkg/install/Dockerfile.elastiknn +61 -0
  74. redisbench_admin/run/ann/pkg/install/Dockerfile.faiss +18 -0
  75. redisbench_admin/run/ann/pkg/install/Dockerfile.flann +10 -0
  76. redisbench_admin/run/ann/pkg/install/Dockerfile.hnswlib +10 -0
  77. redisbench_admin/run/ann/pkg/install/Dockerfile.kgraph +6 -0
  78. redisbench_admin/run/ann/pkg/install/Dockerfile.mih +4 -0
  79. redisbench_admin/run/ann/pkg/install/Dockerfile.milvus +27 -0
  80. redisbench_admin/run/ann/pkg/install/Dockerfile.mrpt +4 -0
  81. redisbench_admin/run/ann/pkg/install/Dockerfile.n2 +5 -0
  82. redisbench_admin/run/ann/pkg/install/Dockerfile.nearpy +5 -0
  83. redisbench_admin/run/ann/pkg/install/Dockerfile.ngt +13 -0
  84. redisbench_admin/run/ann/pkg/install/Dockerfile.nmslib +10 -0
  85. redisbench_admin/run/ann/pkg/install/Dockerfile.opensearchknn +43 -0
  86. redisbench_admin/run/ann/pkg/install/Dockerfile.puffinn +6 -0
  87. redisbench_admin/run/ann/pkg/install/Dockerfile.pynndescent +4 -0
  88. redisbench_admin/run/ann/pkg/install/Dockerfile.redisearch +18 -0
  89. redisbench_admin/run/ann/pkg/install/Dockerfile.rpforest +5 -0
  90. redisbench_admin/run/ann/pkg/install/Dockerfile.scann +5 -0
  91. redisbench_admin/run/ann/pkg/install/Dockerfile.scipy +4 -0
  92. redisbench_admin/run/ann/pkg/install/Dockerfile.sklearn +4 -0
  93. redisbench_admin/run/ann/pkg/install/Dockerfile.sptag +30 -0
  94. redisbench_admin/run/ann/pkg/install/Dockerfile.vald +8 -0
  95. redisbench_admin/run/ann/pkg/install/Dockerfile.vespa +17 -0
  96. redisbench_admin/run/ann/pkg/install.py +70 -0
  97. redisbench_admin/run/ann/pkg/logging.conf +34 -0
  98. redisbench_admin/run/ann/pkg/multirun.py +298 -0
  99. redisbench_admin/run/ann/pkg/plot.py +159 -0
  100. redisbench_admin/run/ann/pkg/protocol/bf-runner +10 -0
  101. redisbench_admin/run/ann/pkg/protocol/bf-runner.py +204 -0
  102. redisbench_admin/run/ann/pkg/protocol/ext-add-query-metric.md +51 -0
  103. redisbench_admin/run/ann/pkg/protocol/ext-batch-queries.md +77 -0
  104. redisbench_admin/run/ann/pkg/protocol/ext-prepared-queries.md +77 -0
  105. redisbench_admin/run/ann/pkg/protocol/ext-query-parameters.md +47 -0
  106. redisbench_admin/run/ann/pkg/protocol/specification.md +194 -0
  107. redisbench_admin/run/ann/pkg/requirements.txt +14 -0
  108. redisbench_admin/run/ann/pkg/requirements_py38.txt +11 -0
  109. redisbench_admin/run/ann/pkg/results/fashion-mnist-784-euclidean.png +0 -0
  110. redisbench_admin/run/ann/pkg/results/gist-960-euclidean.png +0 -0
  111. redisbench_admin/run/ann/pkg/results/glove-100-angular.png +0 -0
  112. redisbench_admin/run/ann/pkg/results/glove-25-angular.png +0 -0
  113. redisbench_admin/run/ann/pkg/results/lastfm-64-dot.png +0 -0
  114. redisbench_admin/run/ann/pkg/results/mnist-784-euclidean.png +0 -0
  115. redisbench_admin/run/ann/pkg/results/nytimes-256-angular.png +0 -0
  116. redisbench_admin/run/ann/pkg/results/sift-128-euclidean.png +0 -0
  117. redisbench_admin/run/ann/pkg/run.py +12 -0
  118. redisbench_admin/run/ann/pkg/run_algorithm.py +3 -0
  119. redisbench_admin/run/ann/pkg/templates/chartjs.template +102 -0
  120. redisbench_admin/run/ann/pkg/templates/detail_page.html +23 -0
  121. redisbench_admin/run/ann/pkg/templates/general.html +58 -0
  122. redisbench_admin/run/ann/pkg/templates/latex.template +30 -0
  123. redisbench_admin/run/ann/pkg/templates/summary.html +60 -0
  124. redisbench_admin/run/ann/pkg/test/__init__.py +0 -0
  125. redisbench_admin/run/ann/pkg/test/test-jaccard.py +19 -0
  126. redisbench_admin/run/ann/pkg/test/test-metrics.py +99 -0
  127. redisbench_admin/run_async/run_async.py +2 -2
  128. redisbench_admin/run_local/run_local.py +2 -2
  129. redisbench_admin/run_remote/run_remote.py +9 -5
  130. {redisbench_admin-0.11.63.dist-info → redisbench_admin-0.11.65.dist-info}/METADATA +2 -5
  131. redisbench_admin-0.11.65.dist-info/RECORD +243 -0
  132. {redisbench_admin-0.11.63.dist-info → redisbench_admin-0.11.65.dist-info}/WHEEL +1 -1
  133. redisbench_admin-0.11.63.dist-info/RECORD +0 -117
  134. {redisbench_admin-0.11.63.dist-info/licenses → redisbench_admin-0.11.65.dist-info}/LICENSE +0 -0
  135. {redisbench_admin-0.11.63.dist-info → redisbench_admin-0.11.65.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,12 @@
1
+ import os
2
+ import pathlib
3
+
4
+ from ann_benchmarks.main import main
5
+ from multiprocessing import freeze_support
6
+
7
+ if __name__ == "__main__":
8
+ workdir = pathlib.Path(__file__).parent.absolute()
9
+ print("Changing the workdir to {}".format(workdir))
10
+ os.chdir(workdir)
11
+ freeze_support()
12
+ main()
@@ -0,0 +1,3 @@
1
+ from ann_benchmarks.runner import run_from_cmdline
2
+
3
+ run_from_cmdline()
@@ -0,0 +1,102 @@
1
+ <h3>{{xlabel}}/{{ylabel}}</h3>
2
+ <div id="{{ xlabel }}{{ ylabel }}{{ label }}">
3
+ <canvas id="chart{{ xlabel }}{{ ylabel }}{{ label }}" width="800" height="600"></canvas>
4
+ <script>
5
+ var ctx = document.getElementById("chart{{ xlabel }}{{ ylabel }}{{ label }}");
6
+ var chart = new Chart(ctx, {
7
+ {% if not render_all_points %}
8
+ type: "line",
9
+ {% else %}
10
+ type: "bubble",
11
+ {% endif %}
12
+ data: { datasets: [
13
+ {% for run in data_points %}
14
+ {
15
+ label: "{{ run["name"] }}",
16
+ fill: false,
17
+ pointStyle: "{{ linestyle[run["name"]][3] }}",
18
+ borderColor: "{{ linestyle[run["name"]][0] }}",
19
+ data: [
20
+ {% for (x, y), l in zip(run["coords"], run["labels"]) %}
21
+ { x: {{ x }} , y: {{ y }}, label: "{{ l }}" },
22
+ {% endfor %}
23
+ ]
24
+ },
25
+ {% endfor %}
26
+ ]},
27
+ options: {
28
+ responsive: false,
29
+ title:{
30
+ display:true,
31
+ text: '{{ plot_label }}'
32
+ },
33
+ scales: {
34
+ xAxes: [{
35
+ display: true,
36
+ type: 'linear',
37
+ max: '1',
38
+ position: 'bottom',
39
+ scaleLabel: {
40
+ display: true,
41
+ labelString: ' {{ xlabel }} '
42
+ }
43
+ }],
44
+ yAxes: [{
45
+ display: true,
46
+ type: 'logarithmic',
47
+ scaleLabel: {
48
+ display: true,
49
+ labelString: ' {{ ylabel }} '
50
+ }
51
+ }]
52
+ }
53
+ }
54
+ });
55
+ function pushOrConcat(base, toPush) {
56
+ if (toPush) {
57
+ if (Chart.helpers.isArray(toPush)) {
58
+ // base = base.concat(toPush);
59
+ Array.prototype.push.apply(base, toPush);
60
+ } else {
61
+ base.push(toPush);
62
+ }
63
+ }
64
+
65
+ return base;
66
+ }
67
+ Chart.Tooltip.prototype.getFooter = function(tooltipItem, data) {
68
+ var me = this;
69
+ var callbacks = me._options.callbacks;
70
+ var item = tooltipItem[0];
71
+
72
+ var beforeFooter = callbacks.beforeFooter.apply(me, arguments);
73
+ var footer = "Parameters: " + data.datasets[item.datasetIndex].data[item.index].label || '';
74
+ var afterFooter = callbacks.afterFooter.apply(me, arguments);
75
+
76
+ var lines = [];
77
+ lines = pushOrConcat(lines, beforeFooter);
78
+ lines = pushOrConcat(lines, footer);
79
+ lines = pushOrConcat(lines, afterFooter);
80
+
81
+ return lines;
82
+ }
83
+
84
+ </script>
85
+ </div>
86
+ {% if args.latex %}
87
+ <div class="row">
88
+ <div class="col-md-4 text-center">
89
+ <button type="button" id="button_{{button_label}}" class="btn btn-default" >Toggle latex code</button>
90
+ </div>
91
+ </div>
92
+ <script>
93
+ $("#button_{{button_label}}").click(function() {
94
+ $("#plot_{{button_label}}").toggle();
95
+ });
96
+ </script>
97
+ <div id="plot_{{button_label}}" style="display:none">
98
+ <pre>
99
+ {{latex_code}}
100
+ </pre>
101
+ </div>
102
+ {% endif %}
@@ -0,0 +1,23 @@
1
+ {% extends "general.html" %}
2
+ {% block content %}
3
+ <div class="container">
4
+ {% for item in plot_data.keys() %}
5
+ {% if item=="normal" %}
6
+ {% if batch %}
7
+ <h2>Plots for {{title}} in batch mode</h2>
8
+ {% else %}
9
+ <h2>Plots for {{title}}</h2>
10
+ {% endif %}
11
+ {% elif item=="scatter" and args.scatter %}
12
+ {% if batch %}
13
+ <h2>Scatterplots for {{title}} in batch mode</h2>
14
+ {% else %}
15
+ <h2>Scatterplots for {{title}}</h2>
16
+ {% endif %}
17
+ {% endif %}
18
+ {% for plot in plot_data[item] %}
19
+ {{ plot }}
20
+ {% endfor %}
21
+ <hr />
22
+ {% endfor %}
23
+ {% endblock %}
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8
+ <title>{{ title }}</title>
9
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js"></script>
10
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
11
+ <!-- Include all compiled plugins (below), or include individual files as needed -->
12
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
13
+ <!-- Bootstrap -->
14
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
15
+ <style>
16
+ body { padding-top: 50px; }
17
+ </style>
18
+ <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
19
+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
20
+ <!--[if lt IE 9]>
21
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
22
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
23
+ <![endif]-->
24
+ </head>
25
+ <body>
26
+
27
+ <nav class="navbar navbar-inverse navbar-fixed-top">
28
+ <div class="container">
29
+ <div class="navbar-header">
30
+ <a class="navbar-brand" href="index.html">ANN Benchmarks</a>
31
+ </div>
32
+ <div id="navbar" class="collapse navbar-collapse">
33
+ <ul class="nav navbar-nav">
34
+ <li class="active"><a href="index.html">Home</a></li>
35
+ </ul>
36
+ <ul class="nav navbar-nav">
37
+ <li class="active"><a href="index.html#datasets">Datasets</a></li>
38
+ </ul>
39
+ <ul class="nav navbar-nav">
40
+ <li class="active"><a href="index.html#algorithms">Algorithms</a></li>
41
+ </ul>
42
+ <ul class="nav navbar-nav">
43
+ <li class="active"><a href="index.html#contact">Contact</a></li>
44
+ </ul>
45
+ </div><!--/.nav-collapse -->
46
+ </div>
47
+ </nav>
48
+
49
+ {% block content %} {% endblock %}
50
+
51
+ <div id="contact">
52
+ <h2>Contact</h2>
53
+ <p>ANN-Benchmarks has been developed by Martin Aumueller (maau@itu.dk), Erik Bernhardsson (mail@erikbern.com), and Alec Faitfull (alef@itu.dk). Please use
54
+ <a href="https://github.com/erikbern/ann-benchmarks/">Github</a> to submit your implementation or improvements.</p>
55
+ </div>
56
+ </div>
57
+ </body>
58
+ </html>
@@ -0,0 +1,30 @@
1
+
2
+ \begin{figure}
3
+ \centering
4
+ \begin{tikzpicture}
5
+ \begin{axis}[
6
+ xlabel={ {{xlabel}} },
7
+ ylabel={ {{ylabel}} },
8
+ ymode = log,
9
+ yticklabel style={/pgf/number format/fixed,
10
+ /pgf/number format/precision=3},
11
+ legend style = { anchor=west},
12
+ cycle list name = black white
13
+ ]
14
+ {% for algo in plot_data %}
15
+ {% if algo.scatter %}
16
+ \addplot [only marks] coordinates {
17
+ {% else %}
18
+ \addplot coordinates {
19
+ {% endif %}
20
+ {% for coord in algo.coords %}
21
+ ({{ coord[0]}}, {{ coord[1] }})
22
+ {% endfor %}
23
+ };
24
+ \addlegendentry{ {{algo.name}} };
25
+ {% endfor %}
26
+ \end{axis}
27
+ \end{tikzpicture}
28
+ \caption{ {{caption}} }
29
+ \label{}
30
+ \end{figure}
@@ -0,0 +1,60 @@
1
+ {% extends "general.html" %}
2
+ {% block content %}
3
+ <div class="container">
4
+ <h1>Info</h1>
5
+ <p>ANN-Benchmarks is a benchmarking environment for approximate nearest neighbor algorithms search. This website contains the current benchmarking results. Please visit <a href="http://github.com/erikbern/ann-benchmarks/">http://github.com/erikbern/ann-benchmarks/</a> to get an overview over evaluated data sets and algorithms. Make a pull request on <a href="http://github.com/erikbern/ann-benchmarks/">Github</a> to add your own code or improvements to the
6
+ benchmarking system.
7
+ </p>
8
+ <div id="results">
9
+ <h1>Benchmarking Results</h1>
10
+ <p>Results are split by distance measure and dataset. In the bottom, you can find an overview of an algorithm's performance on all datasets. Each dataset is annoted
11
+ by <em>(k = ...)</em>, the number of nearest neighbors an algorithm was supposed to return. The plot shown depicts <em>Recall</em> (the fraction
12
+ of true nearest neighbors found, on average over all queries) against <em>Queries per second</em>. Clicking on a plot reveils detailled interactive plots, including
13
+ approximate recall, index size, and build time.</p>
14
+ {% for type in ['non-batch', 'batch'] %}
15
+ {% if len(dataset_with_distances[type]) > 0 %}
16
+ {% if type == 'batch' %}
17
+ <h2>Benchmarks for Batched Queries</h2>
18
+ {% else %}
19
+ <h2>Benchmarks for Single Queries</h2>
20
+ {% endif %}
21
+
22
+ <h2 id ="datasets">Results by Dataset</h2>
23
+ {% for distance_data in dataset_with_distances[type] %}
24
+ <h3>Distance: {{ distance_data.name }} </h3>
25
+ {% for entry in distance_data.entries %}
26
+ <a href="./{{ entry.name }}.html">
27
+ <div class="row" id="{{entry.name}}">
28
+ <div class = "col-md-4 bg-success">
29
+ <h4>{{entry.desc}}</h4>
30
+ </div>
31
+ <div class = "col-md-8">
32
+ <img class = "img-responsive" src="{{ entry.name }}.png" />
33
+ </div>
34
+ </div>
35
+ </a>
36
+ <hr />
37
+ {% endfor %}
38
+ {% endfor %}
39
+ <h2 id="algorithms">Results by Algorithm</h2>
40
+ <ul class="list-inline"><b>Algorithms:</b>
41
+ {% for algo in algorithms[type].keys() %}
42
+ <li><a href="#{{algo}}">{{algo}}</a></li>
43
+ {% endfor %}
44
+ </ul>
45
+ {% for algo in algorithms[type].keys()%}
46
+ <a href="./{{ algo }}.html">
47
+ <div class="row" id="{{algo}}">
48
+ <div class = "col-md-4 bg-success">
49
+ <h4>{{algo}}</h4>
50
+ </div>
51
+ <div class = "col-md-8">
52
+ <img class = "img-responsive" src="{{ algo }}.png" />
53
+ </div>
54
+ </div>
55
+ </a>
56
+ <hr />
57
+ {% endfor %}
58
+ {% endif %}
59
+ {% endfor %}
60
+ {% endblock %}
File without changes
@@ -0,0 +1,19 @@
1
+ import unittest
2
+ import numpy
3
+ from ann_benchmarks.distance import jaccard
4
+
5
+ class TestJaccard(unittest.TestCase):
6
+ def setUp(self):
7
+ pass
8
+
9
+ def test_similarity(self):
10
+ a = [1, 2, 3, 4]
11
+ b = []
12
+ c = [1, 2]
13
+ d = [5, 6]
14
+
15
+ self.assertAlmostEqual(jaccard(a, b), 0.0)
16
+ self.assertAlmostEqual(jaccard(a, a), 1.0)
17
+ self.assertAlmostEqual(jaccard(a, c), 0.5)
18
+ self.assertAlmostEqual(jaccard(c, d), 0.0)
19
+
@@ -0,0 +1,99 @@
1
+ import unittest
2
+ from ann_benchmarks.plotting.metrics import (
3
+ knn, queries_per_second, index_size, build_time, candidates,
4
+ epsilon, rel)
5
+
6
+
7
+ class DummyMetric():
8
+
9
+ def __init__(self):
10
+ self.attrs = {}
11
+ self.d = {}
12
+
13
+ def __getitem__(self, key):
14
+ return self.d.get(key, None)
15
+
16
+ def __setitem__(self, key, value):
17
+ self.d[key] = value
18
+
19
+ def __contains__(self, key):
20
+ return key in self.d
21
+
22
+ def create_group(self, name):
23
+ self.d[name] = DummyMetric()
24
+ return self.d[name]
25
+
26
+
27
+ class TestMetrics(unittest.TestCase):
28
+
29
+ def setUp(self):
30
+ pass
31
+
32
+ def test_recall(self):
33
+ exact_queries = [[0.1, 0.25]]
34
+ run1 = [[]]
35
+ run2 = [[0.2, 0.3]]
36
+ run3 = [[0.2]]
37
+ run4 = [[0.2, 0.25]]
38
+
39
+ self.assertAlmostEqual(
40
+ knn(exact_queries, run1, 2, DummyMetric()).attrs['mean'], 0.0)
41
+ self.assertAlmostEqual(
42
+ knn(exact_queries, run2, 2, DummyMetric()).attrs['mean'], 0.5)
43
+ self.assertAlmostEqual(
44
+ knn(exact_queries, run3, 2, DummyMetric()).attrs['mean'], 0.5)
45
+ self.assertAlmostEqual(
46
+ knn(exact_queries, run4, 2, DummyMetric()).attrs['mean'], 1.0)
47
+
48
+ def test_epsilon_recall(self):
49
+ exact_queries = [[0.05, 0.08, 0.24, 0.3]]
50
+ run1 = [[]]
51
+ run2 = [[0.1, 0.2, 0.55, 0.7]]
52
+
53
+ self.assertAlmostEqual(
54
+ epsilon(exact_queries, run1, 4, DummyMetric(), 1).attrs['mean'],
55
+ 0.0)
56
+
57
+ self.assertAlmostEqual(
58
+ epsilon(exact_queries, run2, 4,
59
+ DummyMetric(), 0.0001).attrs['mean'],
60
+ 0.5)
61
+ # distance can be off by factor (1 + 1) * 0.3 = 0.6 => recall .75
62
+ self.assertAlmostEqual(
63
+ epsilon(exact_queries, run2, 4, DummyMetric(), 1).attrs['mean'],
64
+ 0.75)
65
+ # distance can be off by factor (1 + 2) * 0.3 = 0.9 => recall 1
66
+ self.assertAlmostEqual(
67
+ epsilon(exact_queries, run2, 4, DummyMetric(), 2).attrs['mean'],
68
+ 1.0)
69
+
70
+ def test_relative(self):
71
+ exact_queries = [[0.1, 0.2, 0.25, 0.3]]
72
+ run1 = []
73
+ run2 = [[0.1, 0.2, 0.25, 0.3]]
74
+ run3 = [[0.1, 0.2, 0.55, 0.9]]
75
+
76
+ self.assertAlmostEqual(
77
+ rel(exact_queries, run1, DummyMetric()), float("inf"))
78
+ self.assertAlmostEqual(rel(exact_queries, run2, DummyMetric()), 1)
79
+ # total distance exact: 0.85, total distance run3: 1.75
80
+ self.assertAlmostEqual(rel(exact_queries, run3, DummyMetric()),
81
+ 1.75 / 0.85)
82
+
83
+ def test_queries_per_second(self):
84
+ self.assertAlmostEqual(
85
+ queries_per_second([], {"best_search_time": 0.01}),
86
+ 100)
87
+
88
+ def test_index_size(self):
89
+ self.assertEqual(index_size([], {"index_size": 100}), 100)
90
+
91
+ def test_build_time(self):
92
+ self.assertEqual(build_time([], {"build_time": 100}), 100)
93
+
94
+ def test_candidates(self):
95
+ self.assertEqual(candidates([], {"candidates": 10}), 10)
96
+
97
+
98
+ if __name__ == '__main__':
99
+ unittest.main()
@@ -313,7 +313,7 @@ def ro_benchmark_reuse(
313
313
  ):
314
314
  assert benchmark_type == "read-only"
315
315
  logging.info(
316
- "Given the benchmark for this setup is ready-only, and this setup was already spinned we will reuse the previous, conns and process info."
316
+ "Given the benchmark for this setup is read-only, and this setup was already spinned we will reuse the previous, conns and process info."
317
317
  )
318
318
  artifact_version = setup_details["env"]["artifact_version"]
319
319
  cluster_enabled = setup_details["env"]["cluster_enabled"]
@@ -349,7 +349,7 @@ def ro_benchmark_set(
349
349
  full_logfiles,
350
350
  ):
351
351
  logging.info(
352
- "Given the benchmark for this setup is ready-only we will prepare to reuse it on the next read-only benchmarks (if any )."
352
+ "Given the benchmark for this setup is read-only we will prepare to reuse it on the next read-only benchmarks (if any )."
353
353
  )
354
354
  setup_details["env"] = {}
355
355
  setup_details["env"]["full_logfiles"] = full_logfiles
@@ -237,7 +237,7 @@ def run_local_command_logic(args, project_name, project_version):
237
237
  continue
238
238
  if benchmark_type == "read-only":
239
239
  logging.info(
240
- "Given the benchmark for this setup is ready-only we will prepare to reuse it on the next read-only benchmarks (if any )."
240
+ "Given the benchmark for this setup is read-only we will prepare to reuse it on the next read-only benchmarks (if any )."
241
241
  )
242
242
  setup_details["env"] = {}
243
243
  setup_details["env"][
@@ -252,7 +252,7 @@ def run_local_command_logic(args, project_name, project_version):
252
252
  else:
253
253
  assert benchmark_type == "read-only"
254
254
  logging.info(
255
- "Given the benchmark for this setup is ready-only, and this setup was already spinned we will reuse the previous, conns and process info."
255
+ "Given the benchmark for this setup is read-only, and this setup was already spinned we will reuse the previous, conns and process info."
256
256
  )
257
257
  cluster_api_enabled = setup_details["env"][
258
258
  "cluster_api_enabled"
@@ -404,7 +404,7 @@ def run_remote_command_logic(args, project_name, project_version):
404
404
  ts_key_spot_price = f"ts:{tf_triggering_env}:tests:spot_price"
405
405
  ts_key_full_price = f"ts:{tf_triggering_env}:tests:full_price"
406
406
  ts_key_architecture = f"ts:{tf_triggering_env}:tests:arch:{architecture}"
407
- reused_mixed = False
407
+ reuse_mixed = False
408
408
  for benchmark_type, bench_by_dataset_map in ensure_mixed_types_first(benchmark_runs_plan):
409
409
  if benchmark_type == "mixed" and "read-only" in benchmark_runs_plan:
410
410
  reuse_mixed = True
@@ -440,7 +440,11 @@ def run_remote_command_logic(args, project_name, project_version):
440
440
  setup_settings = setup_details["setup_settings"]
441
441
  benchmarks_map = setup_details["benchmarks"]
442
442
  # we start with an empty per bench-type/setup-name
443
- setup_details["env"] = None
443
+ if not reuse_mixed:
444
+ logging.info(
445
+ "Given we are not reusing a mixed setup we will reset the setup details."
446
+ )
447
+ setup_details["env"] = None
444
448
 
445
449
  # map from setup name to overall target-tables ( if any target is defined )
446
450
  overall_tables[setup_name] = {}
@@ -660,7 +664,7 @@ def run_remote_command_logic(args, project_name, project_version):
660
664
  ld_library_paths,
661
665
  extra_libs,
662
666
  )
663
- if benchmark_type == "read-only" or reused_mixed:
667
+ if benchmark_type == "read-only" or reuse_mixed:
664
668
  ro_benchmark_set(
665
669
  artifact_version,
666
670
  cluster_enabled,
@@ -1398,7 +1402,7 @@ def ro_benchmark_reuse(
1398
1402
  ):
1399
1403
  assert benchmark_type == "read-only"
1400
1404
  logging.info(
1401
- "Given the benchmark for this setup is ready-only, and this setup was already spinned we will reuse the previous, conns and process info."
1405
+ "Given the benchmark for this setup is read-only, and this setup was already spinned we will reuse the previous, conns and process info."
1402
1406
  )
1403
1407
  artifact_version = setup_details["env"]["artifact_version"]
1404
1408
  cluster_enabled = setup_details["env"]["cluster_enabled"]
@@ -1434,7 +1438,7 @@ def ro_benchmark_set(
1434
1438
  full_logfiles,
1435
1439
  ):
1436
1440
  logging.info(
1437
- "Given the benchmark for this setup is ready-only we will prepare to reuse it on the next read-only benchmarks (if any )."
1441
+ "Given the benchmark for this setup is read-only we will prepare to reuse it on the next read-only benchmarks (if any )."
1438
1442
  )
1439
1443
  setup_details["env"] = {}
1440
1444
  setup_details["env"]["full_logfiles"] = full_logfiles
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.1
2
2
  Name: redisbench-admin
3
- Version: 0.11.63
3
+ Version: 0.11.65
4
4
  Summary: Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... ).
5
- License-File: LICENSE
6
5
  Author: filipecosta90
7
6
  Author-email: filipecosta.90@gmail.com
8
7
  Requires-Python: >=3.10.0,<4.0.0
@@ -10,8 +9,6 @@ Classifier: Programming Language :: Python :: 3
10
9
  Classifier: Programming Language :: Python :: 3.10
11
10
  Classifier: Programming Language :: Python :: 3.11
12
11
  Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
- Classifier: Programming Language :: Python :: 3.14
15
12
  Requires-Dist: Flask (>=2.0.1,<3.0.0)
16
13
  Requires-Dist: Flask-HTTPAuth (>=4.4.0,<5.0.0)
17
14
  Requires-Dist: GitPython (>=3.1.12,<4.0.0)