Repository navigation
Experimenting with Threefry and Pallas on TPU #41871
Unanswered
pascalMontmory
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I've been working on my own PRNG, Montmory, for several months. While porting it to TPU, I also started experimenting with compiling Threefry myself using Pallas and exploring optimizations to improve performance.
Here are some results from a single session on one TPU v5 lite, with JAX/jaxlib 0.10.2. These measure output-buffer generation; GB/s uses decimal bytes, while MiB denotes binary output sizes.
Confirmation used seven new seeds, with nine measurements per seed, after a separate search phase. Reported throughput is derived from the median of the per-seed median times. Timing includes the host call, allocation and completion wait; compilation, key preparation, host transfers and output checks are excluded.
The Threefry Pallas kernel retains all 20 rounds. Its tested outputs match the JAX Threefry reference, and Montmory's match its CPU reference. Hashes of timed outputs were checked outside the timing window; RBG was checked only for repeatability on the same backend.
Threefry Pallas remains faster than Montmory in these measurements. The RBG row is the measured JAX/XLA path, not a direct measurement of the hardware PRNG's maximum throughput. These are generation benchmarks, not application speedups or results across multiple TPU generations.
Public research record (code, protocols, measurements, limitations):
https://github.com/pascalMontmory/montmory-prng-research
Documentation is available in English and French; see the repository license and third-party notices for usage terms.
The result links above point to the exact published revision. My GitHub profile: pascalMontmory.
Pascal
All reactions