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

CACTUSDB: 解锁SQL和AI/ML推断的协同优化机会

CACTUSDB: Unlock Co-Optimization Opportunities for SQL and AI/ML Inferences

Arizona State University(亚利桑那州立大学);Meta;Amazon(亚马逊)

Lixi Zhou, Kanchan Chowdhury, Lulu Xie, Jaykumar Tandel, Hong Guan, Zhiwei Fan, Xinwei Fu, Jia Zou

AI总结:

CACTUSDB通过三层中间表示和MCTS优化器,实现SQL与AI/ML推断的协同优化,提升查询性能达441倍。

摘要:

在数据库系统中,日益增长的需求是支持结合结构化查询语言(SQL)和人工智能/机器学习(AI/ML)模型推断的查询,以避免数据去规范化和传输,便于管理,并缓解隐私问题。在数据库系统中执行推断查询的协同优化技术分为四类:(O1)关系代数优化,将AI/ML模型视为黑盒用户定义函数(UDF);(O2)分解的AI/ML推断;(O3)张量-关系转换;以及(O4)通用交叉优化技术。然而,我们发现现有的数据库系统不支持所有这些技术,导致性能低下。在本工作中,我们识别出两个关键挑战以解决上述问题:(1)将涉及不同数据和计算抽象的所有协同优化技术统一到一个系统中的困难;以及(2)缺乏一个能够有效探索指数级搜索空间的优化器。为了解决这些挑战,我们提出了CactusDB,这是一个基于Velox——一个高性能、以UDF为中心的数据库引擎,由Meta开源的新型系统。CactusDB具有三层中间表示(IR),支持关系运算符、表达式运算符和ML函数,以实现任意子计算的灵活优化。此外,我们提出了一种基于蒙特卡洛树搜索(MCTS)的新型优化器,结合查询嵌入,与我们独特的三层IR共同设计,使不同查询之间能够共享和重用优化知识。在MovieLens和TPCx-AI等知名数据集上评估了12个代表性推断工作负载和2000个随机生成的推断查询,结果表明,CactusDB相比替代系统实现了高达441倍的速度提升。

英文摘要:

There is a growing demand for supporting inference queries that combine Structured Query Language (SQL) and Artificial Intelligence / Machine Learning (AI/ML) model inferences in database systems, to avoid data denormalization and transfer, facilitate management, and alleviate privacy concerns. Co-optimization techniques for executing inference queries in database systems without accuracy loss fall into four categories: (O1) Relational algebra optimization treating AI/ML models as black-box user-defined functions (UDFs); (O2) Factorized AI/ML inferences; (O3) Tensor-relational transformation; and (O4) General cross-optimization techniques. However, we found none of the existing database systems support all these techniques simultaneously, resulting in suboptimal performance. In this work, we identify two key challenges to address the above problem: (1) the difficulty of unifying all co-optimization techniques that involve disparate data and computation abstractions in one system; and (2) the lack of an optimizer that can effectively explore the exponential search space. To address these challenges, we present CactusDB, a novel system built atop Velox - a high-performance, UDF-centric database engine, open-sourced by Meta. CactusDB features a three-level Intermediate Representations (IR) that supports relational operators, expression operators, and ML functions to enable flexible optimization of arbitrary sub-computations. Additionally, we propose a novel Monte-Carlo Tree Search (MCTS)-based optimizer with query embedding, co-designed with our unique three-level IR, enabling shared and reusable optimization knowledge across different queries. Evaluation of 12 representative inference workloads and 2,000 randomly generated inference queries on well-known datasets, such as MovieLens and TPCx-AI, shows that CactusDB achieves up to 441 times speedup compared to alternative systems.

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

↑