Skip to content

Commit d756e7d

Browse files
authored
examples/arduino: release 0.2.0, and record both board cores (pytorch#21998)
ETModel.h is new public API that sketches will be written against, so this is a minor rather than a patch. The memory notes now carry measurements for both board cores instead of one. 0.55.2 shipped a 28 KB arena and that was correct; 0.90.0 fails it by 180 bytes, which is how a working example became a broken one without anything in the repository changing. Keeping both rows is the point. The 40 KB row under 0.55.2 is gone because neither of us measured it, and 64 KB has not been retried on 0.90.0, which the text now says rather than implies. Sizes are re-measured on 0.90.0 with the wrapper in place: keyword spotting now uses 45,044 bytes of RAM rather than 47,084.
1 parent 7a51fd7 commit d756e7d

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

‎examples/arduino/README.md‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,9 @@ against 786,432 bytes of flash and 262,144 bytes of RAM:
505505

506506
| Build | Flash | RAM | On hardware |
507507
|-------|-------|-----|-------------|
508-
| HelloExecuTorch | 472,952 (60%) | 3,052 (1%) | `Model loaded OK!`, 1 method |
509-
| AddModel | 507,876 (64%) | 12,268 (4%) | `[1,2,3] + 1 = [2.00, 3.00, 4.00]` |
510-
| KeywordSpotting (CMSIS-NN) | 563,672 (71%) | 47,084 (17%) | detects `yes`, logit 8.95 |
508+
| HelloExecuTorch | 473,368 (60%) | 3,060 (1%) | `Model loaded OK!`, 1 method |
509+
| AddModel | 509,456 (64%) | 12,276 (4%) | `[1,2,3] + 1 = [2.00, 3.00, 4.00]` |
510+
| KeywordSpotting (CMSIS-NN) | 564,664 (71%) | 45,044 (17%) | detects `yes`, logit 8.95 |
511511

512512
Core 0.55.2 reported a 131,072-byte RAM ceiling; 0.90.0 reports 262,144. Figures
513513
from before that change are not comparable.
@@ -521,15 +521,27 @@ comes out of what remains. KeywordSpotting's DS-CNN plans 16 KB of buffers but
521521
needs considerably more for the method's own structures, which leaves a usable
522522
band rather than a floor to clear.
523523

524-
Measured on core **0.55.2**, where Zephyr took a 32 KB stack and a 32 KB heap out
525-
of 128 KB:
524+
The numbers move with the board core, so both are recorded. On **0.90.0**,
525+
which is what Library Manager installs today:
526526

527527
| Arena | Result |
528528
|-------|--------|
529529
| 28 KB | `load_method` fails, `MemoryAllocationFailed` (0x21), 180 B short |
530530
| 40 KB | Works. What the sketch ships |
531+
| 48 KB | Works, with more margin. Globals reach 47 KB of the 256 KB the core reports |
532+
533+
On **0.55.2**, where Zephyr took a 32 KB stack and a 32 KB heap out of 128 KB:
534+
535+
| Arena | Result |
536+
|-------|--------|
537+
| 28 KB | Worked. This is what the example shipped with |
531538
| 64 KB | Globals reach 70,644, past Zephyr's reservation. It ran and printed the right answer, which is what makes it dangerous rather than safe |
532539

540+
That 28 KB row is the whole point of recording both. It was the shipped value
541+
and it was correct, until the core changed underneath it. 64 KB has not been
542+
retried on 0.90.0, so whether the same reservation cliff exists there is
543+
unknown.
544+
533545
The sketch ships 40 KB for that reason, and growing it is not automatically
534546
safer: `arduino-cli` reports RAM against the whole region and knows nothing about
535547
Zephyr's stack and heap, so the 64 KB build still reported a comfortable 53%

‎examples/arduino/library.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
name=ExecuTorch
8-
version=0.1.1
8+
version=0.2.0
99
author=Meta Platforms
1010
maintainer=ExecuTorch Team <executorch@meta.com>
1111
sentence=Run PyTorch models on Arduino microcontrollers with ExecuTorch.

0 commit comments

Comments
 (0)