arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.16298cs.DC
收藏

模板矩阵化

Stencil Matrixization

Wenxuan Zhao, Liang Yuan, Baicheng Yan, Penghao Ma, Yunquan Zhang, Long Wang, Zhe Wang

AI总结:

针对矩阵计算硬件,本文提出基于向量外积的新型模板算法,并通过内存、流水线和数据复用优化获得显著加速。

摘要:

当前的体系结构现已配备矩阵计算单元,旨在增强 AI 和高性能计算应用。在这些体系结构中,两种基本指令类型是矩阵乘法和向量外积,其中后者由于其向量输入而更为轻量。这一特性不仅允许开发超越稠密线性代数计算的灵活算法,还为实现优化提供了更大潜力。模板计算常见于科学和工程应用,涉及嵌套循环。本文介绍了一种利用向量外积的新型模板算法。与以往方法不同,该算法源于 scatter 模式下的模板定义,并最初使用向量外积表达式进行形式化表述。其实现集成了一系列优化,以改善内存访问模式、执行流水线效率和数据复用。这些优化考虑了多种算法选择以及输入向量之间的数据共享。在模拟器上进行的评估表明,与向量化模板算法相比,我们提出的设计实现了显著的加速。

英文摘要:

Current architectures are now equipped with matrix computation units designed to enhance AI and high-performance computing applications. Within these architectures, two fundamental instruction types are matrix multiplication and vector outer product, with the latter being lighter due to its vector inputs. This characteristic not only allows for the development of flexible algorithms beyond dense linear algebra computations but also offers greater potential for implementation optimization. Stencil computations, commonly found in scientific and engineering applications, involve nested loops. This paper introduces a novel stencil algorithm leveraging vector outer products. Unlike previous approaches, this algorithm emerges from the stencil definition in scatter mode and is initially formulated using vector outer product expressions. The implementation integrates a series of optimizations to enhance memory reference patterns, execution pipeline efficiency, and data reuse. These optimizations consider various algorithmic options and data sharing among input vectors. Evaluation conducted on a simulator demonstrates that our proposed design achieves significant speedup compared to vectorized stencil algorithms.

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

↑