[论文解读] OMP2HMPP: HMPP Source Code Generation from Programs with Pragma Extensions
OMP2HMPP 是一个源到源编译器,可自动将扩展了 OpenMP 的 C 代码转换为适用于 GPGPU 加速的 HMPP 兼容代码,利用 Mercurium 框架分析变量生命周期和数据依赖关系。它在顺序执行基础上实现了平均 113× 的加速,并生成的代码几乎与手工优化的 HMPP 版本相当,从而实现在 HPC 和嵌入式 GPU 上的可移植高性能计算。
High-performance computing are based more and more in heterogeneous architectures and GPGPUs have become one of the main integrated blocks in these, as the recently emerged Mali GPU in embedded systems or the NVIDIA GPUs in HPC servers. In both GPGPUs, programming could become a hurdle that can limit their adoption, since the programmer has to learn the hardware capabilities and the language to work with these. We present OMP2HMPP, a tool that, automatically trans-lates a high-level C source code(OpenMP) code into HMPP. The generated version rarely will differs from a hand-coded HMPP version, and will provide an important speedup, near 113%, that could be later improved by hand-coded CUDA. The generated code could be transported either to HPC servers and to embedded GPUs, due to the commonalities between them.
研究动机与目标
- 通过自动将扩展了 OpenMP 的 C 代码转换为 HMPP 指令,降低 GPGPU 编程的复杂性。
- 生成与手工编码版本在性能和结构上高度接近的 HMPP 优化代码。
- 实现 GPGPU 应用在异构架构(包括 HPC 服务器和嵌入式 GPU)之间的可移植性。
- 为缺乏低级 GPU 编程模型专业知识的开发者提供性能优化的起点。
- 探索与 Par4All 等工具集成的未来方向,实现从顺序 C/C++ 代码到端到端自动并行化的完整流程。
提出的方法
- 使用 BSC Mercurium 源到源编译框架解析并分析输入的 OpenMP C 代码,提取抽象语法树(AST)和符号表。
- 执行静态分析,以确定 OpenMP 并行区域中变量的作用域、活跃性及数据访问模式。
- 应用 HMPP 指令(如 callsite、codelet、group、advancedload、delegatestore、synchronize、release、noupdate 和 target),将 OpenMP 区域映射为 GPU 内核。
- 通过使用 noupdate 和 advancedload 优化数据传输,避免冗余的上传和下载操作,尤其适用于在多个内核间重复使用的变量。
- 在依赖关系允许的情况下,对 GPU 内核采用异步执行,以提高并发性并隐藏延迟。
- 生成支持 CUDA 和未来 OpenCL 目标的 HMPP 兼容 C 代码,确保在不同 GPU 平台上的可移植性。
实验结果
研究问题
- RQ1源到源编译器能否在性能损失最小的情况下,自动从扩展了 OpenMP 的 C 代码生成 HMPP 兼容代码?
- RQ2自动生成的 HMPP 代码在性能和结构上与手工优化的 HMPP 实现相比,接近程度如何?
- RQ3生成的代码在 HPC 和嵌入式 GPU 平台上能达到多大程度的高速加速?
- RQ4在转换过程中,哪些优化(如数据传输最小化和异步执行)可以被自动应用?
- RQ5生成代码的性能与顺序执行、OpenMP 和手工编码的 CUDA 版本相比如何?
主要发现
- OMP2HMPP 在测试的 HPC 和嵌入式 GPU 平台上,与顺序版本相比实现了平均 113× 的加速。
- 与原始 OpenMP 版本相比,生成代码实现了超过 31× 的平均加速,显示出显著的性能提升。
- 生成的 HMPP 代码性能几乎与手工优化的 HMPP 版本无法区分,结构和数据移动方面仅有极小差异。
- 该工具通过使用 noupdate 和 advancedload 指令有效减少了数据传输开销,避免了冗余的上传和下载操作。
- 生成的代码可在异构架构间可移植,包括 HPC 服务器中的 NVIDIA Tesla GPU 和嵌入式系统中的 Mali GPU。
- 对于大多数基准测试,生成代码的性能与手工编码的 CUDA 版本相差不超过 1.7×,表明其具有进一步调优的强大潜力。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。