tkonolige commented on a change in pull request #10686:
URL: https://github.com/apache/tvm/pull/10686#discussion_r831315548



##########
File path: src/auto_scheduler/feature.cc
##########
@@ -233,14 +233,9 @@ AnnotationPosType GetAnnotationPosEncoding(const Var& var, 
const Array<PrimExpr>
   }
 }
 
-// Return the extent of a for loop
-int64_t GetLoopExtent(const ForNode* node) {
-  auto pint = node->extent.as<IntImmNode>();
-  if (pint != nullptr) {
-    return pint->value;
-  } else {
-    return 1;
-  }
+// Return the maximum extent of a for loop
+int64_t GetLoopExtent(const ForNode* node, const Analyzer& ana) {
+  return ana.const_int_bound(node->extent)->max_value;

Review comment:
       auto scheduler doesn't work with smbolic shapes, so why would this be a 
problem? Seems like this is strictly an improvement over what we currently have.

##########
File path: src/auto_scheduler/feature.cc
##########
@@ -233,14 +233,9 @@ AnnotationPosType GetAnnotationPosEncoding(const Var& var, 
const Array<PrimExpr>
   }
 }
 
-// Return the extent of a for loop
-int64_t GetLoopExtent(const ForNode* node) {
-  auto pint = node->extent.as<IntImmNode>();
-  if (pint != nullptr) {
-    return pint->value;
-  } else {
-    return 1;
-  }
+// Return the maximum extent of a for loop
+int64_t GetLoopExtent(const ForNode* node, const Analyzer& ana) {
+  return ana.const_int_bound(node->extent)->max_value;

Review comment:
       auto scheduler doesn't work with symbolic shapes, so why would this be a 
problem? Seems like this is strictly an improvement over what we currently have.




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