kem-gov commited on
Commit
0be42ca
·
verified ·
1 Parent(s): a487427

Sync model repo (text/metadata)

Browse files
.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  deit-tiny-int8-ethos-u-executorch.pte filter=lfs diff=lfs merge=lfs -text
 
 
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  deit-tiny-int8-ethos-u-executorch.pte filter=lfs diff=lfs merge=lfs -text
37
+ sample_input.jpg filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: executorch
3
+ display_name: DeiT-Tiny INT8 — Ethos-U85 (ExecuTorch)
4
+ license: apache-2.0
5
+ base_model: facebook/deit-tiny-patch16-224
6
+ base_model_relation: quantized
7
+ tags:
8
+ - image-classification
9
+ - deit
10
+ - vision-transformer
11
+ - int8
12
+ - quantized
13
+ - smoothquant
14
+ - ethos-u85
15
+ - npu
16
+ - arm
17
+ - executorch
18
+ - edge-ai
19
+ - imagenet-1k
20
+ pipeline_tag: image-classification
21
+ datasets:
22
+ - imagenet-1k
23
+ metrics:
24
+ - accuracy
25
+ model-index:
26
+ - name: deit-tiny-int8-ethos-u-executorch
27
+ results:
28
+ - task:
29
+ type: image-classification
30
+ name: Image Classification
31
+ dataset:
32
+ type: imagenet-1k
33
+ name: ImageNet-1K val
34
+ split: validation
35
+ args:
36
+ evaluation_samples: 50000
37
+ metrics:
38
+ - type: accuracy
39
+ value: 67.95
40
+ name: "Top-1 Accuracy (PyTorch INT8 simulation, not measured on-device)"
41
+ - type: accuracy
42
+ value: 88.47
43
+ name: "Top-5 Accuracy (PyTorch INT8 simulation, not measured on-device)"
44
+ ---
45
+
46
+ # DeiT-Tiny INT8 SmoothQuant (ExecuTorch + Ethos-U85)
47
+
48
+ This is an INT8-quantized version of [facebook/deit-tiny-patch16-224](https://huggingface.co/facebook/deit-tiny-patch16-224) (DeiT-Tiny, a data-efficient Vision Transformer from Meta / Facebook AI Research), optimized for the Arm Ethos-U85 NPU. The model was quantized using static PT2E quantization with SmoothQuant activation smoothing (INT8 activations/weights, with the MLP-down projection widened to INT16 activations for accuracy recovery), then ahead-of-time compiled with Arm's Vela compiler and exported to the ExecuTorch `.pte` format for execution on the Ethos-U85 NPU via the Corstone-320 Fixed Virtual Platform (FVP) or equivalent Ethos-U85 silicon (e.g., Alif Ensemble DK-E8).
49
+
50
+ **Important:** the accuracy numbers reported below come from a **PyTorch eager-mode INT8-vs-FP32 comparison pass**, not from running the exported `.pte` on the Corstone-320 FVP. The FVP-based on-device accuracy check (`fvp_subsample` mode) was disabled for this run. Treat these numbers as a proxy for expected NPU behavior, not a measured on-hardware result. See [Known Limitations](#known-limitations) for details.
51
+
52
+ ## Key Highlights
53
+
54
+ Compared to the FP32 baseline:
55
+
56
+ - **3.93x smaller PyTorch state dict** — 21.89 MB to 5.57 MB; the exported Ethos-U85 `.pte` artifact itself is 4.71 MB
57
+ - **99.91% of ops NPU-delegated at compile time** — Vela's static analysis delegates 3,494 of 3,497 ops to the Ethos-U85, with only 3 ops falling back to the host CPU (compile-time metric, not a latency measurement)
58
+ - **-4.18 pp Top-1 / -2.66 pp Top-5 accuracy** vs FP32, measured via PyTorch INT8 simulation on the full 50,000-image ImageNet-1K validation set — not yet confirmed on the exported `.pte`/FVP
59
+
60
+ ## Model Details
61
+
62
+ ### Model Description
63
+
64
+ DeiT-Tiny is a data-efficient Vision Transformer for ImageNet-1K classification, distilled and trained by Facebook AI Research. This is the INT8-quantized, Ethos-U85-targeted export of that model — no finetuning of weights was performed beyond quantization.
65
+
66
+ - **Developed by:** Facebook AI Research (Meta)
67
+ - **Model type:** Image Classification (Vision Transformer / DeiT)
68
+ - **License:** Apache 2.0
69
+ - **Base model:** [facebook/deit-tiny-patch16-224](https://huggingface.co/facebook/deit-tiny-patch16-224) — quantized, not finetuned
70
+
71
+ ### Model Sources
72
+
73
+ - **Repository:** https://huggingface.co/facebook/deit-tiny-patch16-224
74
+
75
+ ## How to Get Started with the Model
76
+
77
+ ### Install dependencies
78
+
79
+ When running from this repository, install `uv` and synchronize the project environment:
80
+
81
+ ```bash
82
+ make install-uv
83
+ uv sync
84
+ ```
85
+
86
+ The example itself uses NumPy and Pillow for preprocessing/postprocessing. It does **not** use the desktop ExecuTorch Python runtime; the compiled model is executed by `arm_executor_runner` inside Corstone-320 FVP.
87
+
88
+ ### Download the model
89
+
90
+ ```python
91
+ from huggingface_hub import hf_hub_download
92
+
93
+ model_path = hf_hub_download(
94
+ repo_id="your-org/deit-tiny-int8-smoothquant-ethos-u85-executorch",
95
+ filename="deit-tiny_ethos_ethosu_optimized.pte",
96
+ )
97
+ ```
98
+
99
+ Place the downloaded `deit-tiny_ethos_ethosu_optimized.pte` next to `example.py`, or pass a different path with `--model`.
100
+
101
+ ### Install Corstone-320 and the runner
102
+
103
+ The example requires both:
104
+
105
+ ```text
106
+ third_party/corstone-320-fvp/bin/FVP_Corstone_SSE-320
107
+ third_party/executorch-arm-runner/cmake-out/arm_executor_runner
108
+ ```
109
+
110
+ On Linux, install the supported toolchain from the repository root:
111
+
112
+ ```bash
113
+ make install-corstone
114
+ ```
115
+
116
+ #### macOS setup
117
+
118
+ Corstone-320 has no native macOS binary in this setup. It runs through the [`FVPs-on-Mac`](https://github.com/Arm-Examples/FVPs-on-Mac) Docker wrapper. Docker Desktop must be installed and running:
119
+
120
+ ```bash
121
+ open -a Docker
122
+ docker info
123
+ ```
124
+
125
+ If the wrapper is not installed yet:
126
+
127
+ ```bash
128
+ git clone https://github.com/Arm-Examples/FVPs-on-Mac.git ~/tools/FVPs-on-Mac
129
+ cd ~/tools/FVPs-on-Mac
130
+ ./build.sh
131
+ echo 'export PATH="$PATH:$HOME/tools/FVPs-on-Mac/bin"' >> ~/.zshrc
132
+ source ~/.zshrc
133
+ FVP_Corstone_SSE-320 --version
134
+ ```
135
+
136
+ The wrapper requires an activated Arm User Based License, normally cached under `~/.armlm`. It mounts that cache into the FVP container automatically. Once Docker, the wrapper and license are ready, return to this repository and build/install the runner:
137
+
138
+ ```bash
139
+ export CXXFLAGS="-Wno-invalid-specialization"
140
+ export CFLAGS="-Wno-invalid-specialization"
141
+ make install-corstone
142
+ ```
143
+
144
+ If `docker info` reports `Cannot connect to the Docker daemon`, wait for Docker Desktop to finish starting before continuing. The first FVP invocation may build its local Docker image and take longer.
145
+
146
+ ### Run inference
147
+
148
+ From the repository root:
149
+
150
+ ```bash
151
+ uv run python models_reports/deit_tiny_ethosu85_executorch/huggingface/example.py
152
+ ```
153
+
154
+ The script performs genuine inference on Corstone-320 FVP: it preprocesses `sample_input.jpg`, stages the `.pte` and FP32 input through semihosting, invokes `arm_executor_runner`, reads the `[1, 1000]` logits, prints the Top-5 ImageNet predictions and overwrites:
155
+
156
+ ```text
157
+ models_reports/deit_tiny_ethosu85_executorch/huggingface/predictions.json
158
+ ```
159
+
160
+ Useful overrides are exposed as command-line arguments:
161
+
162
+ ```bash
163
+ uv run python models_reports/deit_tiny_ethosu85_executorch/huggingface/example.py \
164
+ --model /path/to/model.pte \
165
+ --image /path/to/image.jpg \
166
+ --labels /path/to/imagenet_classes.json \
167
+ --fvp-bin /path/to/FVP_Corstone_SSE-320 \
168
+ --runner-elf /path/to/arm_executor_runner \
169
+ --timelimit 1800
170
+ ```
171
+
172
+ The `.pte` cannot run through the standard desktop ExecuTorch CPU/XNNPACK runtime because it contains an Ethos-U85 delegate. Actual Ethos-U85 silicon is also supported, but this particular example script is an FVP semihosting runner.
173
+
174
+ ## Evaluation
175
+
176
+ ### Testing Data, Factors & Metrics
177
+
178
+ #### Testing Data
179
+
180
+ Evaluated on 50,000 images from ImageNet-1K (full validation split).
181
+
182
+ #### Metrics
183
+
184
+ - **Top-1 / Top-5 Accuracy** — standard ImageNet classification metrics, computed here as a **PyTorch eager-mode FP32-vs-INT8 comparison**, not a measurement of the exported `.pte` running on the Corstone-320 FVP
185
+
186
+ ### Results
187
+
188
+ #### Accuracy
189
+
190
+ | Metric | FP32 (Original) | INT8 SmoothQuant (PyTorch simulation) | Delta |
191
+ |:---|:---:|:---:|:---:|
192
+ | Top-1 Accuracy | 72.13% | 67.95% | -4.18 pp |
193
+ | Top-5 Accuracy | 91.13% | 88.47% | -2.66 pp |
194
+
195
+ These numbers come from a PyTorch-only FP32-vs-INT8 comparison pass over all 50,000 ImageNet-1K validation images. They are a proxy for what the Ethos-U85 NPU should produce, not a value measured from the exported `.pte` on the FVP in this run.
196
+
197
+ #### Efficiency
198
+
199
+ | Metric | Value | What it measures |
200
+ |:---|:---:|:---|
201
+ | PyTorch State Dict Size — FP32 | 21.89 MB | Serialized `state_dict()` size |
202
+ | PyTorch State Dict Size — INT8 | 5.57 MB (3.93x smaller) | Serialized `state_dict()` size |
203
+ | Ethos-U85 `.pte` Size — INT8 | 4.71 MB | Real exported artifact file size |
204
+ | NPU Delegation Coverage (Vela) | 99.91% (3,494 delegated / 3 host ops) | Static, export-time compiler metric — not runtime |
205
+ | Vela MAC Count (per batch) | 1,271,114,184 | Static, export-time compiler metric — not runtime |
206
+
207
+ **No inference latency was measured in this experiment.** No `RuntimeEvaluator` / Corstone-320 FVP timing run was performed for this report; the delegation coverage and MAC count above are static compiler outputs from Vela, not wall-clock measurements. See [Known Limitations](#known-limitations).
208
+
209
+ ## Technical Specifications
210
+
211
+ ### Objective
212
+
213
+ 1,000-class image classification on ImageNet using a tiny Vision Transformer (DeiT) architecture.
214
+
215
+ ### Quantization
216
+
217
+ - **Method:** Static post-training quantization (PT2E) with SmoothQuant activation smoothing applied before observer insertion, targeting the Ethos-U85 Vela compile path
218
+ - **Base precision:** INT8 symmetric weights, per-tensor (`is_per_channel: false`), INT8 activations (a8w8) globally
219
+ - **Per-layer override:** `output.dense` (the MLP-down projection in each transformer block) widened to INT16 activations / INT8 weights (a16w8) for extra accuracy recovery
220
+ - **Activation observer:** Histogram
221
+ - **Calibration:** 2,000 randomly selected ImageNet-1K images
222
+ - **Target:** `ethos-u85-256`, system config `Ethos_U85_SRAM_MRAM`, memory mode `Shared_Sram`
223
+
224
+ ### Export Pipeline
225
+
226
+ 1. Load pretrained FP32 `facebook/deit-tiny-patch16-224`
227
+ 2. Apply SmoothQuant activation smoothing
228
+ 3. Capture model graph via `torch.export`
229
+ 4. Insert quantization observers (global a8w8, with `output.dense` overridden to a16w8)
230
+ 5. Calibrate with 2,000 representative ImageNet-1K images
231
+ 6. Convert observers to Q/DQ pairs
232
+ 7. Ahead-of-time compile the quantized graph with Vela for the `ethos-u85-256` target
233
+ 8. Export to ExecuTorch `.pte` for semihosting execution via the Ethos-U85 NPU delegate
234
+
235
+ ### Preprocessing
236
+
237
+ | Property | Value |
238
+ |---|---|
239
+ | Input shape | `[1, 3, 224, 224]` (BCHW) |
240
+ | Data type | float32 |
241
+ | Value range | [0.0, 1.0] |
242
+ | Color space | RGB |
243
+
244
+ **Steps**:
245
+ 1. Resize shortest side to 256 (bicubic interpolation)
246
+ 2. Center crop to 224x224
247
+ 3. Convert to tensor ([0-255] uint8 -> [0, 1] float32)
248
+
249
+ **Normalization**: ImageNet mean/std (`mean=[0.485, 0.456, 0.406]`, `std=[0.229, 0.224, 0.225]`).
250
+
251
+ ### Postprocessing
252
+
253
+ | Property | Value |
254
+ |---|---|
255
+ | Output shape | `[1, 1000]` |
256
+ | Output format | Raw class logits (unnormalized), ImageNet-1K class ordering |
257
+
258
+ **Steps**:
259
+ 1. Apply softmax over the 1,000 logits
260
+ 2. Take the top-5 classes by probability
261
+
262
+ ## Known Limitations
263
+
264
+ - **Accuracy is a PyTorch simulation, not an on-device measurement.** The Top-1/Top-5 numbers above come from a PyTorch eager-mode FP32-vs-INT8 comparison over the full ImageNet-1K validation set. The FVP-based accuracy mode (`accuracy_modes.fvp_subsample`) that would compare PyTorch vs the actual exported `.pte` running on the Corstone-320 FVP was disabled for this run — there is no measured on-FVP/on-silicon accuracy number to report yet.
265
+ - **No runtime latency was measured.** This experiment did not run a `RuntimeEvaluator` / Corstone-320 FVP timing pass. The 99.91% NPU delegation coverage and the ~1.27B MAC count are static, export-time compiler metrics produced by Vela — they indicate how much of the graph the NPU can execute and how much compute it involves, not how fast it runs.
266
+ - **The `.pte` requires Ethos-U85 hardware or the FVP to execute.** It cannot be run for real inference on a standard desktop/CPU ExecuTorch Python runtime, since the `EthosUBackend` delegate is not registered there — see the `RuntimeError` behavior in [How to Get Started](#how-to-get-started-with-the-model).
267
+ - **Fixed input size** of 224x224, batch size 1 — no dynamic shapes.
benchmarks/README.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Benchmarks
2
+
3
+ Machine-readable measurement records for this model (`vision-classification` schema).
4
+
5
+ ## Files
6
+
7
+ - `deit-tiny-int8-ethos-u-executorch-alif-dk-e8-int8.yaml` — optimized INT8 measurements on the Alif DK-E8
8
+ (Cortex-M55 host + Ethos-U85 NPU) via the ExecuTorch `ethos-u` backend.
9
+ - `deit-tiny-int8-ethos-u-executorch-alif-dk-e8-fp32.yaml` — FP32 reference accuracy (PyTorch; the baseline was
10
+ not compiled to the NPU, so no on-device performance).
11
+
12
+ ## Ethos-U metrics deferred
13
+
14
+ These are **regular vision-classification** records for now. The delivery also carries
15
+ NPU-specific metrics that the 0.6.0 schema's `additionalProperties: false` rejects —
16
+ target `npu_model`/`npu_num_macs` and performance `sram_peak_bytes`, `flash_footprint_mib`,
17
+ `mac_utilization_pct`, `total_cycles`, `active_cycles`, `effective_cycles_ratio_pct`. They
18
+ are **preserved in `metadata.yaml`** and will be added back to these records once a schema
19
+ holds the embedded-NPU profile (see [`upstream.md`](../../../docs/marvik/upstream.md) and
20
+ [ai-portal-model-schema#4](https://github.com/Arm-Collaboration/ai-portal-model-schema/pull/4)).
21
+ `peak_memory_mb` here is the SRAM working-memory peak (`sram_peak_bytes / 1048576`).
benchmarks/deit-tiny-int8-ethos-u-executorch-alif-dk-e8-fp32.yaml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FP32 baseline measurement record — DeiT-Tiny INT8 reference accuracy.
2
+ # The FP32 baseline was NOT compiled/run on the Ethos-U85 (delivered as a PyTorch
3
+ # reference, performance: null), so this carries reference accuracy only — no on-device
4
+ # latency/memory. runtime/benchmark describe the PyTorch eval on the ImageNet workload.
5
+ version: 1.0.0
6
+ task: vision-classification
7
+ created_at: '2026-07-14T21:00:10Z'
8
+ context:
9
+ model:
10
+ id: Arm/deit-tiny-int8-ethos-u-executorch
11
+ filename: not-applicable
12
+ base_model_id: facebook/deit-tiny-patch16-224
13
+ profile: Baseline
14
+ weight_dtype: fp32
15
+ model_size_mb: 21.887
16
+ format: pytorch_state_dict
17
+ target:
18
+ name: Alif DK-E8
19
+ hardware_class: Embedded NPU
20
+ cpu_architecture: armv8.1-m
21
+ cpu_model: Cortex-M55
22
+ cpu_core_count: 1
23
+ cpu_clock_ghz: 0.4
24
+ os: bare-metal
25
+ runtime:
26
+ name: pytorch
27
+ execution_backend: cpu
28
+ dataset:
29
+ name: ImageNet-1k
30
+ sample_count: 50000
31
+ reference_url: https://www.image-net.org/
32
+ slice: val
33
+ benchmark:
34
+ batch_size: 1
35
+ input_resolution: 224x224
36
+ num_runs: 1
37
+ accuracy:
38
+ top_1_accuracy_pct: 72.132
39
+ top_5_accuracy_pct: 91.134
benchmarks/deit-tiny-int8-ethos-u-executorch-alif-dk-e8-int8.yaml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Optimized measurement record — DeiT-Tiny INT8 on Alif DK-E8 (Ethos-U85 NPU, ExecuTorch).
2
+ # Onboarded as a regular vision-classification model; NPU-specific metrics are omitted
3
+ # here until the schema supports them (docs/marvik/upstream.md + ai-portal-model-schema#4):
4
+ # target npu_model/npu_num_macs and performance sram_peak_bytes, flash_footprint_mib,
5
+ # mac_utilization_pct, total_cycles, active_cycles, effective_cycles_ratio_pct — all
6
+ # retained in metadata.yaml. peak_memory_mb is the SRAM working-memory peak
7
+ # (sram_peak_bytes / 1048576).
8
+ version: 1.0.0
9
+ task: vision-classification
10
+ created_at: '2026-07-14T21:00:10Z'
11
+ context:
12
+ model:
13
+ id: Arm/deit-tiny-int8-ethos-u-executorch
14
+ filename: deit-tiny-int8-ethos-u-executorch.pte
15
+ base_model_id: facebook/deit-tiny-patch16-224
16
+ profile: Arm-Optimized
17
+ weight_dtype: int8
18
+ quantization:
19
+ method: PTQ-static
20
+ weight_bits: 8
21
+ activation_bits: 8
22
+ symmetric: true
23
+ mode: static
24
+ weight_granularity: per-tensor
25
+ calibration:
26
+ dataset_name: ImageNet-1k
27
+ sample_count: 2000
28
+ selection: random
29
+ model_size_mb: 4.707
30
+ format: pte
31
+ target:
32
+ name: Alif DK-E8
33
+ hardware_class: Embedded NPU
34
+ cpu_architecture: armv8.1-m
35
+ cpu_model: Cortex-M55
36
+ cpu_core_count: 1
37
+ cpu_clock_ghz: 0.4
38
+ os: bare-metal
39
+ runtime:
40
+ name: executorch
41
+ execution_backend: ethos-u
42
+ config:
43
+ optimisations:
44
+ - CMSIS-NN
45
+ - Ethos-U-Driver
46
+ version: 1.1.0
47
+ dataset:
48
+ name: ImageNet-1k
49
+ sample_count: 50000
50
+ reference_url: https://www.image-net.org/
51
+ slice: val
52
+ benchmark:
53
+ batch_size: 1
54
+ input_resolution: 224x224
55
+ num_runs: 100
56
+ warmup_runs: 10
57
+ performance:
58
+ end_to_end_latency_ms:
59
+ p50: 81.5947
60
+ p90: 81.5948
61
+ peak_memory_mb: 2.558
62
+ frames_per_second: 12.2557
63
+ delegation_pct: 99.91
64
+ accuracy:
65
+ top_1_accuracy_pct: 67.95
66
+ top_5_accuracy_pct: 88.47
config.yaml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ input:
2
+ shape: [1, 3, 224, 224]
3
+ dtype: float32
4
+ range: [0.0, 1.0]
5
+ preprocessing:
6
+ - to_tensor
7
+ - normalize: { mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225] }
8
+
9
+ output:
10
+ shape: [1, 1000]
11
+ format: "Raw class logits (unnormalized), ImageNet-1k class ordering"
12
+ postprocessing:
13
+ softmax: true
14
+ top_k: 5
example.py ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Run DeiT-Tiny Ethos-U85 ExecuTorch inference on Corstone-320 FVP.
2
+
3
+ This example preprocesses one image, stages the compiled ``.pte`` and raw
4
+ FP32 input tensor into a semihosting workdir, invokes ``FVP_Corstone_SSE-320``
5
+ with the bare-metal ``arm_executor_runner`` ELF, then reads the FP32 logits
6
+ written back by the runner and prints the top-5 ImageNet predictions.
7
+
8
+ Prerequisites:
9
+ * ``FVP_Corstone_SSE-320`` is on PATH.
10
+ * ``arm_executor_runner`` was built with ``--pte=semihosting``.
11
+
12
+ From this repository, the default runner path produced by ``make
13
+ install-corstone`` is:
14
+
15
+ third_party/executorch-arm-runner/cmake-out/arm_executor_runner
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ import argparse
21
+ import json
22
+ import os
23
+ import shutil
24
+ import subprocess
25
+ import uuid
26
+ from pathlib import Path
27
+
28
+ import numpy as np
29
+ from PIL import Image
30
+
31
+
32
+ SCRIPT_DIR = Path(__file__).resolve().parent
33
+ REPO_ROOT = SCRIPT_DIR.parents[2]
34
+
35
+ MODEL_PATH = SCRIPT_DIR / "deit-tiny-int8-ethos-u-executorch.pte"
36
+ IMAGE_PATH = SCRIPT_DIR / "sample_input.jpg"
37
+ LABELS_PATH = SCRIPT_DIR / "imagenet_classes.json"
38
+ DEFAULT_WORKDIR = SCRIPT_DIR / "fvp_workdir"
39
+ DEFAULT_RUNNER_ELF = (
40
+ REPO_ROOT / "third_party/executorch-arm-runner/cmake-out/arm_executor_runner"
41
+ )
42
+ DEFAULT_FVP_BIN = REPO_ROOT / "third_party/corstone-320-fvp/bin/FVP_Corstone_SSE-320"
43
+
44
+ INPUT_SIZE = (224, 224) # (H, W)
45
+ RESIZE_SIZE = 256
46
+ IMAGENET_MEAN = np.array([0.485, 0.456, 0.406], dtype=np.float32)
47
+ IMAGENET_STD = np.array([0.229, 0.224, 0.225], dtype=np.float32)
48
+ TOP_K = 5
49
+ NUM_MACS = 256
50
+ SEMIHOSTING_CMD_LINE_MAX = 256
51
+
52
+
53
+ def parse_args() -> argparse.Namespace:
54
+ parser = argparse.ArgumentParser(
55
+ description="Run a DeiT-Tiny Ethos-U85 .pte on Corstone-320 FVP."
56
+ )
57
+ parser.add_argument("--model", type=Path, default=MODEL_PATH)
58
+ parser.add_argument("--image", type=Path, default=IMAGE_PATH)
59
+ parser.add_argument("--labels", type=Path, default=LABELS_PATH)
60
+ parser.add_argument("--workdir", type=Path, default=DEFAULT_WORKDIR)
61
+ parser.add_argument(
62
+ "--fvp-bin",
63
+ default=os.environ.get("FVP_Corstone_SSE_320", str(DEFAULT_FVP_BIN)),
64
+ help="Path to FVP_Corstone_SSE-320, or a binary name available on PATH.",
65
+ )
66
+ parser.add_argument(
67
+ "--runner-elf",
68
+ type=Path,
69
+ default=Path(os.environ.get("ARM_EXECUTOR_RUNNER", DEFAULT_RUNNER_ELF)),
70
+ help="Path to arm_executor_runner built with --pte=semihosting.",
71
+ )
72
+ parser.add_argument("--timelimit", type=int, default=1800)
73
+ return parser.parse_args()
74
+
75
+
76
+ def preprocess(image_path: Path) -> np.ndarray:
77
+ """Resize -> center crop -> normalize -> NCHW FP32."""
78
+ image = Image.open(image_path).convert("RGB")
79
+
80
+ w, h = image.size
81
+ if w < h:
82
+ new_w, new_h = RESIZE_SIZE, round(h * RESIZE_SIZE / w)
83
+ else:
84
+ new_h, new_w = RESIZE_SIZE, round(w * RESIZE_SIZE / h)
85
+ image = image.resize((new_w, new_h), Image.BICUBIC)
86
+
87
+ left = (new_w - INPUT_SIZE[1]) // 2
88
+ top = (new_h - INPUT_SIZE[0]) // 2
89
+ image = image.crop((left, top, left + INPUT_SIZE[1], top + INPUT_SIZE[0]))
90
+
91
+ array = np.asarray(image, dtype=np.float32) / 255.0
92
+ array = array.transpose(2, 0, 1)
93
+ array = (array - IMAGENET_MEAN.reshape(3, 1, 1)) / IMAGENET_STD.reshape(3, 1, 1)
94
+ return np.expand_dims(array.astype(np.float32), axis=0)
95
+
96
+
97
+ def load_labels(labels_path: Path) -> list[str] | None:
98
+ if not labels_path.exists():
99
+ return None
100
+ with labels_path.open() as f:
101
+ labels = json.load(f)
102
+ if isinstance(labels, dict):
103
+ return [labels[str(i)] for i in range(len(labels))]
104
+ return labels
105
+
106
+
107
+ def build_fvp_cmd(
108
+ *,
109
+ fvp_bin: str,
110
+ runner_elf: Path,
111
+ workdir: Path,
112
+ cmd_line: str,
113
+ timelimit: int,
114
+ ) -> list[str]:
115
+ return [
116
+ fvp_bin,
117
+ "-C",
118
+ f"mps4_board.subsystem.ethosu.num_macs={NUM_MACS}",
119
+ "-C",
120
+ "mps4_board.visualisation.disable-visualisation=1",
121
+ "-C",
122
+ "vis_hdlcd.disable_visualisation=1",
123
+ "-C",
124
+ "mps4_board.telnetterminal0.start_telnet=0",
125
+ "-C",
126
+ "mps4_board.uart0.out_file=-",
127
+ "-C",
128
+ "mps4_board.uart0.shutdown_on_eot=1",
129
+ "-C",
130
+ "mps4_board.subsystem.cpu0.semihosting-enable=1",
131
+ "-C",
132
+ "mps4_board.subsystem.ethosu.extra_args='--fast'",
133
+ "-C",
134
+ "mps4_board.subsystem.cpu0.semihosting-stack_base=0",
135
+ "-C",
136
+ "mps4_board.subsystem.cpu0.semihosting-heap_limit=0",
137
+ "-C",
138
+ f"mps4_board.subsystem.cpu0.semihosting-cwd={workdir}",
139
+ "-C",
140
+ f"mps4_board.subsystem.cpu0.semihosting-cmd_line='{cmd_line}'",
141
+ "-a",
142
+ str(runner_elf),
143
+ "--timelimit",
144
+ str(timelimit),
145
+ ]
146
+
147
+
148
+ def run_fvp(
149
+ *,
150
+ model_path: Path,
151
+ input_tensor: np.ndarray,
152
+ workdir: Path,
153
+ fvp_bin: str,
154
+ runner_elf: Path,
155
+ timelimit: int,
156
+ ) -> np.ndarray:
157
+ workdir.mkdir(parents=True, exist_ok=True)
158
+
159
+ run_id = uuid.uuid4().hex[:8]
160
+ staged_model = workdir / model_path.name
161
+ input_path = workdir / f"input_{run_id}.bin"
162
+ output_base = f"out_{run_id}"
163
+ output_path = workdir / f"{output_base}-0.bin"
164
+
165
+ if not staged_model.exists() or staged_model.stat().st_size != model_path.stat().st_size:
166
+ shutil.copyfile(model_path, staged_model)
167
+ input_path.write_bytes(np.ascontiguousarray(input_tensor, dtype=np.float32).tobytes())
168
+
169
+ cmd_line = f"arm_executor_runner -m {staged_model.name} -i {input_path.name} -o {output_base}"
170
+ if len(cmd_line) > SEMIHOSTING_CMD_LINE_MAX:
171
+ raise ValueError(
172
+ f"semihosting cmd_line too long ({len(cmd_line)} > {SEMIHOSTING_CMD_LINE_MAX})"
173
+ )
174
+
175
+ fvp_cmd = build_fvp_cmd(
176
+ fvp_bin=fvp_bin,
177
+ runner_elf=runner_elf,
178
+ workdir=workdir.resolve(),
179
+ cmd_line=cmd_line,
180
+ timelimit=timelimit,
181
+ )
182
+ result = subprocess.run(fvp_cmd, capture_output=True, text=True, check=False)
183
+ if result.returncode != 0:
184
+ raise RuntimeError(
185
+ f"FVP exited with code {result.returncode}\n"
186
+ f"stdout tail:\n{result.stdout[-2048:]}\n"
187
+ f"stderr tail:\n{result.stderr[-2048:]}"
188
+ )
189
+ if not output_path.exists():
190
+ raise RuntimeError(
191
+ f"Runner finished but {output_path} was not produced.\n"
192
+ f"stdout tail:\n{result.stdout[-2048:]}\n"
193
+ f"stderr tail:\n{result.stderr[-2048:]}"
194
+ )
195
+
196
+ logits = np.fromfile(output_path, dtype=np.float32)
197
+ if logits.size != 1000:
198
+ raise ValueError(f"Expected 1000 output logits, got {logits.size}")
199
+ return logits.reshape(1, 1000)
200
+
201
+
202
+ def postprocess(raw_output: np.ndarray, labels: list[str] | None) -> list[dict]:
203
+ logits = raw_output.astype(np.float64)
204
+ logits = logits - logits.max(axis=-1, keepdims=True)
205
+ probabilities = np.exp(logits)
206
+ probabilities = probabilities / probabilities.sum(axis=-1, keepdims=True)
207
+ indices = np.argsort(probabilities[0])[::-1][:TOP_K]
208
+
209
+ results = []
210
+ for index in indices:
211
+ label = labels[int(index)] if labels is not None else None
212
+ results.append(
213
+ {
214
+ "class_index": int(index),
215
+ "label": label,
216
+ "probability": float(probabilities[0, index]),
217
+ }
218
+ )
219
+ return results
220
+
221
+
222
+ def save_results(results: list[dict]) -> None:
223
+ output_path = SCRIPT_DIR / "predictions.json"
224
+ with output_path.open("w") as f:
225
+ json.dump(results, f, indent=2)
226
+ print(f"Saved predictions to {output_path}")
227
+
228
+
229
+ def main() -> None:
230
+ args = parse_args()
231
+ model_path = args.model.resolve()
232
+ image_path = args.image.resolve()
233
+ labels_path = args.labels.resolve()
234
+ runner_elf = args.runner_elf.resolve()
235
+
236
+ if not model_path.exists():
237
+ raise FileNotFoundError(f"Model not found: {model_path}")
238
+ if not image_path.exists():
239
+ raise FileNotFoundError(f"Image not found: {image_path}")
240
+ if not runner_elf.exists():
241
+ raise FileNotFoundError(
242
+ f"arm_executor_runner not found: {runner_elf}\n"
243
+ "Build it with make install-corstone, or pass --runner-elf."
244
+ )
245
+
246
+ labels = load_labels(labels_path)
247
+ input_tensor = preprocess(image_path)
248
+ raw_output = run_fvp(
249
+ model_path=model_path,
250
+ input_tensor=input_tensor,
251
+ workdir=args.workdir,
252
+ fvp_bin=args.fvp_bin,
253
+ runner_elf=runner_elf,
254
+ timelimit=args.timelimit,
255
+ )
256
+ results = postprocess(raw_output, labels)
257
+
258
+ print("Top-5 predictions:")
259
+ for rank, item in enumerate(results, start=1):
260
+ name = item["label"] if item["label"] is not None else f"class_{item['class_index']}"
261
+ print(f" {rank}. {name} (index {item['class_index']}): {item['probability']:.4f}")
262
+
263
+ save_results(results)
264
+
265
+
266
+ if __name__ == "__main__":
267
+ main()
imagenet_classes.json ADDED
@@ -0,0 +1,1002 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ "tench",
3
+ "goldfish",
4
+ "great white shark",
5
+ "tiger shark",
6
+ "hammerhead",
7
+ "electric ray",
8
+ "stingray",
9
+ "cock",
10
+ "hen",
11
+ "ostrich",
12
+ "brambling",
13
+ "goldfinch",
14
+ "house finch",
15
+ "junco",
16
+ "indigo bunting",
17
+ "robin",
18
+ "bulbul",
19
+ "jay",
20
+ "magpie",
21
+ "chickadee",
22
+ "water ouzel",
23
+ "kite",
24
+ "bald eagle",
25
+ "vulture",
26
+ "great grey owl",
27
+ "European fire salamander",
28
+ "common newt",
29
+ "eft",
30
+ "spotted salamander",
31
+ "axolotl",
32
+ "bullfrog",
33
+ "tree frog",
34
+ "tailed frog",
35
+ "loggerhead",
36
+ "leatherback turtle",
37
+ "mud turtle",
38
+ "terrapin",
39
+ "box turtle",
40
+ "banded gecko",
41
+ "common iguana",
42
+ "American chameleon",
43
+ "whiptail",
44
+ "agama",
45
+ "frilled lizard",
46
+ "alligator lizard",
47
+ "Gila monster",
48
+ "green lizard",
49
+ "African chameleon",
50
+ "Komodo dragon",
51
+ "African crocodile",
52
+ "American alligator",
53
+ "triceratops",
54
+ "thunder snake",
55
+ "ringneck snake",
56
+ "hognose snake",
57
+ "green snake",
58
+ "king snake",
59
+ "garter snake",
60
+ "water snake",
61
+ "vine snake",
62
+ "night snake",
63
+ "boa constrictor",
64
+ "rock python",
65
+ "Indian cobra",
66
+ "green mamba",
67
+ "sea snake",
68
+ "horned viper",
69
+ "diamondback",
70
+ "sidewinder",
71
+ "trilobite",
72
+ "harvestman",
73
+ "scorpion",
74
+ "black and gold garden spider",
75
+ "barn spider",
76
+ "garden spider",
77
+ "black widow",
78
+ "tarantula",
79
+ "wolf spider",
80
+ "tick",
81
+ "centipede",
82
+ "black grouse",
83
+ "ptarmigan",
84
+ "ruffed grouse",
85
+ "prairie chicken",
86
+ "peacock",
87
+ "quail",
88
+ "partridge",
89
+ "African grey",
90
+ "macaw",
91
+ "sulphur-crested cockatoo",
92
+ "lorikeet",
93
+ "coucal",
94
+ "bee eater",
95
+ "hornbill",
96
+ "hummingbird",
97
+ "jacamar",
98
+ "toucan",
99
+ "drake",
100
+ "red-breasted merganser",
101
+ "goose",
102
+ "black swan",
103
+ "tusker",
104
+ "echidna",
105
+ "platypus",
106
+ "wallaby",
107
+ "koala",
108
+ "wombat",
109
+ "jellyfish",
110
+ "sea anemone",
111
+ "brain coral",
112
+ "flatworm",
113
+ "nematode",
114
+ "conch",
115
+ "snail",
116
+ "slug",
117
+ "sea slug",
118
+ "chiton",
119
+ "chambered nautilus",
120
+ "Dungeness crab",
121
+ "rock crab",
122
+ "fiddler crab",
123
+ "king crab",
124
+ "American lobster",
125
+ "spiny lobster",
126
+ "crayfish",
127
+ "hermit crab",
128
+ "isopod",
129
+ "white stork",
130
+ "black stork",
131
+ "spoonbill",
132
+ "flamingo",
133
+ "little blue heron",
134
+ "American egret",
135
+ "bittern",
136
+ "crane bird",
137
+ "limpkin",
138
+ "European gallinule",
139
+ "American coot",
140
+ "bustard",
141
+ "ruddy turnstone",
142
+ "red-backed sandpiper",
143
+ "redshank",
144
+ "dowitcher",
145
+ "oystercatcher",
146
+ "pelican",
147
+ "king penguin",
148
+ "albatross",
149
+ "grey whale",
150
+ "killer whale",
151
+ "dugong",
152
+ "sea lion",
153
+ "Chihuahua",
154
+ "Japanese spaniel",
155
+ "Maltese dog",
156
+ "Pekinese",
157
+ "Shih-Tzu",
158
+ "Blenheim spaniel",
159
+ "papillon",
160
+ "toy terrier",
161
+ "Rhodesian ridgeback",
162
+ "Afghan hound",
163
+ "basset",
164
+ "beagle",
165
+ "bloodhound",
166
+ "bluetick",
167
+ "black-and-tan coonhound",
168
+ "Walker hound",
169
+ "English foxhound",
170
+ "redbone",
171
+ "borzoi",
172
+ "Irish wolfhound",
173
+ "Italian greyhound",
174
+ "whippet",
175
+ "Ibizan hound",
176
+ "Norwegian elkhound",
177
+ "otterhound",
178
+ "Saluki",
179
+ "Scottish deerhound",
180
+ "Weimaraner",
181
+ "Staffordshire bullterrier",
182
+ "American Staffordshire terrier",
183
+ "Bedlington terrier",
184
+ "Border terrier",
185
+ "Kerry blue terrier",
186
+ "Irish terrier",
187
+ "Norfolk terrier",
188
+ "Norwich terrier",
189
+ "Yorkshire terrier",
190
+ "wire-haired fox terrier",
191
+ "Lakeland terrier",
192
+ "Sealyham terrier",
193
+ "Airedale",
194
+ "cairn",
195
+ "Australian terrier",
196
+ "Dandie Dinmont",
197
+ "Boston bull",
198
+ "miniature schnauzer",
199
+ "giant schnauzer",
200
+ "standard schnauzer",
201
+ "Scotch terrier",
202
+ "Tibetan terrier",
203
+ "silky terrier",
204
+ "soft-coated wheaten terrier",
205
+ "West Highland white terrier",
206
+ "Lhasa",
207
+ "flat-coated retriever",
208
+ "curly-coated retriever",
209
+ "golden retriever",
210
+ "Labrador retriever",
211
+ "Chesapeake Bay retriever",
212
+ "German short-haired pointer",
213
+ "vizsla",
214
+ "English setter",
215
+ "Irish setter",
216
+ "Gordon setter",
217
+ "Brittany spaniel",
218
+ "clumber",
219
+ "English springer",
220
+ "Welsh springer spaniel",
221
+ "cocker spaniel",
222
+ "Sussex spaniel",
223
+ "Irish water spaniel",
224
+ "kuvasz",
225
+ "schipperke",
226
+ "groenendael",
227
+ "malinois",
228
+ "briard",
229
+ "kelpie",
230
+ "komondor",
231
+ "Old English sheepdog",
232
+ "Shetland sheepdog",
233
+ "collie",
234
+ "Border collie",
235
+ "Bouvier des Flandres",
236
+ "Rottweiler",
237
+ "German shepherd",
238
+ "Doberman",
239
+ "miniature pinscher",
240
+ "Greater Swiss Mountain dog",
241
+ "Bernese mountain dog",
242
+ "Appenzeller",
243
+ "EntleBucher",
244
+ "boxer",
245
+ "bull mastiff",
246
+ "Tibetan mastiff",
247
+ "French bulldog",
248
+ "Great Dane",
249
+ "Saint Bernard",
250
+ "Eskimo dog",
251
+ "malamute",
252
+ "Siberian husky",
253
+ "dalmatian",
254
+ "affenpinscher",
255
+ "basenji",
256
+ "pug",
257
+ "Leonberg",
258
+ "Newfoundland",
259
+ "Great Pyrenees",
260
+ "Samoyed",
261
+ "Pomeranian",
262
+ "chow",
263
+ "keeshond",
264
+ "Brabancon griffon",
265
+ "Pembroke",
266
+ "Cardigan",
267
+ "toy poodle",
268
+ "miniature poodle",
269
+ "standard poodle",
270
+ "Mexican hairless",
271
+ "timber wolf",
272
+ "white wolf",
273
+ "red wolf",
274
+ "coyote",
275
+ "dingo",
276
+ "dhole",
277
+ "African hunting dog",
278
+ "hyena",
279
+ "red fox",
280
+ "kit fox",
281
+ "Arctic fox",
282
+ "grey fox",
283
+ "tabby",
284
+ "tiger cat",
285
+ "Persian cat",
286
+ "Siamese cat",
287
+ "Egyptian cat",
288
+ "cougar",
289
+ "lynx",
290
+ "leopard",
291
+ "snow leopard",
292
+ "jaguar",
293
+ "lion",
294
+ "tiger",
295
+ "cheetah",
296
+ "brown bear",
297
+ "American black bear",
298
+ "ice bear",
299
+ "sloth bear",
300
+ "mongoose",
301
+ "meerkat",
302
+ "tiger beetle",
303
+ "ladybug",
304
+ "ground beetle",
305
+ "long-horned beetle",
306
+ "leaf beetle",
307
+ "dung beetle",
308
+ "rhinoceros beetle",
309
+ "weevil",
310
+ "fly",
311
+ "bee",
312
+ "ant",
313
+ "grasshopper",
314
+ "cricket",
315
+ "walking stick",
316
+ "cockroach",
317
+ "mantis",
318
+ "cicada",
319
+ "leafhopper",
320
+ "lacewing",
321
+ "dragonfly",
322
+ "damselfly",
323
+ "admiral",
324
+ "ringlet",
325
+ "monarch",
326
+ "cabbage butterfly",
327
+ "sulphur butterfly",
328
+ "lycaenid",
329
+ "starfish",
330
+ "sea urchin",
331
+ "sea cucumber",
332
+ "wood rabbit",
333
+ "hare",
334
+ "Angora",
335
+ "hamster",
336
+ "porcupine",
337
+ "fox squirrel",
338
+ "marmot",
339
+ "beaver",
340
+ "guinea pig",
341
+ "sorrel",
342
+ "zebra",
343
+ "hog",
344
+ "wild boar",
345
+ "warthog",
346
+ "hippopotamus",
347
+ "ox",
348
+ "water buffalo",
349
+ "bison",
350
+ "ram",
351
+ "bighorn",
352
+ "ibex",
353
+ "hartebeest",
354
+ "impala",
355
+ "gazelle",
356
+ "Arabian camel",
357
+ "llama",
358
+ "weasel",
359
+ "mink",
360
+ "polecat",
361
+ "black-footed ferret",
362
+ "otter",
363
+ "skunk",
364
+ "badger",
365
+ "armadillo",
366
+ "three-toed sloth",
367
+ "orangutan",
368
+ "gorilla",
369
+ "chimpanzee",
370
+ "gibbon",
371
+ "siamang",
372
+ "guenon",
373
+ "patas",
374
+ "baboon",
375
+ "macaque",
376
+ "langur",
377
+ "colobus",
378
+ "proboscis monkey",
379
+ "marmoset",
380
+ "capuchin",
381
+ "howler monkey",
382
+ "titi",
383
+ "spider monkey",
384
+ "squirrel monkey",
385
+ "Madagascar cat",
386
+ "indri",
387
+ "Indian elephant",
388
+ "African elephant",
389
+ "lesser panda",
390
+ "giant panda",
391
+ "barracouta",
392
+ "eel",
393
+ "coho",
394
+ "rock beauty",
395
+ "anemone fish",
396
+ "sturgeon",
397
+ "gar",
398
+ "lionfish",
399
+ "puffer",
400
+ "abacus",
401
+ "abaya",
402
+ "academic gown",
403
+ "accordion",
404
+ "acoustic guitar",
405
+ "aircraft carrier",
406
+ "airliner",
407
+ "airship",
408
+ "altar",
409
+ "ambulance",
410
+ "amphibian",
411
+ "analog clock",
412
+ "apiary",
413
+ "apron",
414
+ "ashcan",
415
+ "assault rifle",
416
+ "backpack",
417
+ "bakery",
418
+ "balance beam",
419
+ "balloon",
420
+ "ballpoint",
421
+ "Band Aid",
422
+ "banjo",
423
+ "bannister",
424
+ "barbell",
425
+ "barber chair",
426
+ "barbershop",
427
+ "barn",
428
+ "barometer",
429
+ "barrel",
430
+ "barrow",
431
+ "baseball",
432
+ "basketball",
433
+ "bassinet",
434
+ "bassoon",
435
+ "bathing cap",
436
+ "bath towel",
437
+ "bathtub",
438
+ "beach wagon",
439
+ "beacon",
440
+ "beaker",
441
+ "bearskin",
442
+ "beer bottle",
443
+ "beer glass",
444
+ "bell cote",
445
+ "bib",
446
+ "bicycle-built-for-two",
447
+ "bikini",
448
+ "binder",
449
+ "binoculars",
450
+ "birdhouse",
451
+ "boathouse",
452
+ "bobsled",
453
+ "bolo tie",
454
+ "bonnet",
455
+ "bookcase",
456
+ "bookshop",
457
+ "bottlecap",
458
+ "bow",
459
+ "bow tie",
460
+ "brass",
461
+ "brassiere",
462
+ "breakwater",
463
+ "breastplate",
464
+ "broom",
465
+ "bucket",
466
+ "buckle",
467
+ "bulletproof vest",
468
+ "bullet train",
469
+ "butcher shop",
470
+ "cab",
471
+ "caldron",
472
+ "candle",
473
+ "cannon",
474
+ "canoe",
475
+ "can opener",
476
+ "cardigan",
477
+ "car mirror",
478
+ "carousel",
479
+ "carpenter's kit",
480
+ "carton",
481
+ "car wheel",
482
+ "cash machine",
483
+ "cassette",
484
+ "cassette player",
485
+ "castle",
486
+ "catamaran",
487
+ "CD player",
488
+ "cello",
489
+ "cellular telephone",
490
+ "chain",
491
+ "chainlink fence",
492
+ "chain mail",
493
+ "chain saw",
494
+ "chest",
495
+ "chiffonier",
496
+ "chime",
497
+ "china cabinet",
498
+ "Christmas stocking",
499
+ "church",
500
+ "cinema",
501
+ "cleaver",
502
+ "cliff dwelling",
503
+ "cloak",
504
+ "clog",
505
+ "cocktail shaker",
506
+ "coffee mug",
507
+ "coffeepot",
508
+ "coil",
509
+ "combination lock",
510
+ "computer keyboard",
511
+ "confectionery",
512
+ "container ship",
513
+ "convertible",
514
+ "corkscrew",
515
+ "cornet",
516
+ "cowboy boot",
517
+ "cowboy hat",
518
+ "cradle",
519
+ "crane",
520
+ "crash helmet",
521
+ "crate",
522
+ "crib",
523
+ "Crock Pot",
524
+ "croquet ball",
525
+ "crutch",
526
+ "cuirass",
527
+ "dam",
528
+ "desk",
529
+ "desktop computer",
530
+ "dial telephone",
531
+ "diaper",
532
+ "digital clock",
533
+ "digital watch",
534
+ "dining table",
535
+ "dishrag",
536
+ "dishwasher",
537
+ "disk brake",
538
+ "dock",
539
+ "dogsled",
540
+ "dome",
541
+ "doormat",
542
+ "drilling platform",
543
+ "drum",
544
+ "drumstick",
545
+ "dumbbell",
546
+ "Dutch oven",
547
+ "electric fan",
548
+ "electric guitar",
549
+ "electric locomotive",
550
+ "entertainment center",
551
+ "envelope",
552
+ "espresso maker",
553
+ "face powder",
554
+ "feather boa",
555
+ "file",
556
+ "fireboat",
557
+ "fire engine",
558
+ "fire screen",
559
+ "flagpole",
560
+ "flute",
561
+ "folding chair",
562
+ "football helmet",
563
+ "forklift",
564
+ "fountain",
565
+ "fountain pen",
566
+ "four-poster",
567
+ "freight car",
568
+ "French horn",
569
+ "frying pan",
570
+ "fur coat",
571
+ "garbage truck",
572
+ "gasmask",
573
+ "gas pump",
574
+ "goblet",
575
+ "go-kart",
576
+ "golf ball",
577
+ "golfcart",
578
+ "gondola",
579
+ "gong",
580
+ "gown",
581
+ "grand piano",
582
+ "greenhouse",
583
+ "grille",
584
+ "grocery store",
585
+ "guillotine",
586
+ "hair slide",
587
+ "hair spray",
588
+ "half track",
589
+ "hammer",
590
+ "hamper",
591
+ "hand blower",
592
+ "hand-held computer",
593
+ "handkerchief",
594
+ "hard disc",
595
+ "harmonica",
596
+ "harp",
597
+ "harvester",
598
+ "hatchet",
599
+ "holster",
600
+ "home theater",
601
+ "honeycomb",
602
+ "hook",
603
+ "hoopskirt",
604
+ "horizontal bar",
605
+ "horse cart",
606
+ "hourglass",
607
+ "iPod",
608
+ "iron",
609
+ "jack-o'-lantern",
610
+ "jean",
611
+ "jeep",
612
+ "jersey",
613
+ "jigsaw puzzle",
614
+ "jinrikisha",
615
+ "joystick",
616
+ "kimono",
617
+ "knee pad",
618
+ "knot",
619
+ "lab coat",
620
+ "ladle",
621
+ "lampshade",
622
+ "laptop",
623
+ "lawn mower",
624
+ "lens cap",
625
+ "letter opener",
626
+ "library",
627
+ "lifeboat",
628
+ "lighter",
629
+ "limousine",
630
+ "liner",
631
+ "lipstick",
632
+ "Loafer",
633
+ "lotion",
634
+ "loudspeaker",
635
+ "loupe",
636
+ "lumbermill",
637
+ "magnetic compass",
638
+ "mailbag",
639
+ "mailbox",
640
+ "maillot",
641
+ "maillot tank suit",
642
+ "manhole cover",
643
+ "maraca",
644
+ "marimba",
645
+ "mask",
646
+ "matchstick",
647
+ "maypole",
648
+ "maze",
649
+ "measuring cup",
650
+ "medicine chest",
651
+ "megalith",
652
+ "microphone",
653
+ "microwave",
654
+ "military uniform",
655
+ "milk can",
656
+ "minibus",
657
+ "miniskirt",
658
+ "minivan",
659
+ "missile",
660
+ "mitten",
661
+ "mixing bowl",
662
+ "mobile home",
663
+ "Model T",
664
+ "modem",
665
+ "monastery",
666
+ "monitor",
667
+ "moped",
668
+ "mortar",
669
+ "mortarboard",
670
+ "mosque",
671
+ "mosquito net",
672
+ "motor scooter",
673
+ "mountain bike",
674
+ "mountain tent",
675
+ "mouse",
676
+ "mousetrap",
677
+ "moving van",
678
+ "muzzle",
679
+ "nail",
680
+ "neck brace",
681
+ "necklace",
682
+ "nipple",
683
+ "notebook",
684
+ "obelisk",
685
+ "oboe",
686
+ "ocarina",
687
+ "odometer",
688
+ "oil filter",
689
+ "organ",
690
+ "oscilloscope",
691
+ "overskirt",
692
+ "oxcart",
693
+ "oxygen mask",
694
+ "packet",
695
+ "paddle",
696
+ "paddlewheel",
697
+ "padlock",
698
+ "paintbrush",
699
+ "pajama",
700
+ "palace",
701
+ "panpipe",
702
+ "paper towel",
703
+ "parachute",
704
+ "parallel bars",
705
+ "park bench",
706
+ "parking meter",
707
+ "passenger car",
708
+ "patio",
709
+ "pay-phone",
710
+ "pedestal",
711
+ "pencil box",
712
+ "pencil sharpener",
713
+ "perfume",
714
+ "Petri dish",
715
+ "photocopier",
716
+ "pick",
717
+ "pickelhaube",
718
+ "picket fence",
719
+ "pickup",
720
+ "pier",
721
+ "piggy bank",
722
+ "pill bottle",
723
+ "pillow",
724
+ "ping-pong ball",
725
+ "pinwheel",
726
+ "pirate",
727
+ "pitcher",
728
+ "plane",
729
+ "planetarium",
730
+ "plastic bag",
731
+ "plate rack",
732
+ "plow",
733
+ "plunger",
734
+ "Polaroid camera",
735
+ "pole",
736
+ "police van",
737
+ "poncho",
738
+ "pool table",
739
+ "pop bottle",
740
+ "pot",
741
+ "potter's wheel",
742
+ "power drill",
743
+ "prayer rug",
744
+ "printer",
745
+ "prison",
746
+ "projectile",
747
+ "projector",
748
+ "puck",
749
+ "punching bag",
750
+ "purse",
751
+ "quill",
752
+ "quilt",
753
+ "racer",
754
+ "racket",
755
+ "radiator",
756
+ "radio",
757
+ "radio telescope",
758
+ "rain barrel",
759
+ "recreational vehicle",
760
+ "reel",
761
+ "reflex camera",
762
+ "refrigerator",
763
+ "remote control",
764
+ "restaurant",
765
+ "revolver",
766
+ "rifle",
767
+ "rocking chair",
768
+ "rotisserie",
769
+ "rubber eraser",
770
+ "rugby ball",
771
+ "rule",
772
+ "running shoe",
773
+ "safe",
774
+ "safety pin",
775
+ "saltshaker",
776
+ "sandal",
777
+ "sarong",
778
+ "sax",
779
+ "scabbard",
780
+ "scale",
781
+ "school bus",
782
+ "schooner",
783
+ "scoreboard",
784
+ "screen",
785
+ "screw",
786
+ "screwdriver",
787
+ "seat belt",
788
+ "sewing machine",
789
+ "shield",
790
+ "shoe shop",
791
+ "shoji",
792
+ "shopping basket",
793
+ "shopping cart",
794
+ "shovel",
795
+ "shower cap",
796
+ "shower curtain",
797
+ "ski",
798
+ "ski mask",
799
+ "sleeping bag",
800
+ "slide rule",
801
+ "sliding door",
802
+ "slot",
803
+ "snorkel",
804
+ "snowmobile",
805
+ "snowplow",
806
+ "soap dispenser",
807
+ "soccer ball",
808
+ "sock",
809
+ "solar dish",
810
+ "sombrero",
811
+ "soup bowl",
812
+ "space bar",
813
+ "space heater",
814
+ "space shuttle",
815
+ "spatula",
816
+ "speedboat",
817
+ "spider web",
818
+ "spindle",
819
+ "sports car",
820
+ "spotlight",
821
+ "stage",
822
+ "steam locomotive",
823
+ "steel arch bridge",
824
+ "steel drum",
825
+ "stethoscope",
826
+ "stole",
827
+ "stone wall",
828
+ "stopwatch",
829
+ "stove",
830
+ "strainer",
831
+ "streetcar",
832
+ "stretcher",
833
+ "studio couch",
834
+ "stupa",
835
+ "submarine",
836
+ "suit",
837
+ "sundial",
838
+ "sunglass",
839
+ "sunglasses",
840
+ "sunscreen",
841
+ "suspension bridge",
842
+ "swab",
843
+ "sweatshirt",
844
+ "swimming trunks",
845
+ "swing",
846
+ "switch",
847
+ "syringe",
848
+ "table lamp",
849
+ "tank",
850
+ "tape player",
851
+ "teapot",
852
+ "teddy",
853
+ "television",
854
+ "tennis ball",
855
+ "thatch",
856
+ "theater curtain",
857
+ "thimble",
858
+ "thresher",
859
+ "throne",
860
+ "tile roof",
861
+ "toaster",
862
+ "tobacco shop",
863
+ "toilet seat",
864
+ "torch",
865
+ "totem pole",
866
+ "tow truck",
867
+ "toyshop",
868
+ "tractor",
869
+ "trailer truck",
870
+ "tray",
871
+ "trench coat",
872
+ "tricycle",
873
+ "trimaran",
874
+ "tripod",
875
+ "triumphal arch",
876
+ "trolleybus",
877
+ "trombone",
878
+ "tub",
879
+ "turnstile",
880
+ "typewriter keyboard",
881
+ "umbrella",
882
+ "unicycle",
883
+ "upright",
884
+ "vacuum",
885
+ "vase",
886
+ "vault",
887
+ "velvet",
888
+ "vending machine",
889
+ "vestment",
890
+ "viaduct",
891
+ "violin",
892
+ "volleyball",
893
+ "waffle iron",
894
+ "wall clock",
895
+ "wallet",
896
+ "wardrobe",
897
+ "warplane",
898
+ "washbasin",
899
+ "washer",
900
+ "water bottle",
901
+ "water jug",
902
+ "water tower",
903
+ "whiskey jug",
904
+ "whistle",
905
+ "wig",
906
+ "window screen",
907
+ "window shade",
908
+ "Windsor tie",
909
+ "wine bottle",
910
+ "wing",
911
+ "wok",
912
+ "wooden spoon",
913
+ "wool",
914
+ "worm fence",
915
+ "wreck",
916
+ "yawl",
917
+ "yurt",
918
+ "web site",
919
+ "comic book",
920
+ "crossword puzzle",
921
+ "street sign",
922
+ "traffic light",
923
+ "book jacket",
924
+ "menu",
925
+ "plate",
926
+ "guacamole",
927
+ "consomme",
928
+ "hot pot",
929
+ "trifle",
930
+ "ice cream",
931
+ "ice lolly",
932
+ "French loaf",
933
+ "bagel",
934
+ "pretzel",
935
+ "cheeseburger",
936
+ "hotdog",
937
+ "mashed potato",
938
+ "head cabbage",
939
+ "broccoli",
940
+ "cauliflower",
941
+ "zucchini",
942
+ "spaghetti squash",
943
+ "acorn squash",
944
+ "butternut squash",
945
+ "cucumber",
946
+ "artichoke",
947
+ "bell pepper",
948
+ "cardoon",
949
+ "mushroom",
950
+ "Granny Smith",
951
+ "strawberry",
952
+ "orange",
953
+ "lemon",
954
+ "fig",
955
+ "pineapple",
956
+ "banana",
957
+ "jackfruit",
958
+ "custard apple",
959
+ "pomegranate",
960
+ "hay",
961
+ "carbonara",
962
+ "chocolate sauce",
963
+ "dough",
964
+ "meat loaf",
965
+ "pizza",
966
+ "potpie",
967
+ "burrito",
968
+ "red wine",
969
+ "espresso",
970
+ "cup",
971
+ "eggnog",
972
+ "alp",
973
+ "bubble",
974
+ "cliff",
975
+ "coral reef",
976
+ "geyser",
977
+ "lakeside",
978
+ "promontory",
979
+ "sandbar",
980
+ "seashore",
981
+ "valley",
982
+ "volcano",
983
+ "ballplayer",
984
+ "groom",
985
+ "scuba diver",
986
+ "rapeseed",
987
+ "daisy",
988
+ "yellow lady's slipper",
989
+ "corn",
990
+ "acorn",
991
+ "hip",
992
+ "buckeye",
993
+ "coral fungus",
994
+ "agaric",
995
+ "gyromitra",
996
+ "stinkhorn",
997
+ "earthstar",
998
+ "hen-of-the-woods",
999
+ "bolete",
1000
+ "ear",
1001
+ "toilet tissue"
1002
+ ]
metadata.yaml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: 1.0.0
2
+ task: vision-classification
3
+ created_at: '2026-07-14T21:00:10Z'
4
+ context:
5
+ model:
6
+ id: Arm/deit-tiny-int8-ethos-u-executorch
7
+ base_model_id: facebook/deit-tiny-patch16-224
8
+ profile: Arm-Optimized
9
+ weight_dtype: int8
10
+ quantization:
11
+ method: PTQ-static
12
+ weight_bits: 8
13
+ activation_bits: 8
14
+ symmetric: true
15
+ mode: static
16
+ weight_granularity: per-tensor
17
+ calibration:
18
+ dataset_name: ImageNet-1k
19
+ sample_count: 2000
20
+ selection: random
21
+ model_size_mb: 4.707
22
+ format: pte
23
+ filename: deit-tiny-int8-ethos-u-executorch.pte
24
+ target:
25
+ name: Alif DK-E8
26
+ hardware_class: Embedded NPU
27
+ cpu_architecture: armv8.1-m
28
+ cpu_model: Cortex-M55
29
+ cpu_core_count: 1
30
+ cpu_clock_ghz: 0.4
31
+ npu_model: Ethos-U85
32
+ npu_num_macs: 256
33
+ os: bare-metal
34
+ runtime:
35
+ name: executorch
36
+ execution_backend: ethos-u
37
+ config:
38
+ optimisations:
39
+ - CMSIS-NN
40
+ - Ethos-U-Driver
41
+ version: 1.1.0
42
+ dataset:
43
+ name: ImageNet-1k
44
+ sample_count: 50000
45
+ reference_url: https://www.image-net.org/
46
+ slice: val
47
+ benchmark:
48
+ batch_size: 1
49
+ input_resolution: 224x224
50
+ num_runs: 100
51
+ warmup_runs: 10
52
+ performance:
53
+ end_to_end_latency_ms:
54
+ p50: 81.5947
55
+ p90: 81.5948
56
+ sram_peak_bytes: 2682173
57
+ flash_footprint_mib: 4.7069
58
+ frames_per_second: 12.2557
59
+ delegation_pct: 99.91
60
+ mac_utilization_pct: 15.2133
61
+ total_cycles: 32637876
62
+ active_cycles: 32626806
63
+ effective_cycles_ratio_pct: 99.9661
64
+ accuracy:
65
+ top_1_accuracy_pct: 67.95
66
+ top_5_accuracy_pct: 88.47
predictions.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "class_index": 311,
4
+ "label": "grasshopper",
5
+ "probability": 0.3301173782135408
6
+ },
7
+ {
8
+ "class_index": 312,
9
+ "label": "cricket",
10
+ "probability": 0.21808608542863353
11
+ },
12
+ {
13
+ "class_index": 599,
14
+ "label": "honeycomb",
15
+ "probability": 0.011976920119533177
16
+ },
17
+ {
18
+ "class_index": 698,
19
+ "label": "palace",
20
+ "probability": 0.003887443093009725
21
+ },
22
+ {
23
+ "class_index": 913,
24
+ "label": "wreck",
25
+ "probability": 0.0034532177617875135
26
+ }
27
+ ]
sample_input.jpg ADDED

Git LFS Details

  • SHA256: 3de74228decd790ab200751623d823ae21fa78fcff3e98a5a3bbb661852a698a
  • Pointer size: 131 Bytes
  • Size of remote file: 211 kB