tvm安装

参考:http://tvm.apache.org/docs/install/from_source.html
1.下载代码
git clone --recursive https://github.com/apache/tvm tvm
2.编译共享库

依赖包安装:
sudo apt-get update
sudo apt-get install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev

#The minimal building requirements are
#A recent c++ compiler supporting C++ 14 (g++-5 or higher)
#CMake 3.5 or higher
#We highly recommend to build with LLVM to enable all the features.
配置编译选项
mkdir build
cp cmake/config.cmake build

#Edit build/config.cmake to customize the compilation options
#Change set(USE_CUDA OFF) to set(USE_CUDA ON) to enable CUDA backend. Do the same for other backends and libraries you want to build for (OpenCL, RCOM, METAL, VULKAN, …).
#To help with debugging, ensure the embedded graph runtime and debugging functions are enabled with set(USE_GRAPH_RUNTIME ON) and set(USE_GRAPH_RUNTIME_DEBUG ON)
#TVM requires LLVM for for CPU codegen. We highly recommend you to build with the LLVM support on.
#LLVM 4.0 or higher is needed for build with LLVM. Note that version of LLVM from default apt may lower than 4.0.
#Since LLVM takes long time to build from source, you can download pre-built version of LLVM from LLVM Download Page.
#Unzip to a certain location, modify build/config.cmake to add set(USE_LLVM /path/to/your/llvm/bin/llvm-config)
#You can also directly set set(USE_LLVM ON) and let cmake search for a usable version of LLVM.
#You can also use LLVM Nightly Ubuntu Build
#Note that apt-package append llvm-config with version number. For example, set set(USE_LLVM llvm-config-10) if you installed LLVM 10 package
编译TVM
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..  (Debug模式,编译时会用-g -O0选项编译文件)
make -j4

3.Python包安装

export TVM_HOME=/path/to/tvm
export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}

4.Python依赖包

pip3 install --user numpy decorator attrs
pip3 install --user tornado psutil xgboost cloudpickle
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值