Search code examples
gpgpupymc3

How to use the GPU to speed up the Pymc3 sampling?


  1. I've used the 'njobs' parameter to get the multi-sample results, and it's far away from my expection

  2. I've changed the '.theanorc' file to set the 'floatX', 'cnmem' value, etc.

  3. I've monitored the GPU source by the command 'nvidia-smi', and it's well used

But, the sampling speed is already slow, even slower than the CPU.
Is that normal?


Solution

    1. This sounds like a problem of convergence or model construction, not related to njobs or parallelism. Without the model or traces there is not a lot that can be said here.

    GPU is still experimental and we've seen speed-ups for some models and slow-downs for others. ADVI seems to be easier to run on the GPU, though. You can also check that all your model types and input data are float32.