Approximate Nearest Neighbor Search (ANNS) plays a critical role in various disciplines spanning data mining and artificial intelligence, from information retrieval and computer vision to natural language processing and recommender systems. Data volumes have soared in recent years and the computational cost of an exhaustive exact nearest neighbor search is often prohibitive, necessitating the adoption of approximate techniques. The balanced performance and recall of graph-based approaches have more recently garnered significant attention in ANNS algorithms, however, only a few studies have explored harnessing the power of GPUs and multi-core processors despite the widespread use of massively parallel and general-purpose computing. To bridge this gap, we introduce a novel parallel computing hardware-based proximity graph and search algorithm. By leveraging the high-performance capabilities of modern hardware, our approach achieves remarkable efficiency gains. In particular, our method surpasses existing CPU and GPU-based methods in constructing the proximity graph, demonstrating higher throughput in both large- and small-batch searches while maintaining compatible accuracy. In graph construction time, our method, CAGRA, is 2.2~27x faster than HNSW, which is one of the CPU SOTA implementations. In large-batch query throughput in the 90% to 95% recall range, our method is 33~77x faster than HNSW, and is 3.8~8.8x faster than the SOTA implementations for GPU. For a single query, our method is 3.4~53x faster than HNSW at 95% recall.
翻译:近似最近邻搜索(ANNS)在数据挖掘和人工智能的多个学科领域,从信息检索、计算机视觉到自然语言处理和推荐系统,都发挥着关键作用。近年来数据量激增,穷举式精确最近邻搜索的计算成本往往过高,因此必须采用近似技术。基于图的方法在性能与召回率之间的平衡性,最近在ANNS算法中获得了广泛关注。然而,尽管大规模并行和通用计算已得到广泛应用,但仅有少数研究探索如何利用GPU和多核处理器的强大算力。为弥补这一空白,我们提出了一种基于新型并行计算硬件的邻近图与搜索算法。通过充分利用现代硬件的高性能特性,我们的方法实现了显著的效率提升。具体而言,在构建邻近图方面,我们的方法超越了现有的基于CPU和GPU的方法,在大批量和小批量搜索中均展现出更高的吞吐量,同时保持相当的精度。在图构建时间上,我们的方法CAGRA比CPU SOTA实现之一的HNSW快2.2~27倍。在90%至95%召回率范围内的大批量查询吞吐量方面,我们的方法比HNSW快33~77倍,比GPU的SOTA实现快3.8~8.8倍。对于单次查询,在95%召回率下,我们的方法比HNSW快3.4~53倍。