You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "tqchen (via GitHub)" <gi...@apache.org> on 2023/04/10 23:43:51 UTC

[GitHub] [tvm] tqchen opened a new pull request, #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   This PR fixes a previous bug introduced in itermap detection.
   
   Specifically, y - (x % 2) were simplified to y + (x % 2) - 1. Which is wrong. The working rule is  y + ((x + 1) % 2) - 1, but that rule will change the base iterator which is not desirable here.


-- 
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] junrushao commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   This is merged. Thanks for digging into the analysis!


-- 
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 #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   Thank you for finding the error there.  The rewrite were initially introduced to allow simplification of cases of `(x+const)%2` introduced by the `InjectSoftwarePipeline` pass, with equivalent changes made for `DetectIterMap` so that it could handle the simplified expressions.
   
   I agree that the `DetectIterMap` changes are definitely incorrect, and am going through the rewrite rules introduced in that PR to check whether they had a similar error, or whether the error was solely in the `IterMapSimplify` changes.


-- 
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] junrushao merged pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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


-- 
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 commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   I think the gist is that we should avoid to rewrite `(x+1)%2` to `1-x%2` in general. Although this is correct, change positive sign to a negative coefficient will cause issues for iter map detection in general, and is not desirable.


-- 
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 commented on a diff in pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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


##########
3rdparty/cutlass:
##########


Review Comment:
   done



-- 
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 commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   Would also be good to put up such expressions in TVMScript so we have context for new rules
   
   For example, some of the (i +1) %2 expressions do not need simplification mainly because they are in an unrolled loop and the expression will become constant later


-- 
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 commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   Update: We also removed the rule that simplifies  (x + 1) % 2 => 1 - x % 2
   as benefit is minimal and it introduces extra negative cooefficients
   that hurts analysis in general (as negative coefficients are
   harder in many cases).
   
   
   Another take away: we should avoid putting too much burdens on rewrite simplify, some of the examples(that covers long range dependencies) can be better covered by canonical as a result do not need to goto rewrite. Let us check the cases under broader simplifier before adding a new rule for long range dep
   


-- 
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] wrongtest-intellif commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   
   The case `test_postproc_disallow_async_strided_mem_copy_allows` wants to check below index is contiguous but unfortunately failed, I guess it is because rewrite rules in https://github.com/apache/tvm/pull/13936 mutate the sign?
   
   `ax0 + 1024 - j % 2 * 1024`
   
   {i: T.Range(0, 1024), ax0: T.Range(0, 1024), j: T.Range(0, 1023), ax0: T.Range(0, 1024)}


-- 
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 #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   <!---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] tqchen commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

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


[GitHub] [tvm] Lunderberg commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   Thank you, and that makes sense for now.  I'm seeing if I can find the expression that required this simplification step in order to enable a cancellation, but however it gets re-implemented should avoid the breakage in iter map simplification.


-- 
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] junrushao commented on a diff in pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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


##########
3rdparty/cutlass:
##########


Review Comment:
   I think the PR is good to merge, but please revert the change to 3rdparty/cutlass



-- 
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 commented on pull request #14571: [ARITH][BUGFIX] Fix a bug of iter map floormod(x,2) simplify

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

   That is my guess as well. Would be great to confirm if that is the case. We should prioritize the iter map rewrite and avoid mutate sign of iter map expressions.


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