Change the DAG to have separate nodes for operations and arrays #337
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently there is a one-to-one correspondence between operations and arrays: one operation produces one array, and is represented by one node in the DAG.
However, this won't be true when we support multiple outputs (#69) where one operation can produce multiple arrays.
Similarly, it also won't support optimizations like sibling fusion (in Apache Beam, and from FlumeJava originally), where operations that have the same inputs and produce different outputs can be fused into one operation producing multiple outputs. (Wukong calls this "task clustering".)
So we need to change the DAG representation so that one operation can produce multiple arrays, and this means breaking nodes into two types: operations and arrays.
This PR does exactly that. An example DAG (from
test_add_with_broadcast
) in the current representationnow looks like this:
Note:
I wondered about having an option to visualize DAGs as we currently do, but that won't work when there are multiple outputs, so it may be best just to have the more general representation.