用于自动并行化的相关计算之间的重叠估计
Estimating the overlap between dependent computations for automatic parallelization
摘要:
研究程序自动并行化的研究人员早就知道,过多的并行性可能比过少的并行性更糟糕,因为在另一个CPU上运行一个任务会产生开销。因此,自动并行化编译器长期以来一直试图使用粒度分析来确保它们只产生那些成本可能会超过产生成本的计算。然而,这不足以产生好的结果,因为数据依赖性可能会限制并行运行计算的有用性。如果一个计算几乎立即阻塞,并且只能在另一个完成其工作后才能恢复,那么并行化的成本再次超过了收益。我们提出了一组算法,用于识别程序中值得并行执行两个或多个计算的位置,这些算法关注第二个问题以及第一个问题。我们的系统使用分析信息来计算过程调用消耗其输入参数的值的时间和产生其输出参数的值的时间。给定两个可以并行执行的调用,我们的系统使用它们共享的变量的生产和消费时间来确定如果它们并行运行,它们的执行会重叠多少,因此并行执行它们是否是一个好主意。我们已经为Mercury以工具的形式实现了这种技术,该工具使用分析数据来生成关于并行化的建议,以便Mercury编译器应用于程序的下一次编译。我们提出的初步结果表明,这种技术可以产生有用的并行化加速,而不需要更多的程序员比代表输入数据的剖析运行。
英文摘要:
Researchers working on the automatic parallelization of programs have long known that too much parallelism can be even worse for performance than too little, because spawning a task to be run on another CPU incurs overheads. Autoparallelizing compilers have therefore long tried to use granularity analysis to ensure that they only spawn off computations whose cost will probably exceed the spawn-off cost by a comfortable margin. However, this is not enough to yield good results, because data dependencies may \emph{also} limit the usefulness of running computations in parallel. If one computation blocks almost immediately and can resume only after another has completed its work, then the cost of parallelization again exceeds the benefit. We present a set of algorithms for recognizing places in a program where it is worthwhile to execute two or more computations in parallel that pay attention to the second of these issues as well as the first. Our system uses profiling information to compute the times at which a procedure call consumes the values of its input arguments and the times at which it produces the values of its output arguments. Given two calls that may be executed in parallel, our system uses the times of production and consumption of the variables they share to determine how much their executions would overlap if they were run in parallel, and therefore whether executing them in parallel is a good idea or not. We have implemented this technique for Mercury in the form of a tool that uses profiling data to generate recommendations about what to parallelize, for the Mercury compiler to apply on the next compilation of the program. We present preliminary results that show that this technique can yield useful parallelization speedups, while requiring nothing more from the programmer than representative input data for the profiling run.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。