arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.06924math.NAcs.NA
收藏

一种通过稀疏矩阵乘法加速低精度运算的方法

A method for accelerating low precision operations by sparse matrix multiplication

Hongyaoxing Gu

AI总结:

针对低精度张量硬件加速易引入误差的问题,提出结合逐向量量化、用稀疏残差矩阵校正误差的低精度运算加速方法,可在控误差的同时降复杂度,CPU上实现精度最高提15%、速度提1.46倍。

摘要:

近年来,各领域对计算能力的迫切需求促使硬件厂商推出旨在提升计算性能的专用计算硬件。尤其是支持低精度的张量硬件的应用在科研领域日益凸显其重要性。然而,利用低精度张量硬件进行计算加速往往会引入误差,如何在实现有效加速的同时保障计算精度,构成了一项根本性挑战。\n 本文对方法进行了改进,引入低精度量化并采用残差矩阵进行误差校正,同时结合了逐向量量化方法。其核心创新在于,使用残差矩阵补偿误差时,采用稀疏矩阵而非稠密矩阵。该方法仅关注在指定阈值下可能对相对误差产生显著影响的数值,旨在控制量化误差的同时降低计算复杂度。实验结果表明,该方法能够在保持高加速效果的同时有效控制量化误差。在CPU上运行的改进算法最高可实现15%的精度提升,同时速度提升1.46倍。

英文摘要:

In recent years, the fervent demand for computational power across various domains has prompted hardware manufacturers to introduce specialized computing hardware aimed at enhancing computational capabilities. Particularly, the utilization of tensor hardware supporting low precision has gained increasing prominence in scientific research. However, the use of low-precision tensor hardware for computational acceleration often introduces errors, posing a fundamental challenge of simultaneously achieving effective acceleration while maintaining computational accuracy. This paper proposes improvements in the methodology by incorporating low-precision quantization and employing a residual matrix for error correction and combines vector-wise quantization method.. The key innovation lies in the use of sparse matrices instead of dense matrices when compensating for errors with a residual matrix. By focusing solely on values that may significantly impact relative errors under a specified threshold, this approach aims to control quantization errors while reducing computational complexity. Experimental results demonstrate that this method can effectively control the quantization error while maintaining high acceleration effect.The improved algorithm on the CPU can achieve up to 15\% accuracy improvement while 1.46 times speed improvement.

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

↑