-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Refactor MiniBatch and stop using deprecated MRG sampler #6304
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
Conversation
@ferrine this does not fix #4523, VI is still using the MRG RandomStream. This can't be switched yet because of #6277 Line 52 in 5da2617
Lines 872 to 895 in 5da2617
|
It does fix some lack of seeding, for which I think we don't have an issue open |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6304 +/- ##
==========================================
+ Coverage 94.71% 94.79% +0.07%
==========================================
Files 132 148 +16
Lines 26771 27488 +717
==========================================
+ Hits 25357 26058 +701
- Misses 1414 1430 +16
|
pymc/data.py
Outdated
from aesara.tensor.type import TensorType | ||
from aesara.tensor.var import TensorConstant, TensorVariable | ||
|
||
import pymc as pm | ||
|
||
from pymc.aesaraf import convert_observed_data | ||
from pymc.aesaraf import at_rng, convert_observed_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also get rid of at_rng
, as the seeds created by it will be overwritten in compile_pymc
anyway. Just import RandomStream
wherever it's needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
I think I saw that kernel crash in my PR, perhaps an out of bounds indexing? |
b16d9c4
to
b66929f
Compare
no idea why this windows test fails |
hmm, that could be the random stream! |
The issue that blocks the PR seems to be in aesara or I'm doing something wrong aesara-devs/aesara#1301 |
Maybe @brandonwillard or @ricardoV94 have any insights? |
@ferrine are some of these changes independent and could be merged via a separate PR already? |
Not really... The change led to some scan issues that need to be addressed otherwise it would lead to a regression |
Marked this as draft util we figure out the scan issue |
pymc/aesaraf.py
Outdated
from aesara.scalar.basic import Cast | ||
from aesara.tensor.basic import _as_tensor_variable | ||
from aesara.tensor.elemwise import Elemwise | ||
from aesara.tensor.random import RandomStream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the whole at_rng
and set_rng
related utilities below from this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_at_rng
is called by pm.sampling.parallel._Process._start_loop
.
In the interest of the v5 release I think we should take care of that later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, but it's only used by VI
@ferrine What do you think of doing the Minibatch API breaking change for V5, and fixing the MRG later, as that is not user facing anyway. |
That makes to me, we better get back to it later, than get stuck right now. It is also reasonable to improve minibatch API and VI experience later and reduce to something working now |
1e3b8da
to
3acef49
Compare
a3093be
to
9a19ef4
Compare
I marked the VI |
75b697b
to
f3dde69
Compare
@ferrine I squashed the commits so we can rebase-merge this. It looks like you have not set up your |
f3dde69
to
5c86134
Compare
5c86134
to
781fdef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳🚀
@ferrine can you have one last look and merge it if you agree with the changes? |
I had one more look at the PR changes and I don't have anything to add to it. I'll merge once tests pass. |
1218d0c
to
82dfbf6
Compare
Just fixuped the edit of the comment into the moyal logcdf commit. Didn't want to waste CI, so I merged it right away =) |
fix #4523, suspend #6273
closes #6277
@ricardoV94, I've figured out the root cause of the seeding bug