Billion-scale similarity search with GPUs

Jeff Johnson, Matthijs Douze, Hervé Jégou
2/28/2017
cs.CVcs.DBcs.DS

Official code: facebookresearch/faiss (41,179 stars, MIT, last commit 2026-04-29).

Abstract

Similarity search finds application in specialized database systems handling complex data such as images or videos, which are typically represented by high-dimensional features and require specific indexing structures. This paper tackles the problem of better utilizing GPUs for this task. While GPUs excel at data-parallel tasks, prior approaches are bottlenecked by algorithms that expose less parallelism, such as k-min selection, or make poor use of the memory hierarchy. We propose a design for k-selection that operates at up to 55% of theoretical peak performance, enabling a nearest neighbor implementation that is 8.5x faster than prior GPU state of the art. We apply it in different similarity search scenarios, by proposing optimized design for brute-force, approximate and compressed-domain search based on product quantization. In all these setups, we outperform the state of the art by large margins. Our implementation enables the construction of a high accuracy k-NN graph on 95 million images from the Yfcc100M dataset in 35 minutes, and of a graph connecting 1 billion vectors in less than 12 hours on 4 Maxwell Titan X GPUs. We have open-sourced our approach for the sake of comparison and reproducibility.

View on arXivView PDF

Code Implementations(1)

MIT

A library for efficient similarity search and clustering of dense vectors.

41,1794,562C, C++Feb 7, 20175 months agoMIT

Similar Papers

Cite this paper

@article{johnson2017billionscale,
  title  = {Billion-scale similarity search with GPUs},
  author = {Jeff Johnson and Matthijs Douze and Hervé Jégou},
  year   = {2017},
  eprint = {1702.08734},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1702.08734}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1702.08734.svg)](https://codeofpaper.com/paper/1702.08734)

Discussion