arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1607.00145cs.MScs.PF
收藏

一种高性能GEMM类张量-张量乘法器的设计

Design of a high-performance GEMM-like Tensor-Tensor Multiplication

Paul Springer, Paolo Bientinesi

摘要:

我们提出了“GEMM类张量-张量乘法”(GETT),一种新的张量收缩方法,反映了高性能的通用矩阵-矩阵乘法(GEMM)的设计。GETT背后的关键洞察力是识别三个索引集,涉及张量收缩,这使我们能够系统地减少任意张量收缩到一个高度调谐的“宏内核”周围的循环。该宏内核对驻留在缓存层次结构的指定级别中的适当准备(“打包”)的子张量进行操作。与以前的张量收缩方法相比,GETT表现出理想的功能,如单位步幅内存访问,缓存感知,以及完全矢量化,而不需要辅助内存。为了将我们的技术与其他现代张量收缩进行比较,我们将GETT与所谓的Transpose-Transpose-GEMM-Transpose和Loops-over-GEMM方法集成到开源“张量收缩代码生成器“(TCCG)中。各种张量收缩的性能结果表明,GETT有可能成为首选方法:虽然GETT表现出优异的性能,其有效性带宽约束张量收缩是特别令人印象深刻的,超过现有的方法高达$12.4\times$。更准确地说,GETT实现了高达$1.41\times$的带宽约束张量收缩的等效大小的GEMM的加速比,同时实现了高达$91.3\%$的峰值浮点性能的计算约束张量收缩。

英文摘要:

We present "GEMM-like Tensor-Tensor multiplication" (GETT), a novel approach to tensor contractions that mirrors the design of a high-performance general matrix-matrix multiplication (GEMM). The critical insight behind GETT is the identification of three index sets, involved in the tensor contraction, which enable us to systematically reduce an arbitrary tensor contraction to loops around a highly tuned "macro-kernel". This macro-kernel operates on suitably prepared ("packed") sub-tensors that reside in a specified level of the cache hierarchy. In contrast to previous approaches to tensor contractions, GETT exhibits desirable features such as unit-stride memory accesses, cache-awareness, as well as full vectorization, without requiring auxiliary memory. To compare our technique with other modern tensor contractions, we integrate GETT alongside the so called Transpose-Transpose-GEMM-Transpose and Loops-over-GEMM approaches into an open source "Tensor Contraction Code Generator" (TCCG). The performance results for a wide range of tensor contractions suggest that GETT has the potential of becoming the method of choice: While GETT exhibits excellent performance across the board, its effectiveness for bandwidth-bound tensor contractions is especially impressive, outperforming existing approaches by up to $12.4\times$. More precisely, GETT achieves speedups of up to $1.41\times$ over an equivalent-sized GEMM for bandwidth-bound tensor contractions while attaining up to $91.3\%$ of peak floating-point performance for compute-bound tensor contractions.

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

↑