From bd3d93b6a4f7883c89711b9feda44d205f1e3146 Mon Sep 17 00:00:00 2001 From: Nicola Lancellotti Date: Thu, 12 Jan 2023 23:36:05 +0000 Subject: [PATCH] Remove tutorials CMSIS dependency when not needed (#13762) * Remove tutorials CMSIS dependencies when not needed Change-Id: Ic844422c74855f774b97ea57c6cb6eac2236e29b * Address comments Change-Id: Idbaada0753a9d46cfd94f71fcb30c7f7a8a1d17d --- gallery/how_to/work_with_microtvm/install_cmsis.rst | 4 ++++ gallery/how_to/work_with_microtvm/micro_aot.py | 8 +------- gallery/how_to/work_with_microtvm/micro_autotune.py | 6 +----- gallery/how_to/work_with_microtvm/micro_tflite.py | 8 +------- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/gallery/how_to/work_with_microtvm/install_cmsis.rst b/gallery/how_to/work_with_microtvm/install_cmsis.rst index 2f1d2fb1189a..13286b1b54f6 100644 --- a/gallery/how_to/work_with_microtvm/install_cmsis.rst +++ b/gallery/how_to/work_with_microtvm/install_cmsis.rst @@ -33,3 +33,7 @@ Install CMSIS-NN wget ${CMSIS_URL} -O "${DOWNLOAD_PATH}" tar -xf "${DOWNLOAD_PATH}" -C ${CMSIS_PATH} --strip-components=1 rm ${DOWNLOAD_PATH} + + CMSIS_NN_TAG="v4.0.0" + CMSIS_NN_URL="https://github.com/ARM-software/CMSIS-NN.git" + git clone ${CMSIS_NN_URL} --branch ${CMSIS_NN_TAG} --single-branch ${CMSIS_PATH}/CMSIS-NN diff --git a/gallery/how_to/work_with_microtvm/micro_aot.py b/gallery/how_to/work_with_microtvm/micro_aot.py index 81109b2965ef..c1b29ba5c582 100644 --- a/gallery/how_to/work_with_microtvm/micro_aot.py +++ b/gallery/how_to/work_with_microtvm/micro_aot.py @@ -41,7 +41,7 @@ # By default, this tutorial runs on x86 CPU using TVM's C runtime. If you would like # to run on real Zephyr hardware, you must export the `TVM_MICRO_USE_HW` environment # variable. Otherwise (if you are using the C runtime), you can skip installing -# Zephyr and CMSIS-NN. It takes ~20 minutes to install both of them. +# Zephyr. It takes ~20 minutes to install Zephyr. use_physical_hw = bool(os.getenv("TVM_MICRO_USE_HW")) ###################################################################### @@ -49,11 +49,6 @@ # .. include:: ../../../../gallery/how_to/work_with_microtvm/install_zephyr.rst # -###################################################################### -# -# .. include:: ../../../../gallery/how_to/work_with_microtvm/install_cmsis.rst -# - ###################################################################### # Import Python dependencies # ------------------------------- @@ -159,7 +154,6 @@ "board": BOARD, "serial_number": SERIAL, "config_main_stack_size": 4096, - "cmsis_path": os.getenv("CMSIS_PATH", default="/content/cmsis"), "zephyr_base": os.getenv("ZEPHYR_BASE", default="/content/zephyrproject/zephyr"), } diff --git a/gallery/how_to/work_with_microtvm/micro_autotune.py b/gallery/how_to/work_with_microtvm/micro_autotune.py index 9edb9ae75e7f..9be257a57ac5 100644 --- a/gallery/how_to/work_with_microtvm/micro_autotune.py +++ b/gallery/how_to/work_with_microtvm/micro_autotune.py @@ -33,7 +33,7 @@ # -# You can skip the following two sections (installing Zephyr and CMSIS-NN) if the following flag is False. +# You can skip the following section (installing Zephyr) if the following flag is False. # Installing Zephyr takes ~20 min. import os @@ -44,10 +44,6 @@ # .. include:: ../../../../gallery/how_to/work_with_microtvm/install_zephyr.rst # -###################################################################### -# -# .. include:: ../../../../gallery/how_to/work_with_microtvm/install_cmsis.rst -# ###################################################################### # Import Python dependencies diff --git a/gallery/how_to/work_with_microtvm/micro_tflite.py b/gallery/how_to/work_with_microtvm/micro_tflite.py index 86e5d6b4b1ae..0770d472c9b8 100644 --- a/gallery/how_to/work_with_microtvm/micro_tflite.py +++ b/gallery/how_to/work_with_microtvm/micro_tflite.py @@ -36,7 +36,7 @@ # By default, this tutorial runs on x86 CPU using TVM's C runtime. If you would like # to run on real Zephyr hardware, you must export the `TVM_MICRO_USE_HW` environment # variable. Otherwise (if you are using the C runtime), you can skip installing -# Zephyr and CMSIS-NN. It takes ~20 minutes to install both of them. +# Zephyr. It takes ~20 minutes to install Zephyr. use_physical_hw = bool(os.getenv("TVM_MICRO_USE_HW")) ###################################################################### @@ -44,11 +44,6 @@ # .. include:: ../../../../gallery/how_to/work_with_microtvm/install_zephyr.rst # -###################################################################### -# -# .. include:: ../../../../gallery/how_to/work_with_microtvm/install_cmsis.rst -# - ###################################################################### # Import Python dependencies # ------------------------------- @@ -219,7 +214,6 @@ "board": BOARD, "serial_number": SERIAL, "config_main_stack_size": 4096, - "cmsis_path": os.getenv("CMSIS_PATH", default="/content/cmsis"), "zephyr_base": os.getenv("ZEPHYR_BASE", default="/content/zephyrproject/zephyr"), }