Parallel Random Number Generator Matrix State Arrangement
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The Mersenne Twister random number generator faces challenges in parallel processing due to high memory usage and frequent inter-thread communications, limiting its efficiency on multi-core processors and GPUs, resulting in inefficient utilization of high-performance hardware.
Innovation Solution
The state elements are arranged into a matrix with incremental indexing, allowing for efficient parallel processing by minimizing inter-thread communications, where each thread processes a section of the matrix with reduced inter-thread interactions, optimizing the use of hardware resources.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional MT19937 generator is implemented with large memory space to store state elements, then the quality and period of random numbers are improved, but the parallel processing efficiency deteriorates due to heavy inter-thread communication overheads
Solution Approach 1:
The patent divides the state elements into multiple blocks, with each block containing multiple state elements. Each thread processes one block independently, reducing inter-thread communication overhead while maintaining the full state space required for high-quality random number generation. This segmentation allows parallel processing of multiple generators simultaneously without requiring frequent synchronization between threads.
2Speed
If more threads are assigned to process state elements in parallel, then the computation speed is improved, but the inter-thread communication overhead increases
Solution Approach 1:
By organizing state elements into blocks that can be independently processed by different threads, the patent enables scalable parallelism where each thread works on its own block with minimal communication requirements. This segmentation strategy allows the system to efficiently utilize multiple cores or GPU streaming multiprocessors without proportionally increasing communication overhead.
Solution Approach 2:
The patent transforms the traditional linear organization of state elements into a two-dimensional block structure, where threads process blocks in parallel. This dimensional reorganization allows independent processing within each block while reducing the frequency and complexity of inter-thread communications, effectively adding a spatial dimension to the parallel processing architecture.
3Speed
If the state elements are stored in fast shared memory of GPU, then the access speed is improved, but the number of generators that can be hosted is limited by memory capacity
Solution Approach 1:
The patent partitions state elements into blocks that fit within the fast shared memory capacity of each GPU streaming multiprocessor. By organizing generators into groups where each group's state elements occupy one block, the system can host multiple generators per SM while maintaining fast memory access. The block structure enables efficient utilization of limited shared memory resources.
Solution Approach 2:
The patent transitions from storing all state elements of all generators in a flat memory structure to a hierarchical block structure organized in two dimensions: generators across multiple SMs and state elements within blocks on each SM. This dimensional reorganization allows the system to overcome the limited shared memory capacity of individual SMs by distributing generators across multiple SMs while maintaining fast access to frequently used state elements within each block.
Data Source
AI summary
System and method for pseudo-random number generation based on a recursion with significantly increased multithreaded parallelism. A single pseudo-random generator program is assigned with multiple threads to process in parallel. N state elements indexed incrementally are arranged into a matrix comprising x rows, where a respective adjacent pair of state elements in a same column are related by g=(M+j)mod N, wherein j and g represent indexes of the pair of state elements. x can be determined through an modular manipulative inverse of M and N. The matrix can be divided into sections with each section having a number of columns, and each thread is assigned with a section. In this manner, the majority of the requisite interactions among the state elements occur without expensive inter-thread communications, and further each thread may only need to communicate with a single other thread for a small number of times.


