arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2007.11203cs.PL
收藏

多面体模型中相关约简的简化

Simplifying Dependent Reductions in the Polyhedral Model

Cambridge Yang, Eric Atkinson, Michael Carbin

摘要:

约简--使用关联和交换运算符对一组值进行累加--是许多数值计算中的常见计算,包括科学计算、机器学习、计算机视觉和金融分析。当代基于多面体的编译技术使得优化约简(诸如前缀和)成为可能,其中约简的输出的每个分量潜在地与约简中的另一分量共享计算。因此,优化编译器可以识别多个组件之间共享的计算,并生成只计算一次共享计算的代码。然而,这些技术不支持在多面体模型的语言中表述时跨越多个依赖语句的归约。在这种情况下,现有的方法可能会生成不正确的代码,违反原始的,未优化的程序的数据依赖。在这项工作中,我们确定和形式化的优化相关的减少作为一个整数双线性规划。我们提出了一个启发式优化算法,使用仿射顺序计划,以确定如何简化减少仍然保留程序的依赖性。我们证明,该算法提供了一组基准程序的概率推理算法,其性能严重依赖于简化这些减少的文献的最佳复杂性。11个程序中的10个程序的复杂性至少通过输入数据的大小的因子显著地提高,对于典型的实际应用输入,输入数据的大小在$10^4$到$10^6$的范围内。我们还证实了改进的意义,通过显示从$1.1\text{x}$到超过$10^6\text{x}$的挂钟时间的加速。

英文摘要:

A Reduction -- an accumulation over a set of values, using an associative and commutative operator -- is a common computation in many numerical computations, including scientific computations, machine learning, computer vision, and financial analytics. Contemporary polyhedral-based compilation techniques make it possible to optimize reductions, such as prefix sums, in which each component of the reduction's output potentially shares computation with another component in the reduction. Therefore an optimizing compiler can identify the computation shared between multiple components and generate code that computes the shared computation only once. These techniques, however, do not support reductions that -- when phrased in the language of the polyhedral model -- span multiple dependent statements. In such cases, existing approaches can generate incorrect code that violates the data dependences of the original, unoptimized program. In this work, we identify and formalize the optimization of dependent reductions as an integer bilinear program. We present a heuristic optimization algorithm that uses an affine sequential schedule of the program to determine how to simplfy reductions yet still preserve the program's dependences. We demonstrate that the algorithm provides optimal complexity for a set of benchmark programs from the literature on probabilistic inference algorithms, whose performance critically relies on simplifying these reductions. The complexities for 10 of the 11 programs improve siginifcantly by factors at least of the sizes of the input data, which are in the range of $10^4$ to $10^6$ for typical real application inputs. We also confirm the significance of the improvement by showing speedups in wall-clock time that range from $1.1\text{x}$ to over $10^6\text{x}$.

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

↑