我们可以并行运行吗?TornadoVM的自动化循环并行化
Can We Run in Parallel? Automating Loop Parallelization for TornadoVM
摘要:
随着多核系统、GPU和FPGA的出现,循环并行化已经成为加速程序执行的一种有前途的方法。为了跟上时代的步伐,各种面向性能的程序设计语言提供了大量的结构,以允许程序员编写可并行化的循环。相应地,研究人员已经开发出自动并行化循环的技术,这些循环在迭代中不携带依赖关系,和/或调用纯函数。然而,在具有独立于平台的运行时的托管语言(如Java)中,在JIT编译期间执行复杂的依赖性分析实际上是不可行的。在本文中,我们提出了AutoTornado,第一种静态+JIT循环并行化器的Java程序,并行化循环异构体系结构使用TornadoVM(一个基于Graal的VM,支持插入@Parallel结构的循环并行化)。AutoTornado在Soot框架中静态地执行Java程序的复杂依赖性和纯度分析,以生成约束编码条件,在该条件下,给定的循环可以并行化。然后将生成的约束馈送到Z3定理证明器(我们已经与Soot集成),以注释可以使用@Parallel构造并行化的正则for循环。我们还在TornadoVM中添加了运行时支持,以使用静态分析结果进行循环并行化。我们对几个标准并行化内核的评估表明,AutoTornado正确并行化了61.3%的手动并行化循环,具有高效的静态分析和接近零的运行时开销。据我们所知,AutoTornado不仅是第一个为真实世界的JVM执行基于程序分析的并行化的工具,而且是第一个将Z3与Soot集成以实现循环并行化的工具。
英文摘要:
With the advent of multi-core systems, GPUs and FPGAs, loop parallelization has become a promising way to speed-up program execution. In order to stay up with time, various performance-oriented programming languages provide a multitude of constructs to allow programmers to write parallelizable loops. Correspondingly, researchers have developed techniques to automatically parallelize loops that do not carry dependences across iterations, and/or call pure functions. However, in managed languages with platform-independent runtimes such as Java, it is practically infeasible to perform complex dependence analysis during JIT compilation. In this paper, we propose AutoTornado, a first of its kind static+JIT loop parallelizer for Java programs that parallelizes loops for heterogeneous architectures using TornadoVM (a Graal-based VM that supports insertion of @Parallel constructs for loop parallelization). AutoTornado performs sophisticated dependence and purity analysis of Java programs statically, in the Soot framework, to generate constraints encoding conditions under which a given loop can be parallelized. The generated constraints are then fed to the Z3 theorem prover (which we have integrated with Soot) to annotate canonical for loops that can be parallelized using the @Parallel construct. We have also added runtime support in TornadoVM to use static analysis results for loop parallelization. Our evaluation over several standard parallelization kernels shows that AutoTornado correctly parallelizes 61.3% of manually parallelizable loops, with an efficient static analysis and a near-zero runtime overhead. To the best of our knowledge, AutoTornado is not only the first tool that performs program-analysis based parallelization for a real-world JVM, but also the first to integrate Z3 with Soot for loop parallelization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。