-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ENH: Compile the functions needed by SMC before the worker processes are started #7413
Comments
This is based on the issues that come from using The functions needed by SMC are compiled in Line 340 in ab467da
First function (inside Line 218 in ab467da
Second function (in Line 225 in ab467da
Finally, the functions used to calculate the prior probabilities and likelihoods are defined using the respective model properties. Here the issues come from using Lines 237 to 242 in ab467da
Is it possible that I think that the necessary fixes are
|
As a side note, isn't this Line 235 in ab467da
unnecessary? It makes shared variables from set(self.model.value_vars) - set(self.variables) but the set is always empty if I didn't miss any modifications to self.variables .
|
|
For the initial point, we could just pass the result for each chain instead of the function that computes the initial point? |
Oh, seems like a good choice to leave it as it is then if there's even a remote possibility to break something in the future. It doesn't cost much to include the check anyway.
Sounds good to me. |
No, I think this used to be how it worked back when SMC was just another step sampler. But since it hasn't been for a while it doesn't make sense to keep the code complexity around. We can always reintroduce |
Before
No response
After
No response
Context for the issue:
As explained in #7224,
sample_smc
can fail on Windows if the model is defined usingCustomDist
. Everything works on Linux because the worker processes are forked by default whereas they're spawned on Windows. Spawning leads to missing dispatches.#7241 addressed the issue by manually registering the dispatches in the worker processes. A better way to solve the problem would be to compile the necessary functions before starting the worker processes (as is done in
sample
).The text was updated successfully, but these errors were encountered: