arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2306.11686cs.DC
收藏

GPU First —— 在 GPU 上执行传统 CPU 代码

GPU First -- Execution of Legacy CPU Codes on GPUs

Shilei Tian, Tom Scogland, Barbara Chapman, Johannes Doerfert

AI总结:

本文提出名为“GPU First”的新型编译方案,无需修改源码即可自动将传统CPU应用编译为GPU代码,通过部分libc GPU实现或远程过程调用解析库函数,在多个基准测试中实现高达14.36倍加速,有效指导大型传统应用的GPU移植。

摘要:

在异构系统中,利用 GPU 对于实现高性能至关重要。然而,对于开发者而言,充分发挥 GPU 的潜力来加速传统 CPU 应用是一项具有挑战性的任务。移植过程需要识别适合加速的代码区域、管理不同的内存、同步主机和设备执行,以及处理可能无法直接在设备上执行的库函数。这种复杂性使得非专家难以有效利用 GPU,甚至难以开始卸载大型传统应用的某些部分。在本文中,我们提出了一种名为“GPU First”的新型编译方案,该方案无需修改应用源代码,即可自动将传统 CPU 应用直接编译为 GPU 代码。应用内部的库调用要么通过我们的部分 libc GPU 实现来解析,要么通过自动生成的到主机的远程过程调用(RPC)来解析。我们的方法简化了识别适合加速的代码区域的任务,并允许在实际 GPU 硬件上快速测试代码修改,从而指导移植工作。我们在两个具有 OpenMP CPU 和 GPU 并行性的 HPC 代理应用、四个原本仅具有 GPU 并行性的微型基准测试,以及来自 SPEC OMP 2012 套件中三个具有手工优化的 OpenMP CPU 并行性的基准测试上进行了评估,展示了将主机应用移植到 GPU 的简便性。对于现有的并行循环,我们通常能匹配相应手动卸载内核的性能,在 GPU 上实现了高达 14.36 倍的加速,验证了我们的 GPU First 方法能够有效指导大型传统应用的移植工作。

英文摘要:

Utilizing GPUs is critical for high performance on heterogeneous systems. However, leveraging the full potential of GPUs for accelerating legacy CPU applications can be a challenging task for developers. The porting process requires identifying code regions amenable to acceleration, managing distinct memories, synchronizing host and device execution, and handling library functions that may not be directly executable on the device. This complexity makes it challenging for non-experts to leverage GPUs effectively, or even to start offloading parts of a large legacy application. In this paper, we propose a novel compilation scheme called "GPU First" that automatically compiles legacy CPU applications directly for GPUs without any modification of the application source. Library calls inside the application are either resolved through our partial libc GPU implementation or via automatically generated remote procedure calls to the host. Our approach simplifies the task of identifying code regions amenable to acceleration and enables rapid testing of code modifications on actual GPU hardware in order to guide porting efforts. Our evaluation on two HPC proxy applications with OpenMP CPU and GPU parallelism, four micro benchmarks with originally GPU only parallelism, as well as three benchmarks from the SPEC OMP 2012 suite featuring hand-optimized OpenMP CPU parallelism showcases the simplicity of porting host applications to the GPU. For existing parallel loops, we often match the performance of corresponding manually offloaded kernels, with up to 14.36x speedup on the GPU, validating that our GPU First methodology can effectively guide porting efforts of large legacy applications.

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

↑