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

Migrate Blockwise to use taskspec #1159

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

fjetter
Copy link
Member

@fjetter fjetter commented Nov 5, 2024

This is migrating the blockwise expressions and connected ones to the new task spec.

I ran into interesting issues while ripping out the recursion in #1158 and wanted to do this step here first.

@fjetter fjetter changed the title Migrate some to taskspec Migrate Blockwise to use taskspec Nov 5, 2024
Comment on lines +3769 to +3778
subgraphs = {}
for _expr in self.exprs:
if isinstance(_expr, Fused):
subgraph, name = _expr._task(index)[1:3]
graph.update(subgraph)
graph[(name, index)] = name
elif self._broadcast_dep(_expr):
# When _expr is being broadcasted, we only
# want to define a fused task for index 0
graph[(_expr._name, 0)] = _expr._task(0)
if self._broadcast_dep(_expr):
subname = (_expr._name, 0)
else:
graph[(_expr._name, index)] = _expr._task(index)
subname = (_expr._name, index)
subgraphs[subname] = _expr._task(subname, subname[1])

for i, dep in enumerate(self.dependencies()):
graph[self._blockwise_arg(dep, index)] = "_" + str(i)
subgraphs[self._blockwise_arg(dep, index)] = "_" + str(i)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to admit that I don't understand what's going on here but I just went ahead and translated the existing code

Copy link
Collaborator

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the failures look related

@fjetter
Copy link
Member Author

fjetter commented Nov 5, 2024

hmm, there are problems when running the dask/dask tests with to_bag n stuff. That's frustrating

@fjetter
Copy link
Member Author

fjetter commented Nov 5, 2024

Fix is dask/dask#11495

I will not change the CI config to test this. I can retrigger once dask/dask is merged

@fjetter
Copy link
Member Author

fjetter commented Nov 5, 2024

Final problem is dask/dask#11496

the test asserts on the pickled graph size which is blowing up with this since deduplication is not working well. That function caching layer was introduced a little prematurely so let's rip it out and deal with this later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants