Skip to content

Commit

Permalink
Merge pull request #465 from dask-contrib/lgray/fix-optimize-not-hlg
Browse files Browse the repository at this point in the history
fix: optimize even if we have to make the HLG
  • Loading branch information
martindurant committed Feb 1, 2024
2 parents 73c80f8 + 7aafd96 commit 8cb8994
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/dask_awkward/lib/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ def all_optimizations(dsk: Mapping, keys: Sequence[Key], **_: Any) -> Mapping:
if not isinstance(dsk, HighLevelGraph):
dsk = HighLevelGraph.from_collections(str(id(dsk)), dsk, dependencies=())

else:
# Perform dask-awkward specific optimizations.
dsk = optimize(dsk, keys=keys)

# Perform Blockwise optimizations for HLG input
dsk = optimize_blockwise(dsk, keys=keys)
# fuse nearby layers
dsk = fuse_roots(dsk, keys=keys) # type: ignore

# Perform dask-awkward specific optimizations.
dsk = optimize(dsk, keys=keys)
# Perform Blockwise optimizations for HLG input
dsk = optimize_blockwise(dsk, keys=keys)
# fuse nearby layers
dsk = fuse_roots(dsk, keys=keys) # type: ignore
# cull unncessary tasks
dsk = dsk.cull(set(keys)) # type: ignore

Expand Down

0 comments on commit 8cb8994

Please sign in to comment.