稀疏张量代数优化与工作空间
Sparse Tensor Algebra Optimizations with Workspaces
AI总结:
本文提出通过引入工作空间临时张量来优化稀疏张量代数表达式,开发了具体索引表示语言,并在SpMM、SpAdd和MTTKRP等内核上实现了性能提升,其中MTTKRP性能提高35%且首次支持稀疏结果。
摘要:
本文展示了如何通过引入临时张量(称为工作空间)到生成的循环嵌套中,来优化稀疏张量代数表达式。我们开发了一种新的张量操作中间语言,称为具体索引表示,它扩展了张量索引表示。具体索引表示表达了子计算发生的时间和位置,以及它们存储到哪个张量中。然后,我们描述了在此语言中的工作空间优化,以及如何通过建立在文献中先前工作的基础上,将其编译为稀疏代码。我们展示了该优化在几个重要的稀疏张量内核上的重要性,包括稀疏矩阵-矩阵乘法(SpMM)、稀疏张量加法(SpAdd)以及用于张量分解的矩阵化张量乘以Khatri-Rao积(MTTKRP)。我们的结果显示,与先前在张量代数编译方面的工作相比,性能有所提升,并使这些内核的性能与最先进的手工优化实现相当。例如,SpMM先前不被张量代数编译器支持,MTTKRP在nell-2数据集上的性能提高了35%,并且MTTKRP首次能够产生稀疏结果。
英文摘要:
This paper shows how to optimize sparse tensor algebraic expressions by introducing temporary tensors, called workspaces, into the resulting loop nests. We develop a new intermediate language for tensor operations called concrete index notation that extends tensor index notation. Concrete index notation expresses when and where sub-computations occur and what tensor they are stored into. We then describe the workspace optimization in this language, and how to compile it to sparse code by building on prior work in the literature. We demonstrate the importance of the optimization on several important sparse tensor kernels, including sparse matrix-matrix multiplication (SpMM), sparse tensor addition (SpAdd), and the matricized tensor times Khatri-Rao product (MTTKRP) used to factorize tensors. Our results show improvements over prior work on tensor algebra compilation and brings the performance of these kernels on par with state-of-the-art hand-optimized implementations. For example, SpMM was not supported by prior tensor algebra compilers, the performance of MTTKRP on the nell-2 data set improves by 35%, and MTTKRP can for the first time have sparse results.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。