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

并行语义程序依赖图

The Parallel Semantics Program Dependence Graph

Brian Homerding, Atmn Patel, Enrico Armenio Deiana, Yian Su, Zujun Tan, Ziyang Xu, Bhargav Reddy Godala, David I. August, Simone Campanoni

AI总结:

针对现有并行IR缺少语义等价约束捕获表示、顺序PDG不适用于并行代码的问题,提出并行语义程序依赖图PS-PDG,论证其扩展必要性并验证其优化能力更强,助力编译器在保语义下选择并行执行计划。

摘要:

编译器的中间表示(IR)通过编码指令及其相对顺序来定义程序的执行计划。编译器优化的目标是用语义等价的执行计划替换给定的执行计划,以提升程序在目标架构上的性能。IR的替代表示形式,例如程序依赖图(Program Dependence Graph,PDG),通过捕获语义等价的执行计划必须满足的最小约束集来辅助这一过程。\n类似OpenMP的并行编程通过添加指令并行运行的可能性扩展了顺序执行计划,从而生成并行执行计划。近期推出的并行IR,例如TAPIR,可显式编码并行执行计划。这些新的IR最终使编译器能够修改程序员表达的并行执行计划,以更好地适配目标并行架构。\n遗憾的是,并行IR无法帮助编译器识别保留原始语义的并行执行计划集合。换言之,我们仍然缺少并行IR的一种替代表示形式,用于捕获并行执行计划为实现语义等价必须满足的最小约束集。而PDG并非此任务的理想候选,因为它是为顺序代码设计的。\n我们提出并行语义程序依赖图(Parallel Semantics Program Dependence Graph,PS-PDG),以精确捕获所有语义等价的并行执行计划都必须满足的关键程序约束。本文定义了PS-PDG,论证了对PDG的每一项扩展的必要性,并证明了相较于现有基于PDG的自动并行化编译器,PS-PDG具备更强的优化能力。编译器如今可依托PS-PDG选择不同的并行执行计划,同时保持原始语义不变。

英文摘要:

A compiler's intermediate representation (IR) defines a program's execution plan by encoding its instructions and their relative order. Compiler optimizations aim to replace a given execution plan with a semantically-equivalent one that increases the program's performance for the target architecture. Alternative representations of an IR, like the Program Dependence Graph (PDG), aid this process by capturing the minimum set of constraints that semantically-equivalent execution plans must satisfy. Parallel programming like OpenMP extends a sequential execution plan by adding the possibility of running instructions in parallel, creating a parallel execution plan. Recently introduced parallel IRs, like TAPIR, explicitly encode a parallel execution plan. These new IRs finally make it possible for compilers to change the parallel execution plan expressed by programmers to better fit the target parallel architecture. Unfortunately, parallel IRs do not help compilers in identifying the set of parallel execution plans that preserve the original semantics. In other words, we are still lacking an alternative representation of parallel IRs to capture the minimum set of constraints that parallel execution plans must satisfy to be semantically-equivalent. Unfortunately, the PDG is not an ideal candidate for this task as it was designed for sequential code. We propose the Parallel Semantics Program Dependence Graph (PS-PDG) to precisely capture the salient program constraints that all semantically-equivalent parallel execution plans must satisfy. This paper defines the PS-PDG, justifies the necessity of each extension to the PDG, and demonstrates the increased optimization power of the PS-PDG over an existing PDG-based automatic-parallelizing compiler. Compilers can now rely on the PS-PDG to select different parallel execution plans while maintaining the same original semantics.

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

↑