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

Prior class makes it impossible to pickle distribution makers #830

Open
JanWeldert opened this issue Sep 30, 2024 · 0 comments
Open

Prior class makes it impossible to pickle distribution makers #830

JanWeldert opened this issue Sep 30, 2024 · 0 comments

Comments

@JanWeldert
Copy link
Contributor

The Prior class uses a lot of lambda functions and not top-module level functions (e.g. llh within the _init* functions). That makes it impossible to pickle them. That is an issue, because multiprocessing uses pickle. So we can not pass a distribution maker as an argument to any process parallelized with multiprocessing.
I have encountered this problem while trying to parallelize a MCMC sampling algorithm. This algorithm needs a metric function which itself gets an distribution maker as argument.
For now the MCMC sampling function in analysis will only support single CPU execution (very slow), I will add an multi CPU workaround to the MCMC example notebook.

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

No branches or pull requests

1 participant