[Unity][MSC][M0.3] MSCGraph Builder #15615
Merged
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.
This is a pull request for MSC(Multi-System Compile)
RFC: https://discuss.tvm.apache.org/t/rfc-unity-msc-introduction-to-multi-system-compiler/15251/5
Tracking issue: #15233
This is the first part of Milestone 0: Build MSCGraph core parts. Enable translation between Relay, Relax and MSCGraph without loss information.
To limit each PR in reviewable size, the Milestone 0 will be split into 5 steps:
M0.1: Passes for set name and layout for expressions (src/contrib/msc/transform)
M0.2: MSCGraph core (src/contrib/msc/core/ir/graph && python/tvm/contrib/msc/core/ir/graph)
M0.3: MSCGraph Builder (src/contrib/msc/core/ir/graph_builder)
M0.4: Codegen (src/contrib/msc/core/codegen, src/contrib/msc/framework/tvm/codegen)
M0.5: Translation test (relax/relay test && related helper modules in python)
This PR add test for GraphBuilder and MSCGraph.
GraphBuilder translate relax/relay function to MSCGraph. Implement of GraphBuilder is similar to GraphCreator in: https://github.com/apache/tvm/blob/unity/src/relax/transform/fuse_ops.cc
The MSCGraph built form relax will be used as "IR" in all MSC process. This PR test MSCGraph by check the consistency. To keep the unittest clean and tiny, MSCGraph.inspect() is used as the readable "hash" of a MSCGraph. A inspect extract all the important infos in graph to dict, and can be used as the abstract of the graph.
cc @Hzfengsy