arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.22575cs.DC
收藏

一种基于AD的GPU上高效Hessian矩阵与Hessian-向量积计算库

An AD based library for Efficient Hessian and Hessian-Vector Product Computation on GPU

Desh Ranjan, Mohammad Zubair

AI总结:

针对科学应用中多数据点并发Hessian-向量积计算需求,提出基于前向自动微分的CHESSFAD方法,通过行级与分块级双层并行适配GPU,实现的轻量C++库性能较autodiff平均提升5%-50%。

摘要:

Hessian-向量积计算出现在优化、有限元建模等诸多科学应用中。通常需要在多个数据点上并发计算Hessian-向量积。我们提出一种基于自动微分(AD,automatic differentiation)的方法CHESSFAD(Chunked HESSian using Forward-mode AD,基于前向模式自动微分的分块Hessian方法),其设计以Hessian矩阵与Hessian-向量积的高效并行计算为核心考量。CHESSFAD采用前向模式计算二阶导数,可挖掘不同层级的并行性,适配NVIDIA GPU等加速器的计算特性。在CHESSFAD方案中,Hessian矩阵单行的计算与其他行相互独立,因此矩阵各行可并发计算。第二层并行性源于CHESSFAD将Hessian单行的计算划分为多个分块,不同分块可并行计算。CHESSFAD以轻量级头文件式C++库的形式实现,同时支持CPU与GPU平台。我们在一组标准测试函数上评估了CHESSFAD执行大量独立Hessian-向量积的性能,并将其性能与autodiff等现有头文件式C++库进行对比。结果表明,CHESSFAD在所有测试函数上的表现均优于autodiff,平均性能提升幅度在5%-50%之间。

英文摘要:

The Hessian-vector product computation appears in many scientific applications such as in optimization and finite element modeling. Often there is a need for computing Hessian-vector products at many data points concurrently. We propose an automatic differentiation (AD) based method, CHESSFAD (Chunked HESSian using Forward-mode AD), that is designed with efficient parallel computation of Hessian and Hessian-Vector products in mind. CHESSFAD computes second-order derivatives using forward mode and exposes parallelism at different levels that can be exploited on accelerators such as NVIDIA GPUs. In CHESSFAD approach, the computation of a row of the Hessian matrix is independent of the computation of other rows. Hence rows of the Hessian matrix can be computed concurrently. The second level of parallelism is exposed because CHESSFAD approach partitions the computation of a Hessian row into chunks, where different chunks can be computed concurrently. CHESSFAD is implemented as a lightweight header-based C++ library that works both for CPUs and GPUs. We evaluate the performance of CHESSFAD for performing a large number of independent Hessian-Vector products on a set of standard test functions and compare its performance to other existing header-based C++ libraries such as {\tt autodiff}. Our results show that CHESSFAD performs better than {\tt autodiff}, on all these functions with improvement ranging from 5-50\% on average.

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

↑