Skip to content

Cull in graph_to_futures - #2100

Closed
mrocklin wants to merge 2 commits into
dask:masterfrom
mrocklin:cull-before-send
Closed

mrocklin wants to merge 2 commits into
dask:masterfrom
mrocklin:cull-before-send

Conversation

@mrocklin

@mrocklin mrocklin commented Jul 7, 2018

Copy link
Copy Markdown
Member

Currently dask.delayed objects aren't culled prior to sending up to the
scheduler. This can result in too much communication.

This adds a cull step in the Client, but this should maybe be handled instead
by the collections.

@mrocklin mrocklin changed the title [WIP] Cull in graph_to_futures Cull in graph_to_futures Jul 7, 2018
@mrocklin

mrocklin commented Jul 8, 2018

Copy link
Copy Markdown
Member Author

This adds five microseconds per task for what I believe to be a relatively infrequently useful thing. (for context, recall that our budget is currently around 200-300us) Not sure that this is worth it.

In [1]: import dask.array as da

In [2]: x = da.random.random((100000, 100000), chunks=(1000, 1000))

In [3]: y = x + x.T - x.mean(axis=0)

In [4]: from dask.optimization import cull

In [5]: dsk = dict(y.dask)

In [6]: %time _ = cull(dsk, y.__dask_keys__())
CPU times: user 287 ms, sys: 3.84 ms, total: 291 ms
Wall time: 290 ms

In [7]: from dask.core import get_dependencies

In [8]: %time _ = {k: get_dependencies(dsk, k) for kk in y.__dask_keys__() for k
   ...:  in kk}
CPU times: user 48.4 ms, sys: 0 ns, total: 48.4 ms
Wall time: 47.9 ms

In [9]: 0.290 / len(dsk) * 1e6  # microseconds per task
Out[9]: 5.420560747663551

It might would be nicer to handle this in delayed.__dask_optimize__

Currently dask.delayed objects aren't culled prior to sending up to the
scheduler.  This can result in too much communication.

This adds a cull step in the Client, but this should maybe be handled instead
by the collections.
This doesn't affect dependencies and so screws with graphs that have aliases
@jakirkham

Copy link
Copy Markdown
Member

Is this still needed?

@jakirkham

Copy link
Copy Markdown
Member

IIUC dask.delayed has started culling. ( dask/dask#3856 ) So this can be closed.

@quasiben quasiben closed this Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants