autowarefoundation / modelzoo

A collection of machine-learned models for use in autonomous driving applications.
https://www.autoware.org/
Apache License 2.0
62 stars 24 forks source link

Update TVM version to 0.10 #77

Closed ambroise-arm closed 1 year ago

ambroise-arm commented 1 year ago

TVM v0.10.0 has been released: https://github.com/apache/tvm/releases/tag/v0.10.0

Update from the current 0.8 version.

ambroise-arm commented 1 year ago

Regression: baidu_cnn does't compile for Vulkan with TVM 0.10 (bisecting TVM gives https://github.com/apache/tvm/pull/10423 as the culprit)

$ tvmc compile --target vulkan model_files/bcnn.onnx 
One or more operators have not been tuned. Please tune your model for better performance. Use DEBUG logging level to see more details.
Traceback (most recent call last):
  File "/usr/local/bin/tvmc", line 11, in <module>
    load_entry_point('tvm==0.10.0.dev1+gda7b48f94', 'console_scripts', 'tvmc')()
  File "/usr/local/lib/python3.8/dist-packages/tvm-0.10.0.dev1+gda7b48f94-py3.8-linux-aarch64.egg/tvm/driver/tvmc/main.py", line 115, in main
    sys.exit(_main(sys.argv[1:]))
  File "/usr/local/lib/python3.8/dist-packages/tvm-0.10.0.dev1+gda7b48f94-py3.8-linux-aarch64.egg/tvm/driver/tvmc/main.py", line 103, in _main
    return args.func(args)
  File "/usr/local/lib/python3.8/dist-packages/tvm-0.10.0.dev1+gda7b48f94-py3.8-linux-aarch64.egg/tvm/driver/tvmc/compiler.py", line 180, in drive_compile
    compile_model(
  File "/usr/local/lib/python3.8/dist-packages/tvm-0.10.0.dev1+gda7b48f94-py3.8-linux-aarch64.egg/tvm/driver/tvmc/compiler.py", line 353, in compile_model
    graph_module = build(
  File "/usr/local/lib/python3.8/dist-packages/tvm-0.10.0.dev1+gda7b48f94-py3.8-linux-aarch64.egg/tvm/driver/tvmc/compiler.py", line 428, in build
    return relay.build(
  File "/usr/local/lib/python3.8/dist-packages/tvm-0.10.0.dev1+gda7b48f94-py3.8-linux-aarch64.egg/tvm/relay/build_module.py", line 364, in build
    graph_json, runtime_mod, params = bld_mod.build(
  File "/usr/local/lib/python3.8/dist-packages/tvm-0.10.0.dev1+gda7b48f94-py3.8-linux-aarch64.egg/tvm/relay/build_module.py", line 161, in build
    self._build(
  File "tvm/_ffi/_cython/./packed_func.pxi", line 331, in tvm._ffi._cy3.core.PackedFuncBase.__call__
  File "tvm/_ffi/_cython/./packed_func.pxi", line 276, in tvm._ffi._cy3.core.FuncCall
  File "tvm/_ffi/_cython/./base.pxi", line 181, in tvm._ffi._cy3.core.CHECK_CALL
tvm._ffi.base.TVMError: Traceback (most recent call last):
  14: TVMFuncCall
  13: _ZN3tvm7runtime13PackedFuncObj9ExtractorINS0_16P
  12: tvm::relay::backend::RelayBuildModule::GetFunction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#3}::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const
  11: tvm::relay::backend::RelayBuildModule::BuildRelay(tvm::IRModule, tvm::runtime::String const&)
  10: tvm::TIRToRuntime(tvm::runtime::Map<tvm::Target, tvm::IRModule, void, void> const&, tvm::Target const&)
  9: tvm::SplitMixedModule(tvm::IRModule, tvm::Target const&, tvm::Target const&)
  8: tvm::ApplyPasses(tvm::IRModule, tvm::transform::Sequential)
  7: tvm::transform::Pass::operator()(tvm::IRModule) const
  6: tvm::transform::Pass::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
  5: tvm::transform::SequentialNode::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
  4: tvm::transform::Pass::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
  3: tvm::transform::ModulePassNode::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
  2: _ZN3tvm7runtime13PackedFuncObj9ExtractorINS0_16PackedFuncSubObjIZNS0_15TypedPackedFuncIFNS_8IRModuleES5_NS_9transform11PassContextEEE17AssignTypedLambdaIZNS_3tir9transform13MakePackedAPIEiEUlS5_S7_E_EEvT_EUlRKNS0_7TVMArgsEPNS0_11TVMRetValueEE_EEE4CallEPKS1_SF_SJ_
  1: tvm::tir::transform::MakePackedAPI(int)::{lambda(tvm::IRModule, tvm::transform::PassContext)#1}::operator()(tvm::IRModule, tvm::transform::PassContext) const [clone .isra.0]
  0: tvm::tir::MakePackedAPI(tvm::tir::PrimFunc&&, int)
  File "../src/tir/transforms/make_packed_api.cc", line 329
TVMError: Not all Vars are passed in api_args:  'blockIdx.y'  is not bound to any variables

(same on x86)

EDIT: also happens for opencl backend

Issue raised here: https://discuss.tvm.apache.org/t/model-compilation-fails-on-gpu-target/13866

EDIT: fixed by https://github.com/apache/tvm/pull/13341