[SOLVED] Unknown target name vpi


when I was building tvm in my env, it finally successed like this :

[100%] Built target clang
[100%] Built target clang-check
[100%] Built target libclang
[100%] Built target c-arcmt-test
[100%] Built target c-index-test
– Build with RPC support…
– Build with Graph runtime support…
– Build VTA runtime with target: sim
– Found CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-9.0
– Found CUDA_CUDA_LIBRARY=/usr/local/cuda-9.0/lib64/stubs/libcuda.so
– Found CUDA_CUDART_LIBRARY=/usr/local/cuda-9.0/lib64/libcudart.so
– Found CUDA_NVRTC_LIBRARY=/usr/local/cuda-9.0/lib64/libnvrtc.so
– Found CUDA_CUDNN_LIBRARY=/usr/local/cuda-9.0/lib64/libcudnn.so
– Found CUDA_CUBLAS_LIBRARY=/usr/local/cuda-9.0/lib64/libcublas.so
– Build with CUDA support
– Use llvm-config=…/…/llvm-6.0/llvm-build/bin/llvm-config
– /home/liqiang/tvm_proj/llvm-6.0/llvm/include/home/liqiang/tvm_proj/llvm-6.0/llvm-build/include
– Found LLVM_INCLUDE_DIRS=/home/liqiang/tvm_proj/llvm-6.0/llvm/include/home/liqiang/tvm_proj/llvm-6.0/llvm-build/include
– Build with LLVM
– Build with contrib.sort
– Build with contrib.hybriddump
– Configuring done
– Generating done
– Build files have been written to: /home/liqiang/tvm_proj/tvm/build
[ 2%] Built target vta
[ 11%] Built target tvm_runtime
[ 88%] Built target tvm
[ 88%] Built target tvm_topi
[100%] Built target nnvm_compiler

But when I try to using python to import tvm, it indicates this error:

(tvm36) root@liqiang-Inspiron-5557:/home/liqiang/tvm_proj# python
Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tvm
[10:38:09] /home/liqiang/tvm_proj/tvm/src/codegen/build_module.cc:129: Unknown target name vpi

So I donot knoww where it come from, how can I solve this?


same issue

  • build with llvm4.0
  • build from source
  • x86 CPU


This is because Relay creates a bunch of targets without checking if they are enabled or not. If you’re not using “vpi”, you can just edit the source to remove the line that tries to create it.

File: src/relay/backend/build_module.cc

const std::unordered_map<int, tvm::Target> ContextTargetMap::mask2str = {
  {1, tvm::Target::create("llvm")},
  {2, tvm::Target::create("cuda")},
  {4, tvm::Target::create("opencl")},
  {5, tvm::Target::create("aocl")},
  {6, tvm::Target::create("sdaccel")},
  {7, tvm::Target::create("vulkan")},
  {8, tvm::Target::create("metal")},
  {9, tvm::Target::create("vpi")},      <-- delete this line
  {10, tvm::Target::create("rocm")},
  {11, tvm::Target::create("opengl")},
  {12, tvm::Target::create("ext_dev")}

Better yet, you can file a bug and get the author to fix this.


Thanks for reporting the issue, create https://github.com/dmlc/tvm/issues/3197 to track it


should be fixed in the master


Great! I tried and fixed.