Efficiently Vectorized MCMC on Modern Accelerators
Hugh Dance, Pierre Glaser, Peter Orbanz, Ryan P. Adams
Abstract
With the advent of automatic vectorization tools (e.g., JAX's vmap), writing multi-chain MCMC algorithms is often now as simple as invoking those tools on single-chain code. Whilst convenient, for various MCMC algorithms this results in a synchronization problem-loosely speaking, at each iteration all chains running in parallel must wait until the last chain has finished drawing its sample. In this work, we show how to design single-chain MCMC algorithms in a way that avoids synchronization overheads when vectorizing with tools like vmap, by using the framework of finite state machines (FSMs). Using a simplified model, we derive an exact theoretical form of the obtainable speed-ups using our approach, and use it to make principled recommendations for optimal algorithm design. We implement several popular MCMC algorithms as FSMs, including Elliptical Slice Sampling, HMC-NUTS, and Delayed Rejection, demonstrating speed-ups of up to an order of magnitude in experiments.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 8968d2c4-8bfe-4423-b200-a441ddf8206fCited by top-tier papers1
Ask how each one uses itBuilds on6
- JAX MD: A Framework for Differentiable PhysicsSamuel S. Schoenholz, Ekin Dogus CubukNeurIPS 2020 · 195 citations
- Automatic Reparameterisation of Probabilistic ProgramsMaria I. Gorinova, Dave Moore, Matthew D. HoffmanICML 2020 · 33 citations
- Unbiased Contrastive Divergence Algorithm for Training Energy-Based Latent Variable ModelsYixuan Qiu, Lingsong Zhang, Xiao WangICLR 2020 · 26 citations
- Training Linear Finite-State MachinesArash Ardakani, Amir Ardakani, Warren J. GrossNeurIPS 2020 · 5 citations
- Recurrent Neural Language Models as Probabilistic Finite-state AutomataAnej Svete, Ryan CotterellEMNLP 2023 · 1 citation
Related papers
- Probabilistic Programming with Vectorized Programmable InferenceMcCoy R. Becker, Mathieu Huot, George Matheos, Xiaoyan Wang et al.POPL 2026 · 1 citation
- Distributed Metropolis Sampler with Optimal ParallelismWeiming Feng, Thomas P. Hayes, Yitong YinSODA 2021 · 7 citations
- Scaling out speculative execution of finite-state machines with parallel mergeYang Xia, Peng Jiang, Gagan AgrawalPPoPP 2020 · 10 citations
- Involutive MCMC: a Unifying FrameworkKirill Neklyudov, Max Welling, Evgenii Egorov, Dmitry P. VetrovICML 2020 · 40 citations
- Metropolis Adjusted Microcanonical Hamiltonian Monte CarloJakob Robnik, Reuben Cohn-Gordon, Uros SeljakNeurIPS 2025 · 8 citations
