Skip to content
Discussion options

You must be logged in to vote

For a full discussion of the considerations that went into choosing the ThreeFry RNG, you can see the relevant design doc, as well as the paper that JAX's current PRNG implementation is based on: http://www.thesalmons.org/john/random123/papers/random123sc11.pdf

A couple points on how it improves over the Mersenne Twister within the context that JAX is designed for:

  1. Space efficiency: JAX's current implementation of ThreeFry uses a PRNG Key of size 64 bits, while the Mersenne Twister requires over 20000 (you can see this, e.g., by printing np.random.get_state())
  2. Parallelism: threefry is well-suited to massively parallel architectures (the MT model of a global state makes this challenging)
  3. J…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@EngineerKhan
Comment options

@jakevdp
Comment options

@EngineerKhan
Comment options

@jakevdp
Comment options

Answer selected by EngineerKhan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants