[Bug] MatMul
operator in TVM seems fragile
#16891
Labels
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type: bug
TVM seems to have strict restrictions on
MatMul
operator which means that it cannot use tensors with different shapes.Look at this simple graph. In Pytorch and onnx, the model is correctly defined and the input and output shapes are exactly as shown below.
The evidence is here: https://pytorch.org/docs/stable/generated/torch.matmul.html#torch.matmul
When I try to covert
ONNX
toTVM
, I get an error indicating that the tensor shape is inconsistent. However, When convertingPytorch
toTVM
, everything is OK!I guess one possible reason is that
TorchScript
plays a role in this butONNX
does not.Moreover, look at the last line of the error message. I wonder why T.int64(1) is used here. It seems that TVM has a pretty fragile system of
int64
.Expected behavior
Pass compilation as it can produce results in ONNX and PyTorch.
Actual behavior
Compilation failure
Environment
Operating System: Ubuntu 18
TVM:0.15
Torch: 2.1.1
ONNX: 1.15.0
Steps to reproduce
Here is the script:
Triage
The text was updated successfully, but these errors were encountered: