摘要
针对矩阵乘计算的混合精度优化的实现,极大地提升了矩阵乘计算的性能,但与高精度矩阵乘计算相比,混合精度矩阵乘计算时引入了误差。为有效降低混合精度计算中引入的误差,实现了一个面向矩阵乘计算的自动混合精度工具AMAO。该工具在低精度乘高精度加基础混合精度计算的基础上,通过迭代空间进行划分的精度优化算法将原本的基础混合精度计算按照一定比例划分成两部分计算,一部分用高精度计算,另一部分用基础混合精度计算,并根据该算法实现了混合精度代码自动生成工具。实验表明,与混合精度工具AGMMMPC相比,AMAO生成的混合精度代码性能平均降低5.90%,精度平均提升了49.31%。
The implementation of mixed-precision optimization for matrix multiplication computation greatly improves the performance of matrix multiplication computation,but at the same time,compared with high-precision matrix multiplication computation,mixed-precision matrix multiplication computation introduces errors.In order to effectively reduce the errors introduced in the mixed-precision computation,this paper implements an automatic mixed-precision tool AMAO for matrix multiplication computation.On the basis of low precision times high precision plus basic mixing accuracy calculation,the tool divides the original basic mixing accuracy calculation into two parts according to a certain proportion through the precision optimization algorithm of iterative space division,one part uses high precision calculation method and the other part uses the basic mixing accuracy calculation method,and realizes the automatic generation tool of mixed accuracy code according to the algorithm.Experiments show that compared with the mixed-precision tool AGMMMPC,the performance of mixed-precision codes generated by AMAO is reduced by 5.90% on average,and the accuracy is improved by 49.31% on average.
作者
何昊天
周蓓
郭绍忠
张作言
郝江伟
冀立光
许瑾晨
HE Haotian;ZHOU Bei;GUO Shaozhong;ZHANG Zuoyan;HAO Jiangwei;JI Liguang;XU Jinchen(School of Cyberspace Security,University of Information Engineering,Zhengzhou 450001,China)
出处
《计算机科学》
CSCD
北大核心
2024年第S02期756-765,共10页
Computer Science
关键词
混合精度
矩阵乘法
多面体模型
调度变换
代码生成
Mixed precision
Matrix multiplication
Polyhedral model
Scheduling transformation
Code generation