Google colab WARNING:aesara.tensor.blas:We did not find a dynamic library in the library_dir of the library we use for blas

I used the below code to install and import pymc on google colab.

! pip install pymc 
import pymc as pm

For every model I ran, it has a warning as below:
WARNING:aesara.tensor.blas:We did not find a dynamic library in the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.

My model is as below. Each iteration takes about 8 seconds.

with pm.Model() as model:  
  ## parameters to estimate 
  # coefficient of x
  b0_e = pm.Normal('b0', 0, sigma = 100)
  b1_e = pm.Normal('b1', 0, 100, shape= x.shape[1])

  # portion of non-zero
  pi_e = pm.Beta("pi", alpha=1, beta=1)

  # negative binomial - alpha
  alpha_e = pm.Gamma("alpha", alpha=1, beta=1)

  ## get the mu
  mu_u = np.exp(b0_e + pm.math.matrix_dot(x, b1_e))
  
  likelihood = pm.ZeroInflatedNegativeBinomial('y', psi = pi_e, mu = mu_u, alpha = alpha_e, observed = y)

  # Inference!
  # draw 3000 posterior samples using NUTS
  trace = pm.sample(2000, return_inferencedata=True)

If I install pymc3 (! pip install pymc3), then there is also a similar warning below
WARNING:theano.tensor.blas:We did not find a dynamic library in the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.

However, with pymc3 and the exact same code and data, each iteration takes 1.2 seconds.

I wonder if there is anyone knows why there is a large difference between using pymc3 and pymc4. And how to resolve the warning and hopefully increase the speed. Thanks!

@RavinKumar

@yeliu929 There’s some changes coming down the line with the software stack. The realistic answer right now honestly waiting in two ways. As much as its painful just wait the extra time for your sampler to converge. If its a big issue then use something other than colab.

The other waiting is for an announcement from the PyMC team. We’re still as committed as ever to making great PPLs and fast sampling certainly is a must have

1 Like