-
Notifications
You must be signed in to change notification settings - Fork 64
import torch_tvm error #149
Comments
Have you built PyTorch from source? |
I used pip to install pytorch. Is it necessary to build pytorch from souce? |
Hi, I have a similar (or maybe same) error: This is the end of
and is in a docker container with this
|
It shouldn't be necessary to build from source, but there are unfortunately C++ ABI compatibility issues that typically arise from not building from source. The C++ ABI shipped with the pip install of PyTorch usually isn't compatible with system installed LLVMs. You can try downloading lib torch directly (and ensuring it uses the same C++ 11 ABI as your LLVM), but I'd recommend building PT from source. Note: There are some work items on my end that will make this a bit smoother, as we are currently C++ABI unaware in the pytorch/tvm CMakeLists.txt. Filed an issue here: #154 |
I found this error aswell, and it looks like it is due to pytorch/pytorch#30315 (which affects PyTorch 1.4) so the
Also shows up in CircleCI build 697 |
python setup.py test
output:
========================================================================================================= test session starts =========================================================================================================
platform linux -- Python 3.7.4, pytest-5.3.2, py-1.8.1, pluggy-0.13.1
rootdir: /tvm, inifile: setup.cfg, testpaths: test
collected 0 items / 3 errors
=============================================================================================================== ERRORS ================================================================================================================
_________________________________________________________________________________________________ ERROR collecting test/test_core.py __________________________________________________________________________________________________
ImportError while importing test module '/tvm/test/test_core.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test/test_core.py:2: in
from test.util import TVMTest
test/util.py:12: in
import torch_tvm
torch_tvm/init.py:9: in
from ._torch_tvm import *
E ImportError: /tvm/torch_tvm/_torch_tvm.cpython-37m-x86_64-linux-gnu.so: undefined symbol: ZN5torch3jit16SubgraphRewriter22RegisterRewritePatternERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9
________________________________________________________________________________________________ ERROR collecting test/test_models.py _________________________________________________________________________________________________
ImportError while importing test module '/tvm/test/test_models.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test/test_models.py:6: in
import torch_tvm
torch_tvm/init.py:9: in
from ._torch_tvm import *
E ImportError: /tvm/torch_tvm/_torch_tvm.cpython-37m-x86_64-linux-gnu.so: undefined symbol: ZN5torch3jit16SubgraphRewriter22RegisterRewritePatternERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9
_______________________________________________________________________________________________ ERROR collecting test/test_operators.py _______________________________________________________________________________________________
ImportError while importing test module '/tvm/test/test_operators.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test/test_operators.py:2: in
from test.util import TVMTest
test/util.py:12: in
import torch_tvm
torch_tvm/init.py:9: in
from ._torch_tvm import *
E ImportError: /tvm/torch_tvm/_torch_tvm.cpython-37m-x86_64-linux-gnu.so: undefined symbol: ZN5torch3jit16SubgraphRewriter22RegisterRewritePatternERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================================================== 3 errors in 0.76s ==========================================================================================================
The text was updated successfully, but these errors were encountered: