Using NumPy C-API based implementation for BLAS functions

Not sure if this is the right place to post this, if not please lmk.

import exoplanet
import numpy as np
import pandas as pd
import lightkurve as lk
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.timeseries import BoxLeastSquares

import exoplanet as xo
import pymc3 as pm
import aesara_theano_fallback.tensor as tt

import pymc3_ext as pmx
from celerite2.theano import terms, GaussianProcess```
When I run this I get: 

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

This warning doesn't stop the code but It does make it extremely slow.
Is there anyway to fix this I am on windows using conda.

I had similar problem with my installation and the following worked for me. Check with conda list if you have mkl-service installed. If so, check .theanorc in your %USERPROFILE% and add the section below:

[blas]
ldflags = -LC:\Anaconda\envs\<your_environment_name>\Library\bin -lmkl_core -lmkl_intel_thread -lmkl_rt

Alternatively, you can set up a local env variable:

set THEANO_FLAGS=device=cpu, blas.ldflags=-L"%CONDA_PREFIX%\Library\bin" -lmkl_core -lmkl_intel_thread -lmkl_rt
1 Like

Thank you I don’t get that warning anymore after using the first section, but now I can’t create models. This is the error I get,

Exception: ('The following error happened while compiling the node', CGemv{inplace}(AllocEmpty{dtype='float64'}.0, TensorConstant{1.0}, Reshape{2}.0, Elemwise{Composite{((i0 * i1) / i2)}}[(0, 1)].0, TensorConstant{0.0}), '\n', "Compilation failed (return status=1): <command-line>:0:1: error: macro names must be identifiers\r. cc1plus.exe: warning: unrecognized command line option '-Wno-c++11-narrowing'\r. ", 'FunctionGraph(CGemv{inplace}(<TensorType(float64, vector)>, TensorConstant{1.0}, <TensorType(float64, matrix)>, <TensorType(float64, vector)>, TensorConstant{0.0}))')

Please see this recently resolved issue or maybe this one or this one. This one is still open and looks similar as well.