|
| 1 | +#!/bin/bash |
| 2 | +# Copyright 2024 Arm Limited and/or its affiliates. |
| 3 | +# |
| 4 | +# This source code is licensed under the BSD-style license found in the |
| 5 | +# LICENSE file in the root directory of this source tree. |
| 6 | + |
| 7 | +TEST_SUITE=$1 |
| 8 | + |
| 9 | +if [[ -z "${TEST_SUITE:-}" ]]; then |
| 10 | + echo "Missing test suite name, exiting..." |
| 11 | + exit 1 |
| 12 | +else |
| 13 | + echo "Run Arm baremetal test suite ${TEST_SUITE}" |
| 14 | +fi |
| 15 | + |
| 16 | +TEST_SUITE_NAME="$(basename "$0") ${TEST_SUITE}" |
| 17 | + |
| 18 | +test_pytest() { |
| 19 | + echo "${TEST_SUITE_NAME}: Run pytest" |
| 20 | + |
| 21 | + source examples/arm/ethos-u-scratch/setup_path.sh |
| 22 | + |
| 23 | + # Run arm baremetal pytest tests without Corstone-300/Corstone-320 FVP |
| 24 | + pytest -c /dev/null -v -n auto backends/arm/test |
| 25 | +} |
| 26 | + |
| 27 | +test_pytest_ethosu_fvp() { |
| 28 | + echo "${TEST_SUITE_NAME}: Run pytest with fvp" |
| 29 | + |
| 30 | + source examples/arm/ethos-u-scratch/setup_path.sh |
| 31 | + |
| 32 | + # Prepare Corstone-3x0 FVP for pytest |
| 33 | + examples/arm/run.sh --build_only |
| 34 | + backends/arm/test/setup_testing.sh |
| 35 | + |
| 36 | + # Run arm baremetal pytests with Corstone-300/Corstone-320 FVP |
| 37 | + pytest -c /dev/null -v -n auto backends/arm/test -p executorch.backends.arm.test.common --arm_quantize_io --arm_run_corstone300 |
| 38 | +} |
| 39 | + |
| 40 | +test_run_ethosu_fvp() { |
| 41 | + echo "${TEST_SUITE_NAME}: Test ethos-u delegate examples with run.sh" |
| 42 | + |
| 43 | + source examples/arm/ethos-u-scratch/setup_path.sh |
| 44 | + |
| 45 | + # TOSA quantized |
| 46 | + echo "${TEST_SUITE_NAME}: Test ethos-u target TOSA" |
| 47 | + PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=mv2 |
| 48 | + PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=esdr |
| 49 | + PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=emformer_join |
| 50 | + PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=w2l |
| 51 | + |
| 52 | + # Ethos-U55 |
| 53 | + echo "${TEST_SUITE_NAME}: Test ethos-u target Ethos-U55" |
| 54 | + PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=ethos-u55-128 --model_name=mv2 |
| 55 | + |
| 56 | + # Ethos-U85 |
| 57 | + echo "${TEST_SUITE_NAME}: Test ethos-u target Ethos-U85" |
| 58 | + PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=ethos-u85-128 --model_name=mv2 |
| 59 | + } |
| 60 | + |
| 61 | +${TEST_SUITE} |
0 commit comments