[Runtime][PipelineExecutor] Move graph_split into relay testing.#11405
[Runtime][PipelineExecutor] Move graph_split into relay testing.#11405huajsj wants to merge 3 commits intoapache:mainfrom
Conversation
Currently the helper function of pipeline executor unit test like 'graph_slit' stay in the unit test file, and such function not directly related the testing logic. moving such helper function into tvm.relay.testing folder.
|
I think it's better to keep this function in a pipeline executor test file. Things under |
@masahi, thanks for the follow up, I do see some requirement for a solution to handle graph splitting for example in this discussion(https://discuss.tvm.apache.org/t/relay-generate-sub-graphs-from-existing-graph/11594), as a short term solution, this graph_split function can serve as an example and a python level support, I think that should be useful to separate this function into 'relay.testing' to let others use it, for sure I will add documentation and polish the code, please kindly let me know how you think. |
|
Hi, @huajsj. Thanks for your contribution on TVM. I have a simple question for the graph_split func. In many real use case, the relay function can be existed in the module['main'] (i.e. OP fusion or BYOC cases). How can we handle these cases to split the graph? |
As line 116 shown, graph_split only parse the top level function and treat the internal "relay.function" as a "relay.expr.let", that means the operator inside the function will not get involved by the graph split, and not impact the result. then either fuse or byoc logic will not get broken. |
|
Thanks.
Thanks :-) 👍 |
|
@masahi , the document adding and code polish already done, please take a look. |
| %1 = nn.multiply(%data, meta[relay.Constant][0]) | ||
|
|
||
| the split_config should like following | ||
| split_config = [{"operator_name":"add", "operator_index": 1}] |
There was a problem hiding this comment.
I think this way of specifying only works for a graph that is a linear-chain. Being limited is ok for a one-off function in a test code, but for more general utilities I think we want a better implementation. So I still don't support moving this function under relay/testing.
There was a problem hiding this comment.
sure, I will close this PR and work for a more complete solution.
RFC: https://github.com/apache/tvm-rfcs/blob/main/rfcs/0014-pipeline-executor.md
Issue: #8596
Currently the helper function of pipeline executor unit test like 'graph_slit' stay in the unit test file, and such function not directly related the testing logic.
moving such helper function into tvm.relay.testing folder.