TVM 在windows下编译

TVM 在windows下编译

参考链接
https://docs.tvm.ai/install/from_source.html
https://blog.csdn.net/sinat_31425585/article/details/89395680
https://zhuanlan.zhihu.com/p/58814825

  • git clone远程仓库
git clone --recursive https://github.com/apache/incubator-tvm tvm
  • git仓库初始化(不加这句话会在编译的时候报错)
git submodule init
git submodule update
  • 安装llvm
    https://link.zhihu.com/?target=http%3A//releases.llvm.org/download.html
    选择预编译好的LLVM,在安装时候勾选将LLVM加入环境变量
    检查是否安装成功
clang -v
  • cmake创建solution
    进入git工程目录
git clone https://github.com/dmlc/tvm.git
cd tvm mkdir build && cd build
cmake -G "Visual Studio 16 2019 " -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES="Release" ..

可以不用指定Win64 ARM Cmake会根据当前的系统sdk选择

  • vs编译
    编辑git目录下的CMakeLists.txt文件
    将原本的
tvm_option(USE_LLVM "Build with LLVM, can be set to specific llvm-config path" OFF)

改为LLVM安装目录下的二进制执行文件目录 这里是F/LLVM/bin

tvm_option(USE_LLVM "Build with LLVM, can be set to specific llvm-config path" F/LLVM/bin)

打开build目录下的tvm.sln,在Release x64模式下运行
在release x64中生成dll文件后,退回git项目根目录将python 安装包安装:

cd python; python setup.py install --user; cd ..
cd topi/python; python setup.py install --user; cd ../..

将相关依赖库安装

pip install numpy decorator attrs tornado psutil xgboost

你可能感兴趣的:(TVM 在windows下编译)