BANG: Billion-Scale Approximate Nearest Neighbor Search using a Single GPU
Karthik V., Saim Khan, Somesh Singh, Harsha Vardhan Simhadri, Jyothi Vedurada
TL;DR
BANG tackles billion-scale approximate nearest neighbor search by decoupling the graph index from GPU memory and using compressed vectors for distance computations. It introduces a phased CPU-GPU execution model, asynchronous prefetching, and a suite of GPU kernels centered around a PQ-based distance table to maximize parallelism. The approach delivers dramatic throughput gains (tens to hundreds of times higher) over state-of-the-art GPU methods on multiple billion-scale datasets while maintaining recall, and it does so on a single GPU by keeping the graph on the CPU and minimizing data transfer. This work enables practical, cost-efficient vector similarity search for large-scale vector databases on commodity hardware.
Abstract
Approximate Nearest Neighbour Search (ANNS) is a subroutine in algorithms routinely employed in information retrieval, pattern recognition, data mining, image processing, and beyond. Recent works have established that graph-based ANNS algorithms are practically more efficient than the other methods proposed in the literature. The growing volume and dimensionality of data necessitates designing scalable techniques for ANNS. To this end, the prior art has explored parallelising graph-based ANNS on GPU, leveraging its massive parallelism. The current state-of-the-art GPU-based ANNS algorithms either (i) require both the dataset and the generated graph index to reside entirely in the GPU memory, or (ii) they partition the dataset into small independent shards, each of which can fit in GPU memory, and perform the search on these shards on the GPU. While the first approach fails to handle large datasets due to the limited memory available on the GPU, the latter delivers poor performance on large datasets due to high data traffic over the low-bandwidth PCIe interconnect. We introduce BANG, a first-of-its-kind technique for graph-based ANNS on GPU for billion-scale datasets, that cannot entirely fit in the GPU memory. BANG stands out by harnessing a compressed form of the dataset on a single GPU to perform distance computations while efficiently accessing the graph index kept on the host memory, enabling efficient ANNS on large graphs within the limited GPU memory. BANG incorporates highly optimised GPU kernels and proceeds in phases that run concurrently on the GPU and CPU, taking advantage of their architectural specificities. Using a single NVIDIA Ampere A100 GPU, BANG achieves throughputs 50x-400x higher than competing methods for a recall of 0.9 on three popular billion-scale datasets.
