[SYSTEMDS-3556] Counter-based random number generator#2260
Merged
Baunsgaard merged 1 commit intoapache:mainfrom May 13, 2025
Merged
[SYSTEMDS-3556] Counter-based random number generator#2260Baunsgaard merged 1 commit intoapache:mainfrom
Baunsgaard merged 1 commit intoapache:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2260 +/- ##
============================================
+ Coverage 72.71% 72.74% +0.02%
- Complexity 45812 45848 +36
============================================
Files 1474 1477 +3
Lines 171903 172025 +122
Branches 33597 33613 +16
============================================
+ Hits 124996 125131 +135
+ Misses 37467 37453 -14
- Partials 9440 9441 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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. Closes apache#2186 Closes apache#2260 Co-authored-by: ichbinstudent <45435943+ichbinstudent@users.noreply.github.com> Co-authored-by: chris-1187 <christian.munz@posteo.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Co-authored-by: ichbinstudent 45435943+ichbinstudent@users.noreply.github.com
Co-authored-by: chris-1187 christian.munz@posteo.de
Closes #2186