Universal Probabilistic Programming Language Compilation with Parallel Efficient Sequential Monte Carlo Inference

Probabilistic programming languages (PPLs) allow for natural encoding of arbitrary inference problems, and PPL implementations can provide automatic general-purpose inference for these problems. However, constructing inference implementations that are efficient enough is challenging for many real-world problems. Often, this is due to PPLs not fully exploiting available parallelization and optimization opportunities. For example, handling of probabilistic checkpoints in PPLs through the use of continuation-passing style transformations or nonpreemptive multitasking—as is done in many popular PPLs—often disallows compilation to low-level languages required for high-performance platforms such as graphics processing units (GPUs). As a solution to this checkpoint problem, we introduce the concept of PPL control-flow graphs (PCFGs), providing a simple and efficient approach that can be used for handling checkpoints in such languages. We use this approach to implement RootPPL: a low-level PPL built on CUDA and C++ with OpenMP, providing highly efficient and massively parallel SMC inference. We also introduce a general method of compiling universal highlevel PPLs to PCFGs, and illustrate its application when compiling Miking CorePPL—a high-level universal PPL—to RootPPL. This is the first time a universal PPL has been compiled to GPUs with SMC inference. Both RootPPL and the CorePPL compiler are evaluated through a set of real-world experiments in the domains of phylogenetics and epidemiology, demonstrating up to 6× speedups over state-of-the-art PPLs implementing SMC inference.

[1]  David Broman,et al.  Correctness of Sequential Monte Carlo Inference for Probabilistic Programming Languages , 2021, ESOP.

[2]  Thomas B. Schön,et al.  Universal probabilistic programming: a powerful new approach to statistical phylogenetics , 2020, bioRxiv.

[3]  A vision of miking: interactive programmatic modeling, sound language composition, and self-learning compilation , 2019, SLE.

[4]  Vikash K. Mansinghka,et al.  Gen: a general-purpose probabilistic programming system with programmable inference , 2019, PLDI.

[5]  Fredrik Lindsten,et al.  Elements of Sequential Monte Carlo , 2019, Found. Trends Mach. Learn..

[6]  Noah D. Goodman,et al.  Pyro: Deep Universal Probabilistic Programming , 2018, J. Mach. Learn. Res..

[7]  Thomas B. Schön,et al.  Automated learning with a probabilistic programming language: Birch , 2018, Annu. Rev. Control..

[8]  David Broman,et al.  Delayed Sampling and Automatic Rao-Blackwellization of Probabilistic Programs , 2017, AISTATS.

[9]  Zoubin Ghahramani,et al.  Turing: A Language for Flexible Probabilistic Inference , 2018 .

[10]  Jiqiang Guo,et al.  Stan: A Probabilistic Programming Language. , 2017, Journal of statistical software.

[11]  Dustin Tran,et al.  Edward: A library for probabilistic modeling, inference, and criticism , 2016, ArXiv.

[12]  David Tolpin,et al.  Design and Implementation of Probabilistic Programming Language Anglican , 2016, IFL 2016.

[13]  Sebastian Funk,et al.  Comparative Analysis of Dengue and Zika Outbreaks Reveals Differences by Setting and Virus , 2016, bioRxiv.

[14]  Jacques Carette,et al.  Probabilistic Inference by Program Transformation in Hakaru (System Description) , 2016, FLOPS.

[15]  Thomas A. Henzinger,et al.  Probabilistic programming , 2014, FOSE.

[16]  Frank D. Wood,et al.  A New Approach to Probabilistic Programming Inference , 2014, AISTATS.

[17]  Lawrence M. Murray Bayesian State-Space Modelling on High-Performance Hardware Using LibBi , 2013, 1306.3277.

[18]  Anthony Lee,et al.  Parallel Resampling in the Particle Filter , 2013, 1301.4019.

[19]  W. Jetz,et al.  The global diversity of birds in space and time , 2012, Nature.

[20]  Michael I. Jordan,et al.  Graphical Models, Exponential Families, and Variational Inference , 2008, Found. Trends Mach. Learn..

[21]  Joshua B. Tenenbaum,et al.  Church: a language for generative models , 2008, UAI.

[22]  Timothy J. Robinson,et al.  Sequential Monte Carlo Methods in Practice , 2003 .

[23]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[24]  Peter Green,et al.  Markov chain Monte Carlo in Practice , 1996 .

[25]  Amr Sabry,et al.  The essence of compiling with continuations , 1993, PLDI '93.

[26]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[27]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.