Evaluation of Programming Models and Performance for Stencil Computation on GPGPUs
Baodi Shan, Mauricio Araya–Polo · 2024
GPGPUs are widely used in high-performance computing. Therefore, it is crucial to experiment and discover how to better utilize their latest generations of relevant applications. In this paper, we introduce highly tuned stencil-based kernels for NVIDIA A100 and H100 (of a GH200) GPGPUs. Performance results yield useful insights into the behavior of this type of computation for these new accelerators. This knowledge can be leveraged by many scientific applications which involves stencil computations. Further, evaluation of three different programming models: CUDA, OpenACC, and OpenMP target offloading is conducted on aforementioned accelerators. We extensively study the performance and portability of various kernels under each programming model and provide corresponding optimization recommendations. Furthermore, we compare the performance of different programming models on the mentioned architectures. Up to 58% performance improvement was achieved against the previous GPGPU generation for a highly optimized kernel of the same class, and up to 42% for all classes. In terms of programming models, and keeping portability in mind, optimized OpenACC implementation outperforms OpenMP implementation by 33%. If portability is not a factor, the best CUDA implementation outperforms the optimized OpenACC one by 2.1×.