tweag / monad-bayes

A library for probabilistic programming in Haskell.
MIT License
407 stars 62 forks source link

Use parallelism for Population #247

Open turion opened 1 year ago

turion commented 1 year ago

It seems to me that all inference using Population is done single-threaded. But it is a perfect target for trivial parallelization, because all the calculations are independent in a list. One could easily use e.g. https://hackage.haskell.org/package/parallel to make use of several cores.

reubenharry commented 1 year ago

Agreed. The caveat (as discussed) being that resampling is decidedly not parallel, so the advantage depends on the rate of the resampling being reasonably low. That said, I think parallelization here would likely be an easy performance win.