Skip to content

Commit e618466

Browse files
authored
Merge branch 'main' into gh/jorgep31415/130/orig
2 parents 8bc92e8 + a2e7a27 commit e618466

File tree

125 files changed

+4319
-2082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+4319
-2082
lines changed

backends/apple/coreml/test/test_coreml_partitioner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717

1818
class TestCoreMLPartitioner(unittest.TestCase):
19-
# TODO(T182928844): Delegate dim order op to backend.
20-
edge_compile_config = executorch.exir.EdgeCompileConfig(_skip_dim_order=True)
19+
edge_compile_config = executorch.exir.EdgeCompileConfig()
2120

2221
def test_add_sub_skip_mm(self):
2322
class Model(torch.nn.Module):

backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ def get_input_qparams(node: Node) -> dict[int, QuantArgs]:
3232
Raises a ValueError if the node doesn't have any parameters set.
3333
"""
3434
if "input_qparams" not in node.meta.keys():
35-
raise ValueError(f"No input quantization parameter found in node {node}")
35+
raise ValueError(
36+
f"No input quantization parameter found in node {node}\n"
37+
f"original_aten={node.meta.get('original_aten', 'None')}"
38+
)
3639
input_qparams = cast(dict[int, QuantArgs], node.meta["input_qparams"])
3740
if len(input_qparams) == 0:
38-
raise ValueError(f"No input quantization parameter found in node {node}")
41+
raise ValueError(
42+
f"No input quantization parameter found in node {node}\n"
43+
f"original_aten={node.meta.get('original_aten', 'None')}"
44+
)
3945
return input_qparams
4046

4147

@@ -45,11 +51,17 @@ def get_output_qparams(node: Node) -> dict[int, QuantArgs]:
4551
Raises a ValueError if the node doesn't have any parameters set.
4652
"""
4753
if "output_qparams" not in node.meta.keys():
48-
raise ValueError(f"No output quantization parameter found in node {node}")
49-
input_qparams = cast(dict[int, QuantArgs], node.meta["output_qparams"])
50-
if len(input_qparams) == 0:
51-
raise ValueError(f"No output quantization parameter found in node {node}")
52-
return input_qparams
54+
raise ValueError(
55+
f"No output quantization parameter found in node {node}\n"
56+
f"original_aten={node.meta.get('original_aten', 'None')}"
57+
)
58+
output_qparams = cast(dict[int, QuantArgs], node.meta["output_qparams"])
59+
if len(output_qparams) == 0:
60+
raise ValueError(
61+
f"No output quantization parameter found in node {node}\n"
62+
f"original_aten={node.meta.get('original_aten', 'None')}"
63+
)
64+
return output_qparams
5365

5466

5567
class FoldAndAnnotateQParamsPass(ExportPass):

backends/arm/arm_backend.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def __init__(self):
5050
self.output_format = None
5151
self.path_for_intermediates = None
5252
self.tosa_version = None
53+
self.tosa_spec = None
5354
self.input_order = None
5455

5556
def ethosu_compile_spec(

backends/arm/test/common.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,3 @@ def get_u85_compile_spec_unbuilt(
145145
.dump_intermediate_artifacts_to(artifact_path)
146146
)
147147
return compile_spec
148-
149-
150-
def get_target_board(compile_spec: list[CompileSpec]) -> str | None:
151-
for spec in compile_spec:
152-
if spec.key == "compile_flags":
153-
flags = spec.value.decode()
154-
if "u55" in flags:
155-
return "corstone-300"
156-
elif "u85" in flags:
157-
return "corstone-320"
158-
return None

backends/arm/test/models/test_mobilenet_v2_arm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_mv2_u55_BI(self):
9898
)
9999
if conftest.is_option_enabled("corstone_fvp"):
100100
tester.run_method_and_compare_outputs(
101-
atol=1.0, qtol=1, inputs=self.model_inputs, target_board="corstone-300"
101+
atol=1.0, qtol=1, inputs=self.model_inputs
102102
)
103103

104104
@pytest.mark.slow
@@ -118,5 +118,5 @@ def test_mv2_u85_BI(self):
118118
)
119119
if conftest.is_option_enabled("corstone_fvp"):
120120
tester.run_method_and_compare_outputs(
121-
atol=1.0, qtol=1, inputs=self.model_inputs, target_board="corstone-320"
121+
atol=1.0, qtol=1, inputs=self.model_inputs
122122
)

backends/arm/test/ops/test_max_pool.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ def test_maxpool2d_tosa_u55_BI(
173173
(test_data,),
174174
)
175175
if conftest.is_option_enabled("corstone_fvp"):
176-
tester.run_method_and_compare_outputs(
177-
qtol=1, inputs=(test_data,), target_board="corstone-300"
178-
)
176+
tester.run_method_and_compare_outputs(qtol=1, inputs=(test_data,))
179177

180178
@parameterized.expand(test_data_suite)
181179
@pytest.mark.corstone_fvp
@@ -191,9 +189,7 @@ def test_maxpool2d_tosa_u85_BI(
191189
(test_data,),
192190
)
193191
if conftest.is_option_enabled("corstone_fvp"):
194-
tester.run_method_and_compare_outputs(
195-
qtol=1, inputs=(test_data,), target_board="corstone-320"
196-
)
192+
tester.run_method_and_compare_outputs(qtol=1, inputs=(test_data,))
197193

198194
@parameterized.expand(test_data_suite_mult_batches)
199195
def test_maxpool2d_tosa_MI_mult_batches(
@@ -232,9 +228,7 @@ def test_maxpool2d_tosa_u55_BI_mult_batches(
232228
(test_data,),
233229
)
234230
if conftest.is_option_enabled("corstone_fvp"):
235-
tester.run_method_and_compare_outputs(
236-
qtol=1, inputs=(test_data,), target_board="corstone-300"
237-
)
231+
tester.run_method_and_compare_outputs(qtol=1, inputs=(test_data,))
238232

239233
@parameterized.expand(test_data_suite_mult_batches)
240234
@pytest.mark.corstone_fvp
@@ -251,6 +245,4 @@ def test_maxpool2d_tosa_u85_BI_mult_batches(
251245
(test_data,),
252246
)
253247
if conftest.is_option_enabled("corstone_fvp"):
254-
tester.run_method_and_compare_outputs(
255-
qtol=1, inputs=(test_data,), target_board="corstone-320"
256-
)
248+
tester.run_method_and_compare_outputs(qtol=1, inputs=(test_data,))

backends/arm/test/ops/test_maximum.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ def test_maximum_u55_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
121121
self.Maximum(), common.get_u55_compile_spec(), test_data
122122
)
123123
if conftest.is_option_enabled("corstone_fvp"):
124-
tester.run_method_and_compare_outputs(
125-
qtol=1, inputs=test_data, target_board="corstone-300"
126-
)
124+
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data)
127125

128126
@parameterized.expand(Maximum.test_parameters)
129127
def test_maximum_u85_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
@@ -132,6 +130,4 @@ def test_maximum_u85_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
132130
self.Maximum(), common.get_u85_compile_spec(), test_data
133131
)
134132
if conftest.is_option_enabled("corstone_fvp"):
135-
tester.run_method_and_compare_outputs(
136-
qtol=1, inputs=test_data, target_board="corstone-320"
137-
)
133+
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data)

backends/arm/test/ops/test_minimum.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ def test_minimum_u55_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
121121
self.Minimum(), common.get_u55_compile_spec(), test_data
122122
)
123123
if conftest.is_option_enabled("corstone_fvp"):
124-
tester.run_method_and_compare_outputs(
125-
qtol=1, inputs=test_data, target_board="corstone-300"
126-
)
124+
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data)
127125

128126
@parameterized.expand(Minimum.test_parameters)
129127
def test_minimum_u85_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
@@ -133,5 +131,6 @@ def test_minimum_u85_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
133131
)
134132
if conftest.is_option_enabled("corstone_fvp"):
135133
tester.run_method_and_compare_outputs(
136-
qtol=1, inputs=test_data, target_board="corstone-320"
134+
qtol=1,
135+
inputs=test_data,
137136
)

0 commit comments

Comments
 (0)