-
Notifications
You must be signed in to change notification settings - Fork 97
Closes #5316: SplitMix64RNG #5323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7fc8273 to
90d54b8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5323 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 4
Lines ? 63
Branches ? 0
========================================
Hits ? 63
Misses ? 0
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1RyanK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
.chplcheckignore
Outdated
| SortMsg.chpl | ||
| SparseMatrix.chpl | ||
| SparseMatrixMsg.chpl | ||
| SplitMix64RNG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be SplitMix64RNG.chpl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
arkouda/numpy/random/generator.py
Outdated
|
|
||
| seed_u64 = uint64(int(seed)) | ||
| stream_u64 = uint64(int(stream)) | ||
| start_idx_u64 = uint64(int(start_idx)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason these are uint64(int(...)) but in _fill_with_stateless_u64_from_index they are just uint64(...)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. They should be the same. The reason was to ensure an int scalar was passed into uint64, but I think a better way to enforce that is to add @typechecked to the functions. I made the change.
90d54b8 to
7070782
Compare
e47b9f0 to
eb72a01
Compare
Add stateless, index-based RNG via SplitMix64
Summary
This PR introduces a stateless, index-based random number generator to Arkouda using a SplitMix64 mixing function. The new implementation enables reproducible random sequences that are independent of execution order, parallelism, and locale count, making them suitable for sampling, shuffling, sketching, and other distributed algorithms.
The PR adds:
Motivation
Existing RNG paths in Arkouda rely on mutable state, which can make results sensitive to chunking and execution order. Many analytics and data-parallel algorithms instead need pure functions of (seed, stream, index).
Design & Implementation
Testing
Adds extensive reproducibility, statistical, and independence tests, with conservative thresholds to avoid CI flakiness.
Compatibility
No changes to existing RNG behavior; new functionality is opt-in.
Future Work
Potential public API exposure and use in distributed shuffle/sampling paths.
Closes #5316: SplitMix64RNG