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

Dask-CuDF: use default Dask Dataframe optimizer #8581

Merged
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
18 changes: 1 addition & 17 deletions python/dask_cudf/dask_cudf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
from tlz import partition_all

import dask
import dask.dataframe.optimize
from dask import dataframe as dd
from dask.base import normalize_token, tokenize
from dask.context import _globals
from dask.core import flatten
from dask.dataframe.core import (
Scalar,
finalize,
Expand All @@ -22,7 +21,6 @@
)
from dask.dataframe.utils import raise_on_meta_error
from dask.highlevelgraph import HighLevelGraph
from dask.optimization import cull, fuse
from dask.utils import M, OperatorMethodMixin, apply, derived_from, funcname

import cudf
Expand All @@ -34,19 +32,6 @@
DASK_VERSION = LooseVersion(dask.__version__)


def optimize(dsk, keys, **kwargs):
flatkeys = list(flatten(keys)) if isinstance(keys, list) else [keys]
dsk, dependencies = cull(dsk, flatkeys)
dsk, dependencies = fuse(
dsk,
keys,
dependencies=dependencies,
ave_width=_globals.get("fuse_ave_width", 1),
Copy link
Member

Choose a reason for hiding this comment

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

Was wondering if we should be setting this somehow to ensure it is 1. However that appears to be the default anyways. So that doesn't seem needed

The other culling steps happen naturally as part of optimize anyways so no need to reproduce them otherwise either

)
dsk, _ = cull(dsk, keys)
return dsk


class _Frame(dd.core._Frame, OperatorMethodMixin):
""" Superclass for DataFrame and Series

Expand All @@ -65,7 +50,6 @@ class _Frame(dd.core._Frame, OperatorMethodMixin):
"""

__dask_scheduler__ = staticmethod(dask.get)
__dask_optimize__ = staticmethod(optimize)

def __dask_postcompute__(self):
return finalize, ()
Expand Down