Skip to content

Commit 7169fbb

Browse files
Juanfi8DannyYuyang-quic
authored andcommitted
Added logic for model_input flag (pytorch#9310)
Added logic to pass the model_input flag to the aot_arm_compiler Fixes pytorch#9226 .
1 parent 6f1df21 commit 7169fbb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/arm/run.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ function help() {
3939
echo "Usage: $(basename $0) [options]"
4040
echo "Options:"
4141
echo " --model_name=<MODEL> Model file .py/.pth/.pt, builtin model or a model from examples/models. Passed to aot_arm_compiler"
42-
echo " --model_input=<INPUT> Provide model input .pt file to override the input in the model file. Passed to aot_arm_compiler"
42+
echo " --model_input=<INPUT> Provide model input .pt file to override the input in the model file. Passed to aot_arm_compiler"
43+
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."
4344
echo " --aot_arm_compiler_flags=<FLAGS> Only used if --model_name is used Default: ${aot_arm_compiler_flags}"
4445
echo " --portable_kernels=<OPS> Comma separated list of portable (non delagated) kernels to include Default: ${portable_kernels}"
4546
echo " --target=<TARGET> Target to build and run for Default: ${target}"
@@ -200,7 +201,11 @@ for i in "${!test_model[@]}"; do
200201

201202
# Remove old pte files
202203
rm -f "${output_folder}/${model_filename}"
203-
204+
205+
if [ "$model_input_set" = true ]; then
206+
model_compiler_flags="${model_compiler_flags} --model_input=${model_input}"
207+
fi
208+
204209
ARM_AOT_CMD="python3 -m examples.arm.aot_arm_compiler --model_name=${model} --target=${target} ${model_compiler_flags} --intermediate=${output_folder} --output=${pte_file} --so_library=$SO_LIB --system_config=${system_config} --memory_mode=${memory_mode} $bundleio_flag"
205210
echo "CALL ${ARM_AOT_CMD}" >&2
206211
${ARM_AOT_CMD} 1>&2

0 commit comments

Comments
 (0)