I’m using the within chain parallelization (with the function reduce-sum and partial-sum), and I was wondering if we could specify a seed to obtain the same results from a run to another run of the same model, please ?
Indeed, I’m able to specify a seed in the r part and the stan part of my model, leading to the same results from a run to another run of the same model when I don’t use the within chain parallelization.
However, when I use the within chain parallelization with a seed in the r part and the stan part, I don’t obtain the same results from a run to another run of the same exact model (with the same exact data also). So I was wondering If there is a way to specify a seed for stan to perform the same within chain parallelization each time?
Using threading makes things not easily reproducible in an exact way. You may get exact reproducibility if you use the static version of reduce_sum. This version chunks the large sum always in the same packets…and hence the choice of the grainsize is more important to choose well for good performance.
I’m guessing that @wds15 means the version without threading. To do that, you need to change the compiler flags to not use threading I believe. But I don’t know how to do that. @WardBrian or @stevebronder should know.