"NumPy C-API based implementation for BLAS functions" Is it a problem?

I know this is an issue that has been asked about a few times, but I wasn’t able to find a conclusive answer to whether the Theano warning below is something to be concerned about.

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

I work on a Linux server and locally on a Mac and use a conda virtual environment in both, but only get this warning on the Linux server. Sometimes the Linux server is slower, but this could also be due to slower hardware than on my Mac. I am trying to fit a hierarchical model with many parameters and a lot of data on the Linux server, so I want to try to have it running as efficiently as possible.

My main questions are

1. Should I be concerned about this warning?
2. If I can address it, would PyMC3 NUTS sample faster?

How did you install pymc and theano? Did you follow the instructions found here?

Yes, below are the versions installed by conda.

# Name                    Version                   Build  Channel
pymc3                     3.11.4           py39ha563b64_1    conda-forge
theano-pymc               1.1.2            py39he80948d_0    conda-forge
mkl                       2021.4.0           h8d4b97c_729    conda-forge
mkl-service               2.4.0            py39h7e14d7c_0    conda-forge

Do you have gcc installed and, if so, what version?

Yes, I believe it was installed by conda in the virtual environment. If I run conda list gcc, I get the following output:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
gcc                       9.4.0                h192d537_4    conda-forge
gcc_impl_linux-64         9.4.0               h03d3576_11    conda-forge
gcc_linux-64              9.4.0                h391b98a_4    conda-forge
libgcc-devel_linux-64     9.4.0               hd854feb_11    conda-forge
libgcc-ng                 11.2.0              h1d223b6_11    conda-forge

Also, thank you for taking your time to think about this problem.

Also, on a related note (I think), below are the “blas” libraries installed in the virtual environment:

# Name                    Version                   Build  Channel
libblas                   3.9.0           12_linux64_openblas    conda-forge
libcblas                  3.9.0           12_linux64_openblas    conda-forge
libopenblas               0.3.18          pthreads_h8fe5266_0    conda-forge

Strange! Usually this is a windows problem. The only thing I can think of is that there is an environment variable somewhere that isn’t set quite right. @almostmeenal @ricardoV94 any clues?

The server has gcc and openblas installed already, too, but they are different versions. Do you think there could be something strange happening because of those? Are there any diagnostics I can run to help figure this out?

That could definitely be part of it. Which gcc does your $PATH pick up on?

2 Likes

That was the problem!

My PATH had, the following:

/n/app/conda2/bin
/home/jc604/.conda/envs/speclet/bin
/n/app/conda2/bin
...
/n/app/openblas/0.2.19/include
...
/n/app/gcc/6.2.0/bin
...
/n/app/conda2/condabin

Removing the other gcc from my PATH caused the warning to go away. I will update this post with whether or not that caused a substantial difference to the rate of sampling from the larger model.

Thank you @cluhmann for your help and patience. It is greatly appreciated!

2 Likes

I just posted the results from my experiment with running PyMC3 MCMC with and without the Theano BLAS warning. I didn’t find much of a difference. I’m curious to know what people with a better understanding of PyMC3 and Theano expected and if this is surprising or not.

2 Likes

@twiecki I saw your comment on Twitter, and trying to update to v4 is on my to-do list. If I can get it working on the cluster, then I’ll update this post with a comparison.

1 Like