tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bug] an ONNX model after compiling with TVM is inconsistent with ONNXRuntime

Open luyaor opened this issue 3 years ago • 0 comments

Expected behavior

When feed the same input into the same model, one in TVM, another in ONNXRuntime, we supposed that their results are the same.

image

Actual behavior

TVM's result is not aligned with ONNXRuntime's (the shape of output tensor is different).

ONNXRuntime:

[array([[ 2.6177902 ,  1.        , -0.873482  ,  1.9409859 ,  1.766757  ,
        -0.53547204, -0.16376647,  0.4463795 ,  1.7661378 ,  1.9461765 ,
         1.2478232 ,  1.899035  ]], dtype=float32)]

TVM:

[[ 2.6177902   1.         -0.873482    1.9409859   1.766757   -0.53547204
  -0.16376647  0.4463795   1.7661378   1.9461765  -0.436741    0.97049296
   0.8833785  -0.26773602 -0.08188324  0.22318976  0.8830689   0.97308826]]

Environment

TVM v0.9

Steps to reproduce

  1. set up Python 3 environment with TVM(v0.9), numpy, onnx, onnxruntime
  2. Download bug-no1.zip
  3. python check.py

luyaor avatar Sep 08 '22 10:09 luyaor