Skip to content

Cull unnecessary tasks #2

@mrocklin

Description

@mrocklin

Consider the following dask

In [2]: def inc(x): return x + 1

In [3]: d = {'x': 1, 'y': (inc, 'x'), 'z': (inc, 'x'), 'out': (add, 'y', 10)}

mydask

If we go ahead and get out the out key

>>> from dask.threaded import get
>>> get(d, 'out')

We end up doing excess work computing 'z'.

It would be nice to have a function that takes a dask and a key or list of keys and removes all tasks not necessary to compute those keys.

>>> cull(d, ['out'])
{'x': 1, 'y': (inc, 'x'), 'out': (add, 'y', 10)}

mydask

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions