[FR] Use new num_chains arg in cmdstan for hmc, fixed params, and generated quantities
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 160
- Forks
- 69
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 15
Description
Is your feature request related to a problem? Please describe.
So once https://github.com/stan-dev/cmdstan/pull/987 goes into cmdstan, as long as the user compiled with threading on then we should be able to run multiple chains within one Stan program by specifying num_chains inside of the sample argument!
Describe the solution you'd like
Is there a reasonable line for cmdstanr to check if the method is hmc with dense or diag_e inverse metric and then when the user specifies parallel chains, internally cmdstanr passes those as command args to cmdstan instead of using R level parallelism? This should save folks a lot of memory and likewise give a nice little speed bump.
This would also have to wait / check that cmdstanr is at least greater than version 2.27 and has compiled with threading on
Describe alternatives you've considered
I'm not familiar enough with the internals of cmdstanr to know other alts, though I'm happy to discuss whatever can work for yinz!
Additional context
Add any other context about the feature request here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing cmdstanr's sample argument handling and its existing R-level parallel-chain execution. Check the CmdStan version and threading requirements, then determine how HMC with dense or diag_e metrics can pass num_chains to CmdStan. Done means supported configurations use CmdStan's parallel chains without changing unsupported methods or configurations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100