You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/03/10 14:51:39 UTC
[GitHub] [incubator-tvm] dpankratz opened a new pull request #5026: [Bugfix]
Fixed div by zero core dump. Fixed rounding intrinsics on int crash
dpankratz opened a new pull request #5026: [Bugfix] Fixed div by zero core dump. Fixed rounding intrinsics on int crash
URL: https://github.com/apache/incubator-tvm/pull/5026
## Div by zero crash
I found and fixed 2 instances where a divide by zero could be evaluated in `const_fold` causing a Python core dump. For example `tir.const(2) % 0`.
## Rounding intrinsics
When I tried to use llvm intrinsics on integers I found all of them but `popcount` result in an error analogous to:
```
TVMError: LLVM module verification failed with the following errors:
Intrinsic has incorrect return type!
i32 (i32)* @llvm.floor.i32
```
To fix this for `trunc,floor,ceil,nearbyint,round` it is sufficient to return the int expr and avoid the call altogether.
## Other intrinsics
I was looking at fixing the above crash for other intrinsics (`sin,cos,atan,tan,tanh,sigmoid,log,erf,exp,sqrt,rsqrt`) by restricting their usage to floating point numbers. However applying `exp` and `sqrt` to `bool` type seems to be relied on in this test:
https://github.com/apache/incubator-tvm/blob/master/topi/tests/python/test_topi_reduce.py#L51
Evaluating this line for a bool is equivalent to a tautology which makes me suspect it is not intended. If the reviewer(s) agree that these intrinsics should not be applied to ints, then I can add a front-end checks on the instrinsics to this PR and fix the tests.
I would appreciate a review!
@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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] tqchen commented on issue #5026: [Bugfix] Fixed div
by zero core dump. Fixed rounding intrinsics on int crash
Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #5026: [Bugfix] Fixed div by zero core dump. Fixed rounding intrinsics on int crash
URL: https://github.com/apache/incubator-tvm/pull/5026#issuecomment-598287318
Thanks @dpankratz !
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] tqchen commented on issue #5026: [Bugfix] Fixed div
by zero core dump. Fixed rounding intrinsics on int crash
Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #5026: [Bugfix] Fixed div by zero core dump. Fixed rounding intrinsics on int crash
URL: https://github.com/apache/incubator-tvm/pull/5026#issuecomment-597918794
seems that the rebase mess up with the commit history someone, can you try to re-apply the changes on top of the master? Try
```python
git rebase --onto upstream/master HEAD~1
```
This takes your last commit and rebase it on top of the master
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] tqchen commented on issue #5026: [Bugfix] Fixed div
by zero core dump. Fixed rounding intrinsics on int crash
Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #5026: [Bugfix] Fixed div by zero core dump. Fixed rounding intrinsics on int crash
URL: https://github.com/apache/incubator-tvm/pull/5026#issuecomment-597750806
LTGM, @dpankratz can you please rebase against the master
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] tqchen merged pull request #5026: [Bugfix] Fixed
div by zero core dump. Fixed rounding intrinsics on int crash
Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #5026: [Bugfix] Fixed div by zero core dump. Fixed rounding intrinsics on int crash
URL: https://github.com/apache/incubator-tvm/pull/5026
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] dpankratz commented on issue #5026: [Bugfix] Fixed
div by zero core dump. Fixed rounding intrinsics on int crash
Posted by GitBox <gi...@apache.org>.
dpankratz commented on issue #5026: [Bugfix] Fixed div by zero core dump. Fixed rounding intrinsics on int crash
URL: https://github.com/apache/incubator-tvm/pull/5026#issuecomment-597940167
@tqchen Let me know if that looks good. Thanks for your advice with that command!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services