Skip to content

Commit 17acc3b

Browse files
SaoirseARMYIWENX14
authored andcommitted
Arm backend: Remove the reordering of inputs flag (#7698)
Remove the reordering of inputs flag - With updated Vela version input/output order is now preserved. - Remove re-order of inputs in compile spec - Remove re-order of inputs in aot_arm_compiler
1 parent 42d7976 commit 17acc3b

File tree

5 files changed

+13
-53
lines changed

5 files changed

+13
-53
lines changed

backends/arm/arm_backend.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,6 @@ def dump_intermediate_artifacts_to(
122122
self.path_for_intermediates = output_path
123123
return self
124124

125-
def set_input_order(
126-
self, input_order: Optional[str] = None
127-
) -> "ArmCompileSpecBuilder":
128-
"""
129-
Reorder the inputs coming in. This may be required when inputs > 1.
130-
And while using the U55/U85 CompileSpec.
131-
"""
132-
self.input_order = input_order
133-
return self
134-
135125
def build(self) -> List[CompileSpec]:
136126
"""
137127
Generate a list of compile spec objects from the builder

backends/arm/test/common.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,33 +85,28 @@ def get_tosa_compile_spec_unbuilt(
8585

8686
def get_u55_compile_spec(
8787
custom_path=None,
88-
reorder_inputs=None,
8988
) -> list[CompileSpec]:
9089
"""
9190
Default compile spec for Ethos-U55 tests.
9291
"""
9392
return get_u55_compile_spec_unbuilt(
9493
custom_path=custom_path,
95-
reorder_inputs=reorder_inputs,
9694
).build()
9795

9896

9997
def get_u85_compile_spec(
10098
custom_path=None,
101-
reorder_inputs=None,
10299
) -> list[CompileSpec]:
103100
"""
104101
Default compile spec for Ethos-U85 tests.
105102
"""
106103
return get_u85_compile_spec_unbuilt(
107104
custom_path=custom_path,
108-
reorder_inputs=reorder_inputs,
109105
).build()
110106

111107

112108
def get_u55_compile_spec_unbuilt(
113109
custom_path=None,
114-
reorder_inputs=None,
115110
) -> ArmCompileSpecBuilder:
116111
"""Get the ArmCompileSpecBuilder for the Ethos-U55 tests, to modify
117112
the compile spec before calling .build() to finalize it.
@@ -128,14 +123,12 @@ def get_u55_compile_spec_unbuilt(
128123
extra_flags="--debug-force-regor --output-format=raw",
129124
)
130125
.dump_intermediate_artifacts_to(artifact_path)
131-
.set_input_order(reorder_inputs)
132126
)
133127
return compile_spec
134128

135129

136130
def get_u85_compile_spec_unbuilt(
137131
custom_path=None,
138-
reorder_inputs=None,
139132
) -> list[CompileSpec]:
140133
"""Get the ArmCompileSpecBuilder for the Ethos-U85 tests, to modify
141134
the compile spec before calling .build() to finalize it.
@@ -150,7 +143,6 @@ def get_u85_compile_spec_unbuilt(
150143
extra_flags="--output-format=raw",
151144
)
152145
.dump_intermediate_artifacts_to(artifact_path)
153-
.set_input_order(reorder_inputs)
154146
)
155147
return compile_spec
156148

backends/arm/test/test_arm_baremetal.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ test_run_ethosu_fvp() { # End to End model tests
9696
# Ethos-U55
9797
echo "${TEST_SUITE_NAME}: Test ethos-u target Ethos-U55"
9898
examples/arm/run.sh --target=ethos-u55-128 --model_name=mv2
99-
examples/arm/run.sh --target=ethos-u55-128 --model_name=lstm --reorder_inputs=1,0,2
99+
examples/arm/run.sh --target=ethos-u55-128 --model_name=lstm
100100

101101
# Ethos-U85
102102
echo "${TEST_SUITE_NAME}: Test ethos-u target Ethos-U85"
103103
examples/arm/run.sh --target=ethos-u85-128 --model_name=mv2
104-
examples/arm/run.sh --target=ethos-u85-128 --model_name=lstm --reorder_inputs=1,0,2
104+
examples/arm/run.sh --target=ethos-u85-128 --model_name=lstm
105105
}
106106

107107
${TEST_SUITE}

examples/arm/aot_arm_compiler.py

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -259,34 +259,25 @@ def get_calibration_data(
259259
def get_compile_spec(
260260
target: str,
261261
intermediates: Optional[str] = None,
262-
reorder_inputs: Optional[str] = None,
263262
system_config: Optional[str] = None,
264263
memory_mode: Optional[str] = None,
265264
) -> list[CompileSpec]:
266265
spec_builder = None
267266
if target == "TOSA":
268267
spec_builder = ArmCompileSpecBuilder().tosa_compile_spec("TOSA-0.80+BI")
269268
elif "ethos-u55" in target:
270-
spec_builder = (
271-
ArmCompileSpecBuilder()
272-
.ethosu_compile_spec(
273-
target,
274-
system_config=system_config,
275-
memory_mode=memory_mode,
276-
extra_flags="--debug-force-regor --output-format=raw --verbose-operators --verbose-cycle-estimate",
277-
)
278-
.set_input_order(reorder_inputs)
269+
spec_builder = ArmCompileSpecBuilder().ethosu_compile_spec(
270+
target,
271+
system_config=system_config,
272+
memory_mode=memory_mode,
273+
extra_flags="--debug-force-regor --output-format=raw --verbose-operators --verbose-cycle-estimate",
279274
)
280275
elif "ethos-u85" in target:
281-
spec_builder = (
282-
ArmCompileSpecBuilder()
283-
.ethosu_compile_spec(
284-
target,
285-
system_config=system_config,
286-
memory_mode=memory_mode,
287-
extra_flags="--output-format=raw --verbose-operators --verbose-cycle-estimate",
288-
)
289-
.set_input_order(reorder_inputs)
276+
spec_builder = ArmCompileSpecBuilder().ethosu_compile_spec(
277+
target,
278+
system_config=system_config,
279+
memory_mode=memory_mode,
280+
extra_flags="--output-format=raw --verbose-operators --verbose-cycle-estimate",
290281
)
291282

292283
if intermediates is not None:
@@ -429,14 +420,6 @@ def get_args():
429420
required=False,
430421
help="Location for outputs, if not the default of cwd.",
431422
)
432-
parser.add_argument(
433-
"-r",
434-
"--reorder_inputs",
435-
type=str,
436-
required=False,
437-
default=None,
438-
help="Provide the order of the inputs. This can be required when inputs > 1.",
439-
)
440423
parser.add_argument(
441424
"--system_config",
442425
required=False,
@@ -519,7 +502,6 @@ def get_args():
519502
compile_spec = get_compile_spec(
520503
args.target,
521504
args.intermediates,
522-
args.reorder_inputs,
523505
args.system_config,
524506
args.memory_mode,
525507
)

examples/arm/run.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ build_with_etdump=false
2929
build_type="Release"
3030
extra_build_flags=""
3131
build_only=false
32-
reorder_inputs=""
3332
system_config=""
3433
memory_mode=""
3534

@@ -46,7 +45,6 @@ help() {
4645
echo " --extra_build_flags Extra flags to pass to cmake like -DET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE=60000 Default: none "
4746
echo " --build_only Only build, don't run FVP"
4847
echo " --scratch-dir=<FOLDER> Path to your Ethos-U scrach dir if you not using default"
49-
echo " --reorder_inputs=<FLAGS> Reorder the inputs. This can be required when inputs > 1."
5048
echo " --system_config=<CONFIG> 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."
5149
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."
5250
echo " --memory_mode=<MODE> 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"
@@ -66,7 +64,6 @@ for arg in "$@"; do
6664
--extra_build_flags=*) extra_build_flags="${arg#*=}";;
6765
--build_only) build_only=true ;;
6866
--scratch-dir=*) root_dir="${arg#*=}";;
69-
--reorder_inputs=*) reorder_inputs="${arg#*=}";;
7067
--system_config=*) system_config="${arg#*=}";;
7168
--memory_mode=*) memory_mode="${arg#*=}";;
7269
*)
@@ -151,7 +148,7 @@ function generate_pte_file() {
151148
# We are using the aot_lib from build_quantization_aot_lib below
152149
SO_LIB=$(find cmake-out-aot-lib -name libquantized_ops_aot_lib.${SO_EXT})
153150
154-
local ARM_AOT_CMD="python3 -m examples.arm.aot_arm_compiler --model_name=${model} --target=${target} ${model_compiler_flags} --reorder_inputs=${reorder_inputs} --output ${output_folder} --so_library=$SO_LIB --system_config=${system_config} --memory_mode=${memory_mode}"
151+
local ARM_AOT_CMD="python3 -m examples.arm.aot_arm_compiler --model_name=${model} --target=${target} ${model_compiler_flags} --output ${output_folder} --so_library=$SO_LIB --system_config=${system_config} --memory_mode=${memory_mode}"
155152
echo "CALL ${ARM_AOT_CMD}" >&2
156153
${ARM_AOT_CMD} 1>&2
157154
@@ -372,7 +369,6 @@ if [[ -z "$model_name" ]]; then
372369
else
373370
test_model=( "$model_name" )
374371
model_compiler_flags=( "$aot_arm_compiler_flags" )
375-
reorder_inputs=( "$reorder_inputs" )
376372
fi
377373
378374
# loop over running the AoT flow and executing the model on device

0 commit comments

Comments
 (0)