Mosaic: An Interoperable Compiler for Tensor Algebra

Mosaic: An Interoperable Compiler for Tensor Algebra
复制标题

Mosaic:张量代数的可互操作编译器

DOI:
10.1145/3591236
复制
发表时间:
2023
影响因子:
--
通讯作者:
Kjolstad, Fredrik
Kjolstad, Fredrik
中科院分区:
--
文献类型:
--
作者:
Bansal, Manya;Hsu, Olivia;Olukotun, Kunle;Kjolstad, Fredrik

文献摘要

参考文献

相似文献

我们介绍Mosaic,一个稀疏张量代数编译器,可以将张量表达式绑定到其他张量代数库和编译器的外部函数。用户可以通过添加新函数来扩展Mosaic,并使用调度API将子表达式绑定到函数。Mosaic将绑定的子表达式替换为对外部函数的调用,并使用默认代码生成器自动生成剩余的代码。由于生成的代码在默认情况下是融合的,因此用户可以在同一编译器中高效地利用融合和对专用函数的调用。我们展示了我们的双重方法的好处,通过显示调用手写的CPU和专门的硬件函数可以提供高达206倍的加速比在某些情况下对融合代码,而生成融合代码可以提供高达3.57倍的加速比在其他情况下对调用外部函数的代码。Mosaic还提供了一个搜索系统,可以自动将表达式映射到一组注册的外部函数。Mosaic验证了显式绑定和自动搜索。此外,用于添加新的外部功能的接口简单且通用。目前,Mosaic已添加了38个外部函数,每增加一个函数平均需要20行代码。
We introduce Mosaic, a sparse tensor algebra compiler that can bind tensor expressions to external functions of other tensor algebra libraries and compilers. Users can extend Mosaic by adding new functions and bind a sub-expression to a function using a scheduling API. Mosaic substitutes the bound sub-expressions with calls to the external functions and automatically generates the remaining code using a default code generator. As the generated code is fused by default, users can productively leverage both fusion and calls to specialized functions within the same compiler. We demonstrate the benefits of our dual approach by showing that calling hand-written CPU and specialized hardware functions can provide speedups of up to 206× against fused code in some cases, while generating fused code can provide speedups of up to 3.57× against code that calls external functions in other cases. Mosaic also offers a search system that can automatically map an expression to a set of registered external functions. Both the explicit binding and automatic search are verified by Mosaic. Additionally, the interface for adding new external functions is simple and general. Currently, 38 external functions have been added to Mosaic, with each addition averaging 20 lines of code.
DOI: 10.1145/3445814.3446702
发表时间: 2021-04
期刊: Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
影响因子: --
作者:
Guowei Zhang;Nithya Attaluri;J. Emer;Daniel Sánchez
通讯作者: Guowei Zhang;Nithya Attaluri;J. Emer;Daniel Sánchez
MLIR 中稀疏张量计算的编译器支持
DOI: 10.1145/3544559
发表时间: 2022
期刊: ACM Transactions on Architecture and Code Optimization (TACO)
影响因子: --
作者:
["Aart J. C. Bik
通讯作者: ["Aart J. C. Bik
DOI: 10.1145/3133901
发表时间: 2017-10-01
影响因子: 1.8
作者:
Kjolstad, Fredrik;Kamil, Shoaib;Amarasinghe, Saman
通讯作者: Amarasinghe, Saman
DOI: 10.1137/17m1135578
发表时间: 2017-04
期刊: SIAM J. Sci. Comput.
影响因子: --
作者:
Jianyu Huang;D. Matthews;R. Geijn
通讯作者: Jianyu Huang;D. Matthews;R. Geijn
DOI: 10.1145/3428226
发表时间: 2020-11
影响因子: --
作者:
Ryan Senanayake;Changwan Hong;Ziheng Wang;Amalee Wilson;Stephen Chou;Shoaib Kamil;Saman P. Amarasinghe;Fredrik Kjolstad
通讯作者: Ryan Senanayake;Changwan Hong;Ziheng Wang;Amalee Wilson;Stephen Chou;Shoaib Kamil;Saman P. Amarasinghe;Fredrik Kjolstad