apache / apache/tvm

[Bug] TVM result diverges from reference

Open
#18,100 0 comments 0 reactions 0 assignees View on GitHub
needs-triage type: bug
Dominant language
Python
Stars
13.7k
Forks
4k
Avg merge
2d 1h
Merged PRs (30d)
112

Description

### Expected behavior
TVM-compiled model should match PyTorch reference within `rtol=0.01`, `atol=0.001`.

### Actual behavior
Mismatch detected in tensor **o2** (layer index 2):

### Environment
| Item | Value |
|------|-------|
| TVM | v0.9.dev |
| OS | Ubuntu 20.04 |
| Python | 3.8.13 |
| LLVM | 10.0.0 |

###Error
tvm-omax v.s. PyTorch mismatch in #2 tensor named o2:
Not equal to tolerance rtol=0.01, atol=0.001

Mismatched elements: 1 / 8 (12.5%)
Max absolute difference: 87176.266
Max relative difference: 10.557457
x: array([[[[ 1.533974e+00],
[-4.493160e+00]],
...
y: array([[[[ 1.533026e+00],
[-4.493160e+00]],
...

[2025-04-27-19-25-44_none_opt2.zip](https://github.com/user-attachments/files/20961712/2025-04-27-19-25-44_none_opt2.zip)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attached 2025-04-27-19-25-44_none_opt2.zip and reproduce the TVM-versus-PyTorch comparison in the listed Ubuntu, Python, TVM, and LLVM environment. Investigate the mismatch in tensor o2 at layer index 2; done means the compiled result matches the reference within rtol=0.01 and atol=0.001.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.