Skip to content

[data][train][2/n] Push-based streaming_split: pushers, iterator, Ray Train integration, release tests - #66466

Merged
richardliaw merged 66 commits into
ray-project:masterfrom
xinyuangui2:push-split-train
Nov 4, 2026
Merged

richardliaw merged 66 commits into
ray-project:masterfrom
xinyuangui2:push-split-train

Conversation

@xinyuangui2

@xinyuangui2 xinyuangui2 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Pushers: consumers register with the coordinator, and one thread per split sends blocks by value, sequence-numbered, while the split's row window has room.
  • Consumer side: push_based_split_iterator.py adds the receiver and reorder buffer, PushSplitReceiverMixin, and PushBasedDataIterator, which reuses the standard batching pipeline. Iterating on a default actor's task thread raises instead of hanging.
  • Train: RayTrainWorker mixes in the receiver, and the new PushBasedDataConfig shards datasets with the push-based split. It's opt-in, and DataConfig stays the default. DatasetManager now also tracks push coordinators, so their executors shut down with the pull ones.
  • Release tests: nightly *.pull_vs_push variants run each configuration with the pull split, then the push split, on the same cluster.
    • training_ingest_benchmark (full and skip training): fails if push train/global_throughput < 90% of pull's. On the 16-GPU skip_training run, 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

xinyuangui2 and others added 11 commits September 24, 2026 17:52
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]>
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]>
@xinyuangui2
xinyuangui2 changed the base branch from master to xgui/push-split-coordinator September 24, 2026 20:37
@xinyuangui2 xinyuangui2 changed the title [data][train][2/n] Connect push-based streaming_split to Ray Train + pull-vs-push release tests [data][train][2/n] Push-based streaming_split: pushers, iterator, Ray Train integration, release tests Sep 24, 2026
xinyuangui2 and others added 16 commits September 24, 2026 20:53
…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]>
Signed-off-by: xgui <[email protected]>

# Conflicts:
#	python/ray/data/_internal/iterator/push_split_coordinator.py
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
…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
xinyuangui2 and others added 3 commits October 19, 2026 21:06
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]>
Comment on lines +268 to +273
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."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to fail fast if the register is misused.

xinyuangui2 and others added 9 commits October 22, 2026 17:32
…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]>
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]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c77678d. Configure here.

@richardliaw
richardliaw enabled auto-merge (squash) November 3, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues go add ONLY when ready to merge, run all tests release-test release test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants