-
-
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
Fix bug in NUTS variable assignment #4952
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4952 +/- ##
==========================================
+ Coverage 74.01% 74.06% +0.05%
==========================================
Files 86 86
Lines 13860 13862 +2
==========================================
+ Hits 10258 10267 +9
+ Misses 3602 3595 -7
|
We should add a minimal test. This seems to trigger it locally: import pymc3 as pm
with pm.Model() as m:
x = pm.Normal("x", 0, 1)
y = pm.Normal("y", 0, 1)
pm.sample(step=pm.Metropolis([m.rvs_to_values[x]]), chains=1, tune=10, draws=10) |
Getting this error on the Windows run it https://github.com/pymc-devs/pymc3/pull/4952/checks?check_run_id=3368890696#step:7:75 @Spaak, @michaelosthege do you happen to have any idea? These tests are all related to multiprocessing... |
Yes this is definitely caused by pickling (probably a step method), required when multiprocessing uses spawn (which is the default on Windows; POSIX OSes use fork). Default |
You might have missed it because the tests were marked as xfail for other reasons (the one addressed in this PR) |
Yes that's probably what happened. I'll work on a fix now, which I'll file as a separate PR (rather than push commits here) to keep the commit history on main clean (I don't yet know how much code I'll have to touch). |
Sure, but if you find it easier, feel free to force push a clean history to this PR. The bugfix that is revelant to this PR is really just those two lines that @aloctavodia changed in |
Apologies; |
@Spaak any chances something similar was needed for this other failing test? |
@ricardoV94 I did make the same changes to |
Didn't notice. Thanks. One of the changed test seems to have failed though |
8cc2e7e
to
e721e11
Compare
Oh well... that |
Hmm after your force push the |
It fails locally for me (regardless of floatX), so I think it is just a weird fluke |
Yep good idea |
Thanks @aloctavodia and @Spaak |
This is a bug I found while working on bringing BART to V4 #4914. NUTS should use the variables passed to the sampler and not get them from the model. @ricardoV94 recommend having this fix in its own PR and separated from the BART PR.