arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.15957cs.DB
收藏

在GPU上进行还是不进行GPU操作:关系引擎中的向量搜索

To GPU or Not to GPU: Vector Search in Relational Engines

ETH Zürich(苏黎世联邦理工学院)

Vasilis Mageirakos, Joel André, Marko Kabić, Bowen Wu, Yannis Chronis, Gustavo Alonso

AI总结:

本文探讨了在关系引擎中集成GPU进行向量搜索的必要性,通过扩展TPC-H基准测试并设计SQL+VS查询,开发了跨CPU和GPU的执行引擎,并通过实验发现GPU在处理关系组件时更高效,但向量搜索部分需优化索引结构以提升性能。

摘要:

向量搜索(VS)现在已成为大多数数据库引擎的功能。然而,尽管向量搜索是AI/ML/LLMs中常用的功能,现有数据库引擎在实现向量搜索时仍基于CPU。本文探讨了是否应将向量处理集成到GPU中作为引擎的一部分。首先,我们扩展了TPC-H基准测试,加入了向量数据(来自文本和图像),并提出了若干代表性的SQL+VS查询。其次,我们开发了一个模块化的执行引擎,能够跨CPU和GPU运行SQL+VS查询。第三,我们对多种部署进行了广泛的实验:在CPU或GPU内存中运行SQL+VS查询,使用现有索引和新型优化版本,以及在不同GPU和互连(PCIe、NVLink)上运行。结果提供了可操作且反直觉的见解,说明如何在CPU和GPU上运行此类查询。例如,关系组件在GPU上受益更多,而向量搜索部分则不然。此外,当向量搜索涉及数据和索引的移动时,即使使用快速互连,使用GPU也不是最佳选择。因此,我们开发了一种替代的向量索引和嵌入结构,以减少索引的大小,使基于GPU的向量搜索更具竞争力。通过这些改进,最终结果是,关系和向量搜索组件在GPU上都更快,特别是在快速互连上,与现有引擎的架构形成对比。

英文摘要:

Vector search (VS) is now available in most database engines. However, while vector search is a common feature in AI/ML/LLMs where the dominant computing platforms are GPUs, existing database engines operate on CPUs even when implementing vector search. This raises the question of whether integrating vector processing on GPUs as part of the engine would be a better design. In this paper, we explore this question in detail. First, we extend the TPC-H benchmark with vector data (from text and images) and propose a number of representative SQL+VS queries. Second, we develop a modular execution engine that can run SQL+VS queries across CPU and GPU. Third, we perform extensive experiments on a number of deployments: running the SQL+VS queries across CPU and/or GPU, with data residing in CPU or GPU memory, with existing indices and novel, optimized versions, as well as across different GPUs and interconnects (PCIe, NVLink). The results provide actionable and counter-intuitive insights on how to run such queries over CPUs and GPUs. For instance, the relational components benefit much more from running on the GPU than the vector search part. In addition, when the vector search involves moving data and indexes, using the GPU is not the best option, even with fast interconnects. Thus, we develop an alternative organization of vector index and embeddings that reduces the size of the index, making GPU-based vector search more competitive. With these improvements, the final result is that both the relational and vector search components are faster on the GPU, particularly on fast interconnects, in contrast with the architecture used in existing engines.

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

↑