TVM 在windows下编译

TVM 在windows下编译

参考链接
https://docs.tvm.ai/install/from_source.html
https://blog.youkuaiyun.com/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
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值