I’m working on accelerating the fitting of my hierarchical model by augmenting the number of CPU cores utilized. As I understand, PyMC3 utilizes half of the cores by default (which is also my experience on different computers at differing number of CPU cores).
In contrast to
pm.sample(), there is no
As the VI interface of PyMC3 uses scipy for the optimization, I tried to augment the number by setting some environment variables to the maximum number of cores:
os.environ[‘MKL_NUM_THREADS’] = ‘20’
os.environ[‘OPENBLAS_NUM_THREADS’] = ‘20’
os.environ[‘OMP_NUM_THREADS’] = ‘20’
os.environ[‘NUMEXPR_NUM_THREADS’] = ‘20’
Nonetheless, the computation still only utilizes half of the cores. However, by setting the environment variables to a number smaller than half of the cores, the number of actually utilized cores is limited, which works fine.
Is there a way to augment the number of cores utilized in the PyMC3 VI interface? This would be of great help.