You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "rutkoor (via GitHub)" <gi...@apache.org> on 2023/12/12 05:40:55 UTC

[PR] [Arith] Simplify nested if_then_else when constant is appearing in then_expr [tvm]

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

   When constant is appearing in the else_expr, Simplifier pass is able to simplify the nested if_then_else expression and eliminate the redundant if_then_else. But, when constant is appearing in the then_expr, it is unable to simplify the nested if_then_else statements.
   
   The changes in the PR will address the above problem.


-- 
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] [ARITH] Simplify nested if_then_else when constant is appearing in then_expr [tvm]

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

   @tqchen , @junrushao , @Lunderberg 


-- 
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] [ARITH] Simplify nested if_then_else when constant is appearing in then_expr [tvm]

Posted by "quic-sanirudh (via GitHub)" <gi...@apache.org>.
quic-sanirudh merged PR #16227:
URL: https://github.com/apache/tvm/pull/16227


-- 
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] [ARITH] Simplify nested if_then_else when constant is appearing in then_expr [tvm]

Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on code in PR #16227:
URL: https://github.com/apache/tvm/pull/16227#discussion_r1427218216


##########
tests/python/tir-transform/test_tir_transform_simplify.py:
##########
@@ -1757,5 +1757,27 @@ def expected(a: T.handle):
         A[T.int64(1)] = T.float32(0)
 
 
+class TestNestedIfElimination(BaseBeforeAfter):
+    def before(a: T.Buffer((2, 8), "int32"), b: T.Buffer((2, 8), "int32")):
+        for i0, j0 in T.grid(2, 8):
+            with T.block("P"):

Review Comment:
   Does the test case depend on the `BlockNode` being present?  If not, we should remove it.  (Removing the `with T.block`, `T.axis.remap`, `T.reads`, and `T.writes` lines, then using `i0` and `j0` directly.)



-- 
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] [ARITH] Simplify nested if_then_else when constant is appearing in then_expr [tvm]

Posted by "rutkoor (via GitHub)" <gi...@apache.org>.
rutkoor commented on code in PR #16227:
URL: https://github.com/apache/tvm/pull/16227#discussion_r1427604750


##########
tests/python/tir-transform/test_tir_transform_simplify.py:
##########
@@ -1757,5 +1757,27 @@ def expected(a: T.handle):
         A[T.int64(1)] = T.float32(0)
 
 
+class TestNestedIfElimination(BaseBeforeAfter):
+    def before(a: T.Buffer((2, 8), "int32"), b: T.Buffer((2, 8), "int32")):
+        for i0, j0 in T.grid(2, 8):
+            with T.block("P"):

Review Comment:
   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