ANSMET: Approximate Nearest Neighbor Search with Near-Memory Processing and Hybrid Early Termination

Yiwei Li, Yuxin Jin, Boyu Tian, Huanchen Zhang, Mingyu Gao · 2025

Approximate nearest neighbor search (ANNS) is a fundamental operation in modern vector databases to efficiently retrieve nearby vectors to a given query.On general-purpose computing platforms, ANNS is found not only to be highly memory-bound due to the large amount of high-dimensional vectors to access, but also exhibits very low utilization of the fetched data as many memory accesses and computations are wasted on not-so-nearby vectors.To alleviate these two inefficiencies, we propose a hardware-software co-design that integrates near-data processing architectures with a novel hybrid partial-dimension/bit early termination strategy.Distance calculation and comparison in ANNS are offloaded to the near-data processing units at the memory rank level.As a vector is being gradually fetched from memory, we conservatively estimate a lower bound of its distance to the query using the partially fetched data, e.g., a subset of dimensions and/or partial bits of each element.If this lower bound already exceeds a threshold, we could early terminate to avoid future unnecessary data accesses and computations.In the presence of such irregular early termination execution flow, we further optimize the data layouts within a single memory access and across multiple memory ranks in the system, and handle efficient coordination between the near-data units and the host processor that executes the rest of index traversal and result sorting.With all the above optimizations, our design demonstrates an average 5.26× speedup of using near-data processing, and another 1.52× from enabling hybrid early termination on top of it.

Read the paper · More papers on PaperTik