Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ application.
The pack [`PyTorch::ExecuTorch`](https://www.keil.arm.com/packs/executorch-pytorch/) can be optionally installed manually with:

```bash
cpackget add PyTorch::ExecuTorch@1.4.1
cpackget add PyTorch::ExecuTorch@1.5.1
```

> [!Note]
> The pack and Python exporter versions must match, as the generated `.pte`
> format is consumed by the runtime supplied in `PyTorch::ExecuTorch@1.4.1`.
> The matching wheel is `executorch==1.4.1` from PyPI, pinned in
> format is consumed by the runtime supplied in `PyTorch::ExecuTorch@1.5.1`.
> The matching wheel is `executorch==1.5.1` from PyPI, pinned in
> `requirements.txt`.

## Quick start
Expand Down Expand Up @@ -73,7 +73,7 @@ Ethos-U version info:
Arch: v2.0.0
MACs/cc: 256
Cmd stream: v1
ExecuTorch Ethos-U85 example: 8832 byte model
ExecuTorch Ethos-U85 example: 8784 byte model
Output: 10 element(s): 0.0079 0.0459 0.0475 -0.0475 0.0791 0.0411 -0.0285 -0.0744 -0.2246 -0.0016
Test_result: PASS
```
Expand Down
4 changes: 2 additions & 2 deletions RTE/_Debug_SSE-320-U85/Pre_Include_Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
/* ARM::Machine Learning:NPU Support:Ethos-U Driver&Generic U85@1.26.2 */
// enabling global pre includes
#define ETHOSU_ARCH u85
/* PyTorch::Machine Learning:ExecuTorch:Backend EthosU@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch:Backend EthosU@1.5.1 */
#define EXECUTORCH_BUILD_ARM_BAREMETAL 1
#define ET_USE_ETHOS_U_BACKEND 1
/* PyTorch::Machine Learning:ExecuTorch:Runtime@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch:Runtime@1.5.1 */
/* ExecuTorch global configuration */
#define C10_USING_CUSTOM_GENERATED_MACROS
#define FLATBUFFERS_MAX_ALIGNMENT 1024
Expand Down
12 changes: 6 additions & 6 deletions RTE/_Debug_SSE-320-U85/RTE_Components.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
#define RTE_TIMEOUT 1
/* ARM::Machine Learning:NPU Support:Ethos-U Driver&Generic U85@1.26.2 */
#define RTE_ETHOS_U_CORE_DRIVER
/* PyTorch::Machine Learning:ExecuTorch Operators:Quantized dequantize@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch Operators:Quantized dequantize@1.5.1 */
#define RTE_ML_EXECUTORCH_OP_QUANTIZED_DEQUANTIZE /* ExecuTorch op_dequantize */
/* PyTorch::Machine Learning:ExecuTorch Operators:Quantized quantize@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch Operators:Quantized quantize@1.5.1 */
#define RTE_ML_EXECUTORCH_OP_QUANTIZED_QUANTIZE /* ExecuTorch op_quantize */
/* PyTorch::Machine Learning:ExecuTorch:Backend EthosU@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch:Backend EthosU@1.5.1 */
#define RTE_ML_EXECUTORCH_BACKEND_ETHOS_U /* ExecuTorch Ethos-U Backend (Cortex-M host) */
/* PyTorch::Machine Learning:ExecuTorch:Kernel Registration@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch:Kernel Registration@1.5.1 */
#define RTE_ML_EXECUTORCH_KERNEL_REGISTRATION /* ExecuTorch Kernel Registration */
/* PyTorch::Machine Learning:ExecuTorch:Kernel Utils@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch:Kernel Utils@1.5.1 */
#define RTE_ML_EXECUTORCH_KERNEL_UTILS /* ExecuTorch Kernel Utils */
/* PyTorch::Machine Learning:ExecuTorch:Runtime@1.4.1 */
/* PyTorch::Machine Learning:ExecuTorch:Runtime@1.5.1 */
#define RTE_ML_EXECUTORCH_RUNTIME /* ExecuTorch Runtime */


Expand Down
2 changes: 1 addition & 1 deletion ai_layer/ai_layer.clayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ layer:
description: TinyCNN int8 image classifier for Ethos-U85

packs:
- pack: PyTorch::ExecuTorch@1.4.1
- pack: PyTorch::ExecuTorch@1.5.1

define:
- ET_LOG_ENABLED: 0
Expand Down
27 changes: 12 additions & 15 deletions ai_layer/model_pte.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ __attribute__((aligned(16))) const unsigned char model_pte[] = {
0x24, 0x00, 0x00, 0x00, 0x45, 0x54, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00,
0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
0x2c, 0x00, 0x00, 0x00, 0x8c, 0x1a, 0x00, 0x00, 0x8c, 0x1a, 0x00, 0x00, 0xf0, 0xe1, 0xff, 0xff,
0x2c, 0x00, 0x00, 0x00, 0x8c, 0x1a, 0x00, 0x00, 0x8c, 0x1a, 0x00, 0x00, 0x20, 0xe2, 0xff, 0xff,
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x72, 0xdf, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x50, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0xa2, 0xdf, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x00, 0x00,
0x76, 0x65, 0x6c, 0x61, 0x5f, 0x62, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x63, 0x6d, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -430,23 +430,20 @@ __attribute__((aligned(16))) const unsigned char model_pte[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00,
0x28, 0x00, 0x24, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00,
0x08, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
0x28, 0x02, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0x90, 0x03, 0x00, 0x00, 0x94, 0x03, 0x00, 0x00,
0x98, 0x03, 0x00, 0x00, 0x20, 0x06, 0x00, 0x00, 0x6c, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x08, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
0xf8, 0x01, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x64, 0x03, 0x00, 0x00,
0x68, 0x03, 0x00, 0x00, 0xf0, 0x05, 0x00, 0x00, 0x3c, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x72, 0xfd, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00,
0xd0, 0x01, 0x00, 0x00, 0xd0, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00,
0xd0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x38, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa6, 0xfd, 0xff, 0xff,
0x0c, 0x00, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x54, 0x01, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x68, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x65, 0x74, 0x68, 0x6f, 0x73, 0x2d, 0x75, 0x38, 0x35, 0x2d, 0x32, 0x35,
0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x00,
0x64, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x94, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x46, 0x61, 0x6c, 0x73, 0x65, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x70, 0x72, 0x65, 0x73,
0x65, 0x72, 0x76, 0x65, 0x5f, 0x69, 0x6f, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x9c, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x70, 0x75,
0x74, 0x5f, 0x72, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72,
0x6f, 0x75, 0x6e, 0x64, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00,
0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x76, 0x65, 0x6c, 0x61, 0x0d, 0x00, 0x00, 0x00,
0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x00, 0x00, 0x00,
0xf4, 0xfa, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00,
Expand Down
2 changes: 1 addition & 1 deletion cmsis-executorch.cproject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# the Board layer brings the board bring-up.
project:
packs:
- pack: PyTorch::ExecuTorch@1.4.1
- pack: PyTorch::ExecuTorch@1.5.1
- pack: ARM::CMSIS

misc:
Expand Down
2 changes: 1 addition & 1 deletion cmsis-executorch.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ solution:
# Pinned exactly: the pack's C++ runtime and the Python exporter pinned in
# requirements.txt must be the same ExecuTorch version, or the .pte fails
# to load. `cbuild setup --packs` fetches it from the public index.
- pack: PyTorch::ExecuTorch@1.4.1
- pack: PyTorch::ExecuTorch@1.5.1
- pack: ARM::CMSIS
- pack: ARM::CMSIS-NN
- pack: ARM::CMSIS-Compiler
Expand Down
17 changes: 9 additions & 8 deletions documentation/pack-provenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ The pack is published as an asset of the matching ExecuTorch GitHub release,
which is also what its `.pdsc` declares as its download location:

```xml
<url>https://github.com/pytorch/executorch/releases/download/v1.4.1/</url>
<url>https://github.com/pytorch/executorch/releases/download/v1.5.1/</url>
```

So the normal acquisition routes work, and `cbuild setup ... --packs` takes
care of it on a fresh clone. To install it by hand:

```bash
cpackget add PyTorch::ExecuTorch@1.4.1
cpackget add PyTorch::ExecuTorch@1.5.1
```

The version is pinned exactly, in `cmsis-executorch.csolution.yml` and
`cmsis-executorch.cproject.yml`:

```yaml
packs:
- pack: PyTorch::ExecuTorch@1.4.1
- pack: PyTorch::ExecuTorch@1.5.1
```

Both must agree. The pin is exact rather than a `@^1.4.1` range because the
Both must agree. The pin is exact rather than a `@^1.5.1` range because the
pack's C++ runtime and the Python exporter have to be the *same* ExecuTorch
version — see [Moving to a new ExecuTorch version](#moving-to-a-new-executorch-version).

Expand Down Expand Up @@ -63,7 +63,7 @@ ExecuTorch tree at `backends/arm/cmsis_pack/scripts/build_pack.sh`.
```bash
git clone https://github.com/pytorch/executorch.git
cd executorch
git checkout release/1.4 # or the tag matching your target version
git checkout release/1.5 # or the tag matching your target version
git submodule update --init --recursive
```

Expand Down Expand Up @@ -111,7 +111,7 @@ them); the pack lands in the output directory:
backends/arm/cmsis_pack/scripts/build_pack.sh \
--executorch-root "$PWD" \
--build-dir cmake-out-arm \
--version 1.4.1-local \
--version 1.5.1-local \
--output-dir pack-output
```

Expand All @@ -120,7 +120,7 @@ backends/arm/cmsis_pack/scripts/build_pack.sh \
Before trusting a freshly built pack, check the parts that go missing quietly:

```bash
VERSION=1.4.1-local
VERSION=1.5.1-local
PACK=pack-output/PyTorch.ExecuTorch.$VERSION
set -e

Expand Down Expand Up @@ -158,7 +158,8 @@ in order:
2. **Update both pins** — `PyTorch::ExecuTorch@<new>` in the csolution and in
the cproject.
3. **Update the Python pins**: `executorch`, `torch` and `torchao` in
`requirements.txt`, following the new release's `install_requirements.py`;
`requirements.txt`, following the new release's `torch_pin.py` and
`install_requirements.py`;
`requirements-arm-tosa.txt` (the TOSA serializer and its flatbuffers pin)
only changes when the Arm backend's `requirements-arm-tosa.txt` does.
4. **Rebuild the venv, the AI layer and the project:**
Expand Down
13 changes: 7 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
#
# executorch, torch and torchao must match: a .pte exported by one ExecuTorch
# version only loads in the runtime of the same version, and that runtime is
# the PyTorch::ExecuTorch@1.4.1 pack pinned in the csolution. ExecuTorch 1.4.1
# targets torch 2.13.0 and torchao 0.18.0 (install_requirements.py on the
# release/1.4 branch); prebuilt wheels exist for Linux, macOS and Windows,
# Python 3.10 to 3.14 (the export venv stays below 3.14: see requirements-arm-tosa.txt).
executorch==1.4.1
torch==2.13.0
# the PyTorch::ExecuTorch@1.5.1 pack pinned in the csolution. ExecuTorch 1.5.1
# targets torch 2.14.0 (torch_pin.py at the v1.5.1 tag) and torchao 0.18
# (the wheel requires torchao>=0.18.0,<0.19); prebuilt wheels exist for Linux,
# macOS and Windows, Python 3.10 to 3.14 (the export venv stays below 3.14:
# see requirements-arm-tosa.txt).
executorch==1.5.1
torch==2.14.0
torchao==0.18.0

# Vela, the Ethos-U compiler. Same pin as executorch's `ethos_u` extra.
Expand Down
2 changes: 1 addition & 1 deletion setup_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
HERE = Path(__file__).resolve().parent
VENV_DIR = HERE / ".venv"

# ExecuTorch 1.4 declares requires-python = ">=3.10,<3.15" in its pyproject.toml,
# ExecuTorch 1.5 declares requires-python = ">=3.10,<3.15" in its pyproject.toml,
# but the tosa-tools 2026.5.0 it pins for the Arm backend (see
# requirements-arm-tosa.txt) only ships wheels up to CPython 3.13, so on 3.14
# pip reports "No matching distribution found for tosa-tools==2026.5.0".
Expand Down
Loading