You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/12/07 23:58:25 UTC

[GitHub] [tvm] vinx13 opened a new pull request, #13579: [TIR] Add preserve_unit_iters option to blockize/tensorize

vinx13 opened a new pull request, #13579:
URL: https://github.com/apache/tvm/pull/13579

   This PR added an option `preserve_unit_iters` to blockize and tensorize, which helps to maintain stability of the loop structure during tuning. It also added an option `simplify_trivial_iterator` to `SubspaceDivide`, similar to what's already supported in `DetectIterMap`.
   
   cc @junrushao @spectrometerHBH @masahi 
   
   fixed #13517 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] shingjan commented on a diff in pull request #13579: [TIR] Add preserve_unit_iters option to blockize/tensorize

Posted by GitBox <gi...@apache.org>.
shingjan commented on code in PR #13579:
URL: https://github.com/apache/tvm/pull/13579#discussion_r1043725708


##########
src/tir/schedule/primitive/blockize_tensorize.cc:
##########
@@ -427,7 +430,8 @@ Stmt MakeLoopNest(Stmt stmt, const std::vector<const ForNode*>& loops) {
 }
 
 BlockRealize BlockizeImpl(const ScheduleState& self, const StmtSRef& loop_sref,
-                          Map<Block, Block>* block_sref_reuse, arith::Analyzer* analyzer) {
+                          bool preserve_unit_iters, Map<Block, Block>* block_sref_reuse,

Review Comment:
   nit: put preserve_unit_iters at the end of argument like other functions with preserve_unit_iters introduced.



##########
src/arith/iter_affine_map.cc:
##########
@@ -1812,18 +1812,26 @@ class SubspaceDivider {
     // extent of inner
     PrimExpr inner_extent;
 
+    // The kind of the division result.
+    enum class Kind {

Review Comment:
   This looks much cleaner with enum!



##########
tests/python/unittest/test_meta_schedule_runner.py:
##########
@@ -690,6 +690,8 @@ def _check_correct_add(args_before: List[np.ndarray], args_after: List[np.ndarra
         a_before, b_before, c_before = args_before
         a_after, b_after, c_after = args_after
         c_before = a_before + b_before
+        print(a_before)

Review Comment:
   remove the print



##########
tests/python/unittest/test_meta_schedule_schedule_rule_mlt_intrin.py:
##########
@@ -74,16 +74,16 @@ def vnni_conv2d_nchwc_0(placeholder: T.Buffer[(1, 4, 56, 56, 16), "uint8"], plac
         for i0_0, i1_0, i2_0, i3_0, i4_0_0, i0_1, i1_1, i2_1, i3_1, i4_0_1 in T.grid(1, 8, 28, 56, 1, 1, 2, 1, 1, 1):
             for i5_0, i6_0, i7_0, i8_0, i9_0_0, i0_2, i1_2, i2_2, i3_2, i4_0_2, i5_1, i6_1, i7_1, i8_1, i9_0_1, i0_3, i1_3, i2_3, i3_3, i4_0_3 in T.grid(1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1):
                 with T.block("conv2d_NCHWc_int8_o"):
-                    n = T.axis.spatial(1, 0)
+                    n = T.axis.spatial(1, i0_2 + i0_3 + i0_0 + i0_1)

Review Comment:
   This is the result of trivial iters being preserved instead of simplified right? 



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] shingjan commented on a diff in pull request #13579: [TIR] Add preserve_unit_iters option to blockize/tensorize

Posted by GitBox <gi...@apache.org>.
shingjan commented on code in PR #13579:
URL: https://github.com/apache/tvm/pull/13579#discussion_r1043730013


##########
tests/python/unittest/test_meta_schedule_runner.py:
##########
@@ -690,6 +690,8 @@ def _check_correct_add(args_before: List[np.ndarray], args_after: List[np.ndarra
         a_before, b_before, c_before = args_before
         a_after, b_after, c_after = args_after
         c_before = a_before + b_before
+        print(a_before)

Review Comment:
   there are two more prints below this in the same file that likely need to be removed as well.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] vinx13 commented on a diff in pull request #13579: [TIR] Add preserve_unit_iters option to blockize/tensorize

Posted by GitBox <gi...@apache.org>.
vinx13 commented on code in PR #13579:
URL: https://github.com/apache/tvm/pull/13579#discussion_r1043729895


##########
tests/python/unittest/test_meta_schedule_schedule_rule_mlt_intrin.py:
##########
@@ -74,16 +74,16 @@ def vnni_conv2d_nchwc_0(placeholder: T.Buffer[(1, 4, 56, 56, 16), "uint8"], plac
         for i0_0, i1_0, i2_0, i3_0, i4_0_0, i0_1, i1_1, i2_1, i3_1, i4_0_1 in T.grid(1, 8, 28, 56, 1, 1, 2, 1, 1, 1):
             for i5_0, i6_0, i7_0, i8_0, i9_0_0, i0_2, i1_2, i2_2, i3_2, i4_0_2, i5_1, i6_1, i7_1, i8_1, i9_0_1, i0_3, i1_3, i2_3, i3_3, i4_0_3 in T.grid(1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1):
                 with T.block("conv2d_NCHWc_int8_o"):
-                    n = T.axis.spatial(1, 0)
+                    n = T.axis.spatial(1, i0_2 + i0_3 + i0_0 + i0_1)

Review Comment:
   yes



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] tvm-bot commented on pull request #13579: [TIR] Add preserve_unit_iters option to blockize/tensorize

Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13579:
URL: https://github.com/apache/tvm/pull/13579#issuecomment-1341771980

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-ccs-start-->
    * cc @Hzfengsy, @junrushao <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] masahi merged pull request #13579: [TIR] Add preserve_unit_iters option to blockize/tensorize

Posted by GitBox <gi...@apache.org>.
masahi merged PR #13579:
URL: https://github.com/apache/tvm/pull/13579


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org