Vectorised MH
I was wondering whether there is a vectorised implementation of MH (i.e. running several chains in parallel) available in this repo? I've seen that there is a vectorised implementation in AdvancedHMC but I couldn't find any information whether it's available for MH as well.
If you want to run several chains in parallel, you can use
chain = sample(model, spl, MCMCThreads(), 100000, 4; param_names=["μ", "σ"], chain_type=Chains)
The above is adapted from the README example. chain would then have 4 separate chains in it, each with 100,000 samples.
Thanks! I'm aware of the support for using multiple threads. I'm interested in a vectorised implementation because then I could potentially run parallel chains on the GPU which should give better scaling than using multi-threading (if I'm not mistaken). I'm happy to help with adapting any of the existing code to be vectorised if someone gives me pointers about what the general strategy for that should be.
I actually have no idea how that would work -- my understanding is that GPUs work best when you have many identical instructions. I don't know how that would fit into the current framework.
I'll poke around a little and see what could be done here.
@mohamed82008 or @devmotion to you have any thoughts?