arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2502.18113cs.DB
收藏

加速现代CPU上的ANNS图索引构建

Accelerating Graph Indexing for ANNS on Modern CPUs

Mengzhao Wang, Haotian Wu, Xiangyu Ke, Yunjun Gao, Yifan Zhu, Wenchao Zhou

AI总结:

针对现代CPU上图索引构建慢的问题,提出紧凑编码策略Flash,通过减少随机内存访问和优化SIMD利用,在八个数据集上实现10.4至22.9倍的索引加速,同时保持或提升搜索性能。

摘要:

在高维向量空间中,近似最近邻搜索(ANNS)是数据库和人工智能基础设施中的关键组成部分。基于图的方法,特别是HNSW,已成为各种ANNS方法中的领先解决方案,在搜索效率和准确性之间提供了令人印象深刻的权衡。许多现代向量数据库利用图索引作为其核心算法,受益于各种优化以提升搜索性能。然而,与图算法相关的高索引构建时间构成了重大挑战,尤其是考虑到数据量的不断增加、查询处理的复杂性以及动态索引维护的需求。这使得索引构建时间成为用户的关键性能指标。在本文中,我们全面分析了现代CPU上图索引构建效率低下的根本原因,确定距离计算主导了索引构建时间,主要由于高内存访问延迟和次优的算术运算效率。我们证明,在索引构建过程中的距离比较可以使用紧凑向量编码在适当的压缩误差下有效执行。基于在图形索引过程中集成现有紧凑编码方法所获得的见解,我们提出了一种新颖的紧凑编码策略,名为Flash,专门为图索引设计并针对现代CPU架构进行了优化。通过最小化随机内存访问和最大化SIMD(单指令多数据)指令的利用,Flash显著提高了缓存命中率和算术运算效率。在八个真实世界数据集上进行的广泛实验,范围从一千万到十亿个向量,表明Flash在索引构建效率上实现了10.4倍到22.9倍的加速,同时保持或提升了搜索性能。

英文摘要:

In high-dimensional vector spaces, Approximate Nearest Neighbor Search (ANNS) is a key component in database and artificial intelligence infrastructures. Graph-based methods, particularly HNSW, have emerged as leading solutions among various ANNS approaches, offering an impressive trade-off between search efficiency and accuracy. Many modern vector databases utilize graph indexes as their core algorithms, benefiting from various optimizations to enhance search performance. However, the high indexing time associated with graph algorithms poses a significant challenge, especially given the increasing volume of data, query processing complexity, and dynamic index maintenance demand. This has rendered indexing time a critical performance metric for users. In this paper, we comprehensively analyze the underlying causes of the low graph indexing efficiency on modern CPUs, identifying that distance computation dominates indexing time, primarily due to high memory access latency and suboptimal arithmetic operation efficiency. We demonstrate that distance comparisons during index construction can be effectively performed using compact vector codes at an appropriate compression error. Drawing from insights gained through integrating existing compact coding methods in the graph indexing process, we propose a novel compact coding strategy, named Flash, designed explicitly for graph indexing and optimized for modern CPU architectures. By minimizing random memory accesses and maximizing the utilization of SIMD (Single Instruction, Multiple Data) instructions, Flash significantly enhances cache hit rates and arithmetic operations. Extensive experiments conducted on eight real-world datasets, ranging from ten million to one billion vectors, exhibit that Flash achieves a speedup of 10.4$\times$ to 22.9$\times$ in index construction efficiency, while maintaining or improving search performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑