[Data] Parallelize ray.put of read tasks during input generation - #158
Open
rubinfergersoniv wants to merge 1 commit into
Open
[Data] Parallelize ray.put of read tasks during input generation#158rubinfergersoniv wants to merge 1 commit into
rubinfergersoniv wants to merge 1 commit into
Conversation
Previously plan_read_op serialized read tasks into the object store one at a time (`ray.put` per task) and issued a separate `get_local_object_locations` RPC per task inside `_derive_metadata`. With many read tasks this per-task IPC latency accumulates serially and slows down input generation. `ray.put` releases the GIL during the plasma write and raylet RPC, so the work is IPC-bound. This change overlaps that latency with a `ThreadPoolExecutor` (`executor.map` preserves input order) and fetches all serialized sizes in a single `get_local_object_locations` call. The pool size defaults to CPython's I/O-bound heuristic (`min(32, cpu_count + 4)`) and is overridable via `RAY_DATA_READ_TASK_PUT_MAX_WORKERS` for benchmarking. Falls back to the sequential path when there is <=1 task or a single worker. Co-authored-by: Cursor <cursoragent@cursor.com>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
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
Problem (Why)
Previously
plan_read_opserialized read tasks into the object store one at a time (ray.putper task) and issued a separateget_local_object_locationsRPC per task inside_derive_metadata. With many read tasks this per-task IPC latency accumulates serially and slows down input generation.Solution (What + How)
ray.putreleases the GIL during the plasma write and raylet RPC, so the work is IPC-bound. This change overlaps that latency with aThreadPoolExecutor(executor.mappreserves input order) and fetches all serialized sizes in a singleget_local_object_locationscall.The pool size defaults to CPython's I/O-bound heuristic (
min(32, cpu_count + 4)) and is overridable viaRAY_DATA_READ_TASK_PUT_MAX_WORKERSfor benchmarking. Falls back to the sequential path when there is<=1task or a single worker.Test Plan
...