[ARITH] Add support for EQ op in the deduce bound and the loop partition#3775
Merged
tqchen merged 1 commit intoapache:masterfrom Sep 13, 2019
Merged
[ARITH] Add support for EQ op in the deduce bound and the loop partition#3775tqchen merged 1 commit intoapache:masterfrom
EQ op in the deduce bound and the loop partition#3775tqchen merged 1 commit intoapache:masterfrom
Conversation
0bec9a3 to
5a765c0
Compare
Contributor
Author
|
@ZihengJiang @tqchen @derisavi @xqdan can you please review this? thanks. |
umangyadav
commented
Aug 14, 2019
| assert str(res9.min_value) == "pos_inf" | ||
|
|
||
| # Unsatisfiable Mul in `EQ` | ||
| res10 = tvm.arith.DeduceBound(a, (b * a == b), {b: b_s}, {}) # simplifier is not able to prove that (b % b == 0) |
Contributor
Author
Member
There was a problem hiding this comment.
This can be improved by adding a rewrite pattern
EQ op in the deduce bound and the loop partitionEQ op in the deduce bound and the loop partition
5a765c0 to
876cba0
Compare
u99127
reviewed
Aug 15, 2019
yzhliu
approved these changes
Sep 4, 2019
src/arithmetic/bound_deducer.cc
Outdated
| case kGreater: return kLess; | ||
| case kLess: return kGreater; | ||
| default: | ||
| return kGreater; |
Contributor
Author
| assert str(res9.min_value) == "pos_inf" | ||
|
|
||
| # Unsatisfiable Mul in `EQ` | ||
| res10 = tvm.arith.DeduceBound(a, (b * a == b), {b: b_s}, {}) # simplifier is not able to prove that (b % b == 0) |
Member
|
ping @umangyadav @tqchen |
2) Add EQ support in the loop partition and add test for the same 3) Change typo truc to trunc
876cba0 to
c0b5407
Compare
Contributor
Author
tqchen
approved these changes
Sep 13, 2019
Member
|
Thanks @umangyadav @yzhliu @u99127 |
wweic
pushed a commit
to wweic/tvm
that referenced
this pull request
Sep 16, 2019
…he#3775) 2) Add EQ support in the loop partition and add test for the same 3) Change typo truc to trunc
wweic
pushed a commit
to wweic/tvm
that referenced
this pull request
Sep 16, 2019
…he#3775) 2) Add EQ support in the loop partition and add test for the same 3) Change typo truc to trunc
wweic
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Sep 16, 2019
…he#3775) 2) Add EQ support in the loop partition and add test for the same 3) Change typo truc to trunc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves #3774
Adds support for
EQop in the deduce bound.The main check required for
EQis that both LHS and RHS should be constant at the time of relaxing them. e.g. for(i==j)then, bothEvalSetoveriandjboth should be a single point. In other words,EQcondition can not be resolved if one of the operands is variable.Secondly, for
EQwith multiplication where there is no perfect division, e.g(4 * i == 10)can not be solved because division truncation will change one of the operands.This PR extends
DeduceBoundforEQand adds unittests for the same.LoopPartition uses the deduce_bound and with
EQsupport, LoopPartition is also changed to partition based onEQconditions. Unittest for the same is added.