You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Hzfengsy (via GitHub)" <gi...@apache.org> on 2023/08/03 16:59:13 UTC

[GitHub] [tvm] Hzfengsy opened a new pull request, #15471: [ARITH] Enhance Canonical Simplify for LE

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

   This PR enhances the canonical simplifier to support the following patterns:
   
   `x0 * s0 + x1 * s1 + ... + xn + c < 0, let d = gcd(s0, s1, ..., s{n-1}, c)`
   
   1. if can prove -d < xn < d, then we can simplify the expression to `x0 * (s0/d) + x1 * (s1/d) + ... + x{n-1} * (s{n-1}/d) < c/d`, e.g. `x * 8 + y < 16` where `y` \in [0, 8), we can simplify it to `x < 2`
   2. if xn is in pattern of yn % m, where m % d == 0, convert it to yn // d % (m/d) e.g. `x1 * 64 + (x2 * 8 + x3) % 64 < 120`, `x3` \in [0, 8), we can simplify it to `x1 * 8 + (x2 * 8 + x3) // 8 % 8 < 15` ==> `x1 * 8 + x2 % 8 < 15`
   
   cc @tqchen 


-- 
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] tqchen merged pull request #15471: [ARITH] Enhance Canonical Simplify for LE

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


-- 
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 #15471: [ARITH] Enhance Canonical Simplify for LE

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

   <!---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 @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] Hzfengsy commented on a diff in pull request #15471: [ARITH] Enhance Canonical Simplify for LE

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


##########
tests/python/unittest/test_target_codegen_c_host.py:
##########
@@ -64,7 +64,8 @@ def test_add_pipeline():
     s[C].pragma(xo1, "parallel_launch_point")
     s[C].pragma(xo2, "parallel_stride_pattern")
     s[C].pragma(xo2, "parallel_barrier_when_finish")
-    s[C].vectorize(xi)
+    # FIXME(tvm-team): vector operators are not supported for codegen to C yet

Review Comment:
   This case is because of the poor support of vectorization for c_codegen.
   Before this PR, TVM failed to simplify the branch predicate and skip the vectorization. This PR enhances the arith, and makes it TRUE vectoring, but failed on codegen stage.
   
   In short:
   1. It's not related to this PR, as it's codegen issue
   2. It's not a regression, vectorized step is skipped before this PR.



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