[python][torch] Support shuffle for Arrow and tensor batch streaming - #10012
Open
TheR1sing3un wants to merge 1 commit into
Open
TheR1sing3un wants to merge 1 commit into
TheR1sing3un wants to merge 1 commit into
Conversation
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.
Purpose
Torch streaming currently rejects
shuffle=Truewithbatch_format="pyarrow"or"torch". Support bounded row shuffling for both batch formats so training can mix samples across reader batches while keeping payloads in Arrow until tensor conversion.Reuse the existing seed/epoch and rank/worker semantics. Incoming Arrow blocks replace random slots in a rolling buffer, and bounded split interleaving mixes input sources. Filters and sharding precede shuffle; a binding limit retains the existing ordered selection. Output batching and custom tensor conversion run afterward. Close all active readers on completion, early termination, and read/conversion failures.
The default unshuffled path and existing row shuffle order are preserved. Document that this is worker-local buffer shuffling, with additional memory for incoming blocks, gathered output and format readers, and that
prefetch_concurrency=1still applies. Related to #9365.Tests
PET_LOCAL_ADDR=127.0.0.1 GLOO_SOCKET_IFNAME=lo0.git diff --checkpassed.