comaniac commented on a change in pull request #8464:
URL: https://github.com/apache/tvm/pull/8464#discussion_r669130328



##########
File path: src/relay/analysis/annotated_region_set.cc
##########
@@ -213,12 +217,19 @@ class AnnotatedRegionSet::Creator : protected 
MixedModeVisitor {
   const Op begin_op_;
   /*! \brief Region 'end' annotation operator. */
   const Op end_op_;
+  /*! \brief The function name.*/
+  const std::string func_name;

Review comment:
       ```suggestion
     /*! \brief The unique function name that is used to be the name of this 
region set. */
     const std::string func_name_;
   ```

##########
File path: src/relay/transforms/partition_graph.cc
##########
@@ -301,7 +302,7 @@ class Partitioner : public MixedModeMutator {
     }
 
     std::string target = end_node->attrs.as<CompilerAttrs>()->compiler;
-    std::string name = target + "_" + std::to_string(region->GetID());
+    std::string name = target + "_" + std::to_string(region->GetID()) + 
region->GetName();

Review comment:
       Let's make it clearer: target - region (function) - index.
   
   ```suggestion
       std::string name = target + "_" + region->GetName() + "_" + 
std::to_string(region->GetID());
   ```

##########
File path: src/relay/analysis/annotated_region_set.cc
##########
@@ -76,17 +76,21 @@ void AnnotatedRegionSetNode::AddToRegion(AnnotatedRegion 
dest, const Expr& expr)
   }
 }
 
-AnnotatedRegion AnnotatedRegionSetNode::MakeRegion(const std::string& target) {
+AnnotatedRegion AnnotatedRegionSetNode::MakeRegion(const std::string& 
func_name,
+                                                   const std::string& target) {
   auto ret = regions_.emplace(AnnotatedRegion());
   (*ret.first)->id_ = region_id_++;
   (*ret.first)->target_ = target;
+  (*ret.first)->func_name_ = func_name;
   return *ret.first;
 }
 
 class AnnotatedRegionSet::Creator : protected MixedModeVisitor {
  public:
   Creator(const Op& region_begin_op, const Op& region_end_op)
       : begin_op_(region_begin_op), end_op_(region_end_op) {}
+  Creator(const Op& region_begin_op, const Op& region_end_op, const 
std::string& func_name)
+      : begin_op_(region_begin_op), end_op_(region_end_op), 
func_name(func_name) {}

Review comment:
       Is there any reason to keep both constructors?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to