Skip to content
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

Counter based random number generators? #710

Open
tdd11235813 opened this issue Dec 10, 2018 · 1 comment
Open

Counter based random number generators? #710

tdd11235813 opened this issue Dec 10, 2018 · 1 comment

Comments

@tdd11235813
Copy link
Contributor

tdd11235813 commented Dec 10, 2018

I am looking for an efficient way to obtain the same pseudo random numbers being independent of the backend and parallelization. The focus is on parallel RNG, so it can be easily mapped to serial execution.

Counter/Index based RNGs (1, 2, 3) are also lightweight (stateless) and fast in the parallel environment, and therefore used in parallel Monte-Carlo etc.
Other RNGs also offer streams and sub-streams like MRG32k3a with "fast enough" jump aheads and also might offer better quality than CBRNGs, but have states, are slower (e.g., for CBRNG skip-ahead is O(1)) and might be more tricky to use it correctly in parallel environment.

With rocRAND/hipRAND and cuRAND we have RNGs suited for parallel reproducible random number generation, and they also include counter based RNGs. It looks like alpaka does not provide wrapper for it and the host side does not even have support for it.
Random123 could be a library for this gap, because it offers CBRNGs and has CPU as well as CUDA and OpenCL backends, although CPU would be the interesting part for now.

Related to: #390 (unify RNG selection), #610 (Monte Carlo example), upcoming N-body project for mephisto (with real physics ;))

PS: Philox is an CBRNG, and here is rocRAND's implementation

Edit: just want to add that pregenerating random numbers and using them via a table-based approach is not useful, when you have to generate a huge number of them.

@j-stephan
Copy link
Member

We discussed this in today's meeting. @sliwowitz is currently working on a separate RNG library on top of alpaka that will adress this issue. This is therefore WONTFIX and will be closed once the new RNG library is public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants