After I updated Anaconda, sampling with Pymc3 became very slow

Before I updated the anaconda, the time sampling used is followed.

Sampling 2 chains, 8,086 divergences: 100%|██████████| 40000/40000 [2:33:41<00:00, 4.34draws/s]

But using updated anaconda with less ‘draws’ and ‘tune’, the time is time required for sampling is significantly long as followed:

0.17% [67/40000 23:43<235:43:31 Sampling 2 chains, 0 divergences]

I wonder that something wrong with CPU? or the difference of installation with ‘pip’ and ‘conda’?

Yes, installing via pip will not use mkl, we strongly encourage you to install via conda.

I tried to reinstall pymc3, but it seems encountered an error.

Please check this.

@twiecki, what if mkl and other dependencies are installed using conda-forge before, and then pymc3 installation is done using pip (as suggested in Installation Guide (Windows) · pymc-devs/pymc3 Wiki · GitHub). Would you recommend using just conda or, if the dependencies are already installed via conda, pip could be used for an efficient setup?

I’m asking that because this procedure (conda for dependencies, then pip) was the only one that seemed to work cleanly for me while doing a environment setup in Windows 10. Using only conda-forge implied in some warnings related to BLAS.

@Jym0502, btw, I think you should try the procedure described in Installation Guide (Windows) · pymc-devs/pymc3 Wiki · GitHub for creating a fresh new enviroment config.

@rladeira Yes, that’s a good work-around for now: install theano-pymc/aesara using conda and then pymc3 using pip.

1 Like

I reinstalled pymc3 by conda, but the sampling is still slow, almost 10 times slower than before I updated the anaconda.

I reinstalled my pymc3 by anaconda, but the sampling speed is quite slow, almost 10 times slower than before I updated my anaconda.

So I tried to find the reason from warning:

  • Firstly,
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
C:\Users\admin\anaconda3\lib\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
  warnings.warn("DeprecationWarning: there is no c++ compiler."
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.

Although I try to install m2w64-toolchain, I cannot slove this warning.
I found how to install g++ but failed.

Here is my version of m2w64:

m2w64-binutils 2.25.1 5 conda-forge
m2w64-bzip2 1.0.6 6 conda-forge
m2w64-crt-git 5.0.0.4636.2595836 2 conda-forge
m2w64-gcc 5.3.0 6 conda-forge
m2w64-gcc-ada 5.3.0 6 conda-forge
m2w64-gcc-fortran 5.3.0 6 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gcc-objc 5.3.0 6 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-headers-git 5.0.0.4636.c0ad18a 2 conda-forge
m2w64-isl 0.16.1 2 conda-forge
m2w64-libiconv 1.14 6 conda-forge
m2w64-libmangle-git 5.0.0.4509.2e5a9a2 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
m2w64-make 4.1.2351.a80a8b8 2 conda-forge
m2w64-mpc 1.0.3 3 conda-forge
m2w64-mpfr 3.1.4 4 conda-forge
m2w64-pkg-config 0.29.1 2 conda-forge
m2w64-toolchain 5.3.0 7 conda-forge
m2w64-toolchain_win-64 2.4.0 0 conda-forge
m2w64-tools-git 5.0.0.4592.90b8472 2 conda-forge
m2w64-windows-default-manifest 6.4 3 conda-forge
m2w64-winpthreads-git 5.0.0.4634.697f757 2 conda-forge
m2w64-zlib 1.2.8 10 conda-forge

  • Secondly,
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

From here, I knew that it seems to be the reason for the slow sampling, but I tried the code as followed,

conda install numpy scipy mkl
conda install theano pygpu
conda install pymc3

but nothing changed. The warning stills occurred.



And after I created a new enrvironment with the procedure of Installation Guide (Windows) · pymc-devs/pymc3 Wiki · GitHub.
Error occurred to MAP and NUTS.



Exception on NUTS.