arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1607.00291cs.MScs.DCcs.PF
收藏

无需转置的高性能张量收缩

High-Performance Tensor Contraction without Transposition

Devin A. Matthews

AI总结:

针对传统基于BLAS的张量收缩存在性能与存储开销的问题,本文基于BLIS框架实现TBLIS,通过融合转置与分区打包操作消除显式转置,性能接近矩阵乘法且支持多线程,简化了科学应用中的使用。

摘要:

张量计算——尤其是张量收缩(TC)——是众多科学计算应用中的核心计算内核。由于张量收缩与矩阵乘法(MM)具有本质相似性,且BLAS等优化实现已较为成熟,传统张量运算通常基于BLAS操作实现,这会带来性能与存储开销。本文采用灵活的BLIS框架实现张量收缩,可将张量的转置(重塑)与内部分区、打包操作融合,无需显式转置操作或额外工作空间。该实现名为TBLIS,性能接近矩阵乘法,部分情况下显著优于传统张量收缩实现。本实现支持多线程,采用的方法与BLIS中矩阵乘法的多线程方法完全一致,具备相似的性能特征。张量到矩阵转换的管理复杂度在我们的方法中也被自动处理,极大简化了其在科学应用中的使用。

英文摘要:

Tensor computations--in particular tensor contraction (TC)--are important kernels in many scientific computing applications. Due to the fundamental similarity of TC to matrix multiplication (MM) and to the availability of optimized implementations such as the BLAS, tensor operations have traditionally been implemented in terms of BLAS operations, incurring both a performance and a storage overhead. Instead, we implement TC using the flexible BLIS framework, which allows for transposition (reshaping) of the tensor to be fused with internal partitioning and packing operations, requiring no explicit transposition operations or additional workspace. This implementation, TBLIS, achieves performance approaching that of MM, and in some cases considerably higher than that of traditional TC. Our implementation supports multithreading using an approach identical to that used for MM in BLIS, with similar performance characteristics. The complexity of managing tensor-to-matrix transformations is also handled automatically in our approach, greatly simplifying its use in scientific applications.

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

↑