You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
params removed in remove_unused_args pass shouldn't be checked in make_packed_api pass
Actual behavior
In primfunc with dynamic behavior, Variable args used in describing an axis metadata (shape of indices buffer, indptr buffer or data buffer) are removed in remove_unused_args pass, but are required in VarUseDefAnalysis of make_packed_api pass.
From this example we can see m and n are removed from arg list, since they are only used in describing the shape of B_data buffer and C_data and some block read region and write region.All of these place are not included in remove_unused_args pass, so they are removed from the arg list.
However, these args are checked in VarUseDefAnalysis pass and used to check DLTensor shape of B_data&&C_data, and cause the error message:
TVMError: Not all Vars are passed in api_args: 'n' 'm' is not bound to any variables
possiable solutions
Keep var used in BufferNode shape and stride field in the arg list. We can modify the solution in VarUseDefAnalysis pass for BufferNode.
Also,this solution won't influence current case,since we remove these vars by specializing them before remove_unused_args pass with constant value.
The text was updated successfully, but these errors were encountered:
@yzh119 Do you mean simply bypass the var checking in buffer shape and stride field in VarUseDefAnalysis pass?
If so, I am wondering will it cause an assertion error when checking B_data or C_data buffer shape during excution,or it can inversely derive the value of these vars using actual buffer shape even the shape is calculated by different symbolic vars. In other word, can we just treat these symbolic var with T.int32 type as a var declared by T.var("int32") in the body of TVM Script function?
Expected behavior
params removed in remove_unused_args pass shouldn't be checked in make_packed_api pass
Actual behavior
In primfunc with dynamic behavior, Variable args used in describing an axis metadata (shape of indices buffer, indptr buffer or data buffer) are removed in remove_unused_args pass, but are required in VarUseDefAnalysis of make_packed_api pass.
Case
TVM Script kernel:
Primfunc before make_packed_api (decompose format with 5 buckets and 2 tile blocks)
From this example we can see
m
andn
are removed from arg list, since they are only used in describing the shape of B_data buffer and C_data and some block read region and write region.All of these place are not included in remove_unused_args pass, so they are removed from the arg list.However, these args are checked in VarUseDefAnalysis pass and used to check DLTensor shape of B_data&&C_data, and cause the error message:
possiable solutions
Keep var used in BufferNode shape and stride field in the arg list. We can modify the solution in VarUseDefAnalysis pass for BufferNode.
Also,this solution won't influence current case,since we remove these vars by specializing them before remove_unused_args pass with constant value.
The text was updated successfully, but these errors were encountered: