Optimising Density Computations in Probabilistic Programs via Automatic Loop Vectorisation
Sangho Lim, Hyoungjin Lim, Wonyeol Lee, Xavier Rival, Hongseok Yang
摘要
Probabilistic programming languages (PPLs) are a popular tool for high-level modelling across many fields. They provide a range of algorithms for probabilistic inference, which analyse models by learning their parameters from a dataset or estimating their posterior distributions. However, probabilistic inference is known to be very costly. One of the bottlenecks of probabilistic inference stems from the iteration over entries of a large dataset or a long series of random samples. Vectorisation can mitigate this cost, but manual vectorisation is error-prone, and existing automatic techniques are often ad-hoc and limited, unable to handle general repetition structures, such as nested loops and loops with data-dependent control flow, without significant user intervention. To address this bottleneck, we propose a sound and effective method for automatically vectorising loops in probabilistic programs. Our method achieves high throughput using speculative parallel execution of loop iterations, while preserving the semantics of the original loop through a fixed-point check.
We formalise our method as a translation from an imperative PPL into a lower-level target language with primitives geared towards vectorisation. We implemented our method for the Pyro PPL and evaluated it on a range of probabilistic models. Our experiments show significant performance gains against an existing vectorisation baseline, achieving 1.1-6× speedups and reducing GPU memory usage in many cases. Unlike the baseline, which is limited to a subset of models, our method effectively handled all the tested models.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Probabilistic Programming with Programmable Variational Inference 引用了 Smoothness Analysis for Probabilistic Programs with Application to Optimised Variational Inference
- Incremental Computation for Efficient Programmable Inference in Probabilistic Programs 引用了 Probabilistic Programming with Vectorized Programmable Inference
- Probabilistic Programming with Vectorized Programmable Inference 引用了 Probabilistic Programming with Programmable Variational Inference
引用它的顶会 Paper2
- Probabilistic Programming with Vectorized Programmable InferenceMcCoy R. Becker, Mathieu Huot, George Matheos, Xiaoyan Wang 等POPL 2026 · 1 次引用
- Incremental Computation for Efficient Programmable Inference in Probabilistic ProgramsFabian Zaiser, Jack Czenszak, Martin C. Rinard, Vikash K. Mansinghka 等PLDI 2026
它引用的 Paper4
- Diffusive Gibbs SamplingWenlin Chen, Mingtian Zhang, Brooks Paige, José Miguel Hernández-Lobato 等ICML 2024 · 21 次引用
- Compiling Stan to generative probabilistic languages and extension to deep probabilistic programmingGuillaume Baudart, Javier Burroni, Martin Hirzel, Louis Mandel 等PLDI 2021 · 13 次引用
- Probabilistic Programming with Programmable Variational InferenceMcCoy R. Becker, Alexander K. Lew, Xiaoyan Wang, Matin Ghavami 等PLDI 2024 · 8 次引用
- Smoothness Analysis for Probabilistic Programs with Application to Optimised Variational InferenceWonyeol Lee, Xavier Rival, Hongseok YangPOPL 2023 · 8 次引用
相关 Paper
- Static Factorisation of Probabilistic Programs with User-Labelled Sample Statements and While LoopsMarkus Böck, Jürgen CitoOOPSLA 2026 · 1 次引用
- Nonparametric Involutive Markov Chain Monte CarloCarol Mak, Fabian Zaiser, Luke OngICML 2022 · 2 次引用
- Automatically marginalized MCMC in probabilistic programmingJinlin Lai, Javier Burroni, Hui Guan, Daniel SheldonICML 2023 · 4 次引用
- Automatic Reparameterisation of Probabilistic ProgramsMaria I. Gorinova, Dave Moore, Matthew D. HoffmanICML 2020 · 33 次引用
- Programmable MCMC with Soundly Composed Guide ProgramsLong Pham, Di Wang, Feras A. Saad, Jan HoffmannOOPSLA 2024 · 1 次引用
