apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.75k stars 3.47k forks source link

[Bug] tvm/apps/howto_deploy crash #13075

Open engineer1109 opened 2 years ago

engineer1109 commented 2 years ago

Actual behavior

Build the libraries..
python3 prepare_test_libs.py
/usr/local/lib/python3.8/dist-packages/tvm/target/target.py:799: UserWarning: tvm.target.create() is being deprecated. Please use tvm.target.Target() instead
  warnings.warn("tvm.target.create() is being deprecated. Please use tvm.target.Target() instead")
g++ -c -std=c++17 -O2 -fPIC -I/home/wjl/gitlab_xdx/tvm/include -I/home/wjl/gitlab_xdx/tvm/3rdparty/dmlc-core/include -I/home/wjl/gitlab_xdx/tvm/3rdparty/dlpack/include -DDMLC_USE_LOGGING_LIBRARY=\<tvm/runtime/logging.h\> -o lib/libtvm_runtime_pack.o  tvm_runtime_pack.cc
g++ -std=c++17 -O2 -fPIC -I/home/wjl/gitlab_xdx/tvm/include -I/home/wjl/gitlab_xdx/tvm/3rdparty/dmlc-core/include -I/home/wjl/gitlab_xdx/tvm/3rdparty/dlpack/include -DDMLC_USE_LOGGING_LIBRARY=\<tvm/runtime/logging.h\> -o lib/cpp_deploy_pack  cpp_deploy.cc lib/test_addone_sys.o lib/libtvm_runtime_pack.o -L/home/wjl/gitlab_xdx/tvm/build -ldl -pthread
g++ -std=c++17 -O2 -fPIC -I/home/wjl/gitlab_xdx/tvm/include -I/home/wjl/gitlab_xdx/tvm/3rdparty/dmlc-core/include -I/home/wjl/gitlab_xdx/tvm/3rdparty/dlpack/include -DDMLC_USE_LOGGING_LIBRARY=\<tvm/runtime/logging.h\> -o lib/cpp_deploy_normal  cpp_deploy.cc lib/test_addone_sys.o -ltvm_runtime -L/home/wjl/gitlab_xdx/tvm/build -ldl -pthread
Run the example
Run the deployment with all in one packed library...
[11:32:28] cpp_deploy.cc:77: Verify dynamic loading from test_addone_dll.so
[11:32:28] cpp_deploy.cc:69: Finish verification...
[11:32:28] cpp_deploy.cc:81: Verify load function from system lib
terminate called after throwing an instance of 'tvm::runtime::InternalError'
  what():  [11:32:28] cpp_deploy.cc:34: 
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
  Check failed: (f != nullptr) is false: 
Stack trace:
  [bt] (0) lib/cpp_deploy_pack(+0x1bd5c) [0x55bdf3b99d5c]
  [bt] (1) lib/cpp_deploy_pack(+0x6f19) [0x55bdf3b84f19]
  [bt] (2) lib/cpp_deploy_pack(+0x130a4) [0x55bdf3b910a4]
  [bt] (3) lib/cpp_deploy_pack(+0x139a9) [0x55bdf3b919a9]
  [bt] (4) lib/cpp_deploy_pack(+0xe45d) [0x55bdf3b8c45d]
  [bt] (5) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f74a909d083]
  [bt] (6) lib/cpp_deploy_pack(+0x1298e) [0x55bdf3b9098e]

Aborted (core dumped)
Run the cpp deployment with all in normal library...
[11:32:29] cpp_deploy.cc:77: Verify dynamic loading from test_addone_dll.so
[11:32:29] cpp_deploy.cc:69: Finish verification...
[11:32:29] cpp_deploy.cc:81: Verify load function from system lib
terminate called after throwing an instance of 'tvm::runtime::InternalError'
  what():  [11:32:29] cpp_deploy.cc:34: 
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
  Check failed: (f != nullptr) is false: 
Stack trace:
  0: Verify(tvm::runtime::Module, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
  1: DeploySingleOp()
  2: main
  3: __libc_start_main
        at ../csu/libc-start.c:308
  4: _start
  5: 0xffffffffffffffff

Aborted (core dumped)
Run the python deployment with all in normal library...
Verify dynamic loading from test_addone_dll.so
Finish verification...

Environment

Ubuntu 20.04 GCC 9.4.0 TVM 0.9.0

Steps to reproduce

cd tvm/apps/howto_deploy
sh run_example.sh

Verify Function is all failed. Function is nullptr when loading so

anmolsahoo25 commented 2 years ago

13223 should fix this.