Heterogeneity has become a mainstream architecture design choice for building High Performance Computing systems. However, heterogeneity poses significant challenges for achieving performance portability of execution. Adapting a program to a new heterogeneous platform is laborious and requires developers to manually explore a vast space of execution parameters. To address those challenges, this paper proposes new extensions to OpenMP for autonomous, machine learning-driven adaptation. Our solution includes a set of novel language constructs, compiler transformations, and runtime support. We propose a producer-consumer pattern to flexibly define multiple, different variants of OpenMP code regions to enable adaptation. Those regions are transparently profiled at runtime to autonomously learn optimizing machine learning models that dynamically select the fastest variant. Our approach significantly reduces users' efforts of programming adaptive applications on heterogeneous architectures by leveraging machine learning techniques and code generation capabilities of OpenMP compilation. Using a complete reference implementation in Clang/LLVM we evaluate three use-cases of adaptive CPU-GPU execution. Experiments with HPC proxy applications and benchmarks demonstrate that the proposed adaptive OpenMP extensions automatically choose the best performing code variants for various adaptation possibilities, in several different heterogeneous platforms of CPUs and GPUs.
翻译:异构性已成为构建高性能计算系统的主流架构设计选择。然而,异构性给实现执行的可移植性能带来了重大挑战。将程序适配至新型异构平台需要大量人工操作,开发者需手动探索海量的执行参数空间。为应对这些挑战,本文提出了面向自主化、机器学习驱动型自适应的OpenMP扩展方案。我们的解决方案包含一系列新型语言结构、编译器变换及运行时支持。通过提出生产者-消费者模式,可灵活定义OpenMP代码区域的多种不同变体以实现自适应。这些区域在运行时被透明地分析,从而自主训练优化机器学习模型,动态选择执行速度最快的变体。该方法通过利用机器学习技术与OpenMP编译的代码生成能力,显著降低了用户在异构架构上编写自适应应用程序的工作量。基于Clang/LLVM的完整参考实现,我们评估了CPU-GPU自适应执行的三种用例。针对HPC代理应用与基准测试的实验表明,所提出的自适应OpenMP扩展能在多种CPU与GPU异构平台上,自动为各类自适应场景选择性能最优的代码变体。