稀疏张量代数算子的格式抽象
Format Abstraction for Sparse Tensor Algebra Compilers
摘要:
本文展示了如何构建一个稀疏张量代数编译器,它对张量格式(数据布局)是不可知的。我们开发了一个接口来描述格式的功能和属性,并展示了如何构建一个模块化的代码生成器,其中新的格式可以作为插件添加。然后,我们描述了六个接口的实现,组成形成密集,CSR/CSF,COO,DIA,ELL和HASH张量格式及其无数的变体。有了这些实现,我们的代码生成器可以生成代码来计算上述格式的任何组合上的任何张量代数表达式。为了演示我们的技术,我们在taco张量代数编译器中实现了它。我们的模块化代码生成器设计使得添加对新张量格式的支持变得简单,并且生成的代码的性能与手动优化的实现相比具有竞争力。此外,通过扩展taco来支持更广泛的格式,这些格式专门用于不同的应用程序和数据特征,我们可以提高最终用户应用程序的性能。例如,如果输入数据以COO格式提供,则我们的技术允许直接用COO格式的数据计算单个矩阵-向量乘法,这比首先将数据转换为CSR快达3.6 $\times$。
英文摘要:
This paper shows how to build a sparse tensor algebra compiler that is agnostic to tensor formats (data layouts). We develop an interface that describes formats in terms of their capabilities and properties, and show how to build a modular code generator where new formats can be added as plugins. We then describe six implementations of the interface that compose to form the dense, CSR/CSF, COO, DIA, ELL, and HASH tensor formats and countless variants thereof. With these implementations at hand, our code generator can generate code to compute any tensor algebra expression on any combination of the aforementioned formats. To demonstrate our technique, we have implemented it in the taco tensor algebra compiler. Our modular code generator design makes it simple to add support for new tensor formats, and the performance of the generated code is competitive with hand-optimized implementations. Furthermore, by extending taco to support a wider range of formats specialized for different application and data characteristics, we can improve end-user application performance. For example, if input data is provided in the COO format, our technique allows computing a single matrix-vector multiplication directly with the data in COO, which is up to 3.6$\times$ faster than by first converting the data to CSR.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。