SparseAuto:一种基于递归循环嵌套重构的稀疏张量计算自动调度器
SparseAuto: An Auto-Scheduler for Sparse Tensor Computations Using Recursive Loop Nest Restructuring
AI总结:
针对通用稀疏张量代数编译器无法生成渐近最优代码的问题,本文提出SparseAuto自动调度器,通过循环重构、poset代价模型与SMT求解器优化调度,在多种真实张量计算上较TACO实现数量级加速。
摘要:
稀疏张量代数的自动化代码生成与性能优化已在量子计算、物理模拟、计算化学、机器学习等诸多实际应用中成为关键技术。通用稀疏张量代数编译器往往不具备足够的通用性,无法为稀疏张量缩约生成渐近最优的代码。本文展示了如何通过内核分裂与融合,为复杂的稀疏张量表达式生成渐近更优的调度方案。我们提出了通用的循环重构变换,以降低渐近时间复杂度并减少内存占用。\n此外,我们提出了一种自动调度器,它采用基于偏序集(poset)的代价模型,同时利用时间复杂度与辅助内存复杂度来裁剪调度方案的搜索空间。另外,我们重点介绍了可满足性模理论(SMT)求解器在稀疏自动调度器中的应用:它可将更优调度的帕累托前沿近似为数量最少的可行调度方案,且支持编译时用户自定义约束。最后,我们证明该自动调度器能够选出性能更优的调度并为其生成代码。实验结果表明,针对不同真实张量上的多种计算任务,该自动调度器给出的调度方案相较于Tensor Algebra Compiler(TACO,张量代数编译器)生成的代码实现了数量级的加速。
英文摘要:
Automated code generation and performance enhancements for sparse tensor algebra have become essential in many real-world applications, such as quantum computing, physical simulations, computational chemistry, and machine learning. General sparse tensor algebra compilers are not always versatile enough to generate asymptotically optimal code for sparse tensor contractions. This paper shows how to generate asymptotically better schedules for complex sparse tensor expressions using kernel fission and fusion. We present generalized loop restructuring transformations to reduce asymptotic time complexity and memory footprint. Furthermore, we present an auto-scheduler that uses a partially ordered set (poset)-based cost model that uses both time and auxiliary memory complexities to prune the search space of schedules. In addition, we highlight the use of Satisfiability Module Theory (SMT) solvers in sparse auto-schedulers to approximate the Pareto frontier of better schedules to the smallest number of possible schedules, with user-defined constraints available at compile-time. Finally, we show that our auto-scheduler can select better-performing schedules and generate code for them. Our results show that the auto-scheduler provided schedules achieve orders-of-magnitude speedup compared to the code generated by the Tensor Algebra Compiler (TACO) for several computations on different real-world tensors.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。