Skip to content

Commit 9127071

Browse files
committed
Arm backend: Expand run.sh CLI knobs for bare-metal builds
- Clarify help text for select_ops_list, toolchain choices, and add --build-dir reuse. - Track whether select_ops_list was overridden, allow arbitrary cmake -D flags, and tidy scratch or toolchain warnings. - Plumb the new option state through the control flow to prepare for automation. Change-Id: I69b027e726eee0b23206e7e3c836db375a8bf5b6 Signed-off-by: Usamah Zaheer <usamah.zaheer@arm.com>
1 parent 7ae69b6 commit 9127071

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

examples/arm/run.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ output_folder="."
2929
bundleio=false
3030
build_with_etdump=false
3131
build_type="Release"
32+
build_dir=""
3233
extra_build_flags=""
3334
build_only=false
3435
system_config=""
@@ -40,6 +41,7 @@ arm_scratch_dir=${script_dir}/arm-scratch
4041
scratch_dir_set=false
4142
toolchain=arm-none-eabi-gcc
4243
select_ops_list="aten::_softmax.out"
44+
select_ops_list_overridden=false
4345
qdq_fusion_op=false
4446
model_explorer=false
4547
perf_overlay=false
@@ -57,30 +59,30 @@ function help() {
5759
echo " --aot_arm_compiler_flags=<FLAGS> Extra flags to pass to aot compiler"
5860
echo " --no_delegate Do not delegate the model (can't override builtin models)"
5961
echo " --no_quantize Do not quantize the model (can't override builtin models)"
60-
echo " --portable_kernels=<OPS> TO BE DEPRECATED: Alias to select_ops_list."
61-
echo " --select_ops_list=<OPS> Comma separated list of portable (non delagated) kernels to include Default: ${select_ops_list}"
62+
echo " --select_ops_list=<OPS> Comma separated list of portable (non delegated) kernels to include. Default: ${select_ops_list}"
6263
echo " NOTE: This is only used when building for semihosting."
6364
echo " See https://docs.pytorch.org/executorch/stable/kernel-library-selective-build.html for more information."
6465
echo " --target=<TARGET> Target to build and run for Default: ${target}"
6566
echo " --output=<FOLDER> Target build output folder Default: ${output_folder}"
6667
echo " --bundleio Create Bundled pte using Devtools BundelIO with Input/RefOutput included"
6768
echo " --etdump Adds Devtools etdump support to track timing, etdump area will be base64 encoded in the log"
6869
echo " --build_type=<TYPE> Build with Release, Debug, RelWithDebInfo, UndefinedSanitizer or AddressSanitizer, default is ${build_type}"
69-
echo " --extra_build_flags=<FLAGS> Extra flags to pass to cmake like -DET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE=60000 Default: none "
70+
echo " --build-dir=<DIR> Optional: reuse an existing arm_executor_runner build directory (configured via 'cmake -S examples/arm/executor_runner -B <DIR> ...'). If omitted, run.sh auto-configures one under ${et_build_root} for bare-metal targets."
7071
echo " --build_only Only build, don't run"
71-
echo " --toolchain=<TOOLCHAIN> Ethos-U: Toolchain can be specified (e.g. bare metal as arm-none-eabi-gcc or zephyr as arm-zephyr-eabi-gcc Default: ${toolchain}"
72+
echo " --extra_build_flags=\"<FLAGS>\" Extra -D style flags to pass to cmake when run.sh auto-configures the build"
73+
echo " --toolchain=<arm-none-eabi-gcc|arm-zephyr-eabi-gcc> Toolchain preset to use when run.sh auto-configures the build. Default: ${toolchain}"
7274
echo " --system_config=<CONFIG> Ethos-U: System configuration to select from the Vela configuration file (see vela.ini). Default: Ethos_U55_High_End_Embedded for EthosU55 targets, Ethos_U85_SYS_DRAM_Mid for EthosU85 targets."
7375
echo " NOTE: If given, this option must match the given target. This option also sets timing adapter values customized for specific hardware, see ./executor_runner/CMakeLists.txt."
7476
echo " --config=<FILEPATH> Ethos-U: System configuration file that specifies system configurations (vela.ini)"
7577
echo " --memory_mode=<MODE> Ethos-U: Memory mode to select from the Vela configuration file (see vela.ini), e.g. Shared_Sram/Sram_Only. Default: 'Shared_Sram' for Ethos-U55 targets, 'Sram_Only' for Ethos-U85 targets"
7678
echo " --pte_placement=<elf|ADDR> Ethos-U: Control if runtime has PTE baked into the elf or if its placed in memory outside of the elf, defaults to ${pte_placement}"
7779
echo " --specify_ethosu_scratch Use actual Ethos-U scratch size for given model to size temp allocator"
7880
echo " --et_build_root=<FOLDER> Executorch build output root folder to use, defaults to ${et_build_root}"
79-
echo " --scratch-dir=<FOLDER> Path to your Arm scrach dir if you not using default ${arm_scratch_dir}"
81+
echo " --scratch-dir=<FOLDER> Path to your Ethos-U scratch dir if you not using default ${arm_scratch_dir}"
8082
echo " --qdq_fusion_op Enable QDQ fusion op"
8183
echo " --model_explorer Enable model explorer to visualize a TOSA or PTE model graph."
8284
echo " --visualize_pte With --model_explorer, visualize PTE flatbuffer model and delegates. Cannot be used with --visualize_tosa"
83-
echo " NOTE: If PTE contains an Ethos-U delegate, the Ethos-U subgraph will be visualized if aot_arm_compiler_flags is set with the -i flag to include intermediate tosa files."
85+
echo " NOTE: If PTE contains an Ethos-U delegate, the Ethos-U subgraph will be visualized if aot_arm_compiler_flags includes -i for TOSA dumps."
8486
echo " --visualize_tosa With --model_explorer, visualize TOSA flatbuffer model. Cannot be used with --visualize_pte"
8587
echo " --perf_overlay With --model_explorer and --visualize_tosa, include performance data from FVP PMU trace."
8688
exit 0
@@ -94,13 +96,16 @@ for arg in "$@"; do
9496
--aot_arm_compiler_flags=*) aot_arm_compiler_flags="${arg#*=}";;
9597
--no_delegate) aot_arm_compiler_flag_delegate="" ;;
9698
--no_quantize) aot_arm_compiler_flag_quantize="" ;;
97-
--portable_kernels=*) select_ops_list="${arg#*=}" ; echo "WARNING: --portable_kernels is DEPRECATED use select_ops_list." ;;
98-
--select_ops_list=*) select_ops_list="${arg#*=}";;
99+
--select_ops_list=*)
100+
select_ops_list="${arg#*=}"
101+
select_ops_list_overridden=true
102+
;;
99103
--target=*) target="${arg#*=}";;
100104
--output=*) output_folder="${arg#*=}" ; output_folder_set=true ;;
101105
--bundleio) bundleio=true ;;
102106
--etdump) build_with_etdump=true ;;
103107
--build_type=*) build_type="${arg#*=}";;
108+
--build-dir=*) build_dir="${arg#*=}";;
104109
--extra_build_flags=*) extra_build_flags="${arg#*=}";;
105110
--build_only) build_only=true ;;
106111
--toolchain=*) toolchain="${arg#*=}";;

0 commit comments

Comments
 (0)