Skip to content

[Bug] Runtime crash due to dtype mismatch #18099

@duduhedangdang

Description

@duduhedangdang

Expected behavior

Running the generated model with tvm.runtime.GraphExecutor.run() should finish without crashing.
If the input tensor dtype is mismatched, TVM should gracefully raise a Python‐level error instead of hitting an internal CHECK and aborting.

Actual behavior

TVM aborts at runtime with an assertion failure in src/runtime/library_module.cc:

Environment

Item Value
TVM commit v0.9.dev0
OS Ubuntu 20.04
Python 3.8.13 (conda env)
LLVM <llvm-config --10.0.0>
Model source auto-generated ONNX via our fuzzing script

ERROR:
python /home/heyifei/anaconda3/envs/main.py --max_nodes 10 --seed 976170717 --viz_graph
Traceback (most recent call last):
[bt] (6) /tvm/build/libtvm.so(TVMFuncCall+0x6d) [0x75be7579395d]
[bt] (5) /tvm/build/libtvm.so(+0x32bc16a) [0x75be758a716a]
[bt] (4) /tvm/build/libtvm.so(tvm::runtime::GraphExecutor::Run()+0x48) [0x75be75896248]
[bt] (3) /tvm/build/libtvm.so(+0x32ba3ce) [0x75be758a53ce]
[bt] (2) /tvm/build/libtvm.so(+0x31c9a25) [0x75be757b4a25]
[bt] (1)/tvm/build/libtvm.so(tvm::runtime::detail::LogFatal::Entry::Finalize()+0x67) [0x75be7346b157]
[bt] (0) /tvm/build/libtvm.so(tvm::runtime::Backtraceabi:cxx11+0x1b) [0x75be757b676b]
File "/tvm/src/runtime/library_module.cc", line 80
TVMError:

An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html

Check failed: ret == 0 (-1 vs. 0) : Assert fail: (((tir.tvm_struct_get(arg.placeholder_red, 0, 5) == (uint8)0) && (tir.tvm_struct_get(arg.placeholder_red, 0, 6) == (uint8)64)) && (tir.tvm_struct_get(arg.placeholder_red, 0, 7) == (uint16)1)), arg.placeholder_red.dtype is expected to be int64

2025-04-15-15-37-12_none_opt-1.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions