You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a model is compiled with STAN_THREADS and uses a function such as map_rect or reduce_sum, this will lead to the model spawning multiple threads during each call to the log density.
Currently, the model is allowed to spawn up to the hardware number of threads, which means if it is done in a loop which is also parallel on the "outside" you get oversubscription.
The Stan Math library lets you set the maximum number of threads by using init_threadpool_tbb.
We could just expose this, but it has some issues, most notably that calling it multiple times has no effect.
Similar to the print callback, this will also globally apply to all instances from the same shared library.
The text was updated successfully, but these errors were encountered:
If a model is compiled with
STAN_THREADS
and uses a function such asmap_rect
orreduce_sum
, this will lead to the model spawning multiple threads during each call to the log density.Currently, the model is allowed to spawn up to the hardware number of threads, which means if it is done in a loop which is also parallel on the "outside" you get oversubscription.
The Stan Math library lets you set the maximum number of threads by using
init_threadpool_tbb
.We could just expose this, but it has some issues, most notably that calling it multiple times has no effect.
Similar to the print callback, this will also globally apply to all instances from the same shared library.
The text was updated successfully, but these errors were encountered: