Repository navigation
[data][train][2/n] Push-based streaming_split: pushers, iterator, Ray Train integration, release tests - #66466
Conversation
Add Dataset.streaming_split_push_based: a coordinator actor runs the streaming executor and pushes each split's blocks, by value, to the actor hosting that split's PushBasedDataIterator, which iterates them from a local queue. Each consumer declares a prefetch_batches * batch_size row window and reports consumption; the coordinator pushes whole blocks while target_rows - (rows_pushed - rows_consumed) > 0, and feeds pushed-minus-consumed bytes to the executor's external-consumer backpressure. Deliveries are sequence-numbered and reordered on arrival, so ordering doesn't depend on the hosting actor's concurrency. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…vs-push release tests Mix PushSplitReceiverMixin into RayTrainWorker and add PushBasedDataConfig, which shards Train datasets with Dataset.streaming_split_push_based. Add nightly *.pull_vs_push release tests: compare_pull_push_benchmark.py runs train_benchmark.py with the pull split, then the push split, and fails if push global throughput drops below 90% of pull's. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Drop Dataset.streaming_split_push_based. The push-based split is built by an internal streaming_split_push_based(dataset, n, ...) helper instead, so a later PR can switch Dataset.streaming_split over directly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Move the coordinator into its own module, push_split_coordinator.py: the epoch barrier and per-epoch executor, the per-split row window (_SplitFlow), and the external-consumer-bytes pacing feed. The pusher threads, the consumer-side receiver and PushBasedDataIterator move to the follow-up PR. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Wake barrier waiters with a Condition instead of polling every 0.1s, and reject out-of-range split indices. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…split Extend PushSplitCoordinator with consumer registration and one pusher thread per split, which sends blocks by value and sequence-numbered while the split's row window has room. Add push_based_split_iterator.py: the receiver and reorder buffer, PushSplitReceiverMixin, and PushBasedDataIterator, plus the internal streaming_split_push_based helper. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…st; clean up push coordinators Add --compare-pull-push to training_ingest_regression_test/main.py: it runs the configuration with the pull-based split, then the push-based one, records .pull/.push/.comparison results, and gates on --min-throughput-ratio and --max-peak-object-store-ratio. Add nightly peak_object_store_memory.pull_vs_push (push peak <= 1.1x pull) and throughput.pull_vs_push (push steady throughput >= 0.9x pull) variants. Also track push-based split coordinators in Ray Train's DatasetManager so their executors are shut down with the pull-based ones. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…efly If the last arrival's teardown of the previous epoch raised, the other splits waited forever and a retry drove the arrival count negative. Release the barrier in a finally block and log the teardown failure. Also make the coordinator tests type-check under pyrefly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Signed-off-by: xgui <[email protected]> # Conflicts: # python/ray/data/_internal/iterator/push_split_coordinator.py # python/ray/data/tests/test_push_split_coordinator.py
Match DataIterator/BatchIterator override signatures, cast untyped actor results, and suppress the @ray.remote attribute errors pyrefly can't see through. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
- Ignore consumer reports that arrive after a split finished, so a late report can't reopen its send window. - Tag metrics with the next run's dataset id, as SplitCoordinator does: the tag is fetched before the epoch's executor is created. - Report coordinator overhead in stats() (streaming_split_coordinator_s), log per-split finish counts, and restore the full schema() error. - Document why consumer reports don't refresh the pacing feed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Signed-off-by: xgui <[email protected]> # Conflicts: # python/ray/data/_internal/iterator/push_split_coordinator.py
Matches SplitCoordinator, whose overhead stat covers get(), including its wait in get_next. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…cstring Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Signed-off-by: xgui <[email protected]> # Conflicts: # python/ray/data/_internal/iterator/push_split_coordinator.py
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Rename _create_split_dataset to create_streaming_split_dataset and move it to the shared Ray Data utils, so the push-based split and, later, Dataset.streaming_split can share it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Signed-off-by: xgui <[email protected]> # Conflicts: # python/ray/data/_internal/iterator/push_split_coordinator.py
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…nt flow invariant Match SplitCoordinator: if tearing down the previous epoch fails, the next epoch fails for every split instead of starting anyway. The barrier is still released, so no split hangs and a retry can start a later epoch. Also document why bytes_consumed never exceeds bytes_pushed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Signed-off-by: xgui <[email protected]> # Conflicts: # python/ray/data/_internal/iterator/push_split_coordinator.py
A zero-row block was charged 0 rows, so it never used window room and a run of empty blocks (e.g. after a selective filter) was sent without limit. Charge it one row; the consumer echoes the charged count back, so the window stays balanced. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…h window" This reverts commit 8275f1b. Empty blocks are charged 0 rows, as in the pull path's row-based prefetch window; they hold almost no data, so sending a run of them isn't a memory problem, and charging a row that doesn't exist makes the window accounting harder to follow. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
| if not hasattr(consumer, "_push_split_deliver"): | ||
| raise ValueError( | ||
| f"The consumer actor for split {split_idx} does not expose " | ||
| "the push receiver methods. Mix PushSplitReceiverMixin into " | ||
| "the actor class that hosts the PushBasedDataIterator." | ||
| ) |
There was a problem hiding this comment.
Nit: Is this overly defensive? Are we going to be extending this to any more use cases? If not, why would we call register() from a class that does not mix in PushSplitReceiverMixin?
There was a problem hiding this comment.
Just to fail fast if the register is misused.
…it_iterator.py - Add a ReceiverKey type alias documenting what the per-split receiver key is and where it comes from, and use it for the coordinator's consumer registry and the receiver registry. - Rename PushSplitCoordinator.register to register_consumer. - Rename push_based_split_iterator.py (and its test) to push_split_iterator.py, matching push_split_coordinator.py. - Explain the receiver-mixin check: without it a missing mixin hangs the consumer instead of failing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Every split registers before calling start_epoch, and the barrier only releases once all n splits arrive, so all n are always registered. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Drop _make_consumer_ops: the pusher looks up the consumer handle and receiver key once and calls the receiver methods directly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…flow_window Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
…helpers Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv Signed-off-by: xgui <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit c77678d. Configure here.
| time.sleep(0.5) | ||
| assert sampled == 5, "producer never started pushing" | ||
| assert held_refs_seen, "no refs held for in-flight blocks" | ||
| _run_epochs(consumers) |
There was a problem hiding this comment.
Flow-control test starts a second epoch
Medium Severity
test_push_split_flow_control_bounds_buffering already starts an epoch with delay_s=0.2, then calls _run_epochs, which invokes start_epoch again. If the first consumer thread is still alive, that assert fails; if it has exited, a full second epoch runs. Either way the test does not wait for the epoch it sampled, so it can flake under CI load.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c77678d. Configure here.


Why are these changes needed?
Second PR of the push-based
streaming_split, following #66465 (merged), which added the coordinator. It adds the data plane on top of the coordinator, connects it to Ray Train, and adds release tests that guard throughput.push_based_split_iterator.pyadds the receiver and reorder buffer,PushSplitReceiverMixin, andPushBasedDataIterator, which reuses the standard batching pipeline. Iterating on a default actor's task thread raises instead of hanging.RayTrainWorkermixes in the receiver, and the newPushBasedDataConfigshards datasets with the push-based split. It's opt-in, andDataConfigstays the default.DatasetManagernow also tracks push coordinators, so their executors shut down with the pull ones.*.pull_vs_pushvariants run each configuration with the pull split, then the push split, on the same cluster.training_ingest_benchmark(full and skip training): fails if pushtrain/global_throughput< 90% of pull's. On the 16-GPUskip_trainingrun, push is at parity: epoch 121.35s vs 121.01s.training_ingest_regression_test.throughput: fails if push steady throughput < 90% of pull's.training_ingest_regression_test.peak_object_store_memory: fails if push peak object store usage > 110% of pull's.Rollout plan
After merging with (a) mid-epoch resumption and (b) ray data fault-tolerance API, and release tests have shown no regression, we can roll out this refactor.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QfaKctvP9gCsC2EBTpdqnv