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

通用概率编程语言的挂起分析与选择性续体传递风格

Suspension Analysis and Selective Continuation-Passing Style for Universal Probabilistic Programming Languages

Daniel Lundén, Lars Hummelgren, Jan Kudlicka, Oscar Eriksson, David Broman

AI总结:

针对PPL中CPS变换导致的不必要闭包分配开销,提出静态挂起分析驱动的选择性CPS变换,并在Miking CorePPL中验证其正确性与多场景显著性能提升。

摘要:

通用概率编程语言(PPL)使得编码并自动求解统计推断问题相对容易。为求解推断问题,PPL实现通常采用依赖执行挂起的Monte Carlo推断算法。当前最先进的解决方案通过以下两种方式之一启用执行挂起:(i)续体传递风格(CPS)变换,或(ii)高效但相对复杂、且在高级语言中往往不可用的低层解决方案。CPS变换会因不必要的闭包分配而引入开销——PPL社区通常忽视了这一问题。为减少开销,我们为PPL开发了一种新的高效选择性CPS方法。具体而言,我们设计了一种新颖的静态挂起分析技术,可在给定特定推断算法的情况下,确定程序中需要挂起的部分。该分析允许仅在必要处对程序进行选择性CPS变换。我们形式化证明了该分析的正确性,并在Miking CorePPL编译器中实现了分析与变换。我们针对来自系统发生学、流行病学和主题建模的真实世界模型,对大量Monte Carlo推断算法评估了该实现。评估结果表明,在所有模型和推断算法上均取得显著改进。

英文摘要:

Universal probabilistic programming languages (PPLs) make it relatively easy to encode and automatically solve statistical inference problems. To solve inference problems, PPL implementations often apply Monte Carlo inference algorithms that rely on execution suspension. State-of-the-art solutions enable execution suspension either through (i) continuation-passing style (CPS) transformations or (ii) efficient, but comparatively complex, low-level solutions that are often not available in high-level languages. CPS transformations introduce overhead due to unnecessary closure allocations -- a problem the PPL community has generally overlooked. To reduce overhead, we develop a new efficient selective CPS approach for PPLs. Specifically, we design a novel static suspension analysis technique that determines parts of programs that require suspension, given a particular inference algorithm. The analysis allows selectively CPS transforming the program only where necessary. We formally prove the correctness of the analysis and implement the analysis and transformation in the Miking CorePPL compiler. We evaluate the implementation for a large number of Monte Carlo inference algorithms on real-world models from phylogenetics, epidemiology, and topic modeling. The evaluation results demonstrate significant improvements across all models and inference algorithms.

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

↑