arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.06139cs.MS
收藏

GPU加速自动微分,带包层

GPU Accelerated Automatic Differentiation With Clad

Ioana Ifrim, Vassil Vassilev, David J Lange

摘要:

自动微分(AD)在科学和工业上有着重要的意义。它是一种计算通过计算机程序指定的函数的导数的工具。AD应用领域的范围从机器学习到机器人技术再到高能物理。在AD的帮助下计算梯度保证比数值替代更精确,并且与原始函数相比具有更低的常数因子。此外,AD应用领域的问题通常是计算上的限制。它们通常受到高维参数的计算要求的限制,因此可以从图形处理单元(GPU)上的并行实现中受益。Clad旨在支持C/C++和CUDA的差异分析,是一个编译器辅助AD工具,可作为编译器扩展和ROOT。此外,Clad作为Clang编译器的扩展插件;作为交互式解释器Cling的扩展插件;以及作为基于xeus-cling的Xeuter内核扩展。我们展示了在GPU上使用Clad进行并行梯度计算的优势。我们解释了如何通过扩展Clad来支持CUDA,从而带来新的优化层和成比例的加速。行为良好的C++函数的梯度可以在GPU上自动执行。该库可以很容易地集成到现有的框架或交互式使用。此外,我们还展示了所实现的应用程序性能改进,包括ROOT直方图拟合(约10倍)以及卸载到GPU的相应性能提升。

英文摘要:

Automatic Differentiation (AD) is instrumental for science and industry. It is a tool to evaluate the derivative of a function specified through a computer program. The range of AD application domain spans from Machine Learning to Robotics to High Energy Physics. Computing gradients with the help of AD is guaranteed to be more precise than the numerical alternative and have a low, constant factor more arithmetical operations compared to the original function. Moreover, AD applications to domain problems typically are computationally bound. They are often limited by the computational requirements of high-dimensional parameters and thus can benefit from parallel implementations on graphics processing units (GPUs). Clad aims to enable differential analysis for C/C++ and CUDA and is a compiler-assisted AD tool available both as a compiler extension and in ROOT. Moreover, Clad works as a plugin extending the Clang compiler; as a plugin extending the interactive interpreter Cling; and as a Jupyter kernel extension based on xeus-cling. We demonstrate the advantages of parallel gradient computations on GPUs with Clad. We explain how to bring forth a new layer of optimization and a proportional speed up by extending Clad to support CUDA. The gradients of well-behaved C++ functions can be automatically executed on a GPU. The library can be easily integrated into existing frameworks or used interactively. Furthermore, we demonstrate the achieved application performance improvements, including (~10x) in ROOT histogram fitting and corresponding performance gains from offloading to GPUs.

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

↑