Skip to content

Commit 39d3f7d

Browse files
psiddhclaude
andcommitted
Fix MV2 runtime pool sizes and skip Corstone-300 in CI
Corstone-320: redirect zephyr,sram to the 4 MiB ISRAM so the ~3 MiB of allocator pools (method + Ethos-U scratch) fit alongside code. Bump pool sizes to the 1.5 MiB defaults — verified locally that the build links at FLASH 11% / RAM 78% / MODEL_DDR 23%. Corstone-300: 2 MiB ISRAM cannot hold the ~2.9 MiB of runtime pools MV2 needs regardless of pool tuning. Document this in the board conf and skip the MV2 ethos-u55 matrix entry in trunk CI. The hello-executorch sample already validates the Corstone-300 + Ethos-U55 pipeline end-to-end. Co-authored-by: Claude <noreply@anthropic.com>
1 parent b6366da commit 39d3f7d

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

.github/workflows/trunk.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ jobs:
191191
continue
192192
fi
193193
194+
if [[ ${TARGET} == "ethos-u55" ]]; then
195+
echo "---- Skipping MV2 for ${TARGET} (Corstone-300 ISRAM too small for MV2 runtime pools) ----"
196+
continue
197+
fi
198+
194199
echo "---- MV2 ${TARGET} ----"
195200
rm -Rf build
196201

zephyr/samples/mv2-ethosu/boards/mps3_corstone300_fvp.conf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ CONFIG_ETHOS_U=y
1212
# DDR on the FVP so no SRAM copy is needed.
1313
CONFIG_ET_ARM_MODEL_PTE_DMA_ACCESSIBLE=y
1414

15-
# Corstone-300 has 2 MiB ISRAM. Reduce pool sizes to fit within budget
16-
# alongside stack, heap, and runtime buffers.
15+
# Corstone-300 has 2 MiB ISRAM. With the model in DDR the method pool
16+
# needs ~1.4 MiB (752 KiB planned buffer + 602 KiB input tensor).
17+
# The remaining ISRAM is not enough for the Ethos-U scratch (~1.5 MiB),
18+
# so MV2 inference will fail at runtime on this board; Corstone-320 is
19+
# the supported target for MV2. These sizes keep the link step green.
1720
CONFIG_EXECUTORCH_METHOD_ALLOCATOR_POOL_SIZE=786432
1821
CONFIG_EXECUTORCH_TEMP_ALLOCATOR_POOL_SIZE=786432

zephyr/samples/mv2-ethosu/boards/mps4_corstone320_fvp.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CONFIG_ETHOS_U=y
1212
# DDR on the FVP so no SRAM copy is needed.
1313
CONFIG_ET_ARM_MODEL_PTE_DMA_ACCESSIBLE=y
1414

15-
# Corstone-320 has 4 MiB SRAM. Reduce pool sizes from the 1.5 MiB defaults
16-
# to leave headroom for stack, heap, and runtime buffers.
17-
CONFIG_EXECUTORCH_METHOD_ALLOCATOR_POOL_SIZE=786432
18-
CONFIG_EXECUTORCH_TEMP_ALLOCATOR_POOL_SIZE=786432
15+
# With zephyr,sram redirected to the 4 MiB ISRAM (shared with code),
16+
# the default 1.5 MiB pools fit alongside ~460 KiB of .text and overhead.
17+
CONFIG_EXECUTORCH_METHOD_ALLOCATOR_POOL_SIZE=1572864
18+
CONFIG_EXECUTORCH_TEMP_ALLOCATOR_POOL_SIZE=1572864

zephyr/samples/mv2-ethosu/boards/mps4_corstone320_fvp.overlay

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8-
/* The model PTE blob is placed in DDR (0x7000_0000) via a linker snippet
9-
* to avoid overflowing SRAM with the full MobileNetV2 model.
8+
/* Override zephyr,sram to the 4 MiB ISRAM (0x3100_0000) so the allocator
9+
* pools (~3 MiB total) fit alongside code in the same region. The default
10+
* sram@12000000 is only 2 MiB which is too small for MV2.
11+
*
12+
* The model PTE blob is placed in DDR (0x7000_0000) via a linker snippet.
1013
* The Ethos-U can DMA from DDR on the Corstone-320 FVP.
1114
*/
1215
/ {
16+
chosen {
17+
zephyr,sram = &isram;
18+
};
19+
1320
model_ddr: memory@70000000 {
1421
compatible = "zephyr,memory-region", "mmio-sram";
1522
reg = <0x70000000 DT_SIZE_M(16)>;

0 commit comments

Comments
 (0)