Skip to main content
QUICK REVIEW

[Paper Review] Variants of Mersenne Twister Suitable for Graphic Processors

Mutsuo Saito, Makoto Matsumoto|arXiv (Cornell University)|May 27, 2010
Chaos-based Image/Signal EncryptionComputer Science16 references11 citations
TL;DR

This paper proposes MTGP, a Mersenne Twister variant optimized for GPU architectures, leveraging massive parallelism by sharing a single large state space across many threads to achieve long periods and high-dimensional equidistribution. It also introduces MTGPDC, a parameter generator that creates up to 2^32 distinct, high-quality parameter sets for independent random streams, enabling scalable use in large GPU grids with strong statistical guarantees.

ABSTRACT

This paper proposes a type of pseudorandom number generator, Mersenne Twister for Graphic Processor (MTGP), for efficient generation on graphic processessing units (GPUs). MTGP supports large state sizes such as 11213 bits, and uses the high parallelism of GPUs in computing many steps of the recursion in parallel. The second proposal is a parameter-set generator for MTGP, named MTGP Dynamic Creator (MTGPDC). MT- GPDC creates up to 2^32 distinct parameter sets which generate sequences with high-dimensional uniformity. This facility is suitable for a large grid of GPUs where each GPU requires separate random number streams. MTGP is based on linear recursion over the two-element field, and has better high-dimensional equidistribution than the Mersenne Twister pseudorandom number generator.

Motivation & Objective

  • To design a pseudorandom number generator (PRNG) that efficiently exploits the massive parallelism of GPUs while maintaining high statistical quality.
  • To overcome the limitations of per-thread PRNGs on GPUs, which suffer from small state spaces due to limited fast memory.
  • To enable independent random number streams for large-scale GPU grids, where each GPU or thread requires a unique, uncorrelated sequence.
  • To develop a parameter generator that systematically creates high-quality, distinct parameter sets with embedded IDs for scalable deployment.
  • To ensure strong equidistribution and minimal linear dependencies across generated sequences, especially for high-dimensional simulations.

Proposed method

  • MTGP uses a single large state space (e.g., 11213 bits) shared across multiple GPU threads, enabling long periods and high-dimensional equidistribution.
  • The algorithm applies the Mersenne Twister recursion in parallel across threads, with state stored in shared memory for fast access and coalesced memory access patterns.
  • MTGPDC generates parameter sets by embedding a 32-bit ID into the recursion parameters, ensuring independence between streams with different IDs.
  • The parameter generation process selects irreducible characteristic polynomials and tempering parameters to maximize equidistribution up to high dimensions.
  • MTGP uses CUDA kernels to generate pseudorandom numbers in global memory, with state persistence across kernel calls via synchronization and state reloading.
  • The design accounts for GPU memory hierarchy: registers per thread, shared memory per block, and global memory for persistent state and output.

Experimental results

Research questions

  • RQ1Can a single large-state PRNG be efficiently parallelized across thousands of GPU threads to achieve both high performance and high statistical quality?
  • RQ2How can parameter sets for a GPU-optimized PRNG be generated dynamically to ensure independence and high equidistribution across thousands of independent streams?
  • RQ3What is the impact of embedding a unique ID in the recursion parameters on the statistical independence and equidistribution of generated sequences?
  • RQ4How does MTGP compare to existing GPU PRNGs in terms of speed, period length, and statistical robustness?
  • RQ5To what extent does the shared-state design mitigate the trade-off between state size and parallelism in GPU PRNGs?

Key findings

  • MTGP achieves high performance comparable to the fastest GPU PRNGs, such as CURAND (1.7× faster), while offering superior statistical guarantees in terms of equidistribution and period length.
  • MTGP passes all BigCrush statistical tests except those measuring F2-linear dependency, a known limitation shared with Mersenne Twister and WELL, which does not impair practical simulation quality.
  • MTGPDC generates up to 2^32 distinct parameter sets for each of the periods 2^11213−1, 2^23209−1, and 2^44497−1, each with high-dimensional equidistribution properties.
  • The gap between theoretical and realized equidistribution dimensions in MTGP is smaller than in the original Mersenne Twister, indicating improved statistical quality for the same storage footprint.
  • The use of distinct irreducible characteristic polynomials and ID-embedded parameters reduces the risk of correlation between streams, enhancing independence in large-scale GPU deployments.
  • MTGP’s shared-state design allows efficient use of GPU memory hierarchy, with state stored in shared memory and outputs written to global memory, enabling state persistence across kernel launches.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.