[Paper Review] BANG: Billion-Scale Approximate Nearest Neighbor Search using a Single GPU
BANG introduces a novel GPU-based approximate nearest neighbor search method that enables billion-scale ANNS on a single GPU by compressing data for fast distance computation while keeping the graph and raw vectors on the CPU. It achieves 40×–200× higher throughput than state-of-the-art methods on billion-scale datasets at high recall (0.9), leveraging GPU-CPU pipelining, optimized kernels, and reduced PCIe data transfer.
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.
Motivation & Objective
- Address the scalability bottleneck of GPU-based ANNS for billion-scale datasets that exceed GPU memory capacity.
- Overcome the limitations of existing GPU ANNS methods that require full graph and data in GPU memory or rely on multi-GPU setups.
- Enable high-throughput, high-recall ANNS on a single GPU by offloading computation to compressed data on the GPU while maintaining the graph on the CPU.
- Minimize PCIe data transfer overhead between CPU and GPU through overlapping communication with computation and intelligent prefetching.
- Achieve performance parity or superiority over state-of-the-art CPU and multi-GPU ANNS systems using only a single GPU.
Proposed method
- BANG uses Product Quantization (PQ) to compress high-dimensional vectors, enabling efficient distance computations on the GPU without storing full-precision vectors in GPU memory.
- The Vamana graph structure from DiskANN is used as the underlying index, stored and managed on the CPU, while neighbor traversal and distance calculations are performed on the GPU using compressed vectors.
- GPU kernels are highly optimized for core operations including distance computation, sorting, worklist updates, and nearest neighbor selection, maximizing GPU occupancy and parallelism.
- CPU and GPU execute search stages in a pipelined, concurrent fashion: the CPU prepares neighbor information and prefetches data while the GPU performs distance computations.
- Bloom filters are used to accelerate graph traversal by pruning non-promising nodes early, reducing unnecessary GPU work and memory access.
- Communication between CPU and GPU is overlapped with computation using asynchronous data transfers and double buffering, minimizing idle time and PCIe bottlenecks.
Experimental results
Research questions
- RQ1Can a single-GPU ANNS system achieve high throughput and high recall on billion-scale datasets that exceed GPU memory capacity?
- RQ2How can GPU-CPU workload distribution be optimized to minimize data transfer and maximize parallelism in graph-based ANNS?
- RQ3To what extent can data compression (via PQ) enable fast distance computation on the GPU without sacrificing search accuracy?
- RQ4Can pipelining and overlapping communication with computation significantly reduce the performance penalty of offloading graph data to the CPU?
- RQ5How does the proposed method compare in throughput and recall to state-of-the-art GPU and multi-GPU ANNS systems on standard benchmarks?
Key findings
- On billion-scale datasets, BANG achieves 40× to 200× higher throughput than competing GPU-based methods at a recall of 0.9, demonstrating a significant performance advantage.
- For million-scale datasets, BANG outperforms the state-of-the-art in the majority of benchmark cases, with an arithmetic mean throughput 2× higher than the best competing methods.
- BANG maintains high recall (≥0.9) across all evaluated datasets, including large-scale benchmarks like SIFT1B and GIST1M, where prior GPU methods struggle to balance recall and throughput.
- The use of compressed data on the GPU reduces memory bandwidth pressure and enables efficient computation even when the full dataset and graph are stored on the CPU.
- Pipelining and overlapping communication with computation reduce CPU-GPU data transfer overhead, making BANG resilient to PCIe bandwidth limitations.
- BANG is the first GPU-based ANNS system to efficiently handle billion-scale datasets on a single GPU without requiring multi-GPU setups or full in-GPU index storage.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.