Skip to content

Commit 450d008

Browse files
authored
Arm backend: Make it easier to generate non delegated/quantized PTEs (#10387)
Signed-off-by: Zingo Andersen <[email protected]>
1 parent 1717019 commit 450d008

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/arm/run.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ et_root_dir=$(realpath ${et_root_dir})
2020
model_name=""
2121
model_input_set=false
2222
model_input=""
23-
aot_arm_compiler_flags="--delegate --quantize"
23+
aot_arm_compiler_flag_delegate="--delegate"
24+
aot_arm_compiler_flag_quantize="--quantize"
25+
aot_arm_compiler_flags=""
2426
portable_kernels="aten::_softmax.out"
2527
target="ethos-u55-128"
2628
output_folder_set=false
@@ -41,7 +43,9 @@ function help() {
4143
echo " --model_name=<MODEL> Model file .py/.pth/.pt, builtin model or a model from examples/models. Passed to aot_arm_compiler"
4244
echo " --model_input=<INPUT> Provide model input .pt file to override the input in the model file. Passed to aot_arm_compiler"
4345
echo " NOTE: Inference in FVP is done with a dummy input full of ones. Use bundleio flag to run the model in FVP with the custom input or the input from the model file."
44-
echo " --aot_arm_compiler_flags=<FLAGS> Only used if --model_name is used Default: ${aot_arm_compiler_flags}"
46+
echo " --aot_arm_compiler_flags=<FLAGS> Extra flags to pass to aot compiler"
47+
echo " --no_delegate Do not delegate the model (can't override builtin models)"
48+
echo " --no_quantize Do not quantize the model (can't override builtin models)"
4549
echo " --portable_kernels=<OPS> Comma separated list of portable (non delagated) kernels to include Default: ${portable_kernels}"
4650
echo " --target=<TARGET> Target to build and run for Default: ${target}"
4751
echo " --output=<FOLDER> Target build output folder Default: ${output_folder}"
@@ -64,6 +68,8 @@ for arg in "$@"; do
6468
--model_name=*) model_name="${arg#*=}";;
6569
--model_input=*) model_input="${arg#*=}" ; model_input_set=true ;;
6670
--aot_arm_compiler_flags=*) aot_arm_compiler_flags="${arg#*=}";;
71+
--no_delegate) aot_arm_compiler_flag_delegate="" ;;
72+
--no_quantize) aot_arm_compiler_flag_quantize="" ;;
6773
--portable_kernels=*) portable_kernels="${arg#*=}";;
6874
--target=*) target="${arg#*=}";;
6975
--output=*) output_folder="${arg#*=}" ; output_folder_set=true ;;
@@ -160,7 +166,7 @@ if [[ -z "$model_name" ]]; then
160166
model_compiler_flags=( "" "--delegate" "--delegate" "--delegate --quantize" )
161167
else
162168
test_model=( "$model_name" )
163-
model_compiler_flags=( "$aot_arm_compiler_flags" )
169+
model_compiler_flags=( "$aot_arm_compiler_flag_delegate $aot_arm_compiler_flag_quantize $aot_arm_compiler_flags" )
164170
fi
165171

166172
# loop over running the AoT flow and executing the model on device

0 commit comments

Comments
 (0)