一句话:用图神经网络学习混合精度程序表示来预测其性能与精度,从而加速动态精度调优。
混合精度程序在不同运算上使用不同浮点精度,可在精度与性能之间权衡;精度调优即寻找满足给定精度要求且性能更优的混合精度版本。现有方法或仅适用于小规模程序,或效率低下。本文提出 FPLearner,利用图神经网络学习混合精度程序的表示,预测其性能与精度,从而减少动态调优所需的程序运行次数以加速搜索。作者基于五个 HPC 应用构建了混合精度程序数据集,模型在性能预测上取得 96.34% 的 F1 值,精度预测为 97.03%;将该预测器接入 Precimonious 与 HiFPTuner 后,调优时间平均缩短 25.54%,最高 61.07%,同时调优结果质量相当或更优。
A mixed-precision program is a floating-point program that utilizes different precisions for different operations, providing the opportunity of balancing the trade-off between accuracy and performance. Precision tuning aims to find a mixed-precision version of a program that improves its performance while maintaining a given accuracy. Unfortunately, existing precision tuning approaches are either limited to small-scale programs, or suffer from efficiency issues. In this paper, we propose FPLearner, a novel approach that addresses these limitations. Our insight is to leverage a Machine Learning based technique, Graph Neural Networks, to learn the representation of mixed-precision programs to predict their performance and accuracy. Such prediction models can then be used to accelerate the process of dynamic precision tuning by reducing the number of program runs. We create a dataset of mixed-precision programs from five diverse HPC applications for training our models, which achieve 96.34% F1 score in performance prediction and 97.03% F1 score in accuracy prediction. FPLearner improves the time efficiency of two dynamic precision tuners, Precimonious and HiFPTuner, by an average of 25.54% and up to 61.07% while achieving precision tuning results of comparable or better quality.