Skip to content
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

Only sample using a single thread when sampling multiple chains in parallel #5453

Open
Tracked by #7053
twiecki opened this issue Feb 9, 2022 · 1 comment
Open
Tracked by #7053

Comments

@twiecki
Copy link
Member

twiecki commented Feb 9, 2022

My prior of what cores=4 does when calling pm.sample() is that pymc would use 4 of my cores. However, because of multi-threading this might not be the case. Furthermore, multi-threading is causing problems when running multiple chains in parallel: #3140

I thus think we should set os.environ['OMP_NUM_THREADS'] = '1' if we're sampling on > 1 core.

@twiecki
Copy link
Member Author

twiecki commented Feb 9, 2022

One other approach would be to add a kwarg to sample(threads=1) that defaults to 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant