Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] What versions of LLVM exactly to use? #16708

Open
jchia opened this issue Mar 12, 2024 · 1 comment
Open

[Docs] What versions of LLVM exactly to use? #16708

jchia opened this issue Mar 12, 2024 · 1 comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: doc

Comments

@jchia
Copy link
Contributor

jchia commented Mar 12, 2024

Install from Source

The page at https://tvm.apache.org/docs/install/from_source.html says this about LLVM:

We highly recommend to build with LLVM to enable all the features.

Additions/Changes Requested

But I cannot figure out which versions of LLVM are acceptable. On Ubuntu 20.04, I have clang-12 and llvm-12-dev installed from the official Ubuntu focal-updates repo, as well as clang-19 and libpolly-19-dev installed from http://apt.llvm.org/focal/ llvm-toolchain-focal main.

In my config.cmake, I tried setting USE_LLVM to /usr/lib/llvm-12/bin/llvm-config and /usr/lib/llvm-19/bin/llvm-config for ninja builds. Neither worked.

With 12:

/home/jchia/gh/tvm/src/target/llvm/llvm_module.cc:502:38: error: ‘x86’ is not a namespace-name
  502 |   using namespace llvm::sys::detail::x86;

With 19:

FAILED: CMakeFiles/tvm_objs.dir/src/target/llvm/llvm_instance.cc.o 
ccache /usr/bin/c++ -DDMLC_USE_FOPEN64=0 -DDMLC_USE_LOGGING_LIBRARY="<tvm/runtime/logging.h>" -DNDEBUG -DNDEBUG=1 -DTVM_GRAPH_EXECUTOR_TENSORRT -DTVM_INDEX_DEFAULT_I64=1 -DTVM_KALLOC_ALIGNMENT=64 -DTVM_LLVM_VERSION=190 -DTVM_THREADPOOL_USE_OPENMP=0 -DTVM_USE_LIBBACKTRACE=1 -DUSE_FALLBACK_STL_MAP=0 -DUSE_MICRO_STANDALONE_RUNTIME=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DDMLC_ENABLE_RTTI=0 -I/home/jchia/gh/tvm/include -I/home/jchia/gh/tvm/build/libbacktrace/include -I/home/jchia/gh/tvm/3rdparty/libcrc/include -isystem /home/jchia/gh/tvm/3rdparty/dlpack/include -isystem /home/jchia/gh/tvm/3rdparty/dmlc-core/include -isystem /home/jchia/gh/tvm/3rdparty/rang/include -isystem /home/jchia/gh/tvm/3rdparty/compiler-rt -isystem /home/jchia/gh/tvm/3rdparty/picojson -isystem /home/jchia/gh/tvm/build/crt_config -isystem /usr/local/cuda/include -isystem /usr/lib/llvm-19/include -std=c++17 -faligned-new -O2 -Wall -fPIC  -fno-rtti -MD -MT CMakeFiles/tvm_objs.dir/src/target/llvm/llvm_instance.cc.o -MF CMakeFiles/tvm_objs.dir/src/target/llvm/llvm_instance.cc.o.d -o CMakeFiles/tvm_objs.dir/src/target/llvm/llvm_instance.cc.o -c /home/jchia/gh/tvm/src/target/llvm/llvm_instance.cc
/home/jchia/gh/tvm/src/target/llvm/llvm_instance.cc:45:10: fatal error: llvm/Support/Host.h: No such file or directory
   45 | #include <llvm/Support/Host.h>

Could you clarify:

  • Which versions of LLVM can be used.
  • Why exactly LLVM is good/necessary, namely which features are affected and how if LLVM is not used. It's worrying to not know what downsides one is getting for not using LLVM.
  • Whether this part is referring to the USE_LLVM in the config.cmake or something else. E.g. do we need to do something about and CMAKE_C_COMPILER or CMAKE_CXX_COMPILER to point them to clang?

Triage

  • needs-triage
  • docs
@jchia jchia added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: doc labels Mar 12, 2024
@jchia
Copy link
Contributor Author

jchia commented Mar 12, 2024

From the llvm github repo, it appears that llvm-17 has llvm/Support/Host.h but llvm-18 and llvm-19 do not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: doc
Projects
None yet
Development

No branches or pull requests

1 participant