Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data] Configure number of actor task generator outputs to buffer #43299

Merged
merged 5 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ def __init__(
actor_task_errors = DataContext.get_current().actor_task_retry_on_errors
if actor_task_errors:
self._ray_actor_task_remote_args["retry_exceptions"] = actor_task_errors
data_context = DataContext.get_current()
if data_context._max_num_blocks_in_streaming_gen_buffer is not None:
# The `_generator_backpressure_num_objects` parameter should be
# `2 * _max_num_blocks_in_streaming_gen_buffer` because we yield
# 2 objects for each block: the block and the block metadata.
self._ray_actor_task_remote_args["_generator_backpressure_num_objects"] = (
2 * data_context._max_num_blocks_in_streaming_gen_buffer
)
self._min_rows_per_bundle = min_rows_per_bundle

# Create autoscaling policy from compute strategy.
Expand Down
7 changes: 5 additions & 2 deletions python/ray/data/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,15 @@ def run_op_tasks_sync(op: PhysicalOperator, only_existing=False):
"""
tasks = op.get_active_tasks()
while tasks:
ray.wait(
ref_to_task = {task.get_waitable(): task for task in tasks}
ready, _ = ray.wait(
[task.get_waitable() for task in tasks],
num_returns=len(tasks),
fetch_local=False,
timeout=0.1,
)
for task in tasks:
for ref in ready:
task = ref_to_task[ref]
if isinstance(task, DataOpTask):
task.on_data_ready(None)
else:
Expand Down