Repository navigation
Use a stream smaller than num_canonical_nodes unshuffled instead of failing the epoch - #57
Merged
Merged
Conversation
…ad of failing the epoch, and give a stream with a zero shuffle block share a block of one sample.
Documentation build overview
|
This was referenced Oct 23, 2026
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.
With
shuffle=True,per_stream,stratifiedanddevice_per_streambatching shuffle each stream separately overnum_canonical_nodes. A stream with fewer samples than canonical nodes (for example a small stream in a mix, or a smallproportionof a short epoch) failed the whole epoch:The partition already repeats such a stream's samples so that each canonical node holds one, so the shuffle has nothing to do there. The stream is now kept in partition order, with a warning, instead of failing. With
shuffle=Falseit already behaved this way.A related failure: a stream whose share of
shuffle_block_sizerounds down to zero failed withValueError: high <= 0underper_streamandstratified, and with "Samples from stream N are not being used" underdevice_per_stream. It now gets a shuffle block of one sample.The default
randombatching method is unchanged: it shuffles the whole dataset at once, and a dataset smaller thannum_canonical_nodesstill raises there (test_tiny_dataset_exception).Tests:
test_stream_smaller_than_canonical_nodesandtest_stream_share_of_shuffle_block_below_one, each for all three methods. All six fail onmainwith the errors above. The existing batching tests pass.