• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2024, Vol. 46 ›› Issue (11): 1924-1930.

• 高性能计算 • 上一篇    下一篇

一种基于浮点误差分析的混合精度鲁棒性提升方法

于恒彪,易昕,李胜国,李发,姜浩,黄春   

  1. (国防科技大学计算机学院,湖南 长沙 410073)
  • 收稿日期:2023-02-27 修回日期:2023-05-30 接受日期:2024-11-25 出版日期:2024-11-25 发布日期:2024-11-27
  • 基金资助:
    国家自然科学基金(62272471);湖南省自然科学基金(2021JJ40698)

A method for improving the robustness of mixed-precision optimization based on floating-point error analysis

YU Heng-biao,YI Xin,LI Sheng-guo,LI Fa,JIANG Hao,HUANG Chun   

  1. (College of Computer Science and Technology,National University of Defense Technology,Changsha 410073,China)
  • Received:2023-02-27 Revised:2023-05-30 Accepted:2024-11-25 Online:2024-11-25 Published:2024-11-27

摘要: 浮点运算是高性能计算的典型数值求解模式。混合精度优化通过降低程序中浮点变量的精度来提高性能和降低能耗。然而,现有混合精度自动优化技术受限于鲁棒性低的问题,即优化后程序不满足给定输入的结果精度约束。为此,提出了一种基于浮点误差分析的混合精度鲁棒性提升方法。首先,基于浮点误差分析获取能够触发程序不精确计算的输入;然后,基于误差触发输入评估精度配置,引导搜索获取鲁棒性高的混合精度配置。实验结果表明,针对典型浮点应用,该方法能够将混合精度优化的鲁棒性平均提升62%。

关键词: 浮点运算, 混合精度, 鲁棒性, 误差分析

Abstract: Floating-point arithmetic is a typical numerical solution model for high-performance computing. Mixed-precision optimization enhances performance and reduces energy consumption by decreas- ing the precision of floating-point variables in programs. However, existing automatic mixed-precision optimization techniques are limited by low robustness, meaning that the optimized programs fail to meet the result accuracy constraints for given inputs. To address this issue, a method for improving the robustness of mixed-precision optimization based on floating-point error analysis is proposed. Firstly, inputs that can trigger imprecise calculations in the program are identified through floating-point error analysis. Then, based on these error-triggering inputs, the precision configurations are evaluated to guide the search for highly robust mixed-precision configurations. Experimental results show that for typical floating-point applications, this method can improve the robustness of mixed-precision optimization by an average of 62%.

Key words: floating-point arithmetic, mixed precision, robustness, error analysis