Skip to content

Respect dask.annotate during compute/persist calls #4306

@mrocklin

Description

@mrocklin

Now that dask/dask#6889 and #4279 are in (thanks @sjperkins !) we can use the dask.annotate context manager to mark layers built within a context

with dask.annotate(foo="bar"):
    x = da.ones(10)

Some folks may also want to use this same context when calling compute/persist

with dask.annotate(foo="baz"):
    x.compute()

Some thoughts on how we might do this:

  • This would probably require that we check dask.config.get("annotations") inside Client._graph_to_futures and then send those annotations up to the scheduler.
  • We would probably also want to handle those annotations in the Scheduler.update_graph_hlg or Scheduler.update_graph.
  • We'll need to figure out the relative priority when the layer annotations and the compute-time annotations disagree. My guess is that compute time annotations should take precedence.

@sjperkins does this interest you?

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