Open KuiliangL opened 1 year ago
Hi @blufissure. I cannot reproduce this crash in the latest TVM (i.e., 0.13.dev0). I guess this bug has been fixed.
Hi @blufissure. I cannot reproduce this crash in the latest TVM (i.e., 0.13.dev0). I guess this bug has been fixed.
In the latest version, TVM will not check the negative unsigned integer, so this problem will not occur in the latest version.
Here is another example
import tvm
from tvm import tir
a=tir.IntImm('uint32',73829502)
zero1=tir.IntImm('uint32',0)
div1=tir.Div(a,zero1)
v1=tir.Var('v1','int32')
itevars=tir.IterVar([-16, 0], v1, 4, 'vthread.z')
body1 = tir.AttrStmt(itevars,'rolling_buffer_scope',div1,tir.Evaluate(1.6))
body2 = tir.IfThenElse(tir.LT(3,1),body1,tir.Evaluate(0))
func=tir.PrimFunc([],body=body2)
tvm.build(func)
Hello, I’m studying TVM and its low-level operators recently. I tried to construct some test files but I was puzzled by the results of some of the files. When I built different statements, different execution results have occurred. The reason that TVM throws the exception is that TVM checks the uint’s value and finds the uint expression is negative. But I still have two questions:
Why using different Attribute type key can lead to different execution results?(see Primfunc with body1 and body2)
Why using
IfThenElse
statement and using different statements as body can lead to different execution results?The attribute statement with
pragma_auto_unroll_max_step
will execute normally (see PrimFunc with body4). But theLetStmt
statement throws the exception(see PrimFunc with body6). I don't know what causes this difference in execution and whether TVM checks the branch’s expression if the branch is not executed. I have noticed that this problem maybe occurs in the specific version. I’d be appreciated if anyone can help me.Actual behavior
The PrimFunc with body1,body3 and body6 will throw the exception and the PrimFunc with body2,body4 and body5 will execute normally. The error messages are:![image](https://user-images.githubusercontent.com/43975378/234781917-77c7958b-e532-43bc-b0e1-cad46b5a6efc.png)
Environment
TVM version 0.10.dev0, git commit ee319d9d23c80091da9c4fb764b1e6d49d462714
Steps to reproduce
Triage