Repository navigation
Closes #4075: MergeShuffle - #4094
Merged
Merged
Conversation
ajpotts
force-pushed
the
4075_MergeShuffle
branch
2 times, most recently
from
February 12, 2025 18:11
c921328 to
09af72a
Compare
ajpotts
force-pushed
the
4075_MergeShuffle
branch
from
February 12, 2025 20:32
8e7b905 to
5eabdaf
Compare
ajpotts
force-pushed
the
4075_MergeShuffle
branch
from
March 10, 2025 14:52
5eabdaf to
b51c466
Compare
ajpotts
force-pushed
the
4075_MergeShuffle
branch
2 times, most recently
from
May 22, 2025 18:58
c507bf3 to
41d52ae
Compare
ajpotts
force-pushed
the
4075_MergeShuffle
branch
3 times, most recently
from
June 20, 2025 13:24
73c7620 to
40ba6bb
Compare
ajpotts
marked this pull request as ready for review
June 23, 2025 15:13
ajpotts
marked this pull request as draft
June 23, 2025 15:13
ajpotts
force-pushed
the
4075_MergeShuffle
branch
from
June 23, 2025 20:20
54aab43 to
41a7167
Compare
ajpotts
marked this pull request as ready for review
June 23, 2025 20:21
1RyanK
previously approved these changes
Jul 25, 2025
1RyanK
left a comment
Contributor
There was a problem hiding this comment.
Looks good, just a few things
drculhane
approved these changes
Jul 28, 2025
drculhane
left a comment
Contributor
There was a problem hiding this comment.
I'm satisfied that this works as advertised. Thanks for doing this.
ajpotts
force-pushed
the
4075_MergeShuffle
branch
from
August 4, 2025 21:53
cbc00af to
196d2c1
Compare
ajpotts
force-pushed
the
4075_MergeShuffle
branch
from
August 4, 2025 22:05
196d2c1 to
b403e2a
Compare
1RyanK
approved these changes
Aug 5, 2025
drculhane
pushed a commit
to drculhane/arkouda
that referenced
this pull request
Aug 20, 2025
Closes Bears-R-Us#4075: MergeShuffle --------- Co-authored-by: Amanda Potts <[email protected]>
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.
Summary
This PR extends
ak.random.Generator.shufflewith amethodparameter, enabling callers to choose between the existing in-place Fisher–Yates shuffle and a new fully distributed merge shuffle implementation.Motivation
Generator.shufflepreviously relied on a Chapel-side Fisher–Yates shuffle that is serial/global and not suitable for large distributed arrays (it effectively assumes the whole array can be shuffled on a single locale). This change adds a scalable alternative that performs a distributed shuffle across locales while remaining deterministic given the RNG state.What changed
Python client (
arkouda/numpy/random/generator.py)shuffle(self, x, method="FisherYates").FisherYates— serial/global Chapel shuffle (best for small arrays/tests).MergeShuffle— distributed shuffle for production-scale data.methodto the server (method.lower()).x.size), because the distributed shuffle derives per-locale/per-task streams from a single generator draw used as the shuffle seed.Server (
src/RandMsg.chpl)shuffle(...)to dispatch based onmethod:fisheryates→ existingshuffleHelpmergeshuffle→ newmergeShuffleHelpshuffleLocales), thenmergeShuffle/merge).MergeShuffle(returns an error forarray_nd > 1).@chplcheck.ignore("UnusedFormal")annotations where appropriate and minor Chapel style cleanups.Tests (
tests/numpy/random_test.py)test_shufflecoverage:method ∈ {"FisherYates", "MergeShuffle"}pytest.prob_size)Behavior & compatibility notes
Generator.shuffleis now explicitly method-selectable; default remainsFisherYates.MergeShuffle, reproducibility is guaranteed only when the number of locales is unchanged between runs. Changing locale count can change the permutation.MergeShufflecurrently supports 1D arrays only.How to use
Closes #4075: MergeShuffle