From df88c5de6e3e7ff4d7f4519235f076f60fb3d896 Mon Sep 17 00:00:00 2001 From: Richard Burton Date: Tue, 30 May 2023 17:40:39 +0100 Subject: MLECO-4065 MLECO-4066: Updating to 23.05 dependencies * Update dependencies to 23.05 versions * Fix for a break caused by changes in TensorFlow Lite Micro * Update release notes Signed-off-by: Richard Burton Change-Id: Id2f60ea574aab982911125bdcb513adb8edc723d --- CMakeLists.txt | 2 +- dependencies/cmsis | 2 +- dependencies/cmsis-nn | 2 +- dependencies/core-driver | 2 +- dependencies/core-platform | 2 +- dependencies/tensorflow | 2 +- docs/quick_start.md | 2 +- docs/sections/building.md | 13 +++++---- docs/sections/troubleshooting.md | 34 +++++++++++----------- download_dependencies.py | 10 +++---- release_notes.txt | 6 ++++ set_up_default_resources.py | 8 ++--- .../api/common/include/TensorFlowLiteMicro.hpp | 3 +- source/application/api/common/source/Model.cc | 4 +-- 14 files changed, 49 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c4ba3d..a6e41f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ if(POLICY CMP0123) endif() project(arm_ml_embedded_evaluation_kit - VERSION 23.02.0 + VERSION 23.05.0 DESCRIPTION "ARM ML Embedded Evaluation Kit" LANGUAGES C CXX ASM) diff --git a/dependencies/cmsis b/dependencies/cmsis index 41a6424..e94a962 160000 --- a/dependencies/cmsis +++ b/dependencies/cmsis @@ -1 +1 @@ -Subproject commit 41a6424ff4307bd52d94bfc2708874d4224848b6 +Subproject commit e94a96201a97be3e84d3d6ef081d2f0f7db9b5fd diff --git a/dependencies/cmsis-nn b/dependencies/cmsis-nn index d071e9f..61d1bb6 160000 --- a/dependencies/cmsis-nn +++ b/dependencies/cmsis-nn @@ -1 +1 @@ -Subproject commit d071e9f70195559e7242709b8df3adeb7c50d0fb +Subproject commit 61d1bb6c4428ad730e525d0164e12df12b789985 diff --git a/dependencies/core-driver b/dependencies/core-driver index ecdce6c..90f9df9 160000 --- a/dependencies/core-driver +++ b/dependencies/core-driver @@ -1 +1 @@ -Subproject commit ecdce6c33b2cb5e2589e339dd5c3c5c463ace9f2 +Subproject commit 90f9df900acdc0718ecd2dfdc53780664758dec5 diff --git a/dependencies/core-platform b/dependencies/core-platform index 00b8e7b..4db21c9 160000 --- a/dependencies/core-platform +++ b/dependencies/core-platform @@ -1 +1 @@ -Subproject commit 00b8e7beb4fef59c5bef3bc963dfff5bd11718b6 +Subproject commit 4db21c986a8aec9a1ee31479fd3ca9806781865f diff --git a/dependencies/tensorflow b/dependencies/tensorflow index 1d810ca..384dd27 160000 --- a/dependencies/tensorflow +++ b/dependencies/tensorflow @@ -1 +1 @@ -Subproject commit 1d810cac73330d9bf156b38a111ffd8e86523362 +Subproject commit 384dd272f28ea7a99f5f7c211c9791f73cdb301b diff --git a/docs/quick_start.md b/docs/quick_start.md index 37002ad..cad0e8c 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -71,7 +71,7 @@ mkdir resources_downloaded && cd resources_downloaded python3 -m venv env env/bin/python3 -m pip install --upgrade pip env/bin/python3 -m pip install --upgrade setuptools -env/bin/python3 -m pip install ethos-u-vela==3.6.0 +env/bin/python3 -m pip install ethos-u-vela==3.8.0 cd .. curl -L https://github.com/ARM-software/ML-zoo/raw/7c32b097f7d94aae2cd0b98a8ed5a3ba81e66b18/models/anomaly_detection/micronet_medium/tflite_int8/ad_medium_int8.tflite \ diff --git a/docs/sections/building.md b/docs/sections/building.md index bf7ca4d..c7d69c8 100644 --- a/docs/sections/building.md +++ b/docs/sections/building.md @@ -91,17 +91,17 @@ Before proceeding, it is *essential* to ensure that the following prerequisites > > `export PATH=$(readlink -e resources_downloaded/env/bin):${PATH}` -- Python 3.7 or above is installed. Check your current installed version of Python by running: +- Python 3.9 or above is installed. Check your current installed version of Python by running: ```commandline python3 --version ``` ```log - Python 3.7.13 + Python 3.9.7 ``` - > **Note:** If you have an older version of Python installed (< 3.7) see the + > **Note:** If you have an older version of Python installed (< 3.9) see the > [Troubleshooting](./troubleshooting.md#how-to-update-python3-package-to-newer-version) > for instruction on how to update it. @@ -126,7 +126,7 @@ Before proceeding, it is *essential* to ensure that the following prerequisites ``` ```log - pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.7) + pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.9) ``` - Make @@ -361,7 +361,7 @@ This fetches every model into the `resources_downloaded` directory. It also opti for the default 128 MACs configuration of the Arm® *Ethos™-U55* NPU and for the default 256 MACs configuration of the Arm® *Ethos™-U65* NPU. -> **Note:** This script requires Python version 3.7 or higher. Please make sure all [build prerequisites](./building.md#build-prerequisites) +> **Note:** This script requires Python version 3.9 or higher. Please make sure all [build prerequisites](./building.md#build-prerequisites) > are satisfied. > > **Note:** This script also installs required version of CMake into the virtual environment, which can be used by activating it. @@ -709,8 +709,9 @@ After compiling, your custom model has now replaced the default one in the appli > . > The source code is hosted on . -> **Note:** Using the 22.11 versions of software dependencies will require Vela to be at least version 3.6.0 +> **Note:** The correct version of Vela should be used and this depends on the versions of software dependencies used > or you may encounter issues when trying to run applications on different variants of Ethos-U NPUs. +> See for more details of which versions align. The Vela compiler is a tool that can optimize a neural network model into a version that can run on an embedded system containing an *Ethos-U* NPU. diff --git a/docs/sections/troubleshooting.md b/docs/sections/troubleshooting.md index b29b30a..c8bb7b3 100644 --- a/docs/sections/troubleshooting.md +++ b/docs/sections/troubleshooting.md @@ -6,8 +6,8 @@ - [NPU configuration mismatch error when running inference](./troubleshooting.md#npu-configuration-mismatch-error-when-running-inference) - [Errors when cloning the repository](./troubleshooting.md#errors-when-cloning-the-repository) - [Problem installing Vela](./troubleshooting.md#problem-installing-vela) - - [No matching distribution found for ethos-u-vela==3.5.0](./troubleshooting.md#no-matching-distribution-found-for-ethos_u_vela) - - [How to update Python3 package to 3.7 version](./troubleshooting.md#how-to-update-python3-package-to-newer-version) + - [No matching distribution found for ethos-u-vela==3.8.0](./troubleshooting.md#no-matching-distribution-found-for-ethos_u_vela) + - [How to update Python3 package to 3.9 version](./troubleshooting.md#how-to-update-python3-package-to-newer-version) - [Error trying to build on Arm Virtual Hardware](./troubleshooting.md#error-trying-to-build-on-arm-virtual-hardware) - [Internal Compiler Error](./troubleshooting.md#internal-compiler-error) - [Build issues with WSL2](./troubleshooting.md#build-issues-with-wsl2) @@ -129,15 +129,15 @@ To solve this issue install libpython3 on the system. ## No matching distribution found for ethos-u-vela -Vela 3.5.0 increases Python requirement to at least version 3.7, if not installed on your system the following error will occur: +Vela 3.8.0 increases Python requirement to at least version 3.9, if not installed on your system the following error will occur: ```log -python3 -m pip install ethos-u-vela==3.5.0 -ERROR: Could not find a version that satisfies the requirement ethos-u-vela==3.5.0 (from versions: 0.1.0, 1.0.0, 1.1.0, 1.2.0, 2.0.0, 2.0.1, 2.1.1, 3.0.0, 3.1.0, 3.2.0) -ERROR: No matching distribution found for ethos-u-vela==3.5.0 +python3 -m pip install ethos-u-vela==3.8.0 +ERROR: Could not find a version that satisfies the requirement ethos-u-vela==3.8.0 (from versions: 0.1.0, 1.0.0, 1.1.0, 1.2.0, 2.0.0, 2.0.1, 2.1.1, 3.0.0, 3.1.0, 3.2.0) +ERROR: No matching distribution found for ethos-u-vela==3.8.0 ``` -Ensure that the minimum Python 3.7 requirement is installed and it's the default version. +Ensure that the minimum Python 3.9 requirement is installed and it's the default version. Check your current installed version of Python by running: ```commandline @@ -158,37 +158,37 @@ python3 --version Python 3.6.9 ``` -2. Install the Python 3.7 packages necessary on the system: +2. Install the Python 3.9 packages necessary on the system: ```commandline - sudo apt-get install python3.7 python3.7-venv libpython3.7 libpython3.7-dev + sudo apt-get install python3.9 python3.9-venv libpython3.9 libpython3.9-dev ``` 3. Update the `python3` alternatives (set as 1 your previous version displayed at step 1): ```commandline sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 - sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 + sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2 ``` -4. At the prompt, update the configuration by selecting Python3.7 as the chosen default alternative: +4. At the prompt, update the configuration by selecting Python3.9 as the chosen default alternative: ```commandline sudo update-alternatives --config python3 ``` -5. Python3.7 is now set as default you can check it by running: +5. Python3.9 is now set as default, you can check it by running: ```commandline python3 --version ``` ```log - Python 3.7.0 + Python 3.9.0 ``` -> **Note:** After updating to from Python3.6 Python3.7 it may happen that the `gnome-terminal` or the relative -> shortcuts doesn't work anymore. +> **Note:** After updating from Python3.6 to Python3.9 it may happen that the `gnome-terminal` or the relative +> shortcuts don't work anymore. > If when opening it from XTerm with `gnome-terminal` the following error appear: > > ```log @@ -215,7 +215,7 @@ The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command. - apt install python3.8-venv + apt install python3.9-venv You may need to use sudo with that command. After installing the python3-venv package, recreate your virtual environment. @@ -240,7 +240,7 @@ subprocess.CalledProcessError: Command 'python3 -m venv env' returned non-zero e You can fix this error by installing Python virtual environment and removing the corrupted resources_downloaded folder. ```commandline -sudo apt install python3.8-venv +sudo apt install python3.9-venv rm -r resources_downloaded ``` diff --git a/download_dependencies.py b/download_dependencies.py index 385750e..c884b72 100755 --- a/download_dependencies.py +++ b/download_dependencies.py @@ -24,12 +24,12 @@ from urllib.request import urlopen from zipfile import ZipFile from pathlib import Path -TF = "https://github.com/tensorflow/tflite-micro/archive/1d810cac73330d9bf156b38a111ffd8e86523362.zip" -CMSIS = "https://github.com/ARM-software/CMSIS_5/archive/41a6424ff4307bd52d94bfc2708874d4224848b6.zip" +TF = "https://github.com/tensorflow/tflite-micro/archive/384dd272f28ea7a99f5f7c211c9791f73cdb301b.zip" +CMSIS = "https://github.com/ARM-software/CMSIS_5/archive/e94a96201a97be3e84d3d6ef081d2f0f7db9b5fd.zip" CMSIS_DSP = "https://github.com/ARM-software/CMSIS-DSP/archive/refs/tags/v1.14.4.zip" -CMSIS_NN = "https://github.com/ARM-software/CMSIS-NN/archive/refs/tags/23.02.zip" -ETHOS_U_CORE_DRIVER = "https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/snapshot/ethos-u-core-driver-23.02.tar.gz" -ETHOS_U_CORE_PLATFORM = "https://git.mlplatform.org/ml/ethos-u/ethos-u-core-platform.git/snapshot/ethos-u-core-platform-23.02.tar.gz" +CMSIS_NN = "https://github.com/ARM-software/CMSIS-NN/archive/refs/tags/23.05.zip" +ETHOS_U_CORE_DRIVER = "https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/snapshot/ethos-u-core-driver-23.05.tar.gz" +ETHOS_U_CORE_PLATFORM = "https://git.mlplatform.org/ml/ethos-u/ethos-u-core-platform.git/snapshot/ethos-u-core-platform-23.05.tar.gz" def download(url_file: str, post_process=None): diff --git a/release_notes.txt b/release_notes.txt index cefa3c8..cc34c0a 100644 --- a/release_notes.txt +++ b/release_notes.txt @@ -1,3 +1,9 @@ +Changes in 23.05 + * Support for 23.05 NPU components and dependencies (core-driver, core-platform, Vela 3.8.0, CMSIS, CMSIS-NN and TensorFlow Lite Micro). + * Minor updates to CMSIS-pack dependencies. + * Update Python package requirements for compatibility reasons. + * Increase minimum requirements of Python to 3.9 + Changes in 23.02 * Support for 23.02 NPU components and dependencies (core-driver, core-platform, Vela 3.7.0, CMSIS, CMSIS-DSP, CMSIS-NN and TensorFlow Lite Micro). * Improvement to PMU counters - reducing cache maintenance burden for Arm Cortex-M55 CPUs when NPU is used. diff --git a/set_up_default_resources.py b/set_up_default_resources.py index 3bfe52f..740cfb8 100755 --- a/set_up_default_resources.py +++ b/set_up_default_resources.py @@ -381,9 +381,9 @@ def set_up_resources( metadata_file_path = download_dir / "resources_downloaded_metadata.json" metadata_dict = dict() - vela_version = "3.7.0" - py3_major_version_minimum = 3 # Python >= 3.7 is required - py3_minor_version_minimum = 7 + vela_version = "3.8.0" + py3_major_version_minimum = 3 # Python >= 3.9 is required + py3_minor_version_minimum = 9 # Is Python minimum requirement matched? py3_version = sys.version_info @@ -392,7 +392,7 @@ def set_up_resources( or py3_version.minor < py3_minor_version_minimum ): raise Exception( - "ERROR: Python3.7+ is required, please see the documentation on how to update it." + "ERROR: Python3.9+ is required, please see the documentation on how to update it." ) setup_script_hash_verified = False diff --git a/source/application/api/common/include/TensorFlowLiteMicro.hpp b/source/application/api/common/include/TensorFlowLiteMicro.hpp index 944ed4a..17dfd64 100644 --- a/source/application/api/common/include/TensorFlowLiteMicro.hpp +++ b/source/application/api/common/include/TensorFlowLiteMicro.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates + * SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,7 +47,6 @@ #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/micro/kernels/micro_ops.h" -#include "tensorflow/lite/micro/tflite_bridge/op_resolver_bridge.h" #include "tensorflow/lite/schema/schema_generated.h" #include "tensorflow/lite/schema/schema_utils.h" diff --git a/source/application/api/common/source/Model.cc b/source/application/api/common/source/Model.cc index 7de6fde..80c10b7 100644 --- a/source/application/api/common/source/Model.cc +++ b/source/application/api/common/source/Model.cc @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates + * SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -199,7 +199,7 @@ void arm::app::Model::LogInterpreterInfo() for (size_t i = 0; i < nOperators; ++i) { const tflite::Operator* op = subgraph->operators()->Get(i); const tflite::OperatorCode* opcode = opcodes->Get(op->opcode_index()); - const TfLiteRegistration* reg = nullptr; + const TfLiteRegistration_V1* reg = nullptr; tflite::GetRegistrationFromOpCode(opcode, this->GetOpResolver(), ®); std::string opName; -- cgit v1.2.1