Open syang-ng opened 2 years ago
import tvm
v = tvm.tir.Var('v', 'float32')
value = tvm.tir.isnan(v)
op = value.op
buf = tvm.tir.buffer.decl_buffer((1,), "bool")
value = tvm.tir.Call('bool', op, [0.0])
s = tvm.tir.Store(buf.data, value, 0)
f = tvm.tir.PrimFunc({buf.data}, s)
tvm.build(f)
Above is what works for me, isnan()
seems buggy with integer type now
Thanks for your reply! I found a similar issue discussed in the forum, it seems that isnan
/ sqrt
/ ... are designed for floating-point numbers. Though these functions accept a floating-point number, they don't check the date type of parameters, and then cause such crash in codegen. Maybe it would be better to tell the developers that they are floating-point specific functions in the document or somewhere else😂
I try to construct the
tir.Call
expression manually, but after I execute thetvm.build
, the program crashes.Expected behavior
Execute
tvm.build()
successfully.Actual behavior
The program will crash if we construct the
tir.isnan
manually.And another interesting thing is that GDB can not print the whole backtraces, just like the image listed below:![image](https://user-images.githubusercontent.com/25731241/139625588-2b89440f-0e65-48fa-8dd5-49d66bff8213.png)
Environment
Ubuntu18.04, cmake 3.18.2, llvm 12, tested on latest git 4087e72
Steps to reproduce
Here is the script to reproduce the bug: