GithubHelp home page GithubHelp logo

tests error about tvm HOT 4 CLOSED

pytorch avatar pytorch commented on July 28, 2024
tests error

from tvm.

Comments (4)

jjohnson-arm avatar jjohnson-arm commented on July 28, 2024

That symbol is in libtvm.so (using readelf --syms).
So it either can't find that lib, or it hasn't properly linked to it - as this is what happened in #149 for libc10.so and other libraries.
Has your target_link_libraries line inCMakeLists.txt got tvm in it? (See my suggested patch in #149)

from tvm.

MaxBareiss avatar MaxBareiss commented on July 28, 2024

My pytorch did not have libtorch_cpu.so or libtorch_cuda.so (not sure why), so below is the patch I used:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6108e6..b656518 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_python pybind11 tvm tvm_topi)

 target_include_directories(_torch_tvm PUBLIC
     ${CMAKE_CURRENT_SOURCE_DIR}

This fix was included in my first request (I forgot to mention it) and it did not fix the problem. The following commands have the following outputs:

$ readelf -Ws build/tvm/libtvm.so | grep _ZTIN3tvm4NodeE
  7483: 00000000045e81d8    40 OBJECT  WEAK   DEFAULT   21 _ZTIN3tvm4NodeE
 49707: 00000000045e81d8    40 OBJECT  WEAK   DEFAULT   21 _ZTIN3tvm4NodeE

$ readelf -Ws build/_torch_tvm.cpython-35m-x86_64-linux-gnu.so | grep _ZTIN3tvm4NodeE
   315: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  UND _ZTIN3tvm4NodeE

from tvm.

jjohnson-arm avatar jjohnson-arm commented on July 28, 2024

To double-check the linking is working you can try:

$ objdump -p _torch_tvm.cpython-36m-x86_64-linux-gnu.so | grep NEEDED
  NEEDED               libc10.so
  NEEDED               libtorch_cpu.so
  NEEDED               libtorch_python.so
  NEEDED               libtvm.so
  NEEDED               libLLVM-6.0.so.1
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  NEEDED               ld-linux-x86-64.so.2

And you should see a similar list including libtvm.so.
If this is the case then for some reason the pytests can't find the library. I am using a python 3.6 virtual environment when building (though I did have some success with an anaconda environment, though haven't tried it recently).
Using strace python setup.py test the log output shows it found libtvm.so in the python environment here: py3.6env-tvm/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
So maybe the python setup.py install step hasn't worked?

from tvm.

MaxBareiss avatar MaxBareiss commented on July 28, 2024

This issue was caused because my installed tvm was v0.6.0 from master, but this repo requires that the included facebookexperimental version be installed. Uninstalling the upstream tvm and following the tvm install instructions on the included tvm solves this issue.

from tvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.