Abstract
Vector search is a foundational component of modern information retrieval, recommendation systems, and Large Language Model (LLM) architectures. As datasets reach petabyte scales, traditional CPU and GPU implementations face significant challenges regarding power efficiency and tail latency. This paper presents FANNS, an automated framework that co-designs FPGA hardware and vector search algorithms—specifically Inverted File with Product Quantization (IVF-PQ). By dynamically tailoring hardware architectures to specific algorithmic parameters, FANNS achieves up to a 37x speedup over high-end CPUs and demonstrates superior tail-latency scalability compared to GPUs in large-scale distributed deployments.
Introduction
Vector search involves identifying the most similar items within massive datasets of high-dimensional embeddings. As the scale of these datasets grows, the computational burden of searching through millions or billions of vectors becomes a significant bottleneck. While specialized hardware accelerators like FPGAs offer a promising alternative to general-purpose CPUs, static hardware designs often fail to account for the dynamic nature of search algorithms.
The core challenge lies in the variability of algorithms like IVF-PQ. These algorithms utilize several tunable parameters—such as the number of clusters to search (nprobe) or the number of results to return (K)—which shift the computational bottleneck between different stages of the search pipeline. A fixed hardware architecture cannot adapt to these shifts, leading to resource underutilization and suboptimal performance.
The FANNS Framework
To address this, we introduce FANNS (FPGA-accelerated Approximate Nearest Neighbor Search), an end-to-end framework designed to automate the hardware-algorithm co-design process. FANNS moves away from static designs by providing a library of modular hardware building blocks. These Processing Elements (PEs) are optimized for the six distinct stages of the IVF-PQ pipeline, including distance calculation, sorting, and selection.
Automated Design and Modeling
One of the primary barriers to FPGA development is the lengthy compilation time, which can often exceed ten hours. FANNS bypasses this by utilizing sophisticated analytical performance and resource models. These models allow the framework to evaluate millions of potential hardware-algorithm combinations in under an hour, predicting throughput (Queries Per Second) and hardware resource usage (logic gates, memory, etc.) with high accuracy. Once an optimal configuration is identified for a specific dataset and recall target, FANNS automatically generates the ready-to-compile FPGA code.
Hardware-Level Networking
For large-scale deployments, FANNS integrates a hardware-based TCP/IP stack directly into the accelerator. This allows multiple FPGAs to communicate across a network without involving the host CPU. By eliminating the "middleman" of the CPU and operating system, the framework significantly reduces communication overhead and jitter in multi-accelerator environments.
The Shifting Bottleneck Insight
A key contribution of this work is the empirical proof that bottlenecks in vector search are dynamic. For instance, increasing the nprobe parameter to achieve higher accuracy shifts the bottleneck toward the distance computation stage. Conversely, requesting a larger number of results (K) shifts the bottleneck toward the sorting stage. FANNS handles these transitions by re-allocating hardware resources to the specific stage where the bottleneck resides for a given query configuration.
Experimental Results
We evaluated FANNS using industry-standard benchmarks, SIFT100M and Deep100M, each containing 100 million vectors. The results demonstrate the clear advantages of the co-design approach:
- Performance vs. CPU: FANNS-generated accelerators achieved up to a 37.2× speedup over a high-end Intel Xeon CPU.
- Performance vs. Static FPGA: By tailoring the hardware to specific recall targets, FANNS provided up to a 23× speedup compared to generic, non-parameter-aware FPGA designs.
- Scalability and Tail Latency: While GPUs may offer high raw throughput, they often suffer from high latency variance (jitter). In an 8-accelerator configuration, FANNS achieved a 7.6× improvement in 95th-percentile (P95) latency over GPU-based solutions. Extrapolations for a cluster of 1,024 accelerators suggest that FPGA-based systems could provide a 42.1× better P99 latency than GPU clusters.
Limitations and Future Work
While FANNS represents a significant step forward, several areas for improvement remain. The final FPGA bitstream generation still requires approximately 10 hours, making the system most suitable for environments where dataset characteristics are relatively stable. Additionally, while IVF-PQ is a widely used algorithm, future iterations of FANNS could expand to include other popular approaches, such as graph-based search (e.g., HNSW). Finally, the current performance models assume a constant clock frequency; future refinements could account for frequency degradation in extremely dense hardware designs.
Conclusion
FANNS demonstrates that the key to efficient large-scale vector search lies in the tight integration of hardware architecture and algorithmic parameters. By automating the co-design process and optimizing for tail latency, FANNS provides a scalable, high-performance alternative to traditional CPU and GPU search infrastructures.
Summary updated