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.
翻译:随着摩尔定律逼近极限,研究人员正探索不同范式以实现前所未有的性能突破。近似计算(AC)依赖应用程序对结果误差的容忍度,通过牺牲精度换取性能,已展现出显著潜力。尽管AC在机器学习等领域取得成效,但由于对精度的严苛要求,其在高性能计算(HPC)领域的应用仍受局限。我们需要开发工具和技术来识别适合近似的代码区域及其对应用输出质量的影响,从而指导开发人员实施选择性近似。为此,我们提出CHEF-FP——一种基于自动微分(AD)的灵活、可扩展且易于使用的源代码转换工具,用于分析HPC应用中的近似误差。CHEF-FP以Clad作为后端(基于Clang编译器插件和LLVM编译器基础设施构建的高效AD工具),利用其AD能力评估C++代码中的近似误差。该工具通过将误差估计代码注入生成的伴随项中实现源代码级操作,使误差估计代码能够经过编译器优化,从而缩短分析时间并减少内存占用。我们还为基于源代码转换的AD工具提供了理论支撑和架构增强,使其具备浮点误差分析能力。本文主要分析混合精度AC技术引入的误差,并通过评估使用近似函数的代码来展示该工具估算其他类型误差的适用性。此外,我们证明了CHEF-FP在分析阶段相比现有最先进工具带来的加速效果,这得益于其直接在导数源代码中生成并插入近似误差估计代码的能力。