Open iguinn opened 2 years ago
@iguinn numpy.random()
does have an out
argument that does in-place array filling, can't that do the job?
I guess we will then wrap NumPy's random
functions to include an out
argument? Maybe we can also do it generically with meta-programming?
From the Numba docs, looks like their implementation is thread-safe (except when using Generator
s).
To control random number sequences, as far as I understand, we will have to make sure to seed both the Numba and the NumPy random generator (see note here)
@jasondet can you elaborate?
It could be useful to generate random numbers in a ProcessingChain. One use for this would be in pulse generation. An example of what such a processing chain config might look like is:
However, right now it's not clear what RNG processors we could use. The numpy.random generators to do not work with in place array filling. The same is true of the scipy.stats generators. Numba seems to have support for random number generation, but I'm not sure how it works yet. We also want to make sure that we can control the seeding of the RNGs, and make sure that this would work for multi-threading.
Here are the features we want for our RNG processors: 1) Fill output array in place (i.e. have an
out
argument) 2) Have a way to set initial seeds 3) Robust for multithreaded and MPI