Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ We have a number of precomputed data sets in HDF5 format. All data sets have bee
Results
=======

These are all as of April 2023, running all benchmarks on a r6i.16xlarge machine on AWS with `--parallelism 31` and hyperthreading disabled. All benchmarks are single-CPU.
These are all as of April 2025, running all benchmarks on a r6i.16xlarge machine on AWS with `--parallelism 31` and hyperthreading disabled. All benchmarks are single-CPU.

glove-100-angular
-----------------
Expand Down Expand Up @@ -124,9 +124,9 @@ The only prerequisite is Python (tested with 3.10.6) and Docker.
Running
=======

1. Run `python run.py` (this can take an extremely long time, potentially days)
2. Run `python plot.py` or `python create_website.py` to plot results.
3. Run `python data_export.py --out res.csv` to export all results into a csv file for additional post-processing.
1. Run `python run.py` (this can take an extremely long time, potentially days).
2. Run `python plot.py --x-scale logit --y-scale log` to plot results.
3. Run `python create_website.py` to create a website with lots of plots.

You can customize the algorithms and datasets as follows:

Expand Down
9 changes: 4 additions & 5 deletions ann_benchmarks/algorithms/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM ubuntu:22.04

RUN apt-get update
RUN apt-get install -y python3-numpy python3-scipy python3-pip build-essential git
RUN pip3 install -U pip
RUN python3 --version | grep 'Python 3.10'
RUN apt-get install -y python3-pip python-is-python3 build-essential git
RUN python --version | grep 'Python 3.10'

WORKDIR /home/app
COPY requirements.txt run_algorithm.py ./
RUN pip3 install -r requirements.txt
RUN pip install -r requirements.txt

ENTRYPOINT ["python3", "-u", "run_algorithm.py"]
ENTRYPOINT ["python", "-u", "run_algorithm.py"]
7 changes: 3 additions & 4 deletions ann_benchmarks/algorithms/hnswlib/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM ann-benchmarks

RUN apt-get install -y python-setuptools python-pip
RUN pip3 install pybind11 numpy setuptools
RUN git clone https://github.com/nmslib/hnsw.git;cd hnsw; git checkout denorm
RUN pip install pybind11 numpy setuptools
RUN git clone https://github.com/nmslib/hnsw.git; cd hnsw; git checkout denorm

RUN cd hnsw/python_bindings; python3 setup.py install

RUN python3 -c 'import hnswlib'
RUN python -c 'import hnswlib'

6 changes: 3 additions & 3 deletions ann_benchmarks/algorithms/kgraph/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ann-benchmarks

RUN apt-get update && apt-get install -y libboost-timer-dev libboost-chrono-dev libboost-program-options-dev libboost-system-dev libboost-python-dev
RUN apt-get update && apt-get install -y libboost-timer-dev libboost-chrono-dev libboost-program-options-dev libboost-system-dev libboost-python-dev libopenblas-dev
RUN git clone https://github.com/aaalgo/kgraph
RUN cd kgraph && python3 setup.py build && python3 setup.py install
RUN python3 -c 'import pykgraph'
RUN cd kgraph && pip install -e .
RUN python -c 'import kgraph'
4 changes: 2 additions & 2 deletions ann_benchmarks/algorithms/kgraph/module.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import numpy
import pykgraph
import kgraph

from ...constants import INDEX_DIR
from ..base.module import BaseANN
Expand All @@ -18,7 +18,7 @@ def __init__(self, metric, index_params, save_index):
def fit(self, X):
if X.dtype != numpy.float32:
X = X.astype(numpy.float32)
self._kgraph = pykgraph.KGraph(X, self._metric)
self._kgraph = kgraph.KGraph(X, self._metric)
path = os.path.join(INDEX_DIR, "kgraph-index-%s" % self._metric)
if os.path.exists(path):
self._kgraph.load(path)
Expand Down
6 changes: 3 additions & 3 deletions ann_benchmarks/algorithms/nearpy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ann-benchmarks

RUN apt-get install -y libhdf5-openmpi-dev cython
RUN pip3 install nearpy bitarray redis sklearn
RUN python3 -c 'import nearpy'
RUN apt-get install -y libhdf5-openmpi-dev cython3
RUN pip install nearpy bitarray redis
RUN python -c 'import nearpy'
6 changes: 3 additions & 3 deletions ann_benchmarks/algorithms/puffinn/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ann-benchmarks

RUN pip3 install pypandoc==1.4
RUN pip install pypandoc==1.4 pybind11
RUN git clone https://github.com/puffinn/puffinn
RUN cd puffinn && python3 setup.py install
RUN python3 -c 'import puffinn'
RUN cd puffinn && python setup.py install
RUN python -c 'import puffinn'
5 changes: 3 additions & 2 deletions ann_benchmarks/algorithms/vearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ann-benchmarks

RUN pip3 install vearch==3.2.8.3
RUN python3 -c 'import vearch'
RUN pip install 'numpy<2'
RUN pip install vearch==3.2.8.3
RUN python -c 'import vearch'
6 changes: 3 additions & 3 deletions ann_benchmarks/algorithms/voyager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ann-benchmarks

RUN apt-get install -y python-setuptools python-pip
RUN pip3 install voyager
RUN apt-get install -y python-setuptools
RUN pip install voyager

RUN python3 -c 'import voyager'
RUN python -c 'import voyager'

4 changes: 2 additions & 2 deletions plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def inv_fun(x):
# Workaround for bug https://github.com/matplotlib/matplotlib/issues/6789
ax.spines["bottom"]._adjust_location()

plt.savefig(fn_out, bbox_inches="tight")
plt.savefig(fn_out, bbox_inches="tight", dpi=144)
plt.close()


Expand All @@ -108,7 +108,7 @@ def inv_fun(x):
"-y", "--y-axis", help="Which metric to use on the Y-axis", choices=metrics.keys(), default="qps"
)
parser.add_argument(
"-X", "--x-scale", help="Scale to use when drawing the X-axis. Typically linear, logit or a2", default="linear"
"-X", "--x-scale", help="Scale to use when drawing the X-axis. Typically linear, logit or a2", default="linear",
)
parser.add_argument(
"-Y",
Expand Down
20 changes: 10 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ansicolors==1.1.8
docker==7.1.0
h5py==3.8.0
matplotlib==3.6.3
numpy==1.24.2
pyyaml==6.0
psutil==5.9.4
scikit-learn==1.2.1
jinja2==3.1.2
pytest==7.2.2
datasets==2.12.0
requests==2.31.0
h5py==3.13.0
matplotlib==3.10.1
numpy==2.2.4
pyyaml==6.0.2
psutil==7.0.0
scikit-learn==1.6.1
jinja2==3.1.6
pytest==8.3.5
datasets==3.4.0
requests==2.32.3
Binary file modified results/fashion-mnist-784-euclidean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/gist-960-euclidean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/glove-100-angular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/glove-25-angular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/nytimes-256-angular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/sift-128-euclidean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading