merrymercy commented on a change in pull request #6042:
URL: https://github.com/apache/incubator-tvm/pull/6042#discussion_r453785929



##########
File path: src/tir/transforms/unroll_loop.cc
##########
@@ -57,6 +58,9 @@ struct UnrollLoopConfigNode : public 
tvm::AttrsNode<UnrollLoopConfigNode> {
     TVM_ATTR_FIELD(explicit_unroll)
         .describe("Whether to explicitly unroll the loop instead of setting a 
pragma")
         .set_default(true);
+    TVM_ATTR_FIELD(explicit_unroll_max_extent)
+        .describe("The maximum extent of a loop that can be unrolled 
explicitly (-1 for infinite)")
+        .set_default(32);

Review comment:
       I think 32 is a very safe value.
   This value is just to avoid the llvm hanging issue, not for code 
performance. 32 is enough to avoid almost all llvm issues. For the code 
performance,  the schedule developers should choose a reasonable unroll factor 
by themself.
   
   As a global configuration, this default value should be large enough to 
avoid performance regression. And I do not think 16 is safe enough.

##########
File path: src/tir/transforms/unroll_loop.cc
##########
@@ -57,6 +58,9 @@ struct UnrollLoopConfigNode : public 
tvm::AttrsNode<UnrollLoopConfigNode> {
     TVM_ATTR_FIELD(explicit_unroll)
         .describe("Whether to explicitly unroll the loop instead of setting a 
pragma")
         .set_default(true);
+    TVM_ATTR_FIELD(explicit_unroll_max_extent)
+        .describe("The maximum extent of a loop that can be unrolled 
explicitly (-1 for infinite)")
+        .set_default(32);

Review comment:
       I think 32 is a safe value.
   This value is just to avoid the llvm hanging issue, not for code 
performance. 32 is enough to avoid almost all llvm issues. For the code 
performance,  the schedule developers should choose a reasonable unroll factor 
by themself.
   
   As a global configuration, this default value should be large enough to 
avoid performance regression. And I do not think 16 is safe enough.




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


Reply via email to