Simple Graph IR to unify and facilitate DNN graph manipulation #61
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.
Why do we need a new representation?
The previous representation is based on NetworkX and then exported into a very simple IR (list of call inst) called schedule. This is actually a tech det I made before which brings a big dependency (NetworkX & pygraphviz) and ununified code (so many representations). It also makes it hard to serialize the abstract graph (relying on 3rd-party lib for extended/non-standard pickling is bad). And it also mutation hard. That's why it is important to bring a minimal representation that is controllable and simple enough for ppl (for developers now, for users later when stabilized) to play with.
This PR bring a standalone implementation of GraphIR which is not used by existing code for stability consideration but is now experimentally tested in local branches to sharpen its design for meeting the goals mentioned above. In the near future, GraphIR will replace the implementation of NetworkX format in graph generation and schedule format in model materialization.