Skip to content

Commit e221b8d

Browse files
mergennachinfacebook-github-bot
authored andcommitted
Arm backend: Refactor compile spec handling (Try 2) (pytorch#14191)
Summary: Pull Request resolved: pytorch#14191 Redoing pytorch#14111 with additional fixes Differential Revision: D82171193
1 parent 6ed10e5 commit e221b8d

35 files changed

+751
-679
lines changed

backends/arm/TARGETS

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,6 @@
66
# @noautodeps
77
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
88

9-
python_library(
10-
name = "ethosu_partitioner",
11-
srcs = [
12-
"ethosu/__init__.py",
13-
"ethosu/backend.py",
14-
"ethosu/partitioner.py"
15-
],
16-
deps = [
17-
":arm_partitioner",
18-
]
19-
)
20-
python_library(
21-
name = "vgf_partitioner",
22-
srcs = [
23-
"vgf/__init__.py",
24-
"vgf/backend.py",
25-
"vgf/partitioner.py"
26-
],
27-
deps = [
28-
":arm_partitioner",
29-
]
30-
)
319
python_library(
3210
name = "constants",
3311
srcs = [
@@ -50,25 +28,11 @@ python_library(
5028
"//executorch/exir:lib",
5129
],
5230
)
31+
5332
python_library(
54-
name = "arm_partitioner",
55-
srcs = [
56-
"tosa/backend.py",
57-
"tosa/partitioner.py",
58-
],
59-
deps = [
60-
":arm_backend",
61-
":constants",
62-
"//executorch/backends/arm/debug:schema",
63-
"//executorch/backends/arm/operator_support:operator_support",
64-
"//executorch/backends/arm/_passes:passes",
65-
"//executorch/exir:lib",
66-
],
67-
)
68-
python_library(
69-
name = "arm_backend",
33+
name = "arm_compile_spec",
7034
srcs = [
71-
"arm_backend.py",
35+
"common/arm_compile_spec.py",
7236
],
7337
deps = [
7438
"fbsource//third-party/pypi/flatbuffers:flatbuffers",
@@ -79,11 +43,56 @@ python_library(
7943
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/tosa:tosa",
8044
":arm_vela",
8145
":process_node",
46+
"//executorch/exir/backend:compile_spec_schema",
8247
"//executorch/backends/arm/operators:lib",
8348
"//executorch/backends/arm/operators:node_visitor",
8449
"//executorch/backends/arm/_passes:passes",
8550
],
8651
)
52+
53+
python_library(
54+
name = "ethosu",
55+
srcs = [
56+
"ethosu/__init__.py",
57+
"ethosu/backend.py",
58+
"ethosu/compile_spec.py",
59+
"ethosu/partitioner.py",
60+
],
61+
deps = [
62+
":arm_compile_spec",
63+
":arm_vela",
64+
"//executorch/backends/arm/tosa:specification",
65+
"//executorch/backends/arm/tosa:partitioner",
66+
],
67+
)
68+
69+
python_library(
70+
name = "tosa_compile_spec",
71+
srcs = [
72+
"tosa/__init__.py",
73+
"tosa/compile_spec.py",
74+
],
75+
deps = [
76+
":arm_compile_spec",
77+
"//executorch/backends/arm/tosa:specification",
78+
],
79+
)
80+
81+
python_library(
82+
name = "vgf",
83+
srcs = [
84+
"vgf/__init__.py",
85+
"vgf/backend.py",
86+
"vgf/compile_spec.py",
87+
"vgf/partitioner.py",
88+
],
89+
deps = [
90+
":arm_compile_spec",
91+
"//executorch/backends/arm/tosa:specification",
92+
"//executorch/backends/arm/tosa:partitioner",
93+
],
94+
)
95+
8796
python_library(
8897
name = "process_node",
8998
srcs = ["process_node.py"],

backends/arm/arm_backend.py

Lines changed: 0 additions & 245 deletions
This file was deleted.

0 commit comments

Comments
 (0)