Diststan — distributed Stan fits across a network of computers

Run chains for one fit across a few machines on your network — by hand?

To cut the manual friction of distributing, monitoring, and collecting the draw files, I wrote myself a package and thought I’d share in case anyone finds it useful: GitHub - ssp3nc3r/diststan: Distributed cmdstanr/Stan MCMC fitting across a small heterogeneous SSH cluster via mirai · GitHub

This is really cool, thanks for sharing! I have recently been working on a workflow for using cmdstanr within the many-short-chains paradigm as explained in Margossian et al. 2024 on a cluster. Currently I use snakemake for this, but perhaps diststan would be a more accessible solution if it could somehow support the specification and bookkeeping of superchains (groups of chains with the same init values).

I think it does what you are asking. In one of the readme examples you’ll see you can specify more than one chain per machine (e.g., 2 for box one in the code below):

  hosts     = c("me@box1", "me@box2", "me@box3"),
  chains    = c(2, 1, 1),

For the custom init, I added a section in the readme for you to see how you can do that: GitHub - ssp3nc3r/diststan: Distributed cmdstanr/Stan MCMC fitting across a small heterogeneous SSH cluster via mirai · GitHub