HackerPapers

arXiv:1702.08734cs.CV

Billion-scale similarity search with GPUs

Jeff Johnson, Matthijs Douze, Hervé Jégou

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.

arXiv comments
Journal reference
DOI
Subjects
cs.CVComputer Vision and Pattern Recognition cs.DBDatabases cs.DSData Structures and Algorithms cs.IRInformation Retrieval

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Mar 2023 to Jan 2024. Found in 5 HN submissions from Mar 2017 to Jun 2026. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • The implementations that I am aware of, including the one in Faiss which I wrote (described in detail in https://arxiv.org/abs/1702.08734), do not index the vector based on its PQ encoding (e.g., in IVFPQ). The IVF cell chosen in which to put the vector is based on its…

      jhjView on HNParent context

    • Depends on what you want to optimize for. See this paper https://arxiv.org/abs/1702.08734 And this library that it describes https://github.com/facebookresearch/faiss Which is an optimal use of your time as you can install it in a minute with anaconda if you use Python.

      PaulHouleView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.