Skip to content

Commit 58f3e5d

Browse files
Arm backend: smollm2 test scratch buffer / seq length increase (pytorch#20107)
- Increase the scratch buffer size to 1MB when running smollm2 test. This is due to hitting mem allocation failure on Ethos-U. - Export pte with sequence length set to 32. This is due to an issue where executor runner hangs - Renamed test_model_smollm2_135M to include ethos_u85 in name - Added smollm2 test to ci trunk cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani Signed-off-by: Christoffer J.L <christoffer.johanssonlundqvist@arm.com>
1 parent 1fb8c73 commit 58f3e5d

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/trunk.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ jobs:
258258
- test_arm_backend: test_pytest_models_ethos_u85
259259
- test_arm_backend: test_run_ethos_u85
260260
- test_arm_backend: test_smaller_stories_llama_tosa
261+
- test_arm_backend: test_model_smollm2_135M_ethos_u85
261262
- test_arm_backend: test_memory_allocation
262263
- test_arm_backend: test_ootb_tests_ethos_u
263264
- test_arm_backend: test_ootb_tests_tosa

backends/arm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Below is an overview of some of the testing options this script provides:
251251
| `test_arm_backend.sh test_pytest_ops_vkml` | Runs operator unit tests for VKML/VGF specific use-cases. |
252252
| `test_arm_backend.sh test_pytest_models_vkml` | Runs model unit tests for VKML/VGF specific use-cases. |
253253
| `test_arm_backend.sh test_run_vkml` | Runs end-to-end unit tests for VKML/VGF specific use-cases. |
254-
| `test_arm_backend.sh test_model_smollm2_135M` | Runs some models with Corstone FVP. |
254+
| `test_arm_backend.sh test_model_smollm2_135M_ethos_u85` | Runs smollm2_135M for Ethos-U85 specific use-cases. |
255255
| `test_arm_backend.sh test_ootb_tests_ethos_u` | Runs out-of-the-box tests for Ethos-U. |
256256
| `test_arm_backend.sh test_ootb_tests_tosa` | Runs out-of-the-box tests for TOSA. |
257257
| `test_arm_backend.sh test_ootb_tests_vgf` | Runs out-of-the-box tests for VKML/VGF. |

backends/arm/test/test_arm_backend.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ test_deit_e2e_ethos_u() {
303303
# ------------------------------------
304304
# -------- Miscellaneous tests -------
305305
# ------------------------------------
306-
test_model_smollm2_135M() {
306+
test_model_smollm2_135M_ethos_u85() {
307307
echo "${TEST_SUITE_NAME}: Test SmolLM2-135M on Ethos-U85"
308308

309309
backends/arm/scripts/build_executorch.sh
@@ -313,7 +313,7 @@ test_model_smollm2_135M() {
313313
base.model_class=smollm2 \
314314
base.params=examples/models/smollm2/135M_config.json \
315315
debug.verbose=True model.enable_dynamic_shape=False quantization.pt2e_quantize="ethosu_8a8w" \
316-
backend.ethosu.enabled=True backend.ethosu.target="ethos-u85-256" backend.ethosu.memory_mode=Dedicated_Sram_384KB
316+
backend.ethosu.enabled=True backend.ethosu.target="ethos-u85-256" backend.ethosu.memory_mode=Dedicated_Sram_384KB export.max_seq_length=32
317317

318318
# Build the arm_executor_runner application, pre-loading the pte in the DDR for faster linking
319319
local pte_addr="0x76000000"
@@ -326,8 +326,8 @@ test_model_smollm2_135M() {
326326
--memory_mode=Dedicated_Sram_384KB \
327327
--ethosu_tools_dir="${scratch_dir}" \
328328
--toolchain=arm-none-eabi-gcc \
329-
--extra_build_flags="-DET_ARM_BAREMETAL_SCRATCH_TEMP_ALLOCATOR_POOL_SIZE=0x20000" \
330-
--select_ops_list="dim_order_ops::_to_dim_order_copy.out"
329+
--extra_build_flags="-DET_ARM_BAREMETAL_SCRATCH_TEMP_ALLOCATOR_POOL_SIZE=0x100000" \
330+
--select_ops_list="dim_order_ops::_to_dim_order_copy.out"
331331

332332

333333
# Deploy the application on the FVP in fast mode

0 commit comments

Comments
 (0)