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] Remove limit on number of tasks launched per scheduling step #47393

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions python/ray/data/_internal/execution/streaming_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ def _scheduling_loop_step(self, topology: Topology) -> bool:
i = 0
while op is not None:
i += 1
if i > PROGRESS_BAR_UPDATE_INTERVAL:
break
if i % PROGRESS_BAR_UPDATE_INTERVAL == 0:
self._refresh_progress_bars(topology)
topology[op].dispatch_next_task()
self._resource_manager.update_usages()
op = select_operator_to_run(
Expand All @@ -320,13 +320,7 @@ def _scheduling_loop_step(self, topology: Topology) -> bool:
)

update_operator_states(topology)

# Update the progress bar to reflect scheduling decisions.
for op_state in topology.values():
op_state.refresh_progress_bar(self._resource_manager)
# Refresh the global progress bar to update elapsed time progress.
if self._global_info:
self._global_info.refresh()
self._refresh_progress_bars(topology)

self._update_stats_metrics(state="RUNNING")
if time.time() - self._last_debug_log_time >= DEBUG_LOG_INTERVAL_SECONDS:
Expand All @@ -347,6 +341,14 @@ def _scheduling_loop_step(self, topology: Topology) -> bool:
# Keep going until all operators run to completion.
return not all(op.completed() for op in topology)

def _refresh_progress_bars(self, topology: Topology):
# Update the progress bar to reflect scheduling decisions.
for op_state in topology.values():
op_state.refresh_progress_bar(self._resource_manager)
# Refresh the global progress bar to update elapsed time progress.
if self._global_info:
self._global_info.refresh()

def _consumer_idling(self) -> bool:
"""Returns whether the user thread is blocked on topology execution."""
return len(self._output_node.outqueue) == 0
Expand Down
Loading