Skip to content

Commit 505f4bc

Browse files
committed
remove vestigial input order spec flag
Signed-off-by: Rob Elliott <[email protected]> Change-Id: I9f121252bd009250c61fe136fcf8d278c480133f
1 parent 6730dd6 commit 505f4bc

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

backends/arm/arm_backend.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def __init__(self):
2525
self.output_format = None
2626
self.path_for_intermediates = None
2727
self.tosa_spec = None
28-
self.input_order = None
2928

3029
def vgf_compile_spec(
3130
self,
@@ -159,13 +158,6 @@ def build(self) -> List[CompileSpec]:
159158
CompileSpec("debug_artifact_path", self.path_for_intermediates.encode())
160159
)
161160

162-
if self.input_order:
163-
self.compile_spec.append(
164-
CompileSpec(
165-
"input_order", " ".join(map(str, self.input_order)).encode()
166-
)
167-
)
168-
169161
return self.compile_spec
170162

171163

backends/arm/arm_vela.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323

2424
# Pack either input or output tensor block, compose the related arrays into
2525
# per-io structs to simplify runtime use.
26-
def vela_bin_pack_io(prefix, data, shape_order=None):
26+
def vela_bin_pack_io(prefix, data):
2727
vela_input_shapes = data[prefix + "_shape"]
2828

29-
order = shape_order if shape_order else range(len(vela_input_shapes))
3029
ios = struct.pack("<i", len(vela_input_shapes))
31-
for i in order:
30+
for i in range(len(vela_input_shapes)):
3231
io_shape = vela_input_shapes[i]
3332
io_elem_size = data[prefix + "_elem_size"][i]
3433
io_offset = data[prefix + "_offset"][i]
@@ -45,9 +44,7 @@ def vela_bin_pack_io(prefix, data, shape_order=None):
4544
# Output via Vela to binary stream for ArmBackendEthosU
4645
# WARNING: Do not change this without changing VelaBinStream.cpp as that
4746
# function consumes this format and the two need to align.
48-
def vela_compile(
49-
tosa_flatbuffer: bytes, args: List[str], shape_order=None, verbose: bool = False
50-
):
47+
def vela_compile(tosa_flatbuffer: bytes, args: List[str], verbose: bool = False):
5148
"""
5249
Compile a TOSA graph to a binary stream for ArmBackendEthosU using Vela.
5350
"""
@@ -98,7 +95,7 @@ def vela_compile(
9895
bin_blocks["scratch_data"] = b"\x00" * block_length
9996

10097
# Capture inputs and outputs
101-
bin_blocks["inputs"] = vela_bin_pack_io("input", data, shape_order)
98+
bin_blocks["inputs"] = vela_bin_pack_io("input", data)
10299
bin_blocks["outputs"] = vela_bin_pack_io("output", data)
103100

104101
bin_blocks["vela_end_stream"] = b""

backends/arm/ethosu_backend.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ def _compile_tosa_flatbuffer(
4242
representation to a target specific binary stream.
4343
"""
4444
compile_flags = []
45-
input_order = []
4645
for spec in compile_spec:
4746
if spec.key == "compile_flags":
4847
compile_flags.append(spec.value.decode())
49-
if spec.key == "input_order":
50-
input_order = list(map(int, spec.value.decode().split(",")))
5148

5249
if len(compile_flags) == 0:
5350
# Not testing for compile_flags correctness here, just that they are
@@ -60,7 +57,6 @@ def _compile_tosa_flatbuffer(
6057
binary = vela_compile(
6158
tosa_flatbuffer,
6259
compile_flags,
63-
input_order,
6460
verbose=logger.getEffectiveLevel() == logging.INFO,
6561
)
6662
return binary

backends/arm/tosa_backend.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,13 @@ def preprocess( # noqa: C901
6363
artifact_path = None
6464
output_format = ""
6565
compile_flags = []
66-
input_order = []
6766
for spec in compile_spec:
6867
if spec.key == "debug_artifact_path":
6968
artifact_path = spec.value.decode()
7069
if spec.key == "output_format":
7170
output_format = spec.value.decode()
7271
if spec.key == "compile_flags":
7372
compile_flags.append(spec.value.decode())
74-
if spec.key == "input_order":
75-
input_order = list(map(int, spec.value.decode().split(",")))
7673

7774
# Check that the output format is set correctly in the compile spec
7875
if output_format != "tosa":
@@ -129,12 +126,6 @@ def preprocess( # noqa: C901
129126
dbg_fail(node, graph_module, tosa_graph, artifact_path)
130127
raise
131128

132-
if len(input_order) > 0:
133-
if input_count != len(input_order):
134-
raise RuntimeError(
135-
"The rank of the input order is not equal to amount of input tensors"
136-
)
137-
138129
if artifact_path:
139130
tag = arm_get_first_delegation_tag(graph_module)
140131
dbg_tosa_dump(

0 commit comments

Comments
 (0)