Skip to content
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

Vectorised MH #37

Open
treigerm opened this issue Oct 12, 2020 · 3 comments
Open

Vectorised MH #37

treigerm opened this issue Oct 12, 2020 · 3 comments

Comments

@treigerm
Copy link

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.

@cpfiffer
Copy link
Member

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.

@treigerm
Copy link
Author

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.

@cpfiffer
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants