Efficient GPU Implementation of Automatic Differentiation for Computational Fluid Dynamics
Authors:
- 18 December 2023
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 377-386
Abstract
Many scientific and engineering applications require repeated calculations of derivatives of output functions with respect to input parameters. Automatic Differentiation (AD) is a method that automates derivative calculations and can significantly speed up code development. In Computational Fluid Dynamics (CFD), derivatives of flux functions with respect to state variables (Jacobian) are needed for efficient solutions of the nonlinear governing equations. AD of flux functions on graphics processing units (GPUs) is challenging as flux computations involve many intermediate variables that create high register pressure and require significant memory traffic because of the need to store the derivatives. This paper presents a forward-mode AD method based on multivariate dual numbers that addresses these challenges and simultaneously reduces the floating-point operation count. The dimension of the multivariate dual numbers is optimized for performance. The flux computations are restructured to minimize the number of temporary variables and reduce register pressure. For effective utilization of memory bandwidth, shared memory is used to store the local flux Jaco-bian. This AD implementation is compared with several other Jacobian implementations on an NVIDIA V100 GPU (V100). For three-dimensional perfect-gas compressible-flow equations implemented in a practical CFD code, the AD implementation of a flux Jacobian based on multivariate dual numbers of dimension 5 outperforms all other GPU AD implementations on V100. Its performance is comparable with the optimized hand-differentiated version. The implementation achieves 75% of the peak floating-point throughput and 61 % of the peak global device memory bandwidth usage.Keywords
This publication has 21 references indexed in Scilit:
- GPU Accelerated Automatic Differentiation With CladJournal of Physics: Conference Series, 2023
- AutoMat: automatic differentiation for generalized standard materials on GPUsComputational Mechanics, 2021
- Kokkos 3: Programming Model Extensions for the Exascale EraIEEE Transactions on Parallel and Distributed Systems, 2021
- Algorithmic Differentiation of Numerical MethodsACM Transactions on Mathematical Software, 2015
- Fast Reverse-Mode Automatic Differentiation using Expression Templates in C++ACM Transactions on Mathematical Software, 2014
- The Tapenade automatic differentiation toolACM Transactions on Mathematical Software, 2013
- A Bibliography of Automatic Differentiation2006
- Iterative Methods for Sparse Linear Systems2003
- Approximate Riemann solvers, parameter vectors, and difference schemesJournal of Computational Physics, 1981
- Numerical Differentiation of Analytic FunctionsSIAM Journal on Numerical Analysis, 1967