Increasing heterogeneity in HPC architectures and compiler advancements have led to OpenMP being frequently used to enable computations on heterogeneous devices. However, the efficient movement of data on heterogeneous computing platforms is crucial for achieving high utilization. The implicit OpenMP data-mapping rules often result in redundant data transfer, which can be a bottleneck for program performance. Programmers must explicitly map data between the host and connected accelerator devices to achieve efficient data movement. For this, OpenMP offers the target data and target update constructs. Ensuring efficient data transfer requires programmers to reason about complex data flow. This can be a laborious and error-prone process since the programmer must keep a mental model of data validity and lifetime spanning multiple data environments. Any automated analysis should maximize data reuse, minimize data transfer, and must consider control flow and context from function call sites, making the analysis interprocedural and context sensitive. In this paper, we present a static analysis tool, OMPDart (OpenMP DAta Reduction Tool), for OpenMP programs that models data dependencies between host and device regions and applies source code transformations to achieve efficient data transfer. The analysis is based on a hybrid data structure that joins an Abstract Syntax Tree (AST) with a Control Flow Graph (CFG). Our evaluations on nine HPC benchmarks demonstrate that OMPDart is capable of generating effective data mapping constructs that substantially reduce data transfer between host and device. OMPDart helps reduce data transfers by 85% and improves runtime performance by 1.6x over an expert-defined implementation of LULESH 2.0.
翻译:随着高性能计算架构日益异构化以及编译技术的进步,OpenMP被频繁用于在异构设备上启用计算。然而,在异构计算平台上高效的数据移动对于实现高利用率至关重要。OpenMP隐式的数据映射规则常常导致冗余的数据传输,这可能成为程序性能的瓶颈。程序员必须在主机与连接的加速器设备之间显式地映射数据,以实现高效的数据移动。为此,OpenMP提供了target data和target update结构。确保高效的数据传输要求程序员对复杂的数据流进行推理。这可能是一个费力且容易出错的过程,因为程序员必须在跨越多个数据环境时,在脑海中保持数据有效性和生命周期的模型。任何自动化分析都应最大化数据重用、最小化数据传输,并且必须考虑来自函数调用点的控制流和上下文,这使得分析成为过程间且上下文敏感的。在本文中,我们提出了一种用于OpenMP程序的静态分析工具OMPDart(OpenMP数据约简工具),该工具对主机与设备区域之间的数据依赖关系进行建模,并应用源代码转换以实现高效的数据传输。该分析基于一种混合数据结构,该结构将抽象语法树与控制流图相结合。我们在九个高性能计算基准测试上的评估表明,OMPDart能够生成有效的数据映射结构,从而显著减少主机与设备之间的数据传输。与专家定义的LULESH 2.0实现相比,OMPDart帮助减少了85%的数据传输,并将运行时性能提高了1.6倍。