Repository navigation
Revert "Revert "Use HighLevelGraph layers everywhere in collections (… - #6707
Conversation
jrbourbeau
left a comment
There was a problem hiding this comment.
Playing around with this PR locally it looks like we can still produce HighLevelGraphs that have raw dictionaries in their layers which causes HighLevelGraph.get_dependencies to fail. For example:
import dask.array as da
x = da.ones(10, chunks=(2,))
dsk = x.__dask_graph__()
# Print out HighLevelGraph layers for x
from pprint import pprint
pprint(dsk.layers)
# Get dependencies for all the keys
deps = dsk.get_dependencies()
print(f"{deps = }")raises and AttributeError:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-61e7febb21f5> in <module>
8
9 # Get dependencies for all the keys
---> 10 deps = dsk.get_dependencies()
11 print(f"{deps = }")
~/projects/dask/dask/dask/highlevelgraph.py in get_dependencies(self)
369 self.key_dependencies = {}
370 for layer in self.layers.values():
--> 371 self.key_dependencies.update(layer.get_dependencies(all_keys))
372
373 return self.key_dependencies
AttributeError: 'dict' object has no attribute 'get_dependencies'
I see there's a HighLevelGraph._fix_hlg_layers_inplace method which ensures all layers are of type Layer. Should we call that at the end of HighLevelGraph.__init__ to make sure we always have a uniform layer type? @madsbk I'd be curious to hear what you think -- I also could be totally missing something
Good point, I totally agree :) I think we should:
Afterwards, we can look at merging:
After which, we can begin the working of sending HLGs directly to the scheduler in Distributed:
|
|
Thanks all for coordinating! |
…#6510)" (#6697)"
This reverts commit e09d8d9.
cc @madsbk