TVM 如何编译生成 libtvm.so libtvm_runtime.so
参考《TVM编译器原理与实践》新书出版发行 - 知乎 (zhihu.com)
2.1 配置TVM环境
- 开发环境:ubuntu22.04
- 下载源码 就是到github下载,现在源码多了 unity 暂时不知道是否有什么区别
- 编译
- 先安装conda tvm-build虚拟环境,这里面是一些tvm依赖工具,比如 llvm,还有python需要的东西,编译 tvm 的话也在这里
- 用cmake编译tvm库
- 先安装conda tvm-build虚拟环境,这里面是一些tvm依赖工具,比如 llvm,还有python需要的东西,编译 tvm 的话也在这里
- 运行
坑
不要在Windows下载了然后拷贝过去。
下载源码
Install from Source — tvm 0.16.dev0 documentation (apache.org)
如果下载慢可以配置下代理,然后本地启动远程代理,让远程的git通过端口连接到本地笔记本电脑,远程配置出口端口export http_proxy=http://127.0.0.1:7890; export https_proxy=http://127.0.0.1:7890; export HTTP_PROXY=http://127.0.0.1:7890; export HTTPS_PROXY=http://127.0.0.1:7890
本地配置远程端口到本地代理的入口 ssh -R 7890:localhost:v2rayNPort -N root@hostname.site -p 22
git clone --recursive https://github.com/apache/tvm tvm
各个子系统git地址:
tvm/3rdparty/cutlass: https://github.com/NVIDIA/cutlass.git
tvm/3rdparty/dlpack: https://github.com/dmlc/dlpack.git
tvm/3rdparty/dmlc-core: https://github.com/dmlc/dmlc-core.git
tvm/3rdparty/libbacktrace: https://github.com/tlc-pack/libbacktrace.git
tvm/3rdparty/rang: https://github.com/agauniyal/rang.git
tvm/3rdparty/vta-hw:https://github.com/apache/tvm-vta.git