As we reach the limit of Moore's Law, researchers are exploring different paradigms to achieve unprecedented performance. Approximate Computing (AC), which relies on the ability of applications to tolerate some error in the results to trade-off accuracy for performance, has shown significant promise. Despite the success of AC in domains such as Machine Learning, its acceptance in High-Performance Computing (HPC) is limited due to stringent requirements for accuracy. We need tools and techniques to identify regions of code that are amenable to approximations and their impact on the application output quality to guide developers to employ selective approximation. To this end, we propose CHEF-FP, a flexible, scalable, and easy-to-use source-code transformation tool based on Automatic Differentiation (AD) for analyzing approximation errors in HPC applications. CHEF-FP uses Clad, an efficient AD tool built as a plugin to the Clang compiler and based on the LLVM compiler infrastructure, as a backend and utilizes its AD abilities to evaluate approximation errors in C++ code. CHEF-FP works at the source by injecting error estimation code into the generated adjoints. This enables the error-estimation code to undergo compiler optimizations resulting in improved analysis time and reduced memory usage. We also provide theoretical and architectural augmentations to source code transformation-based AD tools to perform FP error analysis. This paper primarily focuses on analyzing errors introduced by mixed-precision AC techniques. We also show the applicability of our tool in estimating other kinds of errors by evaluating our tool on codes that use approximate functions. Moreover, we demonstrate the speedups CHEF-FP achieved during analysis time compared to the existing state-of-the-art tool due to its ability to generate and insert approximation error estimate code directly into the derivative source.
翻译:随着我们逐渐接近摩尔定律的极限,研究人员们在探索不同的方法来实现卓越的性能。近似计算(Approximate Computing, AC)是一种可靠的方法,它依赖应用程序在结果中容忍一些误差,以换取精度与性能的平衡。尽管在机器学习等领域内,AC 已经取得了显著的成功,但由于高性能计算(HPC) 的精度要求严格,AC 在 HPC 领域中的接受程度受限。我们需要工具和技术来识别代码中适合近似计算的区域以及其对应用程序输出的质量影响,并引导开发人员采用有选择性的近似计算。为此,我们提出了CHEF-FP,CHEF-FP 是基于自动微分 (Automatic Differentiation, AD)的灵活、可扩展且易于使用的源代码转换工具,用于分析 HPC 应用程序中的近似误差。CHEF-FP 使用Clad做为后端,它是一款建立在Clang编译器之上并基于LLVM编译器基础设施的高效 AD 工具,并利用它的AD 能力来评估 C++ 代码中的近似误差。CHEF-FP 在源代码级别注入误差估计代码来生成导数,在编译器优化的下,使误差估计的代码受益,从而实现了提高分析时间和减少内存占用的目的。我们还通过提供理论和架构增强来实现基于源代码转换的 AD 工具进行FP误差分析的目的。本文主要聚焦于分析混合精度 AC 技术带来的误差。我们还通过在使用近似函数的代码上评估我们的工具展示了它评估其他类型误差的应用性。此外,我们展示了CHEF-FP 在分析时间上相对于现有最先进工具实现的速度增长,这归功于它能直接生成并插入近似误差估计代码到导数源中的能力。