RStan, I think, was -O2, but both Cmdstans appeared to be -O3, except for some files in stanc compiled at -O0. Note that RStan and Cmdstan 2.15 ran at a similar speed. I ran 4 chains in parallel and started with the same seed (839520129) for all the runs. The script for launching Cmdstan 2.17 looks like this:
#!/bin/bash
for i in {1..4}
do
../jc_multilevelTest.cmdstan2.17 sample id=$i random seed=839520129 data file="fakeData.Rdump" output file=test$i.csv.cmdstan2.17 &
done
wait
~/Desktop/UQ/cmdstan-2.17.0/bin/stansummary test?.csv.cmdstan2.17
Time was measured simply by looking at elapsed time, but it was not even close.
For Cmdstan 2.15:
Warmup took (44, 38, 40, 42) seconds, 2.7 minutes total
Sampling took (32, 24, 30, 22) seconds, 1.8 minutes total
For Cmdstan 2.17:
Warmup took (211, 205, 217, 255) seconds, 15 minutes total
Sampling took (150, 160, 168, 150) seconds, 10 minutes total
I did notice than in spite of the same seed, Cmdstan 2.15 and Cmdstan 2.17 did not generate identical chains. Here are the summary outputs:
For Cmdstan 2.15:
Mean MCSE StdDev 5% 50% 95% N_Eff N_Eff/s R_hat
lp__ -7.9e+02 1.1e-01 3.7e+00 -8.0e+02 -7.9e+02 -7.9e+02 1181 11 1.0e+00
accept_stat__ 9.4e-01 1.4e-03 8.9e-02 7.5e-01 9.7e-01 1.0e+00 4000 37 1.0e+00
stepsize__ 1.1e-02 8.1e-04 1.1e-03 1.0e-02 1.2e-02 1.3e-02 2.0 0.018 4.3e+13
treedepth__ 8.1e+00 1.2e-01 4.4e-01 7.0e+00 8.0e+00 9.0e+00 14 0.13 1.1e+00
n_leapfrog__ 3.2e+02 4.2e+01 1.2e+02 2.6e+02 2.6e+02 5.1e+02 8.2 0.076 1.1e+00
divergent__ 0.0e+00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 4000 37 -nan
energy__ 8.0e+02 1.5e-01 5.0e+00 8.0e+02 8.0e+02 8.1e+02 1137 10 1.0e+00
A 1.8e+03 2.1e-01 9.1e+00 1.8e+03 1.8e+03 1.8e+03 1919 18 1.0e+00
beta_JC 9.2e-01 2.3e-05 1.4e-03 9.2e-01 9.2e-01 9.2e-01 3438 32 1.0e+00
n 7.5e-01 1.9e-05 1.2e-03 7.5e-01 7.5e-01 7.6e-01 3566 33 1.0e+00
C 3.6e-03 1.7e-05 7.0e-04 2.5e-03 3.6e-03 4.7e-03 1612 15 1.0e+00
m 8.4e-01 4.1e-04 1.5e-02 8.1e-01 8.4e-01 8.6e-01 1360 13 1.0e+00
SD_curve[1] 1.7e+01 3.3e-02 1.8e+00 1.4e+01 1.7e+01 2.0e+01 2905 27 1.0e+00
SD_curve[2] 1.3e+01 2.7e-02 1.5e+00 1.1e+01 1.3e+01 1.6e+01 3013 28 1.0e+00
SD_curve[3] 1.0e+01 2.1e-02 1.2e+00 8.7e+00 1.0e+01 1.2e+01 3072 28 1.0e+00
SD_curve[4] 1.0e+01 2.1e-02 1.2e+00 8.3e+00 9.9e+00 1.2e+01 3218 30 1.0e+00
SD_curve[5] 1.3e+01 2.4e-02 1.4e+00 1.1e+01 1.3e+01 1.5e+01 3303 30 1.0e+00
SD_curve[6] 1.8e+01 3.4e-02 1.9e+00 1.5e+01 1.8e+01 2.1e+01 3242 30 1.0e+00
SD_curve[7] 1.2e+00 2.5e-03 1.4e-01 1.0e+00 1.2e+00 1.5e+00 2997 28 1.0e+00
SD_curve[8] 5.1e-01 1.1e-03 5.8e-02 4.2e-01 5.0e-01 6.1e-01 2838 26 1.0e+00
alpha_JC[1] 1.9e+03 3.3e-02 2.1e+00 1.9e+03 1.9e+03 1.9e+03 4000 37 1.0e+00
alpha_JC[2] 1.9e+03 2.8e-02 1.8e+00 1.9e+03 1.9e+03 1.9e+03 4000 37 1.0e+00
alpha_JC[3] 1.6e+03 2.2e-02 1.4e+00 1.6e+03 1.6e+03 1.6e+03 4000 37 1.0e+00
alpha_JC[4] 1.3e+03 2.2e-02 1.4e+00 1.3e+03 1.3e+03 1.3e+03 4000 37 1.0e+00
alpha_JC[5] 1.0e+03 2.5e-02 1.6e+00 1.0e+03 1.0e+03 1.0e+03 4000 37 1.0e+00
alpha_JC[6] 8.0e+02 3.7e-02 2.3e+00 7.9e+02 8.0e+02 8.0e+02 4000 37 1.0e+00
alpha_JC[7] 1.8e+03 5.9e-03 3.6e-01 1.8e+03 1.8e+03 1.8e+03 3790 35 1.0e+00
alpha_JC[8] 1.8e+03 5.3e-03 3.3e-01 1.8e+03 1.8e+03 1.8e+03 3833 35 1.0e+00
SD_alpha 1.6e+01 2.7e-01 7.7e+00 8.1e+00 1.4e+01 3.0e+01 810 7.5 1.0e+00
B 1.7e+03 2.0e-01 8.8e+00 1.7e+03 1.7e+03 1.7e+03 1976 18 1.0e+00
For Cmdstan 2.17:
Mean MCSE StdDev 5% 50% 95% N_Eff N_Eff/s R_hat
lp__ -7.9e+02 1.1e-01 3.7e+00 -8.0e+02 -7.9e+02 -7.9e+02 1180 1.9e+00 1.0e+00
accept_stat__ 9.5e-01 1.2e-03 7.4e-02 7.9e-01 9.8e-01 1.0e+00 4000 6.4e+00 1.0e+00
stepsize__ 1.1e-02 1.4e-04 1.9e-04 1.0e-02 1.1e-02 1.1e-02 2.0 3.2e-03 9.0e+12
treedepth__ 8.2e+00 1.3e-02 4.8e-01 8.0e+00 8.0e+00 9.0e+00 1286 2.1e+00 1.0e+00
n_leapfrog__ 3.6e+02 3.3e+00 1.3e+02 2.6e+02 2.6e+02 5.1e+02 1624 2.6e+00 1.0e+00
divergent__ 0.0e+00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 4000 6.4e+00 -nan
energy__ 8.0e+02 1.5e-01 4.9e+00 8.0e+02 8.0e+02 8.1e+02 1137 1.8e+00 1.0e+00
A 1.8e+03 1.9e-01 8.9e+00 1.8e+03 1.8e+03 1.8e+03 2209 3.5e+00 1.0e+00
beta_JC 9.2e-01 2.4e-05 1.3e-03 9.2e-01 9.2e-01 9.2e-01 3063 4.9e+00 1.0e+00
n 7.5e-01 2.1e-05 1.1e-03 7.5e-01 7.5e-01 7.6e-01 3050 4.9e+00 1.0e+00
C 3.6e-03 1.9e-05 7.0e-04 2.6e-03 3.7e-03 4.7e-03 1336 2.1e+00 1.0e+00
m 8.4e-01 4.1e-04 1.5e-02 8.1e-01 8.4e-01 8.6e-01 1442 2.3e+00 1.0e+00
SD_curve[1] 1.7e+01 3.1e-02 1.7e+00 1.4e+01 1.7e+01 2.0e+01 3119 5.0e+00 1.0e+00
SD_curve[2] 1.3e+01 3.0e-02 1.5e+00 1.1e+01 1.3e+01 1.6e+01 2468 3.9e+00 1.0e+00
SD_curve[3] 1.0e+01 2.2e-02 1.2e+00 8.7e+00 1.0e+01 1.3e+01 2782 4.4e+00 1.0e+00
SD_curve[4] 1.0e+01 2.2e-02 1.2e+00 8.3e+00 9.9e+00 1.2e+01 2907 4.6e+00 1.0e+00
SD_curve[5] 1.3e+01 2.6e-02 1.4e+00 1.1e+01 1.3e+01 1.5e+01 2683 4.3e+00 1.0e+00
SD_curve[6] 1.8e+01 3.6e-02 2.0e+00 1.5e+01 1.8e+01 2.1e+01 3039 4.8e+00 1.0e+00
SD_curve[7] 1.2e+00 2.3e-03 1.3e-01 1.0e+00 1.2e+00 1.5e+00 3395 5.4e+00 1.0e+00
SD_curve[8] 5.0e-01 1.0e-03 6.0e-02 4.2e-01 5.0e-01 6.1e-01 3343 5.3e+00 1.0e+00
alpha_JC[1] 1.9e+03 3.3e-02 2.1e+00 1.9e+03 1.9e+03 1.9e+03 4000 6.4e+00 1.0e+00
alpha_JC[2] 1.9e+03 2.8e-02 1.8e+00 1.9e+03 1.9e+03 1.9e+03 4000 6.4e+00 1.0e+00
alpha_JC[3] 1.6e+03 2.2e-02 1.4e+00 1.6e+03 1.6e+03 1.6e+03 4000 6.4e+00 1.0e+00
alpha_JC[4] 1.3e+03 2.2e-02 1.4e+00 1.3e+03 1.3e+03 1.3e+03 4000 6.4e+00 1.0e+00
alpha_JC[5] 1.0e+03 2.6e-02 1.7e+00 1.0e+03 1.0e+03 1.0e+03 4000 6.4e+00 1.0e+00
alpha_JC[6] 8.0e+02 3.6e-02 2.3e+00 7.9e+02 8.0e+02 8.0e+02 4000 6.4e+00 1.0e+00
alpha_JC[7] 1.8e+03 6.0e-03 3.6e-01 1.8e+03 1.8e+03 1.8e+03 3556 5.7e+00 1.0e+00
alpha_JC[8] 1.8e+03 5.5e-03 3.3e-01 1.8e+03 1.8e+03 1.8e+03 3458 5.5e+00 1.0e+00
SD_alpha 1.6e+01 2.5e-01 8.0e+00 8.2e+00 1.4e+01 3.0e+01 989 1.6e+00 1.0e+00
B 1.7e+03 1.7e-01 8.6e+00 1.7e+03 1.7e+03 1.7e+03 2403 3.8e+00 1.0e+00
So far as I can see so far, the effective sample sizes are roughly similar, except for n_leapfrog__
, where it’s much larger for Cmdstan 2.17.
ETA: Looks like the effective sample size for treedepth__
is also much larger for Cmdstan 2.17.