Many of today's probabilistic programming languages (PPLs) have brittle inference performance: the performance of the underlying inference algorithm is very sensitive to the precise way in which the probabilistic program is written. A standard way of addressing this challenge in traditional programming languages is via program optimizations, which seek to unburden the programmer from writing low-level performant code, freeing them to work at a higher-level of abstraction. The arsenal of applicable program optimizations for PPLs to choose from is scarce in comparison to traditional programs; few of today's PPLs offer significant forms of automated program optimization. In this work we develop a new family of program optimizations specific to discrete-valued knowledge compilation based PPLs. We identify a particular form of program structure unique to these PPLs that tangibly affects exact inference performance in these programs: redundant random variables -- variables with repeated parameters and inconsistent path conditions. We develop a new program analysis and associated optimization called flip-hoisting that identifies these redundancies and optimizes them into a single random variable. We show that flip-hoisting yields inference speedups of up to 60% on applications of probabilistic programs such as Bayesian networks and probabilistic verification.
翻译:当今许多概率性编程语言( PPLs) 都具有微小的推论性能: 基本推论算法的性能对于概率性程序书写的确切方式非常敏感。 传统编程语言中应对这一挑战的标准方式是程序优化, 力求让程序员摆脱写低级性能代码的负担, 让他们可以在更高的抽象水平上工作。 PPLP选择的可应用程序优化工具库与传统程序相比很少; 今天的PPPLs很少提供重要的自动程序优化形式。 在此工作中,我们开发了一套针对离散价值知识编程的新的程序优化系统。 我们确定了一种独特的程序结构形式,这些程序结构明显地影响到这些方案的精确推导性性性能: 多余随机变量 -- 变量反复出现, 路径条件不一致。 我们开发了一个新的程序分析和相关优化程序, 识别这些冗余的冗余性, 并优化了这些冗余性, 并优化了它们成为单一随机变量。 我们展示了60 % 的平动性网络, 将这种平动性网络转化为60号的快速性测试程序。