Skip to content

Commit

Permalink
[DOCS] Improve documents on deployment (#1412)
Browse files Browse the repository at this point in the history
* [DOCS] Improve documents on deployment

* minor updates
  • Loading branch information
tqchen authored Jul 10, 2018
1 parent 4d0c936 commit f0ae174
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
39 changes: 38 additions & 1 deletion docs/deploy/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _deploy-and-integration:

Deploy and Integration
======================

Expand All @@ -6,7 +8,42 @@ as well as how to integrate it with your project.

.. image:: http://www.tvm.ai/images/release/tvm_flexible.png

In order to integrate the compiled module, we do not have to ship the compiler stack. We only need to use a lightweight runtime API that can be integrated into various platforms.
Unlike traditional deep learning frameworks. TVM stack is divided into two major components:

- TVM compiler, which does all the compilation and optimizations
- TVM runtime, which runs on the target devices.

In order to integrate the compiled module, we **do not** need to build entire TVM on the target device. You only need to build the TVM compiler stack on your desktop and use that to cross-compile modules that are deployed on the target device.
We only need to use a light-weight runtime API that can be integrated into various platforms.

For example, you can run the following commands to build the runtime API
on a Linux based embedded system such as Raspberry Pi:

.. code:: bash
git clone --recursive https://github.com/dmlc/tvm
cd tvm
mkdir build
cp cmake/config.cmake build
cd build
cmake ..
make runtime
Note that we type `make runtime` to only build the runtime library.
If you want to include additional runtime such as OpenCL,
you can modify `config.cmake` to enable these options.
After you get the TVM runtime library, you can link the compiled library

The easiest and recommended way to test, tune and benchmark TVM kernels on
embedded devices is through TVM's RPC API.
Here are the links to the related tutorials.

- :ref:`tutorial-cross-compilation-and-rpc`
- :ref:`tutorial-deploy-model-on-mali-gpu`
- :ref:`tutorial-deploy-model-on-rasp`

After you finished tuning and benchmarking, you might need to deploy the model on the
target device without relying on RPC. see the following resources on how to do so.

.. toctree::
:maxdepth: 2
Expand Down
3 changes: 3 additions & 0 deletions docs/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Installation
============

To install TVM, please read :ref:`install-from-source`.
If you are interested in deploying to mobile/embedded devices,
you do not need to install the entire tvm stack on your device,
instead, you only need the runtime, please read :ref:`deploy-and-integration`.
If you would like to quickly try out TVM or do demo/tutorials, checkout :ref:`docker-images`

.. toctree::
Expand Down
2 changes: 2 additions & 0 deletions tutorials/cross_compilation_and_rpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""
.. _tutorial-cross-compilation-and-rpc:
Cross Compilation and RPC
=========================
**Author**: `Ziheng Jiang <https://github.com/ZihengJiang/>`_
Expand Down
4 changes: 3 additions & 1 deletion tutorials/nnvm/deploy_model_on_mali_gpu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
.. _tutorial-deploy-model-on-mali-gpu:
Deploy the Pretrained Model on ARM Mali GPU
=======================================================
===========================================
**Author**: `Lianmin Zheng <https://lmzheng.net/>`_, `Ziheng Jiang <https://ziheng.org/>`_
This is an example of using NNVM to compile a ResNet model and
Expand Down
2 changes: 2 additions & 0 deletions tutorials/nnvm/deploy_model_on_rasp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""
.. _tutorial-deploy-model-on-rasp:
Deploy the Pretrained Model on Raspberry Pi
===========================================
**Author**: `Ziheng Jiang <https://ziheng.org/>`_
Expand Down
2 changes: 2 additions & 0 deletions tutorials/nnvm_quick_start.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""
.. _tutorial-nnvm-quick-start:
Quick Start Tutorial for Compiling Deep Learning Models
=======================================================
**Author**: `Yao Wang <https://github.com/kevinthesun>`_
Expand Down

0 comments on commit f0ae174

Please sign in to comment.