-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add support for random Generators in Numba backend #691
Conversation
bfcb8e1
to
caeaf02
Compare
d4fbab6
to
1dd479a
Compare
Size and rng copy are now supported |
1aed284
to
769809e
Compare
@aseyboldt Elemwise is working again in case you want to benchmark before/after |
762bcad
to
e2382de
Compare
e2382de
to
d4f6070
Compare
b770467
to
372efd6
Compare
372efd6
to
d46f085
Compare
26009f7
to
113a594
Compare
Here is a test snippet: %env NUMBA_DISABLE_ERROR_MESSAGE_HIGHLIGHTING=1
import colorama
import pytensor
import pytensor.tensor as pt
import numpy as np
x = pt.vector("x", shape=(5,), dtype="float64")
out = pt.psi(x) * 2
fn = pytensor.function([x], out, mode="NUMBA")
x_test = np.random.uniform(size=5)
fn(x_test) Not setting that variable will lead to the warning showing up (if colorama can be imported) |
Tests pass with a77df24 My only concern is that users with colorama will see the warning. I don't know how to filter that kind of messages, and also agree that filtering any NumbaWarning is a tad too much. Should we perhaps ask Numba to have a subclass for caching warnings? Perhaps that would be more reasonable to filter by default? For clarity there's a sort of regression when we introduced the |
a77df24
to
1dead4c
Compare
Ok fixed with some regex, I was being tripped by multiple bold escape codes... |
1dead4c
to
59d2ca7
Compare
Marking as a draft because I want to merge a bugfix and do a release before this major changes get in |
Sounds like you had a fun afternoon. |
…from a node, for readability
Co-authored-by: Jesse Grabowski <48652735+jessegrabowski@users.noreply.github.com> Co-authored-by: Adrian Seyboldt <aseyboldt@users.noreply.github.com>
…rop support for RandomState Co-authored-by: Adrian Seyboldt <aseyboldt@users.noreply.github.com> Co-authored-by: Jesse Grabowski <48652735+jessegrabowski@users.noreply.github.com>
59d2ca7
to
69111c8
Compare
Good one! |
Description
TODO:
Related Issue
RandomVariable
treatssize=()
assize=None
#568Checklist
Type of change