You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/05/12 00:53:44 UTC

[GitHub] [tvm] mehrdadh opened a new pull request, #11283: [Hexagon] Update Readme

mehrdadh opened a new pull request, #11283:
URL: https://github.com/apache/tvm/pull/11283

   Update readme for hexagon testing.
   
   cc @adstraw 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] adstraw commented on a diff in pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
adstraw commented on code in PR #11283:
URL: https://github.com/apache/tvm/pull/11283#discussion_r871800939


##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 

Review Comment:
   Should this read 
   ```
   rm -rf build
   ./tests/scripts/task_config_build_hexagon.sh build
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] adstraw commented on a diff in pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
adstraw commented on code in PR #11283:
URL: https://github.com/apache/tvm/pull/11283#discussion_r871799142


##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```

Review Comment:
   Might be good to put this in a checked in shell script as well.  And... would be great if the script took the -j argument from the command line.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] mehrdadh commented on pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on PR #11283:
URL: https://github.com/apache/tvm/pull/11283#issuecomment-1125182072

   cc @csullivan 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] adstraw commented on a diff in pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
adstraw commented on code in PR #11283:
URL: https://github.com/apache/tvm/pull/11283#discussion_r872564209


##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```

Review Comment:
   Yes, it's readable.  What I am suggesting is that we remove the inline bash script from the readme and simply link to task_build_hexagon_api.sh.  This way we don't have to encode and update the same thing twice:  once in the readme and again in the script.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] adstraw commented on a diff in pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
adstraw commented on code in PR #11283:
URL: https://github.com/apache/tvm/pull/11283#discussion_r871800939


##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 

Review Comment:
   Should this read 
   ```
   ./tests/scripts/task_config_build_hexagon.sh build
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] mehrdadh commented on pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on PR #11283:
URL: https://github.com/apache/tvm/pull/11283#issuecomment-1126227863

   @adstraw thanks for the review and great suggestions. I have another PR https://github.com/apache/tvm/pull/11304 to fix `ci.py` for hexagon. We can update this readme nonce that is merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] mehrdadh merged pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
mehrdadh merged PR #11283:
URL: https://github.com/apache/tvm/pull/11283


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] adstraw commented on a diff in pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
adstraw commented on code in PR #11283:
URL: https://github.com/apache/tvm/pull/11283#discussion_r871782964


##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).

Review Comment:
   Just a few nits:
   * specially -> especially
   * "setting up environment variables and building various ..."
   



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"

Review Comment:
   Are there any requirements on version?  Might document below.



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm

Review Comment:
   Instead of `cd tvm` I would say (outside of the script section) that this works "from your TVM home dir"



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).
+
+## Run Tests
+You have the options of running Hexagon test on real hardware or on Hexagon simulator. Also, depending on whether you decided to use Hexagon docker image or not we will explain both cases here.
+
+**Note: You can always find updated instructions based on this [script](https://github.com/apache/tvm/blob/main/tests/scripts/task_python_hexagon.sh).**
+
+### Only follow these steps if running tests outside of docker
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the HexagonSDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+
+export PYTHONPATH=$PYTHONPATH:"path to `tvm/python`"
+```
+
+### Now, follow these steps
+**Note:** If you are using Hexagon docker image, first step is to log into the Hexagon docker image. Following these commands you will log in to the most recent version of Hexagon docker image on your TVM local branch.
+
+```bash
+cd tvm
+./docker/bash.sh ci_hexagon
+```
+
+Now, you need to export few environment variables and execute following commands:
+
+```bash
+# Run RPC Tracker in the background
+export TVM_TRACKER_HOST="0.0.0.0"
+export TVM_TRACKER_PORT=9192

Review Comment:
   Is it safe to hard code 9192?



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```

Review Comment:
   I feel like it would be better just to refer folks to the shell script to avoid having to update in two places.



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```

Review Comment:
   Same as above.



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).
+
+## Run Tests
+You have the options of running Hexagon test on real hardware or on Hexagon simulator. Also, depending on whether you decided to use Hexagon docker image or not we will explain both cases here.
+
+**Note: You can always find updated instructions based on this [script](https://github.com/apache/tvm/blob/main/tests/scripts/task_python_hexagon.sh).**
+
+### Only follow these steps if running tests outside of docker
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the HexagonSDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+
+export PYTHONPATH=$PYTHONPATH:"path to `tvm/python`"
+```

Review Comment:
   Repeat from above?  Necessary?



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).
+
+## Run Tests
+You have the options of running Hexagon test on real hardware or on Hexagon simulator. Also, depending on whether you decided to use Hexagon docker image or not we will explain both cases here.
+
+**Note: You can always find updated instructions based on this [script](https://github.com/apache/tvm/blob/main/tests/scripts/task_python_hexagon.sh).**
+
+### Only follow these steps if running tests outside of docker
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the HexagonSDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+
+export PYTHONPATH=$PYTHONPATH:"path to `tvm/python`"
+```
+
+### Now, follow these steps
+**Note:** If you are using Hexagon docker image, first step is to log into the Hexagon docker image. Following these commands you will log in to the most recent version of Hexagon docker image on your TVM local branch.
+
+```bash
+cd tvm
+./docker/bash.sh ci_hexagon
+```
+

Review Comment:
   Docker Noob question:  No need to rebuild at this point right?  Might be worth mentioning that here.  



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."

Review Comment:
   Might discuss how / where to download the SDK below.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] mehrdadh commented on a diff in pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on code in PR #11283:
URL: https://github.com/apache/tvm/pull/11283#discussion_r871805150


##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).

Review Comment:
   if you mean `task_build_hexagon_api.sh`, it should work



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"

Review Comment:
   added.



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```

Review Comment:
   yeah, let's add that in a separate PR



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 

Review Comment:
   added



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).

Review Comment:
   this should work too, it works for me



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm

Review Comment:
   done



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).
+
+## Run Tests
+You have the options of running Hexagon test on real hardware or on Hexagon simulator. Also, depending on whether you decided to use Hexagon docker image or not we will explain both cases here.
+
+**Note: You can always find updated instructions based on this [script](https://github.com/apache/tvm/blob/main/tests/scripts/task_python_hexagon.sh).**
+
+### Only follow these steps if running tests outside of docker
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the HexagonSDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+
+export PYTHONPATH=$PYTHONPATH:"path to `tvm/python`"
+```

Review Comment:
   it is because we also need these at runtime



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```

Review Comment:
   Do you think shell script is readable enough?



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).
+
+## Run Tests
+You have the options of running Hexagon test on real hardware or on Hexagon simulator. Also, depending on whether you decided to use Hexagon docker image or not we will explain both cases here.
+
+**Note: You can always find updated instructions based on this [script](https://github.com/apache/tvm/blob/main/tests/scripts/task_python_hexagon.sh).**
+
+### Only follow these steps if running tests outside of docker
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the HexagonSDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+
+export PYTHONPATH=$PYTHONPATH:"path to `tvm/python`"
+```
+
+### Now, follow these steps
+**Note:** If you are using Hexagon docker image, first step is to log into the Hexagon docker image. Following these commands you will log in to the most recent version of Hexagon docker image on your TVM local branch.
+
+```bash
+cd tvm
+./docker/bash.sh ci_hexagon
+```
+
+Now, you need to export few environment variables and execute following commands:
+
+```bash
+# Run RPC Tracker in the background
+export TVM_TRACKER_HOST="0.0.0.0"
+export TVM_TRACKER_PORT=9192

Review Comment:
   changed it



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).

Review Comment:
   done.



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).
+
+## Run Tests
+You have the options of running Hexagon test on real hardware or on Hexagon simulator. Also, depending on whether you decided to use Hexagon docker image or not we will explain both cases here.
+
+**Note: You can always find updated instructions based on this [script](https://github.com/apache/tvm/blob/main/tests/scripts/task_python_hexagon.sh).**
+
+### Only follow these steps if running tests outside of docker
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the HexagonSDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+
+export PYTHONPATH=$PYTHONPATH:"path to `tvm/python`"
+```
+
+### Now, follow these steps
+**Note:** If you are using Hexagon docker image, first step is to log into the Hexagon docker image. Following these commands you will log in to the most recent version of Hexagon docker image on your TVM local branch.
+
+```bash
+cd tvm
+./docker/bash.sh ci_hexagon
+```
+

Review Comment:
   added



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."

Review Comment:
   added a link



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] csullivan commented on a diff in pull request #11283: [Hexagon] Update Readme

Posted by GitBox <gi...@apache.org>.
csullivan commented on code in PR #11283:
URL: https://github.com/apache/tvm/pull/11283#discussion_r871778377


##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).

Review Comment:
   This link is broken in the markdown preview. Probably just because this is not merged, but mentioning just in case.



##########
tests/python/contrib/test_hexagon/README.md:
##########
@@ -15,23 +15,123 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-Documents manual TE schedule to illustrate Hexagon operator slicing.
-
-High Level Notes:
-* Using float32 (for now) so that tests will pass on CPU
-* Using global storage scope (for now) which means "cache" reads and writes from global, to global
-* TIR is pending changes from the work-in-progress layout RFC
-  (https://github.com/apache/tvm-rfcs/pull/39)
-* TIR has been hand-edited for context and clarity
-  * Added C-style comments
-  * Changed variable names
-  * Added spacing and line breaks
-* Naming conventions
-  * Using input (instead of activation)
-  * Using filter (instead of weight, kernel)
-  * Using `k` to denote channel-out and `c` or `rc` (reduction channel) to denote channel-in
-  * Using `rh` and `rw` (reduction height / width) to denote filter height and width
-
-[Conv2d](test_conv2d_blocked.md)
-
-[Conv2d -> Conv2d](test_conv2d_conv2d.md)
\ No newline at end of file
+# Test TVM on Hexagon
+This document explains various pieces that are involved in testing TVM on an Android device which includes Hexagon DSP or Hexagon simulator.
+
+## What is HexagonLauncherRPC?
+HexagonLauncherRPC is a class to handle interactions with an Android phone which includes Hexagon DSP or Hexagon simulator to run a TVMModule(function/operation/graph) on Hexagon. HexagonLauncherRPC reuses [minRPC](https://github.com/apache/tvm/tree/main/src/runtime/minrpc) implementation to set up an RPC connection from host (your local machine) to Hexagon target, and it is passed through Android RPC server.
+
+## Build Required Tools/Libraries
+To build TVM for Hexagon and run tests you need to run multiple steps which includes preparing required tools, setup environment variables and build various versions of TVM. Alternatively, you can skip these instructions and use docker image which has pre-installed required tools. We highly recommend to use docker, specially if this is your first time working with Hexagon. For instructions on using docker image follow ["use hexagon docker image"](#use-hexagon-docker-image).
+
+- Build TVMRuntime library and C++ RPC server for Android.
+- Build minRPC server along with FastRPC for Hexagon.
+- Build TVM library with Hexagon support for host machine.
+- Build TVMRuntime library and RPC server for host machine.
+
+First, ensure to export Clang libraries to `LD_LIBRARY_PATH` and Hexagon toolchain to `HEXAGON_TOOLCHAIN`:
+```bash
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to `llvm-clang/lib` sub-directory"
+
+export HEXAGON_TOOLCHAIN="Path to Hexagon toolchain. It can be the Hexagon toolchain included in the SDK, for example `HEXAGON_SDK_PATH/tools/HEXAGON_Tools/x.y.z/Tools`.  The `x.y.z` in the path is the toolchain version number, which is specific to the version of the SDK."
+```
+
+First build Hexagon API application under `apps/hexagon_api`. This step will generate `tvm_rpc_android` and `libtvm_runtime.so` to run on Android. Also, it generates `libtvm_runtime.a` `libtvm_runtime.so`, `libhexagon_rpc_skel.so` and `libhexagon_rpc_sim.so` to run on Hexagon device or Hexagon simulator.
+
+**Note:** To get the most updated instructions, please take a look at [task_build_hexagon_api.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh).
+
+```bash
+cd apps/hexagon_api
+mkdir build
+cd build
+cmake -DANDROID_ABI=arm64-v8a \
+        -DANDROID_PLATFORM=android-28 \
+        -DUSE_ANDROID_TOOLCHAIN="path to `android-ndk/build/cmake/android.toolchain.cmake` file" \
+        -DUSE_HEXAGON_ARCH=v65|v66|v68|v69 \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON_TOOLCHAIN="path to Hexagon toolchain `Tools` sub-directory which explained above" \
+        -DUSE_OUTPUT_BINARY_DIR="path to `build/hexagon_api_output` which is a sub-directory of `tvm`" ..
+
+make -j2
+```
+
+Next, we need to build TVM on host with RPC and Hexagon dependencies. To do that follow these commands.
+
+**Note:** To get the most recent configs for this step, please take a look at [task_config_build_hexagon.sh](https://github.com/apache/tvm/blob/main/tests/scripts/task_config_build_hexagon.sh).
+
+```bash
+cd tvm
+mkdir build
+cd build
+cmake -DUSE_LLVM="path to `llvm/bin/llvm-config`" \
+        -DUSE_RPC=ON \
+        -DCMAKE_CXX_COMPILER="path to `clang++` executable" \
+        -DUSE_HEXAGON_SDK="path to Hexagon SDK" \
+        -DUSE_HEXAGON=ON ..
+
+make -j2
+```
+
+## Use Hexagon Docker Image
+To use hexagon docker image, install TVM and Hexagon API follow these steps.
+
+```bash
+# Log in to docker image
+cd tvm
+./docker/bash.sh ci_hexagon
+
+# Build TVM
+./tests/scripts/task_config_build_hexagon.sh 
+cd build
+cmake ..
+make -j2
+
+# Build Hexagon API
+cd ..
+./tests/scripts/task_build_hexagon_api.sh 
+```
+
+Now that you have built required tools, you can jump to [run test examples](#run-tests).

Review Comment:
   Also broken
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org