Skip to content

Conversation

@MasterJH5574
Copy link
Contributor

PR #15471 enhances the simplification for LE, while missed a case where the upper bound kPosInf is divisible by a factor. Therefore, prior to this PR, when simplifying x * 1024 + y < z * 7168, it will fails with the error message

InternalError: Check failed: value < 1LL << (dtype.bits() - 1)
(8589934591 vs. 2147483648) : ValueError: Literal value 8589934591
exceeds maximum of int32

This is just because the upper bound 7 here divides kPosInf the maximum value of int64, which passes an "if" condition in #15471 unexpectedly.

This PR fixes the issue.

PR apache#15471 enhances the simplification for LE, while missed a case
where the upper bound `kPosInf` is divisible by a factor. Therefore,
prior to this PR, when simplifying `x * 1024 + y < z * 7168`, it will
fails with the error message
```
InternalError: Check failed: value < 1LL << (dtype.bits() - 1)
(8589934591 vs. 2147483648) : ValueError: Literal value 8589934591
exceeds maximum of int32
```

This is just because the upper bound 7 here divides `kPosInf` the
maximum value of int64, which passes an "if" condition in apache#15471
unexpectedly.

This PR fixes the issue.
@MasterJH5574 MasterJH5574 force-pushed the tvm-dev/2024-03-12-arith-le branch from 4bbca4b to 2b66744 Compare March 12, 2024 05:33
@tqchen
Copy link
Member

tqchen commented Mar 12, 2024

Great fix!

@tqchen tqchen merged commit f34a58a into apache:main Mar 12, 2024
thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
PR apache#15471 enhances the simplification for LE, while missed a case
where the upper bound `kPosInf` is divisible by a factor. Therefore,
prior to this PR, when simplifying `x * 1024 + y < z * 7168`, it will
fails with the error message
```
InternalError: Check failed: value < 1LL << (dtype.bits() - 1)
(8589934591 vs. 2147483648) : ValueError: Literal value 8589934591
exceeds maximum of int32
```

This is just because the upper bound 7 here divides `kPosInf` the
maximum value of int64, which passes an "if" condition in apache#15471
unexpectedly.

This PR fixes the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants