Skip to main content
QUICK REVIEW

[Paper Review] A fast vectorised implementation of Wallace's normal random number generator

Richard P. Brent|arXiv (Cornell University)|Apr 19, 2010
Numerical Methods and AlgorithmsComputer Science17 references11 citations
TL;DR

This paper presents RANN4, a fast vectorized implementation of Wallace's normal random number generator that uses orthogonal matrix transformations on pools of normally distributed variates to generate new variates without relying on uniform random number streams or transcendental functions. It achieves over three times the speed of traditional methods like Box-Muller and Polar on vector processors such as the Fujitsu VP2200 and VPP300, with a performance of just 6.4 cycles per variate using a conservative throw-away factor of f=3.

ABSTRACT

Wallace has proposed a new class of pseudo-random generators for normal variates. These generators do not require a stream of uniform pseudo-random numbers, except for initialisation. The inner loops are essentially matrix-vector multiplications and are very suitable for implementation on vector processors or vector/parallel processors such as the Fujitsu VPP300. In this report we outline Wallace's idea, consider some variations on it, and describe a vectorised implementation RANN4 which is more than three times faster than its best competitors (the Polar and Box-Muller methods) on the Fujitsu VP2200 and VPP300.

Motivation & Objective

  • To develop a high-performance normal random number generator suitable for vector and parallel architectures.
  • To eliminate reliance on uniform random number streams and elementary functions like log, sqrt, sin, and cos in normal variate generation.
  • To achieve performance approaching that of fast uniform random number generators on vector processors.
  • To ensure statistical robustness through careful parameter selection and error monitoring in the implementation.

Proposed method

  • The method uses orthogonal matrix transformations (e.g., rotation matrices) to generate new normal variates from existing ones in a pool, preserving the sum of squares and ensuring normality.
  • A pool of nN normally distributed numbers is regenerated using N matrix-vector multiplications, with n typically set to 2 or 4 for efficiency.
  • Integer constants α, β, γ, δ are used to define non-unit strides in the transformation, ensuring statistical independence and reducing correlation in extreme values.
  • A throw-away factor f is applied to discard initial values from each pass, reducing correlation in outlier magnitudes and improving statistical properties.
  • The implementation monitors the sum of squares to detect drift due to rounding errors, enabling runtime correction and error detection.
  • The generator is implemented on Fujitsu VP2200 and VPP300 systems, leveraging vector instruction-level parallelism for high throughput.

Experimental results

Research questions

  • RQ1Can Wallace’s normal random number generator be efficiently vectorized to achieve performance close to that of fast uniform generators on vector processors?
  • RQ2How do statistical properties such as moment consistency and uniformity of transformed variables depend on the choice of parameters like the throw-away factor f?
  • RQ3What is the impact of orthogonal matrix transformations with non-unit strides on the correlation structure of extreme values in the output sequence?
  • RQ4Can the generator maintain statistical quality without relying on external uniform random number streams or transcendental function evaluations?

Key findings

  • RANN4 achieves a performance of 6.4 cycles per normal variate on the Fujitsu VP2200/10 with f=3, representing a 3.2x speedup over the previously fastest method, RANN3 (21.9 cycles).
  • On the VPP300, the performance is approximately 11.4 nsec per variate (f=3), or 5.4 nsec with f=1, demonstrating a two-fold performance gain over the VP2200.
  • Statistical tests show that the transformed variables u = exp(-(x²+y²)/2) and v = arctan(x/y) are uniformly distributed, with χ² statistics indicating no significant deviation from uniformity for f ≥ 1.
  • The fourth moment of the generated variates is significantly small at the 5% confidence level for f=1, indicating increased correlation in extreme values; this effect is mitigated for f ≥ 3.
  • The sum of squares is monitored to detect drift from rounding errors, and the method successfully detects memory corruption when the work area is overwritten.
  • Independent streams of random numbers can be generated on multiple processors in a vector-parallel system like the VPP300 without inter-processor communication after initialization.

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.