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

一种在现代节点架构上加速模板计算的可移植框架

A Portable Framework for Accelerating Stencil Computations on Modern Node Architectures

Ryuichi Sai, John Mellor-Crummey, Jinfan Xu, Mauricio Araya-Polo

AI总结:

本文提出 StencilPy 框架,通过高级 DSL 与多架构后端生成高效模板代码,在 CPU、GPU 和 Cerebras 等加速器上实现接近手写优化代码的性能、可移植性与更高开发效率。

摘要:

基于高阶模板的有限差分方法广泛应用于地震模拟、天气预报、计算流体动力学以及其他科学应用。在一种架构上实现 HPC 级别的模板计算颇具挑战,而在不牺牲性能的情况下移植到其他架构则需要大量工作,在当前这个拥有众多独特架构的黄金时代尤其如此。为帮助开发者在模板计算中同时实现性能、可移植性和生产效率,我们开发了 StencilPy。借助 StencilPy,开发者使用高级领域专用语言编写模板计算,从而提升生产效率;同时,其后端会为现有和新兴架构生成高效代码,包括现代众核 CPU(如 AMD Genoa-X、Fujitsu A64FX 和 Intel Sapphire Rapids)、最新一代 GPU(包括 NVIDIA H100 和 A100、AMD MI200、Intel Ponte Vecchio)以及加速器(包括 Cerebras 和 STX)。StencilPy 展现出与手写代码相当的良好性能结果,保持跨架构性能可移植性,并提升生产效率。其模块化设计支持轻松配置、定制和扩展。使用 StencilPy 编写的 25 点星形模板长度仅为手工 CUDA 代码的四分之一,并在 NVIDIA H100 GPU 上达到相近性能。此外,使用我们工具编写的同一内核比用 Cerebras Software Language(CSL)手工优化的代码短 7 倍,并在 Cerebras CS-2 上提供与该代码相当的性能。

英文摘要:

Finite-difference methods based on high-order stencils are widely used in seismic simulations, weather forecasting, computational fluid dynamics, and other scientific applications. Achieving HPC-level stencil computations on one architecture is challenging, porting to other architectures without sacrificing performance requires significant effort, especially in this golden age of many distinctive architectures. To help developers achieve performance, portability, and productivity with stencil computations, we developed StencilPy. With StencilPy, developers write stencil computations in a high-level domain-specific language, which promotes productivity, while its backends generate efficient code for existing and emerging architectures, including modern many-core CPUs (such as AMD Genoa-X, Fujitsu A64FX, and Intel Sapphire Rapids), latest generations of GPUs (including NVIDIA H100 and A100, AMD MI200, and Intel Ponte Vecchio), and accelerators (including Cerebras and STX). StencilPy demonstrates promising performance results on par with hand-written code, maintains cross-architectural performance portability, and enhances productivity. Its modular design enables easy configuration, customization, and extension. A 25-point star-shaped stencil written in StencilPy is one-quarter of the length of a hand-crafted CUDA code and achieves similar performance on an NVIDIA H100 GPU. In addition, the same kernel written using our tool is 7x shorter than hand-optimized code written in Cerebras Software Language (CSL), and it delivers comparable performance that code on a Cerebras CS-2.

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

↑