Buying a new computer - best hardware for fast Stan performance

@peopletrees - I also rarely have issues with RAM and Stan (cmdstan or Rstan). But then most of my systems have 16GB minimum.

One thing to be aware of RE: CPU count - running on hyperthreaded cores can be much slower than physical CPU cores. @Bob_Carpenter has mentioned this a few times in other threads, but if you have a CPU with 2 physical cores + 2 hyperthreaded, you are often better off running only 2 chains in parallel rather than 4. I have experienced 4 chains on 2 physical cores (i.e., sequential 2 chains per core) finishing sooner than 4 chains in parallel so often that I now just default to only using physical cores in parallel with Stan.

FYI - parallel::detectCores() in R includes hyperthreaded cores, so the rstan advice of “For execution on a local, multicore CPU with excess RAM we recommend calling options(mc.cores = parallel::detectCores()).” should probably have an asterisk or be amended to “parallel::detectCores(logical = FALSE)”. I would guess this advice currently actually slows down the analysis on many systems. @bgoodri - thoughts?

1 Like