-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multicore inference not working #445
Comments
I'm sorry but I cannot reproduce your error. I'm using Ubuntu 20.4.3 LTS, so that makes me think that may be a macOS specific problem. Do you have another computer to test the same code? I'm not familiar with macOS at all. I could try to bring some folks who use macOS to this issue. |
Just for reference I use both a Mac and an Ubuntu system and on the Mac @dharasim code worked fine. The error is not reproducible on my side either.
I am on macOS 11.5.2. It seems to me that this is Python-related rather than |
Thank you very much for the suggestion! I tried it, installing pymc3 and bambi in a clean conda environment, but I get the same error unfortunately. |
Do PyMC3 works? Can you try running: https://docs.pymc.io/en/v3/pymc-examples/examples/generalized_linear_models/GLM-binomial-regression.html (so we take |
Indeed, I get the same error running that code. So I confirm it's not a bambi issue. |
This pymc3 issue seems to be relevant: pymc-devs/pymc#3140 One possible workaround is to wrap the sampling into an if statement: import bambi as bmb
import pandas as pd
import numpy as np
data = pd.DataFrame({
"y": np.random.normal(size=50),
"x1": np.random.normal(size=50),
"x2": np.random.normal(size=50)
})
if __name__ == '__main__':
model = bmb.Model("y ~ x1 + x2", data)
fitted = model.fit()
print('done') This code works for me. |
@dharasim thanks for reporting a possible solution! I was completely unaware of this problem. Glad you found a solution! |
First of all, thank you very much for working on this great project!
My issue is that even for very simple models, running chains on multiple cores doesn't work.
Content of test_bambi.py:
Output:
However, if I set
model.fit(cores=1)
it runs the chains sequentially and succeeds.I used a fresh installation in a virtual env with python 3.9.7 on macOS 11.6 on a machine with a 2.6 GHz 6-Core Intel Core i7.
The text was updated successfully, but these errors were encountered: