Baunsgaard opened a new pull request, #2260:
URL: https://github.com/apache/systemds/pull/2260

   This commit adds a new random generator for SystemDS, that improves the 
speed at witch we generate random matrices. The algorithm uses Philox4x64_10 to 
generate batches of random double values with 64 bit randomness. The 
implementation is based of an implementation in openRAND, and verified on 
various statistical methods.
   
   - Quality: Instead of 32 bits in java.util.Random, Philox4_64 produces 64 
bits of randomness. While java.util.Random has a period of only (2^48), while 
the period of Philox4_64 is 2^256 - 1.
   - Speed: While the Java version of Philox4x64_10 is only about half as fast 
as java.util.Random, there is a Cuda kernel version available producing the 
exact same sequence of random numbers. This means that the Cuda and Java 
versions can be used interchangeably. If a system has support for Cuda, the 
kernel is used, if not, the Java version can be used as a fallback. The kernel 
version is around 200 times faster than java.util.Random, and even faster, if 
the results are not copied to the CPU but kept in the GPU's memory.
   - Parallelisation: When using state based PRNGs, it is impossible to 
generate the same random matrix when changing the block size. With counter 
based PRNGs it is possible to change the block size but still compute the same 
random matrix by using the global index (row * row_size + col) as the counter.
   
   Co-authored-by: ichbinstudent 
<[email protected]>
   Co-authored-by: chris-1187 <[email protected]>
   
   Closes #2186


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to