diff --git a/README.md b/README.md index fc1be6009..36e5cb4f9 100644 --- a/README.md +++ b/README.md @@ -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 ----------------- @@ -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: diff --git a/ann_benchmarks/algorithms/base/Dockerfile b/ann_benchmarks/algorithms/base/Dockerfile index 9e1b3fd60..d1a9a4e13 100644 --- a/ann_benchmarks/algorithms/base/Dockerfile +++ b/ann_benchmarks/algorithms/base/Dockerfile @@ -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"] diff --git a/ann_benchmarks/algorithms/hnswlib/Dockerfile b/ann_benchmarks/algorithms/hnswlib/Dockerfile index 964890336..b88375253 100644 --- a/ann_benchmarks/algorithms/hnswlib/Dockerfile +++ b/ann_benchmarks/algorithms/hnswlib/Dockerfile @@ -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' diff --git a/ann_benchmarks/algorithms/kgraph/Dockerfile b/ann_benchmarks/algorithms/kgraph/Dockerfile index 0ba71df0e..e4de332e4 100644 --- a/ann_benchmarks/algorithms/kgraph/Dockerfile +++ b/ann_benchmarks/algorithms/kgraph/Dockerfile @@ -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' diff --git a/ann_benchmarks/algorithms/kgraph/module.py b/ann_benchmarks/algorithms/kgraph/module.py index ddd8bc723..7a1563471 100644 --- a/ann_benchmarks/algorithms/kgraph/module.py +++ b/ann_benchmarks/algorithms/kgraph/module.py @@ -1,7 +1,7 @@ import os import numpy -import pykgraph +import kgraph from ...constants import INDEX_DIR from ..base.module import BaseANN @@ -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) diff --git a/ann_benchmarks/algorithms/nearpy/Dockerfile b/ann_benchmarks/algorithms/nearpy/Dockerfile index 4411816e5..0d151db98 100644 --- a/ann_benchmarks/algorithms/nearpy/Dockerfile +++ b/ann_benchmarks/algorithms/nearpy/Dockerfile @@ -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' \ No newline at end of file +RUN apt-get install -y libhdf5-openmpi-dev cython3 +RUN pip install nearpy bitarray redis +RUN python -c 'import nearpy' \ No newline at end of file diff --git a/ann_benchmarks/algorithms/puffinn/Dockerfile b/ann_benchmarks/algorithms/puffinn/Dockerfile index dd4714af7..af15d0bf2 100644 --- a/ann_benchmarks/algorithms/puffinn/Dockerfile +++ b/ann_benchmarks/algorithms/puffinn/Dockerfile @@ -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' diff --git a/ann_benchmarks/algorithms/vearch/Dockerfile b/ann_benchmarks/algorithms/vearch/Dockerfile index 5193a5dcb..382f77aed 100644 --- a/ann_benchmarks/algorithms/vearch/Dockerfile +++ b/ann_benchmarks/algorithms/vearch/Dockerfile @@ -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' diff --git a/ann_benchmarks/algorithms/voyager/Dockerfile b/ann_benchmarks/algorithms/voyager/Dockerfile index f4361d741..d765e5932 100644 --- a/ann_benchmarks/algorithms/voyager/Dockerfile +++ b/ann_benchmarks/algorithms/voyager/Dockerfile @@ -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' diff --git a/plot.py b/plot.py index 2255e1057..497c704b1 100644 --- a/plot.py +++ b/plot.py @@ -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() @@ -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", diff --git a/requirements.txt b/requirements.txt index 4682d5b6d..198378cee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/results/fashion-mnist-784-euclidean.png b/results/fashion-mnist-784-euclidean.png index a9c40fae9..a3f8008ed 100755 Binary files a/results/fashion-mnist-784-euclidean.png and b/results/fashion-mnist-784-euclidean.png differ diff --git a/results/gist-960-euclidean.png b/results/gist-960-euclidean.png index 4e4088185..33c39503f 100755 Binary files a/results/gist-960-euclidean.png and b/results/gist-960-euclidean.png differ diff --git a/results/glove-100-angular.png b/results/glove-100-angular.png index 29c3fd69a..90e951200 100755 Binary files a/results/glove-100-angular.png and b/results/glove-100-angular.png differ diff --git a/results/glove-25-angular.png b/results/glove-25-angular.png index 6c9c0dce1..45812f3f4 100755 Binary files a/results/glove-25-angular.png and b/results/glove-25-angular.png differ diff --git a/results/nytimes-256-angular.png b/results/nytimes-256-angular.png index 9f97da23f..ea765f1dd 100755 Binary files a/results/nytimes-256-angular.png and b/results/nytimes-256-angular.png differ diff --git a/results/sift-128-euclidean.png b/results/sift-128-euclidean.png index def0e3101..63702acd5 100755 Binary files a/results/sift-128-euclidean.png and b/results/sift-128-euclidean.png differ