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

[BUG] Separate PartitionTask done from results #3155

Merged
merged 3 commits into from
Nov 1, 2024

Conversation

jaychia
Copy link
Contributor

@jaychia jaychia commented Oct 31, 2024

This PR marks PartitionTasks as done only after they have been explicitly marked as done by the runner.

Previously, we used the existence of the .results on a PartitionTask to determine whether or not it is done. However, this is not quite correct in the case of the RayRunner, which will attach a result containing a Ray ObjectRef, which is a future. This future may not (and is likely not) be completed yet at the time of PartitionTask creation.

@github-actions github-actions bot added the bug Something isn't working label Oct 31, 2024
Copy link

codspeed-hq bot commented Oct 31, 2024

CodSpeed Performance Report

Merging #3155 will not alter performance

Comparing jay/fix-rayrunner-tasks-done (be1fbfd) with main (8817a08)

Summary

✅ 17 untouched benchmarks

@jaychia jaychia force-pushed the jay/fix-rayrunner-tasks-done branch from f344065 to 11f77d9 Compare October 31, 2024 18:27
@jaychia jaychia force-pushed the jay/fix-rayrunner-tasks-done branch from 11f77d9 to 9dc0c6e Compare October 31, 2024 19:21
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.00%. Comparing base (b4332ec) to head (be1fbfd).
Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3155      +/-   ##
==========================================
+ Coverage   78.87%   79.00%   +0.12%     
==========================================
  Files         624      634      +10     
  Lines       75925    76940    +1015     
==========================================
+ Hits        59888    60788     +900     
- Misses      16037    16152     +115     
Files with missing lines Coverage Δ
daft/execution/execution_step.py 89.22% <100.00%> (+0.18%) ⬆️
daft/runners/pyrunner.py 87.62% <100.00%> (+0.08%) ⬆️
daft/runners/ray_runner.py 81.25% <100.00%> (+0.05%) ⬆️

... and 37 files with indirect coverage changes

@jaychia jaychia requested a review from kevinzwang October 31, 2024 23:22
Copy link
Member

@kevinzwang kevinzwang left a comment

Choose a reason for hiding this comment

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

Changes look fine to me. Wondering if this will cause any performance regressions though?

@jaychia
Copy link
Contributor Author

jaychia commented Nov 1, 2024

Changes look fine to me. Wondering if this will cause any performance regressions though?

I think that is unlikely, given that the ray wait is performed somewhere else (after this PR it is done in the _run_plan loop. Before this PR, it is done somewhere, perhaps in the physical plan, perhaps in the consumer of the data when showing the data etc).

@jaychia jaychia merged commit c435e92 into main Nov 1, 2024
44 checks passed
@jaychia jaychia deleted the jay/fix-rayrunner-tasks-done branch November 1, 2024 00:43
@jaychia
Copy link
Contributor Author

jaychia commented Nov 1, 2024

Also seeing now that the Ray trace no longer shows a long duration during next(tasks) iteration on the Physical Plan after this change.

Before:
image

After:
image

This is much more expected... I think in the past next(tasks) was taking so long because we called ray.get on some partition metadata in there. Because the task wasn't actually done, the physical plan was actually blocking on retrieving the metadata until the task completed.

Notice how the trace for tasks are also much nicer now... Much less time between when tasks are created compared when they actually run...

sagiahrac pushed a commit to sagiahrac/Daft that referenced this pull request Nov 4, 2024
This PR marks `PartitionTasks` as done only after they have been
explicitly marked as done by the runner.

Previously, we used the existence of the `.results` on a PartitionTask
to determine whether or not it is done. However, this is not quite
correct in the case of the RayRunner, which will attach a result
containing a Ray ObjectRef, which is a future. This future may not (and
is likely not) be completed yet at the time of PartitionTask creation.

---------

Co-authored-by: Jay Chia <jaychia94@gmail.com@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants