-
Notifications
You must be signed in to change notification settings - Fork 407
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 deterministic random number generator #857
Comments
Args, I knew you would ask for this. On CPUs it is already deterministic. I have to think about how to do that on the GPU without screwing with the whole GPU backend implementation. |
Would you terribly mind if the randomness of the numbers would degrade somewhat (i.e. if it doesn't reach quite as good a degree of randomness as with what it does during release mode)? |
For debugging, correlations in the random numbers don't really matter. It would also be nice for regression testing if I always got the same results on CUDA and could use a tighter tolerance. |
I need to think about this though--there may be other sources of non-determinism besides the RNG. |
To use the RNG's deterministicly via solution #1066 , the application has to do something like this code snippet to initialize the random pool:
And then use the
So as long as each Note: Depending on how many work items you have, you could have significantly more state saved than when letting Kokkos manage the number of RNG pool items to use. |
The above text refers to the solution implemented in #1066. |
A deterministic random number generator (i.e. it gives the same random numbers regardless of how many threads) would be helpful for debugging, especially for CUDA. I don't care how slow it is.
The text was updated successfully, but these errors were encountered: