-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallel mcmc #648
Parallel mcmc #648
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I've left a few comments after a quick first pass over it.
As for "why we did not do this before": Last time I was concerned with the efficiency of the slice sampler implementation was for the benchmark in which all runs were limited to a single core. Vectorizing it improved speed up to 36-fold which was more than enough. Having said that, the ability to additionally parallelize init and sampling across cores is a great addition!
Codecov Report
@@ Coverage Diff @@
## main #648 +/- ##
==========================================
+ Coverage 74.81% 75.03% +0.22%
==========================================
Files 75 74 -1
Lines 5667 5673 +6
==========================================
+ Hits 4240 4257 +17
+ Misses 1427 1416 -11
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this! I'm fine with merging this once JML's comments are addressed
Cheers! |
Not sure why we did not do this before, but it seems rather straight forward to parallelize
slice_np
:Similarly, we can parallize the initialization with
SIR
which can take quite long with a large numbers of chains and a slow potential function.This PR adds the
num_workers
argument toMCMCPosterior
and adds a function that performsslice_np
parallelized over workers.We have another refactor of the slice samplers waiting in #607 but we can integrate that later I find.
Still todo: