paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Optimising Density Computations in Probabilistic Programs via Automatic Loop Vectorisation

通过自动循环向量化优化概率程序中的密度计算
POPL 10(POPL)2026匹配度 5/10 · 论文属于概率编程语言的编译优化,与贝叶斯/概率程序有边缘关联,且有形式化与工程实现;但核心不是静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析,也未涉及与LLM的交叉。引用 3 inbox
Sangho Lim, Hyoungjin Lim, Wonyeol Lee, Xavier Rival, Hongseok Yang
crossref: 2026-09-10

AI 速览

一句话:提出可靠的自动循环向量化方法,用推测并行与不动点检查加速概率程序推断。

概率编程语言中的推断代价高昂,其瓶颈之一在于对大型数据集或长随机样本序列的逐项迭代。向量化可缓解该开销,但手工向量化易错,现有自动方法多为 ad-hoc 且受限,难以处理嵌套循环与数据依赖控制流。本文提出一种可靠有效的概率程序循环自动向量化方法:以推测式并行执行循环迭代提升吞吐,并通过不动点检查保持原循环语义;方法被形式化为从命令式 PPL 到带向量化原语的低层目标语言的翻译。作者在 Pyro 上实现,并在多个概率模型上评估,相较已有向量化基线取得 1.1–6× 加速,且在许多情况下降低 GPU 显存占用,并能处理全部测试模型。

问题
概率推断中对数据集或随机样本序列的循环迭代是主要性能瓶颈,而现有自动向量化技术难以处理嵌套循环和数据依赖控制流。
方法
将循环向量化形式化为从命令式 PPL 到带向量化原语的低层目标语言的翻译,采用推测式并行执行迭代并通过不动点检查保证语义保持。
评估
在 Pyro 上实现,并在多种概率模型上与已有向量化基线对比,报告了 1.1–6× 的加速、GPU 显存占用下降以及对全部测试模型的覆盖。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@article{abs-2511-11070,
  title = {Optimising Density Computations in Probabilistic Programs via Automatic Loop Vectorisation},
  author = {Sangho Lim and Hyoungjin Lim and Wonyeol Lee and Xavier Rival and Hongseok Yang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {POPL},
  year = {2026},
  doi = {10.1145/3776663}
}