Skip to content

Commit 7c6982d

Browse files
committed
Merge remote-tracking branch 'origin/main' into toupstream/remove_reorder
2 parents ca1b136 + d1b33cb commit 7c6982d

File tree

5 files changed

+21
-71
lines changed

5 files changed

+21
-71
lines changed

backends/arm/arm_backend.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ def __init__(self):
4949
self.compiler_flags = []
5050
self.output_format = None
5151
self.path_for_intermediates = None
52-
self.quantize_io = False
53-
self.tosa_spec = None
52+
self.tosa_version = None
5453
self.input_order = None
5554

5655
def ethosu_compile_spec(
@@ -123,14 +122,6 @@ def dump_intermediate_artifacts_to(
123122
self.path_for_intermediates = output_path
124123
return self
125124

126-
def set_quantize_io(self, quantize_io: bool = False) -> "ArmCompileSpecBuilder":
127-
"""
128-
Quantization of inputs and dequantization of outputs for cases where
129-
whole graph is quantized and method signature is not of quantized type.
130-
"""
131-
self.quantize_io = quantize_io
132-
return self
133-
134125
def build(self) -> List[CompileSpec]:
135126
"""
136127
Generate a list of compile spec objects from the builder
@@ -160,9 +151,6 @@ def build(self) -> List[CompileSpec]:
160151
)
161152
)
162153

163-
if self.quantize_io:
164-
self.compile_spec.append(CompileSpec("quantize_io", "True".encode()))
165-
166154
return self.compile_spec
167155

168156

@@ -173,13 +161,6 @@ def is_tosa(compile_spec: List[CompileSpec]) -> bool:
173161
return False
174162

175163

176-
def is_quantize_io(compile_specs: List[CompileSpec]) -> bool:
177-
for spec in compile_specs:
178-
if spec.key == "quantize_io" and spec.value.decode() == "True":
179-
return True
180-
return False
181-
182-
183164
def get_tosa_version(compile_spec: List[CompileSpec]) -> TosaSpecification:
184165
for spec in compile_spec:
185166
if spec.key == "tosa_version":

backends/arm/arm_partitioner.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import torch
1313
from executorch.backends.arm.arm_backend import (
1414
ArmBackend,
15-
is_quantize_io,
1615
) # usort: skip
1716
from executorch.backends.arm.operator_support.tosa_supported_operators import (
1817
TOSASupportedOperators,
@@ -89,9 +88,6 @@ def is_partitioned(node: torch.fx.Node, tag=tag) -> bool:
8988
node.meta["delegation_tag"] = tag
9089
partition_tags[tag] = self.delegation_spec
9190

92-
if not is_quantize_io(self.delegation_spec.compile_specs):
93-
continue
94-
9591
# De-tag outmost q-nodes upwards and dq-nodes downwards.
9692
# De-tag if at least one input/ output is not part of partition.
9793
for node in partition.nodes:

backends/arm/test/common.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,40 +78,34 @@ def get_tosa_compile_spec_unbuilt(
7878
ArmCompileSpecBuilder()
7979
.tosa_compile_spec(tosa_spec)
8080
.dump_intermediate_artifacts_to(custom_path)
81-
.set_quantize_io(True)
8281
)
8382

8483
return compile_spec_builder
8584

8685

8786
def get_u55_compile_spec(
88-
quantize_io=True,
8987
custom_path=None,
9088
) -> list[CompileSpec]:
9189
"""
9290
Default compile spec for Ethos-U55 tests.
9391
"""
9492
return get_u55_compile_spec_unbuilt(
95-
quantize_io=quantize_io,
9693
custom_path=custom_path,
9794
).build()
9895

9996

10097
def get_u85_compile_spec(
101-
quantize_io=True,
10298
custom_path=None,
10399
) -> list[CompileSpec]:
104100
"""
105101
Default compile spec for Ethos-U85 tests.
106102
"""
107103
return get_u85_compile_spec_unbuilt(
108-
quantize_io=quantize_io,
109104
custom_path=custom_path,
110105
).build()
111106

112107

113108
def get_u55_compile_spec_unbuilt(
114-
quantize_io=True,
115109
custom_path=None,
116110
) -> ArmCompileSpecBuilder:
117111
"""Get the ArmCompileSpecBuilder for the Ethos-U55 tests, to modify
@@ -128,14 +122,12 @@ def get_u55_compile_spec_unbuilt(
128122
memory_mode="Shared_Sram",
129123
extra_flags="--debug-force-regor --output-format=raw",
130124
)
131-
.set_quantize_io(quantize_io)
132125
.dump_intermediate_artifacts_to(artifact_path)
133126
)
134127
return compile_spec
135128

136129

137130
def get_u85_compile_spec_unbuilt(
138-
quantize_io=True,
139131
custom_path=None,
140132
) -> list[CompileSpec]:
141133
"""Get the ArmCompileSpecBuilder for the Ethos-U85 tests, to modify
@@ -150,7 +142,6 @@ def get_u85_compile_spec_unbuilt(
150142
memory_mode="Shared_Sram",
151143
extra_flags="--output-format=raw",
152144
)
153-
.set_quantize_io(quantize_io)
154145
.dump_intermediate_artifacts_to(artifact_path)
155146
)
156147
return compile_spec

backends/arm/test/ops/test_depthwise_conv.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -259,58 +259,48 @@ def test_dw_conv_tosa_BI(self, test_name: str, model: torch.nn.Module):
259259

260260
@parameterized.expand(testsuite_conv2d[:4], skip_on_empty=True)
261261
@pytest.mark.corstone_fvp
262-
def test_dw_conv2d_u55_BI(
263-
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = True
264-
):
262+
def test_dw_conv2d_u55_BI(self, test_name: str, model: torch.nn.Module):
265263
self._test_dw_conv_ethos_BI_pipeline(
266264
model,
267-
common.get_u55_compile_spec(quantize_io=set_quantize_io),
265+
common.get_u55_compile_spec(),
268266
model.get_inputs(),
269267
)
270268

271269
@parameterized.expand(testsuite_conv2d[4:], skip_on_empty=True)
272270
@pytest.mark.corstone_fvp
273271
@conftest.expectedFailureOnFVP # TODO: MLETORCH-516
274-
def test_dw_conv2d_u55_BI_xfails(
275-
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False
276-
):
272+
def test_dw_conv2d_u55_BI_xfails(self, test_name: str, model: torch.nn.Module):
277273
self._test_dw_conv_ethos_BI_pipeline(
278274
model,
279-
common.get_u55_compile_spec(quantize_io=set_quantize_io),
275+
common.get_u55_compile_spec(),
280276
model.get_inputs(),
281277
)
282278

283279
@parameterized.expand(testsuite_conv1d, skip_on_empty=True)
284280
@pytest.mark.corstone_fvp
285-
def test_dw_conv1d_u55_BI(
286-
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = True
287-
):
281+
def test_dw_conv1d_u55_BI(self, test_name: str, model: torch.nn.Module):
288282
self._test_dw_conv_ethos_BI_pipeline(
289283
model,
290-
common.get_u55_compile_spec(quantize_io=set_quantize_io),
284+
common.get_u55_compile_spec(),
291285
model.get_inputs(),
292286
)
293287

294288
@parameterized.expand(testsuite_conv1d + testsuite_conv2d_u85)
295289
@pytest.mark.corstone_fvp
296-
def test_dw_conv_u85_BI(
297-
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = True
298-
):
290+
def test_dw_conv_u85_BI(self, test_name: str, model: torch.nn.Module):
299291
self._test_dw_conv_ethos_BI_pipeline(
300292
model,
301-
common.get_u85_compile_spec(quantize_io=set_quantize_io),
293+
common.get_u85_compile_spec(),
302294
model.get_inputs(),
303295
)
304296

305297
# All test cases except 3x3_1x3x256x256_gp3_st1 have numerical issues on FVP. MLETORCH-520
306298
@parameterized.expand(testsuite_conv2d_u85_xfails)
307299
@pytest.mark.corstone_fvp
308300
@conftest.expectedFailureOnFVP
309-
def test_dw_conv_u85_BI_xfails(
310-
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = True
311-
):
301+
def test_dw_conv_u85_BI_xfails(self, test_name: str, model: torch.nn.Module):
312302
self._test_dw_conv_ethos_BI_pipeline(
313303
model,
314-
common.get_u85_compile_spec(quantize_io=set_quantize_io),
304+
common.get_u85_compile_spec(),
315305
model.get_inputs(),
316306
)

examples/arm/aot_arm_compiler.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -266,26 +266,18 @@ def get_compile_spec(
266266
if target == "TOSA":
267267
spec_builder = ArmCompileSpecBuilder().tosa_compile_spec("TOSA-0.80+BI")
268268
elif "ethos-u55" in target:
269-
spec_builder = (
270-
ArmCompileSpecBuilder()
271-
.ethosu_compile_spec(
272-
target,
273-
system_config=system_config,
274-
memory_mode=memory_mode,
275-
extra_flags="--debug-force-regor --output-format=raw --verbose-operators --verbose-cycle-estimate",
276-
)
277-
.set_quantize_io(True)
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",
278274
)
279275
elif "ethos-u85" in target:
280-
spec_builder = (
281-
ArmCompileSpecBuilder()
282-
.ethosu_compile_spec(
283-
target,
284-
system_config=system_config,
285-
memory_mode=memory_mode,
286-
extra_flags="--output-format=raw --verbose-operators --verbose-cycle-estimate",
287-
)
288-
.set_quantize_io(True)
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",
289281
)
290282

291283
if intermediates is not None:

0 commit comments

Comments
 (0)