manupa-arm commented on a change in pull request #5320: [BYOC] Prevent
duplicate outputs in subgraph Tuple
URL: https://github.com/apache/incubator-tvm/pull/5320#discussion_r408995221
##########
File path: src/relay/transforms/partition_graph.cc
##########
@@ -456,18 +370,111 @@ class Partitioner : public ExprMutator {
}
/*!
- * \brief Get the index of the return(output);
- * this is to be used as tuplegetitem idx
+ * \brief This function is called first time that we encounter a compiler_end
+ * node to create the function for the subgraph.
*/
- int GetRetIdx(AnnotatedRegion sg, const Expr& arg) {
- int idx = 0;
- for (auto arg_ : sg->GetOutputs()) {
- if (arg == arg_) {
- return idx;
+ void CreateFunction(AnnotatedRegion region, const CallNode* call) {
Review comment:
Actually, the way the MergeCompilerRegions algorithm works, the annotations
need to adhere to the rule that they have a single input and a single output.
(See step 3 merging in this
[RFC](https://discuss.tvm.ai/t/rfc-byoc-an-extended-graph-partitioning-flow/6028)
).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services