Comments (5)
E ImportError: /tvm/torch_tvm/_torch_tvm.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN3c1021AutogradMetaInterfaceE
I found this error aswell, and it looks like it is due to pytorch/pytorch#30315 (which affects PyTorch 1.4) so the CMakeLists.txt
needs to change to something like:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6108e6..3903a78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,7 @@ add_subdirectory(${TVM_DIR})
pybind11_add_module(_torch_tvm SHARED ${TORCH_TVM_SRCS})
target_link_libraries(_torch_tvm PUBLIC
- torch pybind11 tvm tvm_topi)
+ torch c10 torch_cpu torch_python pybind11 tvm tvm_topi)
Also shows up in CircleCI build 697
from tvm.
Have you built PyTorch from source?
from tvm.
Have you built PyTorch from source?
I used pip to install pytorch. Is it necessary to build pytorch from souce?
from tvm.
Hi, I have a similar (or maybe same) error:
This is the end of python setup.py test
copying build/lib.linux-x86_64-3.6/torch_tvm/_torch_tvm.cpython-36m-x86_64-linux-gnu.so -> torch_tvm
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.3.3, 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 <module>
from test.util import TVMTest
test/util.py:12: in <module>
import torch_tvm
torch_tvm/__init__.py:9: in <module>
from ._torch_tvm import *
E ImportError: /tvm/torch_tvm/_torch_tvm.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN3c1021AutogradMetaInterfaceE
_____________________ 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 <module>
import torch_tvm
torch_tvm/__init__.py:9: in <module>
from ._torch_tvm import *
E ImportError: /tvm/torch_tvm/_torch_tvm.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN3c1021AutogradMetaInterfaceE
___________________ 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 <module>
from test.util import TVMTest
test/util.py:12: in <module>
import torch_tvm
torch_tvm/__init__.py:9: in <module>
from ._torch_tvm import *
E ImportError: /tvm/torch_tvm/_torch_tvm.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN3c1021AutogradMetaInterfaceE
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 3 errors in 0.66s ===============================
(env) root@25711c3c1895:/tvm#
and is in a docker container with this Dockerfile
:
FROM ubuntu
RUN apt-get update && apt-get install -y git python3 python3-venv git cmake ninja-build g++ python3-dev llvm
RUN git clone --recurse-submodules https://github.com/pytorch/tvm.git && cd tvm && python3 -m venv env
RUN git clone https://github.com/pytorch/pytorch.git --recursive
RUN . tvm/env/bin/activate && cd pytorch && pip3 install -r requirements.txt
RUN . tvm/env/bin/activate && cd pytorch && BUILD_BINARY=OFF BUILD_TEST=0 BUILD_CAFFE2_OPS=0 python setup.py install
# RUN . tvm/env/bin/activate && cd tvm && git checkout 9d3ca57
# RUN . tvm/env/bin/activate && cd tvm && python setup.py install --cmake
# RUN . tvm/env/bin/activate && cd tvm && OMP_NUM_THREADS=2 python setup.py test
from tvm.
Have you built PyTorch from source?
I used pip to install pytorch. Is it necessary to build pytorch from souce?
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
from tvm.
Related Issues (20)
- Can't Build the Project on MacOs HOT 5
- error when importing torch_tvm HOT 6
- Error when installing TVM on Raspberry (PyTorch 1.1) HOT 1
- Question on FuseSupportedOps pass HOT 2
- "setup.py install --cmake" errors for type_traits, hashtable_policy.h and unordered_map.h HOT 1
- convert demo needed HOT 1
- No significant change in iters/sec while comparing cpu vs gpu performance HOT 5
- is this repo really useful and working? HOT 1
- LLVM error when import torch_tvm after building pytorch and torch_tvm from source HOT 5
- Saving the compiled graph HOT 1
- 3D Convolution? HOT 1
- llvm version HOT 1
- RuntimeError: _Map_base::at
- Problems about installing torch_tvm ? HOT 3
- Make build C++ ABI aware
- tests error HOT 4
- "malloc(): memory corruption" when running benchmark.py
- Has the project been deprecated? HOT 2
- Is There Any Speed Benchmark for Pytorch/tvm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tvm.