Skip to content

Commit

Permalink
Remove tutorials CMSIS dependency when not needed (#13762)
Browse files Browse the repository at this point in the history
* Remove tutorials CMSIS dependencies when not needed

Change-Id: Ic844422c74855f774b97ea57c6cb6eac2236e29b

* Address comments

Change-Id: Idbaada0753a9d46cfd94f71fcb30c7f7a8a1d17d
  • Loading branch information
NicolaLancellotti authored Jan 12, 2023
1 parent be25803 commit bd3d93b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
4 changes: 4 additions & 0 deletions gallery/how_to/work_with_microtvm/install_cmsis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 1 addition & 7 deletions gallery/how_to/work_with_microtvm/micro_aot.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,14 @@
# 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"))

######################################################################
#
# .. include:: ../../../../gallery/how_to/work_with_microtvm/install_zephyr.rst
#

######################################################################
#
# .. include:: ../../../../gallery/how_to/work_with_microtvm/install_cmsis.rst
#

######################################################################
# Import Python dependencies
# -------------------------------
Expand Down Expand Up @@ -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"),
}

Expand Down
6 changes: 1 addition & 5 deletions gallery/how_to/work_with_microtvm/micro_autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
8 changes: 1 addition & 7 deletions gallery/how_to/work_with_microtvm/micro_tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@
# 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"))

######################################################################
#
# .. include:: ../../../../gallery/how_to/work_with_microtvm/install_zephyr.rst
#

######################################################################
#
# .. include:: ../../../../gallery/how_to/work_with_microtvm/install_cmsis.rst
#

######################################################################
# Import Python dependencies
# -------------------------------
Expand Down Expand Up @@ -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"),
}

Expand Down

0 comments on commit bd3d93b

Please sign in to comment.