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

打开黑箱:GPU 代码生成过程中的性能估计

Opening the Black Box: Performance Estimation during Code Generation for GPUs

Dominik Ernst, Georg Hager, Markus Holzer, Matthias Knorr, Gerhard Wellein

AI总结:

本文提出一种结合性能模型与解析硬件度量估计器的方法,通过准确建模内存层次数据传输量,快速探索配置空间并为 GPU 代码生成选择高性能候选实现。

摘要:

自动代码生成经常被用于创建针对特定硬件和应用参数进行专门调优的算法实现。代码生成过程涉及选择合适的代码变换、调优参数和并行化策略。为了覆盖巨大的搜索空间,代码生成框架可能会采用耗时的自动调优、利用特定场景的性能模型,或者将性能视为一个必须通过机器学习来描述的无形黑箱。本文通过一个与解析硬件度量估计器相结合的性能模型来识别决定性能的相关机制,从而解决这一选择问题。这使得能够快速探索大型配置空间,以高精度识别出高效的候选实现。我们当前的方法面向内存密集型 GPGPU 应用,重点是对内存层次结构所有层级的数据传输量进行正确建模。我们展示了如何将该方法与 pystencils 模板代码生成器耦合,该生成器用于生成一个 3D25pt 模板和基于 Lattice Boltzmann Method 的复杂两相流体求解器的内核。对于这两者,该方法都能提供一个可用于选择性能最佳候选实现的排序。该方法不限于模板内核,而是可以集成到任何能够生成所需地址表达式的代码生成器中。

英文摘要:

Automatic code generation is frequently used to create implementations of algorithms specifically tuned to particular hardware and application parameters. The code generation process involves the selection of adequate code transformations, tuning parameters, and parallelization strategies. To cover the huge search space, code generation frameworks may apply time-intensive autotuning, exploit scenario-specific performance models, or treat performance as an intangible black box that must be described via machine learning. This paper addresses the selection problem by identifying the relevant performance-defining mechanisms through a performance model coupled with an analytic hardware metric estimator. This enables a quick exploration of large configuration spaces to identify highly efficient candidates with high accuracy. Our current approach targets memory-intensive GPGPU applications and focuses on the correct modeling of data transfer volumes to all levels of the memory hierarchy. We show how our method can be coupled to the pystencils stencil code generator, which is used to generate kernels for a range four 3D25pt stencil and a complex two phase fluid solver based on the Lattice Boltzmann Method. For both, it delivers a ranking that can be used to select the best performing candidate. The method is not limited to stencil kernels, but can be integrated into any code generator that can generate the required address expressions.

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

↑