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/11/04 21:55:37 UTC

[GitHub] [tvm] Lunderberg opened a new pull request, #13299: [TIR] Introduce ReduceBranchingThroughOvercompute

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

   This PR introduces a new transform, which attempts to reduce branching by adding overcompute, where the overcompute has provably no effect on any observable value outside the PrimFunc.


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


Re: [PR] [TIR] Introduce ReduceBranchingThroughOvercompute [tvm]

Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on PR #13299:
URL: https://github.com/apache/tvm/pull/13299#issuecomment-1942085566

   @LeiWang1999 We did, yes.  It's located [here](https://github.com/apache/tvm/blob/main/src/tir/transforms/simplify.h#L38).
   
   That said, in most cases it's better to apply [`tir::transform::Simplify`](https://github.com/apache/tvm/blob/main/src/tir/transforms/simplify.h#L38) instead.  That way, the full context is available for a single simplification call.  Simplifying a statement in isolation may miss context-dependent simplifications.  (e.g. Within an `if i==0` block, `if i + 1 < 16` could be simplified to to `True`.)


-- 
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 #13299: [TIR] Introduce ReduceBranchingThroughOvercompute

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

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


Re: [PR] [TIR] Introduce ReduceBranchingThroughOvercompute [tvm]

Posted by "LeiWang1999 (via GitHub)" <gi...@apache.org>.
LeiWang1999 commented on PR #13299:
URL: https://github.com/apache/tvm/pull/13299#issuecomment-1941120265

   hi @Lunderberg , did we implement `Stmt Simplify(Stmt stmt, arith::Analyzer* analyzer);`?


-- 
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] Lunderberg commented on a diff in pull request #13299: [TIR] Introduce ReduceBranchingThroughOvercompute

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


##########
tests/python/unittest/test_tir_transform_simplify.py:
##########
@@ -1689,5 +1689,26 @@ def expected(A: T.Buffer[1, "int32"]):
         A[0] = 12
 
 
+# class TestTemp(BaseBeforeAfter):
+#     """Simplification using prior known"""
+
+#     transitively_prove_inequalities = False
+#     convert_boolean_to_and_of_ors = False
+#     apply_constraints_to_boolean_branches = False
+#     propagate_knowns_to_prove_conditional = False
+#     propagate_knowns_to_simplify_expressions = False
+
+#     def before(A: T.Buffer[16, "int32"]):
+#         for i in T.serial(16):
+#             if i != 0:
+#                 if i * i == 0:
+#                     A[i] = 5
+
+#     def expected(A: T.Buffer[16, "int32"]):
+#         for i in T.serial(16):
+#             if i != 0:
+#                 T.evaluate(0)
+
+

Review Comment:
   Thank you, and removed!



-- 
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] Lunderberg merged pull request #13299: [TIR] Introduce ReduceBranchingThroughOvercompute

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


-- 
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] csullivan commented on pull request #13299: [TIR] Introduce ReduceBranchingThroughOvercompute

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

   @tvm-bot rerun


-- 
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] csullivan commented on a diff in pull request #13299: [TIR] Introduce ReduceBranchingThroughOvercompute

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


##########
tests/python/unittest/test_tir_transform_simplify.py:
##########
@@ -1689,5 +1689,26 @@ def expected(A: T.Buffer[1, "int32"]):
         A[0] = 12
 
 
+# class TestTemp(BaseBeforeAfter):
+#     """Simplification using prior known"""
+
+#     transitively_prove_inequalities = False
+#     convert_boolean_to_and_of_ors = False
+#     apply_constraints_to_boolean_branches = False
+#     propagate_knowns_to_prove_conditional = False
+#     propagate_knowns_to_simplify_expressions = False
+
+#     def before(A: T.Buffer[16, "int32"]):
+#         for i in T.serial(16):
+#             if i != 0:
+#                 if i * i == 0:
+#                     A[i] = 5
+
+#     def expected(A: T.Buffer[16, "int32"]):
+#         for i in T.serial(16):
+#             if i != 0:
+#                 T.evaluate(0)
+
+

Review Comment:
   Will need to remove this.



-- 
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] Lunderberg commented on pull request #13299: [TIR] Introduce ReduceBranchingThroughOvercompute

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

   @csullivan This PR is ready for review and passing all unit tests, if you have a chance to review.


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