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] should set num_returns in ray.wait inside ray data progress bar #46692

Merged
merged 2 commits into from
Jul 30, 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
11 changes: 9 additions & 2 deletions python/ray/data/_internal/progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ def _truncate_name(self, name: str) -> str:
def block_until_complete(self, remaining: List[ObjectRef]) -> None:
t = threading.current_thread()
while remaining:
done, remaining = ray.wait(remaining, fetch_local=False, timeout=0.1)
done, remaining = ray.wait(
remaining, num_returns=len(remaining), fetch_local=False, timeout=0.1
)
self.update(len(done))

with _canceled_threads_lock:
Expand All @@ -148,7 +150,12 @@ def fetch_until_complete(self, refs: List[ObjectRef]) -> List[Any]:
# See https://github.com/ray-project/ray/issues/30375.
fetch_local = True
while remaining:
done, remaining = ray.wait(remaining, fetch_local=fetch_local, timeout=0.1)
done, remaining = ray.wait(
remaining,
num_returns=len(remaining),
fetch_local=fetch_local,
timeout=0.1,
)
if fetch_local:
fetch_local = False
for ref, result in zip(done, ray.get(done)):
Expand Down