2086355985
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[10], [line 2](vscode-notebook-cell:?execution_count=10&line=2)
[1] print(np.random.randint(2**31))
----> [2] jax.random.PRNGKey(np.random.randint(2**31 + 1))
File numpy\\random\\mtrand.pyx:780, in numpy.random.mtrand.RandomState.randint()
File numpy\\random\\_bounded_integers.pyx:1423, in numpy.random._bounded_integers._rand_int32()
ValueError: high is out of bounds for int32
The origin of the problem seems to come back to Numpy actually. Numpy uses C long for np.int_ and in Microsoft even on a 64-bit system long int is 32-bit.
I'll make a PR to make that change, assuming that dealing with 32-bit systems was the reason choosing 2**32 was chosen initially.
Running into an issue where I get
ValueError: high is out of bounds for int32
trying to run any alternative backends on Windows.MWE setup:
This fits fine:
However this fails:
I get the same error with:
pseudo_fit = pseudo_mod.fit(tune=5, draws=5, inference_method="blackjax_nuts")
This creeps up on Windows only, it's not replicable on my m1 macbook air with the exact same package install.
The issue seems to be with the jax random number generator key:
jax_seed = jax.random.PRNGKey(np.random.randint(2**32 - 1))
I tested this and the highest value that I don't get an error is
2**31
(my guess here is a 32 bit system that includes space for2^0
?)gives
The origin of the problem seems to come back to Numpy actually. Numpy uses C
long
fornp.int_
and in Microsoft even on a 64-bit systemlong int
is 32-bit.I'll make a PR to make that change, assuming that dealing with 32-bit systems was the reason choosing
2**32
was chosen initially.