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

[FEAT] Ray shuffle experiment #2883

Closed
wants to merge 16 commits into from
Closed

[FEAT] Ray shuffle experiment #2883

wants to merge 16 commits into from

Conversation

jaychia
Copy link
Contributor

@jaychia jaychia commented Sep 22, 2024

No description provided.

Copy link

codspeed-hq bot commented Sep 23, 2024

CodSpeed Performance Report

Merging #2883 will not alter performance

Comparing jay/shuffle-experiment (ade5e2f) with main (768f422)

Summary

✅ 17 untouched benchmarks

@jaychia jaychia force-pushed the jay/shuffle-experiment branch from 6b5a053 to cef8843 Compare September 29, 2024 01:33
Copy link

codecov bot commented Sep 29, 2024

Codecov Report

Attention: Patch coverage is 24.48037% with 327 lines in your changes missing coverage. Please review.

Project coverage is 78.38%. Comparing base (868bbfa) to head (ade5e2f).
Report is 85 commits behind head on main.

Files with missing lines Patch % Lines
daft/runners/ray_runner.py 18.22% 166 Missing ⚠️
daft/execution/physical_plan.py 3.50% 55 Missing ⚠️
src/daft-scheduler/src/scheduler.rs 0.00% 34 Missing ⚠️
src/daft-plan/src/physical_planner/translate.rs 57.77% 19 Missing ⚠️
src/daft-plan/src/physical_ops/exchange_op.rs 0.00% 16 Missing ⚠️
daft/execution/physical_plan_shuffles.py 74.46% 12 Missing ⚠️
...sical_optimization/rules/reorder_partition_keys.rs 0.00% 12 Missing ⚠️
src/daft-plan/src/physical_plan.rs 0.00% 9 Missing ⚠️
daft/context.py 33.33% 2 Missing ⚠️
daft/runners/pyrunner.py 66.66% 1 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2883      +/-   ##
==========================================
- Coverage   78.71%   78.38%   -0.34%     
==========================================
  Files         597      599       +2     
  Lines       69735    70131     +396     
==========================================
+ Hits        54895    54969      +74     
- Misses      14840    15162     +322     
Flag Coverage Δ
78.38% <24.48%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
daft/runners/runner.py 73.52% <100.00%> (+1.65%) ⬆️
src/daft-plan/src/physical_ops/mod.rs 0.00% <ø> (ø)
daft/runners/pyrunner.py 85.07% <66.66%> (-0.18%) ⬇️
src/daft-plan/src/display.rs 80.00% <0.00%> (-0.33%) ⬇️
daft/context.py 78.61% <33.33%> (+1.05%) ⬆️
src/daft-plan/src/physical_plan.rs 51.21% <0.00%> (-1.38%) ⬇️
daft/execution/physical_plan_shuffles.py 74.46% <74.46%> (ø)
...sical_optimization/rules/reorder_partition_keys.rs 75.25% <0.00%> (-4.97%) ⬇️
src/daft-plan/src/physical_ops/exchange_op.rs 0.00% <0.00%> (ø)
src/daft-plan/src/physical_planner/translate.rs 91.97% <57.77%> (-1.88%) ⬇️
... and 3 more

... and 4 files with indirect coverage changes

@jaychia jaychia changed the title [DRAFT] Ray shuffle experiment [FEAT] Ray shuffle experiment Sep 29, 2024
@github-actions github-actions bot added the enhancement New feature or request label Sep 29, 2024
jaychia added a commit that referenced this pull request Oct 28, 2024
…an variant (#3083)

# Summary

Refactors our `PhysicalPlan` by adding a new
`PhysicalPlan::ShuffleExchange` variant.

## Why?

**This PR makes it easier to add new shuffle implementations, by simply
extending the `PhysicalPlan::ShuffleExchange` enum**

1. To users, the physical plan looks a lot more legible (even I don't
really know what a "Flatten" is...)
2. Easier to add new types of shuffles... Also, there's a nice place to
add a layer of heuristics to figure out when to use the new shuffles
(the new `ShuffleExchangeBuilder` builder can let us direct clients to
use more complex shuffles by consulting environment variables, available
cluster resources, number of partitions etc)

## Elaboration

Our previous PhysicalPlan was a bit of a leaky abstraction, expressing 2
types of shuffles by invoking an unnecessarily low-level chain of
operations to users of the abstraction, as well as users of Daft:

1. `FanoutHash/Range/Random -> Flatten -> ReduceMerge`: this pattern was
used to express a "NaiveFullyMaterializingMapReduce" shuffle
(materialize all Map tasks, perform a "flatten" which makes no sense to
users, then reduce and merge)
3. `Split/Coalesce -> Flatten`: this pattern was used to express a
"SplitOrCoalesceToTargetNum" shuffle

This leaky abstraction makes it difficult to add new types of shuffles
(e.g. the push-based shuffle implemented in #2883) as it involves adding
new PhysicalPlan variant(s). Additionally, all of these shuffles share
similar characteristics during plan optimization, and the actual
implementation of "how" to execute these shuffles should be highly
dependent on factors such as available cluster resources, expected
complexity of the shuffle and more.

---------

Co-authored-by: Jay Chia <[email protected]@users.noreply.github.com>
@samster25
Copy link
Member

@jaychia is PR still relevant after merging in your other one?

@jaychia
Copy link
Contributor Author

jaychia commented Oct 31, 2024

@jaychia is PR still relevant after merging in your other one?

No, this is just used by @colin-ho for reference. Closing.

@jaychia jaychia closed this Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants