Comments (9)
I hope you created a symbolic link to llvm-config. By default the llvm-8 installation installs llvm-config-8, so you can create a symbolic link by
ln -s /usr/bin/llvm-config-8 /usr/bin/llvm-config
from tvm.
I just tried creating a symbolic link, but I got the same error. I think it might be an issue with cmake rather than llvm?
from tvm.
perhaps you need to git submodule update --init --recursive
?
if not, after creating that symlink, could you try git clean -xfd
and rebuilding with python setup.py install --cmake
?
from tvm.
It fixed my issue with python setup.py install, but it errors when I try to run python setup.py test:
=========================================================== ERRORS ============================================================
_____________________________________________ ERROR collecting test/test_core.py ______________________________________________
ImportError while importing test module '/home/ubuntu/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: /home/ubuntu/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 '/home/ubuntu/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: /home/ubuntu/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 '/home/ubuntu/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: /home/ubuntu/tvm/torch_tvm/_torch_tvm.cpython-37m-x86_64-linux-gnu.so: undefined symbol: ZN5torch3jit16SubgraphRewriter22RegisterRewritePatternERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9
====================================================== warnings summary =======================================================
/home/ubuntu/anaconda3/lib/python3.7/site-packages/pywt/_utils.py:6
/home/ubuntu/anaconda3/lib/python3.7/site-packages/pywt/_utils.py:6: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Iterable
-- Docs: https://docs.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================= 1 warnings, 3 error in 1.57 seconds =============================================
from tvm.
Could the undefined symbol errors have something to do with the PyTorch version?
from tvm.
Yep, it certainly could be the version of PyTorch, but RegisterRewritePattern
has been around for a while. If you're willing, I'd recommend building PyTorch locally. Otherwise, a newer nightly might help.
The other issue might be a mismatch caused by the __cxx11
symbol, which might be resolved by adding -D_GLIBCXX_USE_CXX11_ABI=0
to your build command. I'm going off this StackOverflow post: https://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring.
More concretely that would mean changing https://github.com/pytorch/tvm/blob/master/CMakeLists.txt#L10 to either
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
or
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=1")
from tvm.
I tried doing rebuilding the nightly version of PyTorch and changing the line in CMakeLists.txt, and I think it fixed my previous errors, but now I have new errors with python setup.py test:
_________________________________________________________ ERROR collecting test/test_core.py __________________________________________________________
test/test_core.py:2: in
from test.util import TVMTest
test/util.py:12: in
import torch_tvm
torch_tvm/init.py:7: in
from tvm import relay # This registers all the schedules
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/init.py:23: in
from . import tensor
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/tensor.py:20: in
from ._ffi.node import NodeBase, NodeGeneric, register_node, convert_to_node
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/node.py:24: in
from .node_generic import NodeGeneric, convert_to_node, const
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/node_generic.py:23: in
from .base import string_types
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/base.py:60: in
_LIB, _LIB_NAME = _load_lib()
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/base.py:52: in _load_lib
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
../anaconda3/lib/python3.7/ctypes/init.py:356: in init
self._handle = _dlopen(self._name, mode)
E OSError: /home/ubuntu/anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/libtvm.so: undefined symbol: _ZN4llvm14TargetRegistry12lookupTargetERKSsRSs
________________________________________________________ ERROR collecting test/test_models.py _________________________________________________________
test/test_models.py:6: in
import torch_tvm
torch_tvm/init.py:7: in
from tvm import relay # This registers all the schedules
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/init.py:23: in
from . import tensor
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/tensor.py:20: in
from ._ffi.node import NodeBase, NodeGeneric, register_node, convert_to_node
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/node.py:24: in
from .node_generic import NodeGeneric, convert_to_node, const
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/node_generic.py:23: in
from .base import string_types
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/base.py:60: in
_LIB, _LIB_NAME = _load_lib()
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/base.py:52: in _load_lib
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
../anaconda3/lib/python3.7/ctypes/init.py:356: in init
self._handle = _dlopen(self._name, mode)
E OSError: /home/ubuntu/anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/libtvm.so: undefined symbol: _ZN4llvm14TargetRegistry12lookupTargetERKSsRSs
_______________________________________________________ ERROR collecting test/test_operators.py _______________________________________________________
test/test_operators.py:2: in
from test.util import TVMTest
test/util.py:12: in
import torch_tvm
torch_tvm/init.py:7: in
from tvm import relay # This registers all the schedules
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/init.py:23: in
from . import tensor
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/tensor.py:20: in
from ._ffi.node import NodeBase, NodeGeneric, register_node, convert_to_node
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/node.py:24: in
from .node_generic import NodeGeneric, convert_to_node, const
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/node_generic.py:23: in
from .base import string_types
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/base.py:60: in
_LIB, _LIB_NAME = _load_lib()
../anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/_ffi/base.py:52: in _load_lib
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
../anaconda3/lib/python3.7/ctypes/init.py:356: in init
self._handle = _dlopen(self._name, mode)
E OSError: /home/ubuntu/anaconda3/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-linux-x86_64.egg/tvm/libtvm.so: undefined symbol: _ZN4llvm14TargetRegistry12lookupTargetERKSsRSs
================================================================== warnings summary ===================================================================
/home/ubuntu/anaconda3/lib/python3.7/site-packages/pywt/_utils.py:6
/home/ubuntu/anaconda3/lib/python3.7/site-packages/pywt/_utils.py:6: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Iterable
-- Docs: https://docs.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================= 1 warnings, 3 error in 0.90 seconds =========================================================
This seems kind of similar to this: apache/tvm#521, so I think this has something to do with llvm, but I'm not sure how to fix it. I tried setting the LLVM-CONFIG environmental variable to llvm-config-8.0 and I've checked my gcc version (it's 7.4.0), but that doesn't seem to help. I'm running llvm-8.0 and I've created the symbolic link from llvm-config-8. to llvm-config.
Do you have any ideas what else I could try? Sorry about all the questions.
from tvm.
It worked once I built PyTorch from source! I think the nightly build of PyTorch was causing the errors.
from tvm.
It worked once I built PyTorch from source! I think the nightly build of PyTorch was causing the errors.
Which version it is in your case? I have also built from source, but it failed.
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
- import torch_tvm error HOT 5
- 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.