Closed stuvet closed 1 year ago
Sounds great to me. Would you open a PR? Would be great to have summary_cores argument wherever there is summary_args, which includes the gq, mle, and vb functions as well as the mcmc ones.
Ah yes, I didn't think about the other options, but I'm just starting to use gq
& it'll be very welcome here too. I'll add them all & submit in a sec.
@stuvet, I actually think you can supply the number of cores to the summary_args
argument, e.g. tar_stan_mcmc_rep_summary(..., summary_args = list(.cores = 4))
. The summary_args
argument populates the ...
argument of the summary()
method of CmdStanFit
objects, which then gets forwarded to posterior::summarize_draws().
Prework
Proposal
posterior::summarise_draws
has a.cores
option which offers big speedups for summarising larger posteriors. Currently it is not accessible viasummary_args
.It'd be very helpful to expose a
summary_cores
option totar_stan_summary
andtar_stan_mcmc
, which could default to1
to matchposterior::summarise_draws
defaults. In my fork I've includedparallel::detectCores
triggered bysummary_cores = NULL
. I was half way through submitting it as a PR, but saw the prework so raised here first. Currently tested withtar_make_future
on slurm (need to set appropriatencpus
in the default resources if called fromtar_stan_mcmc
).Happy to submit it as a PR if you'd like, but you may forsee problems that I can't.
Thanks