-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import dask.bag as db | ||
|
||
from .explicit_comms.dataframe.shuffle import get_default_shuffle_method | ||
|
||
# We have to replace all modules that imports Dask's `get_default_shuffle_method()` | ||
# TODO: introduce a shuffle-algorithm dispatcher in Dask so we don't need this hack | ||
db.core.get_default_shuffle_method = get_default_shuffle_method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import dask.dataframe as dd | ||
from dask import config | ||
|
||
from .explicit_comms.dataframe.shuffle import ( | ||
get_default_shuffle_method, | ||
get_rearrange_by_column_wrapper, | ||
) | ||
from .proxify_device_objects import proxify_decorator, unproxify_decorator | ||
|
||
if config.get("dataframe.query-planning", None) is not False and config.get( | ||
"explicit-comms", False | ||
): | ||
raise NotImplementedError( | ||
"The 'explicit-comms' config is not yet supported when " | ||
"query-planning is enabled in dask. Please use the shuffle " | ||
"API directly, or use the legacy dask-dataframe API " | ||
"(set the 'dataframe.query-planning' config to `False`" | ||
"before importing `dask.dataframe`).", | ||
) | ||
|
||
|
||
# Monkey patching Dask to make use of explicit-comms when `DASK_EXPLICIT_COMMS=True` | ||
dd.shuffle.rearrange_by_column = get_rearrange_by_column_wrapper( | ||
dd.shuffle.rearrange_by_column | ||
) | ||
# We have to replace all modules that imports Dask's `get_default_shuffle_method()` | ||
# TODO: introduce a shuffle-algorithm dispatcher in Dask so we don't need this hack | ||
dd.shuffle.get_default_shuffle_method = get_default_shuffle_method | ||
dd.multi.get_default_shuffle_method = get_default_shuffle_method | ||
|
||
|
||
# Monkey patching Dask to make use of proxify and unproxify in compatibility mode | ||
dd.shuffle.shuffle_group = proxify_decorator(dd.shuffle.shuffle_group) | ||
dd.core._concat = unproxify_decorator(dd.core._concat) |