giuseros commented on a change in pull request #8014:
URL: https://github.com/apache/tvm/pull/8014#discussion_r633566451



##########
File path: src/relay/transforms/partition_graph.cc
##########
@@ -503,16 +506,35 @@ Pass PartitionGraph() {
     return partitioning::RemoveDefaultAnnotations(m);
   };
 
-  runtime::TypedPackedFunc<IRModule(IRModule, PassContext)> part_func =
-      [=](IRModule m, PassContext pc) { return 
partitioning::Partitioner(m).Partition(); };
+  runtime::TypedPackedFunc<IRModule(IRModule, PassContext)> part_func = 
[=](IRModule m,
+                                                                            
PassContext pc) {
+    return partitioning::Partitioner(m, mangle_fn).Partition();
+  };
 
   auto flatten_tuples_pass = CreateModulePass(flatten_tuples, 0, 
"FlattenNestedTuples", {});
   auto remove_default_pass = CreateModulePass(remove_defaults, 0, 
"RemoveDefaultAnnotations", {});
   auto partition_pass = CreateModulePass(part_func, 0, "PartitionGraph", {});
   return Sequential({flatten_tuples_pass, remove_default_pass, partition_pass, 
InferType()});
 }
 
+Pass PartitionGraph() {
+  // Default version. All the function signatures will be "COMPILER_ID"
+  auto mangle_fn = [](String name) { return name; };
+  return PartitionGraphCommon(mangle_fn);
+}
+
+Pass PartitionGraphWithModName(String mod_name) {

Review comment:
       Adding the `PartitionGraphWithModName` is a very simple change, but 
maybe is a tiny less elegant than a `MangleGraph` pass (which is a bit more 
code to write, do to a simple thing).I implemented (and used) the `MangleGraph` 
pass, so that you can see the difference. I would be still go for a 
`PartitionGraphWithModName`  but I don't have a strong opinion here. 




-- 
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:
us...@infra.apache.org


Reply via email to