TVM部署和集成Deploy and Integration
TVM部署和集成Deploy and Integration
本文包含如何將TVM部署到各種平臺以及如何將其與項目集成。
 
與傳統的深度學習框架不同。TVM堆棧分為兩個主要組件:
TVM編譯器,完成所有編譯和優化
TVM runtime運行時,在目標設備上運行。
為了集成編譯后的模塊,不需要在目標設備上構建整個TVM。只需要在桌面上構建TVM編譯器堆棧,用它來交叉編譯部署在目標設備上的模塊。只需要使用一個輕量級的runtime運行時API,它可以集成到各種平臺中。
例如,可以運行以下命令,基于Linux的嵌入式系統(如Raspberry Pi)上構建runtime運行時API:
git clone --recursive
 https://github.com/apache/tvm tvm
cd tvm
mkdir build
cp cmake/config.cmake build
cd build
cmake …
make runtime
注意,鍵入make runtime只構建runtime運行時庫。如果要包含其他runtime運行時(如OpenCL),可以修改config.cmake啟用這些選項。獲得TVM運行庫之后,可以鏈接已編譯的庫。
在嵌入式設備上測試、調整和基準測試TVM內核的最簡單和推薦的方法是通過TVM’s RPC
 API。以下是相關的模塊。
· Cross Compilation and RPC
· Deploy the Pretrained Model on Raspberry Pi
在完成優化和基準測試之后,可能需要在不依賴RPC的情況下將模型部署到目標設備上。請參閱下面的參考資料以了解如何這樣做。
· Deploy TVM Module using C++ API
o Get TVM Runtime Library
o Dynamic Library vs. System Module
· Deploy to Android
o Build model for Android Target
o TVM Runtime for Android Target
· Integrate TVM into Your Project
o DLPack Support
o Integrate User Defined C++ Array
o Integrate User Defined Python Array
· HLS Backend Example
o Setup
o Emulation
o Synthesis
o Run
· Relay Arm ? Compute Library Integration
o Introduction
o Installing Arm Compute Library
o Building with ACL support
o Usage
o More examples
o Operator support
o Adding a new operator
· Relay TensorRT Integration
o Introduction
o Installing TensorRT
o Building TVM with TensorRT support
o Build and Deploy ResNet-18 with TensorRT
o Partitioning and Compilation Settings
o Runtime Settings
o Operator support
o Adding a new operator
· Vitis-AI Integration
o DPU naming information
o Build instructions
o Getting started
總結
以上是生活随笔為你收集整理的TVM部署和集成Deploy and Integration的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: Relay张量集成
 - 下一篇: 深度学习加速器堆栈Deep Learni