# Brew a Parallel RNG?

**URL:** <https://discourse.julialang.org/t/brew-a-parallel-rng/30286>\
**Category:** Performance\
**Created:** [October 25, 2019, 5:10am UTC](https://discourse.julialang.org/t/brew-a-parallel-rng/30286 "2019-10-25T05:10:11Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [October 26, 2019, 7:46am UTC](https://discourse.julialang.org/t/brew-a-parallel-rng/30286/5 "2019-10-26T07:46:25Z")

</div>

I fond what Guy Steele mentioned in the last half of this talk interesting:

[![](https://global.discourse-cdn.com/julialang/original/3X/c/e/ce0b1e884ff882ad64dbd60f1729f65ccc3ffd4e.jpeg "Keynote with Guy Steele") ](https://www.youtube.com/watch?v=0hlBkQ5DjaY)

IIRC there is a type of SRNG that can be split in such a way that the distribution of resulting streams combined is equivalent to the original stream (or something like that). It would be nice to look into (probably some follow up studies of):

[http://supertech.lcs.mit.edu/papers/dprng.pdf](http://supertech.lcs.mit.edu/papers/dprng.pdf)

> **[Parallel random numbers: As easy as 1, 2, 3](https://ieeexplore.ieee.org/abstract/document/6114424)**
>
> Most pseudorandom number generators (PRNGs) scale poorly to massively parallel high-performance computation because they are designed as sequentially dependent state transformations. We demonstrate that independent, keyed transformations of counters...

which were mentioned in the talk.

My understanding is that this would guarantee that parallel computation result with SRNG to be deterministic even when the scheduler is dynamic (as in Julia), ~~if you construct the computation as some combination of map/filter/reduce/etc.~~ (edit: hmm… wait, does it work for any computation?)

---

_[View the full topic](https://discourse.julialang.org/t/brew-a-parallel-rng/30286)._
