Repository navigation
Commit b897b19
authored
Fix the KeywordSpotting arena and reconcile it with the README (pytorch#21788)
Fix the KeywordSpotting arena and reconcile it with the README
The sketch shipped a 28 KB arena, which fails on hardware at
load_method:
ET| E [ET:memory_allocator.h:105] Memory allocation failed: 180B
requested
(adjusted for alignment), 4B available
FAIL: method 0x21
The README already documented that 28 KB fails, and its measured table
(46,068 bytes of RAM, 10/10 keywords) corresponds to a 40 KB arena. The
sketch
and the documentation were out of sync; the documentation was the
correct one.
Set the arena to 40 KB. Verified on an Arduino UNO Q: RAM comes out at
46,068
bytes (35%), exactly reproducing the README's figure, and mfcc_yes.h
scores
"yes" at 8.95 against -10.80 to -0.46 for the other eleven classes.
Not simply raising it further, which was my first instinct and was
wrong.
Zephyr reserves a 32 KB stack and a 32 KB heap out of the board's 128
KB, so a
64 KB arena pushes globals to 70,644 bytes and overlaps that
reservation.
It ran and printed the right answer when I tried it, which is exactly
the
problem: arduino-cli reports RAM against the full 131,072 bytes, knows
nothing
about Zephyr's reservations, and calls that build a comfortable 53%. The
arena
is bounded on both sides, so the README section now gives the band as a
table
rather than describing a floor.
Authored with assistance from Claude Code.1 parent d92a619 commit b897b19
2 files changed
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
501 | | - | |
502 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| |||
0 commit comments