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

一种通过泛型编程实现性能可移植性的方法

An approach to performance portability through generic programming

Andreas Hadjigeorgiou, Christodoulos Stylianou, Michele Weiland, Dirk Jacob Verschuur, Jacob Finkenrath

AI总结:

针对高性能计算硬件多样化带来的软件开发复杂度问题,提出基于C++模板元编程的泛型编程设计方法,将底层工具集成到高层泛型算法,实现跨CPU、GPU的性能可移植性,并通过声波方程有限差分算法在三类硬件上验证了可行性。

摘要:

高性能计算领域硬件多样性的不断扩大,给科学软件开发增添了极大的复杂性。想要编写可维护软件的开发者有两种选择:1)使用所谓的数据局部性抽象,在内部处理可移植性问题,由此需要在性能与生产力之间进行权衡。这类抽象通常以库、领域特定语言和运行时系统的形式存在。2)采用泛型编程,此时性能、生产力和可移植性都取决于软件设计。沿着第二种方向,本研究提出了一种设计方法,能够将底层的、冗长的编程工具集成到基于C++模板元编程的高层泛型算法中。这使得开发面向主机-设备计算架构(如CPU和GPU)的性能可移植应用成为可能。有了合适的设计,泛型算法向新硬件的扩展就成为一个定义明确的流程,可与代码的其他部分隔离开来开发。这使得科学软件在高性能计算硬件日趋多样化的时期,既能保持可维护性又能保持高效性。作为概念验证,我们开发了一种用于声波方程的有限差分建模算法,并使用roofline模型(屋顶线模型)分析,在Intel Xeon Gold 6248 CPU、Nvidia Tesla V100 GPU和AMD MI100 GPU上进行了基准测试。

英文摘要:

The expanding hardware diversity in high performance computing adds enormous complexity to scientific software development. Developers who aim to write maintainable software have two options: 1) To use a so-called data locality abstraction that handles portability internally, thereby, performance-productivity becomes a trade off. Such abstractions usually come in the form of libraries, domain-specific languages, and run-time systems. 2) To use generic programming where performance, productivity and portability are subject to software design. In the direction of the second, this work describes a design approach that allows the integration of low-level and verbose programming tools into high-level generic algorithms based on template meta-programming in C++. This enables the development of performance-portable applications targeting host-device computer architectures, such as CPUs and GPUs. With a suitable design in place, the extensibility of generic algorithms to new hardware becomes a well defined procedure that can be developed in isolation from other parts of the code. That allows scientific software to be maintainable and efficient in a period of diversifying hardware in HPC. As proof of concept, a finite-difference modelling algorithm for the acoustic wave equation is developed and benchmarked using roofline model analysis on Intel Xeon Gold 6248 CPU, Nvidia Tesla V100 GPU, and AMD MI100 GPU.

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

↑