论文标题
高性能的GPU至CPU转透明和通过高级平行构建体优化
High-Performance GPU-to-CPU Transpilation and Optimization via High-Level Parallel Constructs
论文作者
论文摘要
尽管并行性仍然是性能的主要来源,但随着每个新硬件的生成,架构实现和编程模型都会发生变化,通常会导致昂贵的应用程序重新设计。大多数用于性能可移植性的工具都需要手动和昂贵的应用程序移植到另一个编程模型。 我们提出了一种替代方法,该方法将以一个编程模型(CUDA)编写的程序自动转换为基于polygeist/mlir的另一种(CPU线程)。我们的方法包括平行构造的表示,该构建体允许常规编译器转换透明地应用,而无需修改并实现并行性特定的优化。我们通过转换和优化多核CPU的CUDA Rodinia基准套件来评估我们的框架,并通过手写OpenMP代码实现76%的Geomean加速。此外,我们展示了Pytorch的CUDA内核如何在不使用用户干预的情况下有效地运行和扩展仅CPU的仅超级计算机Fugaku。我们的pytorch兼容性层利用了cuda pytorch核的使用优于Pytorch CPU本机后端2.7 $ \ times $。
While parallelism remains the main source of performance, architectural implementations and programming models change with each new hardware generation, often leading to costly application re-engineering. Most tools for performance portability require manual and costly application porting to yet another programming model. We propose an alternative approach that automatically translates programs written in one programming model (CUDA), into another (CPU threads) based on Polygeist/MLIR. Our approach includes a representation of parallel constructs that allows conventional compiler transformations to apply transparently and without modification and enables parallelism-specific optimizations. We evaluate our framework by transpiling and optimizing the CUDA Rodinia benchmark suite for a multi-core CPU and achieve a 76% geomean speedup over handwritten OpenMP code. Further, we show how CUDA kernels from PyTorch can efficiently run and scale on the CPU-only Supercomputer Fugaku without user intervention. Our PyTorch compatibility layer making use of transpiled CUDA PyTorch kernels outperforms the PyTorch CPU native backend by 2.7$\times$.