Closed maresb closed 1 year ago
@maresb asked me to post the aesara config here in hopes that it will provide insight. Let me know if any other information will be helpful.
Thanks @opherdonchin for the extra info! I see that @brandonwillard has added the MWE needed
tag. Would it be possible for you to strip your current model to the bare minimum required to reproduce the error, and then post it here? Thanks!
Thanks @opherdonchin for the extra info! I see that @brandonwillard has added the
MWE needed
tag. Would it be possible for you to strip your current model to the bare minimum required to reproduce the error, and then post it here? Thanks!
We may also need the commands used to build the (virtual) environment in which this issue occurs from scratch.
Also, don't use PyMC in these reproductions.
Hi @brandonwillard ,
I don't know enough about aesara
to build an aesara
model without pymc
. Sorry about that.
I used a minimal environment for testing:
In response to @maresb request for the miminal model, this post includes the full minimal model (see below). In producing it, it seems to me that the key lines in the model may be:
beta = pm.Normal('beta', mu=0, sigma=1.5, dims=['process', 'measure'])
mu_y = pm.Deterministic('mu_y', pm.math.dot(x,beta), dims=['subject', 'measure'])
Because if these lines are replaced by the following:
beta = pm.Normal('beta', mu=0, sigma=1.5, dims=['measure'])
mu_y = pm.Deterministic('mu_y', beta, dims=['subject', 'measure'])
This error goes away (and is replaced with a different one).
Here is the full model:
In contrast, by commenting out the lines indicate and removing comments from the ones shown, I get the following:
I don't know enough about
aesara
to build anaesara
model withoutpymc
. Sorry about that.
That's fine, but it means that the PyMC-related work being done in this issue should be done in a PyMC issue or Discussion first (i.e. until the Aesara parts of the issue are understood and reproducible). The basic idea is that readers and/or developers here may know nothing about PyMC, so it's less likely that progress would be made here than elsewhere, and that increases the chances of this becoming a stale issue.
Agreed. I should have mentioned that I pinged @lucianopaz, and he intends to take a look at this (in particular in relation to #947) when he finds the time.
@opherdonchin, I reproduced your pymc model to see if I could dive into the issue further, but the model works for me.
I noticed that your aesara.config.blas__ldflags
says -lmkl_rt
only. Mine says: '-L"C:\\...\\anaconda3\\envs\\pymc-issue-test\\Library\\bin" -lmkl_core -lmkl_intel_thread -lmkl_rt'
. So the problem you are seeing is caused by the missing library directory in the blas__ldflags
. It's also strange that you don't have the other mkl libraries in those flags.
By any chance, are you attempting to modify the default blas__ldflags
? There are three ways to do so:
aesara.config.blas__ldflags
at the beginning of the script.aesararc
fileIf imagine that if you are not setting the aesara.config
value in your script, it's highly unlikely that you are using environment variables by mistake. I think that the most likely cause to your problem is that you have an .aesararc
file in one of the paths listed here that is leading to the incorrect blas flags setup. If you don't have this file, then this might indicate that there is some deeper problem with how aesara
sets the default blas__ldflags
(which I find very strange), or from where this configuration option is read.
Hi @lucianopaz !
Thanks for the suggestions. In the related PyMC discourse discussion, you suggested I try adding the line:
aesara.config.blas__ldflags = f'"-L{os.path.join(sys.prefix, "Library", "bin")}" -lmkl_core -lmkl_intel_thread -lmkl_rt'
And that works! At least, it works in the stripped down environment with the stripped down script I made for this issue. I'll check the full version later but I don't see why there should be a problem.
I tried following up on the suggestions here as well. I did not find an AESARA_FLAGS
or AESARARC
environment variable and I also did not find a $HOME$.aesararc
or $HOME\.aesararc.txt
. Thus, I don't know how the aesara
flags have gotten out of whack.
Is there a way to keep following this up beyond this point to identify the original problem? I mean, it is fixed for me, but it would be nice to know what went wrong.
Opher
I honestly don’t know how the blas flags could have gotten to the state they were. If you search for mkl in aesara you find that it’s set in a few scripts in the library, so I don’t understand what could have broken them. Maybe @brandonwillard has an idea?
Description of your problem or feature request
There is a report on Discourse about an issue from a Windows user regarding a linking problem. @lucianopaz believes the issue is related to #947:
Versions and main components
python -c "import aesara; print(aesara.config)"
)