Skip to main content
QUICK REVIEW

[Paper Review] ParlayANN: Scalable and Deterministic Parallel Graph-Based Approximate Nearest Neighbor Search Algorithms

Magdalen Dobson, Zheqi Shen|arXiv (Cornell University)|May 7, 2023
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

ParlayANN introduces a scalable, deterministic, and lock-free parallel implementation of four state-of-the-art graph-based approximate nearest neighbor search (ANNS) algorithms, enabling high-throughput, high-recall search on billion-scale datasets. By eliminating sequential bottlenecks and locks, it achieves superior parallel scalability and deterministic outputs across diverse workloads, outperforming existing non-graph and graph-based methods—especially on out-of-distribution queries.

ABSTRACT

Approximate nearest-neighbor search (ANNS) algorithms are a key part of the modern deep learning stack due to enabling efficient similarity search over high-dimensional vector space representations (i.e., embeddings) of data. Among various ANNS algorithms, graph-based algorithms are known to achieve the best throughput-recall tradeoffs. Despite the large scale of modern ANNS datasets, existing parallel graph based implementations suffer from significant challenges to scale to large datasets due to heavy use of locks and other sequential bottlenecks, which 1) prevents them from efficiently scaling to a large number of processors, and 2) results in nondeterminism that is undesirable in certain applications. In this paper, we introduce ParlayANN, a library of deterministic and parallel graph-based approximate nearest neighbor search algorithms, along with a set of useful tools for developing such algorithms. In this library, we develop novel parallel implementations for four state-of-the-art graph-based ANNS algorithms that scale to billion-scale datasets. Our algorithms are deterministic and achieve high scalability across a diverse set of challenging datasets. In addition to the new algorithmic ideas, we also conduct a detailed experimental study of our new algorithms as well as two existing non-graph approaches. Our experimental results both validate the effectiveness of our new techniques, and lead to a comprehensive comparison among ANNS algorithms on large scale datasets with a list of interesting findings.

Motivation & Objective

  • Address the lack of scalable, deterministic parallel implementations for graph-based ANNS algorithms that can efficiently utilize large-scale multicore systems.
  • Overcome the scalability limitations of existing implementations, which rely on per-vertex locks and degrade beyond tens of threads.
  • Enable deterministic behavior in ANNS to support use cases requiring reproducibility, such as vector databases, crash recovery, and replication.
  • Conduct a comprehensive evaluation of graph-based and non-graph-based ANNS algorithms at billion-scale datasets to identify performance and recall trade-offs under parallel execution.
  • Provide a new open-source library (ParlayANN) with reusable tools and parallel algorithm implementations for future research and deployment in large-scale vector search.

Proposed method

  • Design lock-free parallel algorithms for four SOTA graph-based ANNS methods: HNSW, HCNNG, LSH-Graph, and GDSR, using the ParlayLib parallel programming framework.
  • Employ a shared-memory, work-stealing execution model to minimize contention and avoid locks, enabling high scalability across hundreds of cores.
  • Use a deterministic graph construction and search strategy where vertex processing order is fixed by a global priority queue, ensuring identical outputs across runs.
  • Implement a hybrid indexing strategy that combines graph traversal with efficient memory access patterns to reduce false sharing and improve load balancing.
  • Leverage the ParlayLib runtime system to express fine-grained parallelism in graph construction and query processing while maintaining correctness and determinism.
  • Integrate algorithmic optimizations such as early termination, cache-aware data layout, and parallel priority queue operations to improve performance on large-scale datasets.
Figure 1 . Scalability of original and our new implementations of four ANNS algorithms on various number of threads. Within each subfigure, all numbers are speedup numbers relative to the original implementation on one thread . Higher is better. Results were tested on a machine with 48 cores using d
Figure 1 . Scalability of original and our new implementations of four ANNS algorithms on various number of threads. Within each subfigure, all numbers are speedup numbers relative to the original implementation on one thread . Higher is better. Results were tested on a machine with 48 cores using d

Experimental results

Research questions

  • RQ1Can lock-free, deterministic parallel implementations of graph-based ANNS algorithms scale efficiently to hundreds of cores on billion-scale datasets?
  • RQ2How do graph-based ANNS algorithms compare to non-graph-based approaches (e.g., IVF, LSH) in terms of recall and throughput on out-of-distribution queries?
  • RQ3What are the performance and scalability characteristics of state-of-the-art ANNS algorithms when executed in a shared-memory, parallel setting with high core counts?
  • RQ4Can deterministic graph-based ANNS achieve high recall and throughput simultaneously, especially in real-world scenarios with OOD queries?
  • RQ5How do algorithmic choices in graph construction and search affect parallel scalability and determinism in large-scale vector search?

Key findings

  • ParlayANN achieves significant speedup beyond 50 threads—unlike existing lock-based implementations, which saturate at tens of threads—demonstrating superior scalability on large-scale datasets.
  • The library achieves deterministic outputs across multiple runs, resolving a critical issue in production systems requiring reproducibility and consistency.
  • HCNNG, a less-known graph-based algorithm, outperforms HNSW and other methods in recall on out-of-distribution queries, challenging prior assumptions about algorithmic dominance.
  • Graph-based methods in ParlayANN consistently achieve higher recall than IVF and LSH-based approaches, especially on OOD queries, where the latter show severe performance degradation.
  • ParlayANN’s throughput exceeds that of disk-based systems like SPANN and DiskANN on in-memory workloads, even when accounting for primary memory constraints.
  • The benchmarking study reveals that existing public ANNS implementations often report results under non-representative conditions (e.g., small datasets, sequential execution), limiting their real-world applicability.
Figure 2 . An example of ANNS graph and a greedy search. The blue arrows represent directed edges in the proximity graph, which is a mix of long and short edges. Below is an example of NNS query on point $q$ (red point). The algorithm starts with adding the starting point $A$ as the only point in th
Figure 2 . An example of ANNS graph and a greedy search. The blue arrows represent directed edges in the proximity graph, which is a mix of long and short edges. Below is an example of NNS query on point $q$ (red point). The algorithm starts with adding the starting point $A$ as the only point in th

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.