Skip to content

Commit ca1b136

Browse files
committed
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 0dba025 commit ca1b136

File tree

5 files changed

+3
-37
lines changed

5 files changed

+3
-37
lines changed

backends/arm/arm_backend.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,6 @@ def set_quantize_io(self, quantize_io: bool = False) -> "ArmCompileSpecBuilder":
131131
self.quantize_io = quantize_io
132132
return self
133133

134-
def set_input_order(
135-
self, input_order: Optional[str] = None
136-
) -> "ArmCompileSpecBuilder":
137-
"""
138-
Reorder the inputs coming in. This may be required when inputs > 1.
139-
And while using the U55/U85 CompileSpec.
140-
"""
141-
self.input_order = input_order
142-
return self
143-
144134
def build(self) -> List[CompileSpec]:
145135
"""
146136
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
@@ -87,37 +87,32 @@ def get_tosa_compile_spec_unbuilt(
8787
def get_u55_compile_spec(
8888
quantize_io=True,
8989
custom_path=None,
90-
reorder_inputs=None,
9190
) -> list[CompileSpec]:
9291
"""
9392
Default compile spec for Ethos-U55 tests.
9493
"""
9594
return get_u55_compile_spec_unbuilt(
9695
quantize_io=quantize_io,
9796
custom_path=custom_path,
98-
reorder_inputs=reorder_inputs,
9997
).build()
10098

10199

102100
def get_u85_compile_spec(
103101
quantize_io=True,
104102
custom_path=None,
105-
reorder_inputs=None,
106103
) -> list[CompileSpec]:
107104
"""
108105
Default compile spec for Ethos-U85 tests.
109106
"""
110107
return get_u85_compile_spec_unbuilt(
111108
quantize_io=quantize_io,
112109
custom_path=custom_path,
113-
reorder_inputs=reorder_inputs,
114110
).build()
115111

116112

117113
def get_u55_compile_spec_unbuilt(
118114
quantize_io=True,
119115
custom_path=None,
120-
reorder_inputs=None,
121116
) -> ArmCompileSpecBuilder:
122117
"""Get the ArmCompileSpecBuilder for the Ethos-U55 tests, to modify
123118
the compile spec before calling .build() to finalize it.
@@ -135,15 +130,13 @@ def get_u55_compile_spec_unbuilt(
135130
)
136131
.set_quantize_io(quantize_io)
137132
.dump_intermediate_artifacts_to(artifact_path)
138-
.set_input_order(reorder_inputs)
139133
)
140134
return compile_spec
141135

142136

143137
def get_u85_compile_spec_unbuilt(
144138
quantize_io=True,
145139
custom_path=None,
146-
reorder_inputs=None,
147140
) -> list[CompileSpec]:
148141
"""Get the ArmCompileSpecBuilder for the Ethos-U85 tests, to modify
149142
the compile spec before calling .build() to finalize it.
@@ -159,7 +152,6 @@ def get_u85_compile_spec_unbuilt(
159152
)
160153
.set_quantize_io(quantize_io)
161154
.dump_intermediate_artifacts_to(artifact_path)
162-
.set_input_order(reorder_inputs)
163155
)
164156
return compile_spec
165157

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: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ 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]:
@@ -276,7 +275,6 @@ def get_compile_spec(
276275
extra_flags="--debug-force-regor --output-format=raw --verbose-operators --verbose-cycle-estimate",
277276
)
278277
.set_quantize_io(True)
279-
.set_input_order(reorder_inputs)
280278
)
281279
elif "ethos-u85" in target:
282280
spec_builder = (
@@ -288,7 +286,6 @@ def get_compile_spec(
288286
extra_flags="--output-format=raw --verbose-operators --verbose-cycle-estimate",
289287
)
290288
.set_quantize_io(True)
291-
.set_input_order(reorder_inputs)
292289
)
293290

294291
if intermediates is not None:
@@ -431,14 +428,6 @@ def get_args():
431428
required=False,
432429
help="Location for outputs, if not the default of cwd.",
433430
)
434-
parser.add_argument(
435-
"-r",
436-
"--reorder_inputs",
437-
type=str,
438-
required=False,
439-
default=None,
440-
help="Provide the order of the inputs. This can be required when inputs > 1.",
441-
)
442431
parser.add_argument(
443432
"--system_config",
444433
required=False,
@@ -521,7 +510,6 @@ def get_args():
521510
compile_spec = get_compile_spec(
522511
args.target,
523512
args.intermediates,
524-
args.reorder_inputs,
525513
args.system_config,
526514
args.memory_mode,
527515
)

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)