Efficiently Vectorized MCMC on Modern Accelerators

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Dance, Hugh, Glaser, Pierre, Orbanz, Peter, Adams, Ryan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918079791890432
author Dance, Hugh
Glaser, Pierre
Orbanz, Peter
Adams, Ryan
author_facet Dance, Hugh
Glaser, Pierre
Orbanz, Peter
Adams, Ryan
contents With the advent of automatic vectorization tools (e.g., JAX's $\texttt{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 $\texttt{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.
format Preprint
id arxiv_https___arxiv_org_abs_2503_17405
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Efficiently Vectorized MCMC on Modern Accelerators
Dance, Hugh
Glaser, Pierre
Orbanz, Peter
Adams, Ryan
Mathematical Software
Machine Learning
Computation
With the advent of automatic vectorization tools (e.g., JAX's $\texttt{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 $\texttt{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.
title Efficiently Vectorized MCMC on Modern Accelerators
topic Mathematical Software
Machine Learning
Computation
url https://arxiv.org/abs/2503.17405