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

Use the new HLG pack/unpack API in Dask #4489

Merged
merged 8 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion continuous_integration/environment-3.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ dependencies:
# The '.git@master' is a hack needed to work around the failure
# ERROR: Package 'dask' requires a different Python: 3.6.12 not in '>=3.6'
# It only happens in CI; cannot reproduce locally
- git+https://github.com/dask/dask.git@master
- git+https://github.com/madsbk/dask.git@hlg_pack_move_to_dask
- keras
2 changes: 1 addition & 1 deletion continuous_integration/environment-3.7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ dependencies:
- zict
- zstandard
- pip:
- git+https://github.com/dask/dask
- git+https://github.com/madsbk/dask.git@hlg_pack_move_to_dask
- git+https://github.com/jcrist/crick # Only tested here
- keras
2 changes: 1 addition & 1 deletion continuous_integration/environment-3.8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies:
- zict # overridden by git tip below
- zstandard
- pip:
- git+https://github.com/dask/dask
- git+https://github.com/madsbk/dask.git@hlg_pack_move_to_dask
- git+https://github.com/dask/s3fs
- git+https://github.com/dask/zict
- git+https://github.com/intake/filesystem_spec
Expand Down
3 changes: 1 addition & 2 deletions distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
from .metrics import time
from .protocol import to_serialize
from .protocol.pickle import dumps, loads
from .protocol.highlevelgraph import highlevelgraph_pack
from .publish import Datasets
from .pubsub import PubSubClientExtension
from .security import Security
Expand Down Expand Up @@ -2540,7 +2539,7 @@ def _graph_to_futures(
if not isinstance(dsk, HighLevelGraph):
dsk = HighLevelGraph.from_collections(id(dsk), dsk, dependencies=())

dsk = highlevelgraph_pack(dsk, self, keyset)
dsk = dsk.__dask_distributed_pack__(self, keyset)

annotations = {}
if user_priority:
Expand Down
170 changes: 0 additions & 170 deletions distributed/protocol/highlevelgraph.py

This file was deleted.

8 changes: 5 additions & 3 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from tornado.ioloop import IOLoop, PeriodicCallback

import dask
from dask.highlevelgraph import HighLevelGraph

from . import profile
from .batched import BatchedSend
Expand Down Expand Up @@ -84,7 +85,6 @@
from .pubsub import PubSubSchedulerExtension
from .stealing import WorkStealing
from .variable import VariableExtension
from .protocol.highlevelgraph import highlevelgraph_unpack

try:
from cython import compiled
Expand Down Expand Up @@ -3668,8 +3668,10 @@ def update_graph_hlg(
fifo_timeout=0,
annotations=None,
):

dsk, dependencies, annotations = highlevelgraph_unpack(hlg, annotations)
unpacked_graph = HighLevelGraph.__dask_distributed_unpack__(hlg, annotations)
dsk = unpacked_graph["dsk"]
dependencies = unpacked_graph["deps"]
annotations = unpacked_graph["anno"]

# Remove any self-dependencies (happens on test_publish_bag() and others)
for k, v in dependencies.items():
Expand Down