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

OpenMP顾问

OpenMP Advisor

Alok Mishra, Abid M. Malik, Meifeng Lin, Barbara Chapman

摘要:

随着高性能计算行业异构体系结构的日益多样化,将遗留应用程序移植到不同的体系结构上运行是一个严峻的挑战。在本文中,我们介绍了OpenMP Advisor,这是第一款使用机器学习将代码卸载到带有OpenMP的GPU的编译器工具。虽然该工具目前仅限于GPU,但它可以扩展到支持其他支持OpenMP的设备。该工具有两种模式:训练模式和预测模式。训练模式必须在目标硬件上执行。它将基准代码作为输入,生成并执行可能在目标设备上运行的代码的每个变体,然后从所有执行的代码中收集数据,以训练基于ML的成本模型,用于预测模式。然而,在预测模式下,该工具不需要与目标设备进行任何交互。它接受C代码作为输入,并返回可用于将代码卸载到指定设备的最佳代码变体。该工具可以通过使用基于机器学习的成本模型预测内核的运行时间来确定最适合卸载的内核。此工具的主要目标是维护OpenMP的可移植性。使用我们的Advisor,我们能够为七种不同的架构生成多个应用程序的代码,并正确预测每个架构上每个应用程序的十大最佳变体。初步研究结果表明,该工具可以帮助编译器开发人员和HPC应用研究人员在即将到来的异构计算环境中移植他们的传统HPC代码。

英文摘要:

With the increasing diversity of heterogeneous architecture in the HPC industry, porting a legacy application to run on different architectures is a tough challenge. In this paper, we present OpenMP Advisor, a first of its kind compiler tool that enables code offloading to a GPU with OpenMP using Machine Learning. Although the tool is currently limited to GPUs, it can be extended to support other OpenMP-capable devices. The tool has two modes: Training mode and Prediction mode. The training mode must be executed on the target hardware. It takes benchmark codes as input, generates and executes every variant of the code that could possibly run on the target device, and then collects data from all of the executed codes to train an ML-based cost model for use in prediction mode. However, in prediction mode the tool does not need any interaction with the target device. It accepts a C code as input and returns the best code variant that can be used to offload the code to the specified device. The tool can determine the kernels that are best suited for offloading by predicting their runtime using a machine learning-based cost model. The main objective behind this tool is to maintain the portability aspect of OpenMP. Using our Advisor, we were able to generate code of multiple applications for seven different architectures, and correctly predict the top ten best variants for each application on every architecture. Preliminary findings indicate that this tool can assist compiler developers and HPC application researchers in porting their legacy HPC codes to the upcoming heterogeneous computing environment.

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

↑