arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.14706cs.DBcs.PL
收藏

Galley:面向稀疏张量程序的现代查询优化

Galley: Modern Query Optimization for Sparse Tensor Programs

University of Washington(华盛顿大学);Massachusetts Institute of Technology(麻省理工学院)

Kyle Deeds, Willow Ahrens, Magda Balazinska, Dan Suciu

AI总结:

本研究提出声明式张量编程系统Galley,通过扩展FAQ框架分解程序、基于代价优化稀疏张量算子,在机器学习和子图计数任务中实现显著性能提升且优化开销极小。

摘要:

张量编程抽象是一种基础范式,允许用户通过高级命令式接口编写高性能程序。近期关于稀疏张量编译器的研究将这一范式扩展到了稀疏张量(即大多数元素未被显式表示的张量)。借助这类系统,用户可用简洁的语言定义程序语义与算法决策,再编译为高效的底层代码。但这些系统仍要求用户对程序结构和内存布局做出复杂决策,才能编写出高效的程序。\n本研究提出了Galley,一种声明式张量编程系统,用户无需做出复杂的算法决策即可编写高效的张量程序。Galley是首个将稀疏张量代数基于代价下界(lowering)到稀疏张量编译器命令式语言的系统,也是首个对除求和与乘积之外的任意算子进行优化的系统。首先,它通过对FAQ框架的新颖扩展,将输入程序分解为一系列聚合步骤。其次,Galley对每个聚合步骤进行优化并转换为具体程序,再通过稀疏张量编译器编译执行。实验表明,在基于连接的机器学习任务中,Galley生成的程序比同类方法快1-300倍;在子图计数工作负载下,其性能比最先进的关系数据库快5-20倍,且优化开销极小。

英文摘要:

The tensor programming abstraction is a foundational paradigm which allows users to write high performance programs via a high-level imperative interface. Recent work on sparse tensor compilers has extended this paradigm to sparse tensors (i.e., tensors where most entries are not explicitly represented). With these systems, users define the semantics of the program and the algorithmic decisions in a concise language that can be compiled to efficient low-level code. However, these systems still require users to make complex decisions about program structure and memory layouts to write efficient programs. This work presents Galley, a system for declarative tensor programming that allows users to write efficient tensor programs without making complex algorithmic decisions. Galley is the first system to perform cost based lowering of sparse tensor algebra to the imperative language of sparse tensor compilers, and the first to optimize arbitrary operators beyond sum and product. First, it decomposes the input program into a sequence of aggregation steps through a novel extension of the FAQ framework. Second, Galley optimizes and converts each aggregation step to a concrete program, which is compiled and executed with a sparse tensor compiler. We show that Galley produces programs that are 1-300x faster than competing methods for machine learning over joins and 5-20x faster than a state-of-the-art relational database for subgraph counting workloads with a minimal optimization overhead.

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

↑