Skip to content

Commit f01198f

Browse files
authored
Arm backend: fwd fix for tosa dir refactor for buck files (#14031)
Summary: As title Also buckify debug dir Differential Revision: D81811706
1 parent 705150c commit f01198f

File tree

9 files changed

+96
-67
lines changed

9 files changed

+96
-67
lines changed

backends/arm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ For more information on TOSA see https://www.mlplatform.org/tosa/tosa_spec.html
3434
## Layout of key components
3535

3636
Export:
37-
* `tosa_backend.py` - The TOSA conversion flow all other backends rely on.
37+
* `tosa/backend.py` - The TOSA conversion flow all other backends rely on.
3838
* `ethosu/backend.py` - Main entrypoint for the EthosUBackend.
3939
* `vgf_backend.py` - Main entrypoint for VgfBackend.
4040
* For more information see the section on [Arm Backend Architecture](#arm-backend-architecture).

backends/arm/TARGETS

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ python_library(
3737
python_library(
3838
name = "arm_partitioner",
3939
srcs = [
40-
"tosa_backend.py",
41-
"tosa_partitioner.py",
40+
"tosa/backend.py",
41+
"tosa/partitioner.py",
4242
"vgf_backend.py",
4343
"vgf_partitioner.py",
4444
],
4545
deps = [
4646
":arm_backend",
4747
":constants",
48+
"//executorch/backends/arm/debug:schema",
4849
"//executorch/backends/arm/operator_support:operator_support",
4950
"//executorch/backends/arm/_passes:passes",
5051
"//executorch/exir:lib",
@@ -76,9 +77,9 @@ python_library(
7677
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/tosa:tosa",
7778
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/tosa:tosa",
7879
"//executorch/backends/arm/operators:node_visitor",
79-
"//executorch/backends/arm:tosa_mapping",
80-
"//executorch/backends/arm:tosa_quant_utils",
81-
"//executorch/backends/arm:tosa_utils",
80+
"//executorch/backends/arm/tosa:mapping",
81+
"//executorch/backends/arm/tosa:quant_utils",
82+
"//executorch/backends/arm/tosa:utils",
8283
"//executorch/exir:lib",
8384
],
8485
)
@@ -91,54 +92,6 @@ python_library(
9192
"fbsource//third-party/pypi/ethos-u-vela:ethos-u-vela",
9293
],
9394
)
94-
python_library(
95-
name = "tosa_mapping",
96-
srcs = [
97-
"tosa_mapping.py",
98-
],
99-
deps = [
100-
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/serializer:serializer",
101-
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/serializer:serializer",
102-
"//caffe2:torch",
103-
],
104-
)
105-
python_library(
106-
name = "tosa_quant_utils",
107-
srcs = [
108-
"tosa_quant_utils.py",
109-
],
110-
deps = [
111-
"fbsource//third-party/pypi/numpy:numpy",
112-
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/serializer:serializer",
113-
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/serializer:serializer",
114-
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/tosa:tosa",
115-
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/tosa:tosa",
116-
":constants",
117-
":tosa_mapping",
118-
"//executorch/exir/dialects:lib",
119-
],
120-
)
121-
python_library(
122-
name = "tosa_specification",
123-
srcs = [
124-
"tosa_specification.py",
125-
],
126-
deps = [
127-
"fbsource//third-party/pypi/packaging:packaging",
128-
"//executorch/exir/backend:compile_spec_schema",
129-
],
130-
)
131-
python_library(
132-
name = "tosa_utils",
133-
srcs = [
134-
"tosa_utils.py",
135-
],
136-
deps = [
137-
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/serializer:serializer",
138-
":tosa_quant_utils",
139-
"//executorch/backends/arm/operators:node_visitor",
140-
],
141-
)
14295
python_library(
14396
name = "arm_model_evaluator",
14497
srcs = [

backends/arm/_passes/TARGETS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ python_library(
66
deps = [
77
"//executorch/backends/arm:common",
88
"//executorch/backends/arm:constants",
9-
"//executorch/backends/arm:tosa_quant_utils",
10-
"//executorch/backends/arm:tosa_utils",
9+
"//executorch/backends/arm/tosa:quant_utils",
10+
"//executorch/backends/arm/tosa:utils",
1111
"//executorch/backends/arm/tosa/dialect:lib",
1212
"//executorch/backends/transforms:fuse_view_copy",
1313
"//executorch/backends/transforms:remove_getitem_op",

backends/arm/debug/TARGETS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# @noautodeps
2+
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
3+
4+
python_library(
5+
name = "schema",
6+
srcs = [
7+
"__init__.py",
8+
"schema.py",
9+
],
10+
deps = [
11+
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/serializer:serializer",
12+
"//caffe2:torch",
13+
],
14+
)

backends/arm/operator_support/TARGETS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ python_library(
66
deps = [
77
"//executorch/backends/arm:constants",
88
"//executorch/backends/arm/_passes:passes",
9-
"//executorch/backends/arm:tosa_specification",
9+
"//executorch/backends/arm/tosa:tosa",
1010
"//executorch/backends/transforms:remove_getitem_op",
1111
"//executorch/backends/xnnpack/_passes:xnnpack_passes",
1212
"//executorch/exir:lib",

backends/arm/operators/TARGETS

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ python_library(
55
name = "node_visitor",
66
srcs = ["node_visitor.py"],
77
deps = [
8-
"//executorch/backends/arm:tosa_mapping",
9-
"//executorch/backends/arm:tosa_specification",
8+
"//executorch/backends/arm/debug:schema",
9+
"//executorch/backends/arm/tosa:mapping",
10+
"//executorch/backends/arm/tosa:tosa",
1011
],
1112
)
1213

@@ -23,9 +24,9 @@ python_library(
2324
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/tosa:tosa",
2425
":node_visitor",
2526
":operator_validation_utils",
26-
"//executorch/backends/arm:tosa_mapping",
27-
"//executorch/backends/arm:tosa_quant_utils",
28-
"//executorch/backends/arm:tosa_utils",
27+
"//executorch/backends/arm/tosa:mapping",
28+
"//executorch/backends/arm/tosa:quant_utils",
29+
"//executorch/backends/arm/tosa:utils",
2930
"//executorch/backends/arm/_passes:passes",
3031
"//executorch/exir:lib",
3132
],

backends/arm/test/TARGETS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ python_library(
3030
srcs = ["common.py"],
3131
deps = [
3232
":runner_utils",
33-
"//executorch/backends/arm:tosa_specification",
33+
"//executorch/backends/arm/tosa:tosa",
3434
"fbsource//third-party/pypi/pytest:pytest",
3535
]
3636
)
@@ -43,7 +43,7 @@ python_library(
4343
"//executorch/backends/xnnpack/test/tester:tester",
4444
"//executorch/backends/arm:ethosu_partitioner",
4545
"//executorch/backends/arm/quantizer:lib",
46-
"//executorch/backends/arm:tosa_mapping",
46+
"//executorch/backends/arm/tosa:mapping",
4747
"//executorch/devtools/backend_debug:delegation_info",
4848
"//executorch/exir/backend:operator_support",
4949
"fbsource//third-party/pypi/tabulate:tabulate",

backends/arm/tosa/TARGETS

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
2+
3+
python_library(
4+
name = "mapping",
5+
srcs = [
6+
"mapping.py",
7+
],
8+
deps = [
9+
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/serializer:serializer",
10+
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/serializer:serializer",
11+
"//caffe2:torch",
12+
":specification",
13+
],
14+
)
15+
python_library(
16+
name = "quant_utils",
17+
srcs = [
18+
"quant_utils.py",
19+
],
20+
deps = [
21+
"fbsource//third-party/pypi/numpy:numpy",
22+
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/serializer:serializer",
23+
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/serializer:serializer",
24+
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/tosa:tosa",
25+
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/tosa:tosa",
26+
"//executorch/backends/arm:constants",
27+
":mapping",
28+
"//executorch/exir/dialects:lib",
29+
],
30+
)
31+
python_library(
32+
name = "specification",
33+
srcs = [
34+
"specification.py",
35+
],
36+
deps = [
37+
"fbsource//third-party/pypi/packaging:packaging",
38+
"//executorch/exir/backend:compile_spec_schema",
39+
],
40+
)
41+
python_library(
42+
name = "utils",
43+
srcs = [
44+
"utils.py",
45+
],
46+
deps = [
47+
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/serializer:serializer",
48+
":quant_utils",
49+
"//executorch/backends/arm/operators:node_visitor",
50+
],
51+
)
52+
53+
python_library(
54+
name = "tosa",
55+
srcs = [
56+
"__init__.py",
57+
],
58+
deps = [
59+
":specification",
60+
],
61+
)

backends/arm/tosa/dialect/TARGETS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ python_library(
88
],
99
deps = [
1010
"//caffe2:torch",
11-
"//executorch/backends/arm:tosa_specification",
11+
"//executorch/backends/arm/tosa:tosa",
1212
"//executorch/exir/dialects:lib",
1313
],
1414
)
@@ -19,7 +19,7 @@ python_library(
1919
deps = [
2020
":core",
2121
"//caffe2:torch",
22-
"//executorch/backends/arm:tosa_specification",
22+
"//executorch/backends/arm/tosa:tosa",
2323
],
2424
)
2525

@@ -30,7 +30,7 @@ python_library(
3030
":core",
3131
":ops",
3232
"//caffe2:torch",
33-
"//executorch/backends/arm:tosa_specification",
33+
"//executorch/backends/arm/tosa:tosa",
3434
"//executorch/exir/dialects:lib",
3535
],
3636
)

0 commit comments

Comments
 (0)