Skip to content

Commit aa3ee7e

Browse files
[ExecuTorch] Arm Ethos: Disable pyre (#8746)
Disabling Pyre. Relying on OSS mypy enabled in #7776. Differential Revision: [D70146769](https://our.internmc.facebook.com/intern/diff/D70146769/) ghstack-source-id: 268178737 Pull Request resolved: #8664 --------- Co-authored-by: Digant Desai <[email protected]>
1 parent 4b85ee2 commit aa3ee7e

File tree

5 files changed

+10
-27
lines changed

5 files changed

+10
-27
lines changed

backends/arm/TARGETS

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# @noautodeps
22
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
3-
43
python_library(
54
name = "arm_partitioner",
65
srcs = [
@@ -9,21 +8,18 @@ python_library(
98
"tosa_backend.py",
109
"tosa_partitioner.py",
1110
],
12-
typing = True,
1311
deps = [
1412
":arm_backend",
1513
"//executorch/backends/arm/operator_support:operator_support",
1614
"//executorch/backends/arm/_passes:passes",
1715
"//executorch/exir:lib",
1816
],
1917
)
20-
2118
python_library(
2219
name = "arm_backend",
2320
srcs = [
2421
"arm_backend.py",
2522
],
26-
typing = True,
2723
deps = [
2824
"fbsource//third-party/pypi/flatbuffers:flatbuffers",
2925
"fbsource//third-party/pypi/ml-dtypes:ml-dtypes",
@@ -36,11 +32,9 @@ python_library(
3632
"//executorch/backends/arm/_passes:passes",
3733
],
3834
)
39-
4035
python_library(
4136
name = "process_node",
4237
srcs = ["process_node.py"],
43-
typing = True,
4438
deps = [
4539
"fbsource//third-party/serialization_lib/python/tosa:tosa",
4640
"//executorch/backends/arm/operators:node_visitor",
@@ -50,36 +44,30 @@ python_library(
5044
"//executorch/exir:lib",
5145
],
5246
)
53-
5447
python_library(
5548
name = "arm_vela",
5649
srcs = [
5750
"arm_vela.py",
5851
],
59-
typing = True,
6052
deps = [
6153
"fbsource//third-party/pypi/ethos-u-vela:ethos-u-vela",
6254
],
6355
)
64-
6556
python_library(
6657
name = "tosa_mapping",
6758
srcs = [
6859
"tosa_mapping.py",
6960
],
70-
typing = True,
7161
deps = [
7262
"fbsource//third-party/serialization_lib/python/serializer:serializer",
7363
"//caffe2:torch",
7464
],
7565
)
76-
7766
python_library(
7867
name = "tosa_quant_utils",
7968
srcs = [
8069
"tosa_quant_utils.py",
8170
],
82-
typing = True,
8371
deps = [
8472
"fbsource//third-party/pypi/numpy:numpy",
8573
"fbsource//third-party/serialization_lib/python/serializer:serializer",
@@ -88,38 +76,32 @@ python_library(
8876
"//executorch/exir/dialects:lib",
8977
],
9078
)
91-
9279
python_library(
9380
name = "tosa_specification",
9481
srcs = [
9582
"tosa_specification.py",
9683
],
97-
typing = True,
9884
deps = [
9985
"fbsource//third-party/pypi/packaging:packaging",
10086
"//executorch/exir/backend:compile_spec_schema",
10187
],
10288
)
103-
10489
python_library(
10590
name = "tosa_utils",
10691
srcs = [
10792
"tosa_utils.py",
10893
],
109-
typing = True,
11094
deps = [
11195
"fbsource//third-party/serialization_lib/python/serializer:serializer",
11296
":tosa_quant_utils",
11397
"//executorch/backends/arm/operators:node_visitor",
11498
],
11599
)
116-
117100
python_library(
118101
name = "arm_model_evaluator",
119102
srcs = [
120103
"util/arm_model_evaluator.py",
121104
],
122-
typing = True,
123105
deps = [
124106
"//caffe2:torch",
125107
]

backends/arm/_passes/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
33
python_library(
44
name = "passes",
55
srcs = glob(["*.py"]),
6-
typing = True,
76
deps = [
87
"//executorch/backends/arm:tosa_quant_utils",
98
"//executorch/backends/arm:tosa_utils",

backends/arm/operator_support/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
33
python_library(
44
name = "operator_support",
55
srcs = glob(["*.py"]),
6-
typing = True,
76
deps = [
87
"//executorch/backends/arm/_passes:passes",
98
"//executorch/backends/arm:tosa_specification",

backends/arm/operators/TARGETS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
44
python_library(
55
name = "node_visitor",
66
srcs = ["node_visitor.py"],
7-
typing = True,
87
deps = [
98
"//executorch/backends/arm:tosa_mapping",
109
"//executorch/backends/arm:tosa_specification",
@@ -14,7 +13,6 @@ python_library(
1413
python_library(
1514
name = "ops",
1615
srcs = glob(["op_*.py", "ops_*.py"]),
17-
typing = True,
1816
deps = [
1917
"fbsource//third-party/serialization_lib/python/tosa:tosa",
2018
":node_visitor",
@@ -29,7 +27,6 @@ python_library(
2927
python_library(
3028
name = "lib",
3129
srcs = ["__init__.py"],
32-
typing = True,
3330
deps = [
3431
":node_visitor",
3532
":ops",

backends/arm/test/ops/test_linear.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def forward(self, x):
127127
def _test_linear_tosa_MI_pipeline(
128128
self, module: torch.nn.Module, test_data: Tuple[torch.Tensor]
129129
):
130-
(
130+
tester = (
131131
ArmTester(
132132
module,
133133
example_inputs=test_data,
@@ -141,13 +141,14 @@ def _test_linear_tosa_MI_pipeline(
141141
.to_edge_transform_and_lower()
142142
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
143143
.to_executorch()
144-
.run_method_and_compare_outputs(inputs=test_data)
145144
)
145+
if conftest.is_option_enabled("tosa_ref_model"):
146+
tester.run_method_and_compare_outputs(inputs=test_data)
146147

147148
def _test_linear_tosa_BI_pipeline(
148149
self, module: torch.nn.Module, test_data: Tuple[torch.Tensor]
149150
):
150-
(
151+
tester = (
151152
ArmTester(
152153
module,
153154
example_inputs=test_data,
@@ -162,8 +163,9 @@ def _test_linear_tosa_BI_pipeline(
162163
.to_edge_transform_and_lower()
163164
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
164165
.to_executorch()
165-
.run_method_and_compare_outputs(inputs=test_data, qtol=1)
166166
)
167+
if conftest.is_option_enabled("tosa_ref_model"):
168+
tester.run_method_and_compare_outputs(inputs=test_data, qtol=1)
167169

168170
def _test_linear_tosa_ethosu_BI_pipeline(
169171
self,
@@ -186,9 +188,11 @@ def _test_linear_tosa_ethosu_BI_pipeline(
186188
.to_executorch()
187189
.serialize()
188190
)
191+
# TODO: Add FVP testing support.
189192
return tester
190193

191194
@parameterized.expand(test_data_suite_rank1 + test_data_suite_rank4)
195+
@pytest.mark.tosa_ref_model
192196
def test_linear_tosa_MI(
193197
self,
194198
test_name: str,
@@ -208,6 +212,7 @@ def test_linear_tosa_MI(
208212
)
209213

210214
@parameterized.expand(test_data_suite_rank1 + test_data_suite_rank4)
215+
@pytest.mark.tosa_ref_model
211216
def test_linear_tosa_BI(
212217
self,
213218
test_name: str,
@@ -249,6 +254,7 @@ def test_linear_tosa_u55_BI(
249254
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data)
250255

251256
@parameterized.expand(test_data_suite_rank1 + test_data_suite_rank4)
257+
@pytest.mark.corstone_fvp
252258
def test_linear_tosa_u85_BI(
253259
self,
254260
test_name: str,

0 commit comments

Comments
 (0)