Saved in:
Bibliographic Details
Main Authors: Lundén, Daniel, Hummelgren, Lars, Kudlicka, Jan, Eriksson, Oscar, Broman, David
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2302.13051
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913300010237952
author Lundén, Daniel
Hummelgren, Lars
Kudlicka, Jan
Eriksson, Oscar
Broman, David
author_facet Lundén, Daniel
Hummelgren, Lars
Kudlicka, Jan
Eriksson, Oscar
Broman, David
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2302_13051
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Suspension Analysis and Selective Continuation-Passing Style for Universal Probabilistic Programming Languages
Lundén, Daniel
Hummelgren, Lars
Kudlicka, Jan
Eriksson, Oscar
Broman, David
Programming Languages
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.
title Suspension Analysis and Selective Continuation-Passing Style for Universal Probabilistic Programming Languages
topic Programming Languages
url https://arxiv.org/abs/2302.13051