Skip to content

Commit b23f883

Browse files
authored
Revert "Migrate from cpp_python_extension to runtime.cxx_python_extension (#14154)" (#14233)
This reverts commit 6d8583d. Something went wrong with the automated merge of it + several PRs stacked on it initially, and my attempt to recover merged an old version.
1 parent 9e28fd7 commit b23f883

File tree

16 files changed

+30
-75
lines changed

16 files changed

+30
-75
lines changed

.ci/scripts/unittest-buck2.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ set -eux
99
# TODO: expand this to //...
1010
# TODO: can't query cadence & vulkan backends
1111
# TODO: can't query //kernels/prim_ops because of non-buckified stuff in OSS.
12-
# TODO: Make //backends/arm tests use runtime wrapper so we can just query //backends/arm/...
13-
buck2 query "//backends/apple/... + //backends/arm: + //backends/arm/debug/... + \
14-
//backends/arm/operator_support/... + //backends/arm/operators/... + \
15-
//backends/arm/_passes/... + //backends/arm/runtime/... + //backends/arm/tosa/... \
16-
+ //backends/example/... + \
12+
buck2 query "//backends/apple/... + //backends/example/... + \
1713
//backends/mediatek/... + //backends/transforms/... + \
1814
//backends/xnnpack/... + //configurations/... + //extension/flat_tensor: + \
1915
//extension/llm/runner: + //kernels/aten/... + //kernels/optimized/... + \

backends/arm/TARGETS

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ runtime.python_library(
1414
"ethosu/partitioner.py"
1515
],
1616
deps = [
17-
":arm_vela",
18-
"//executorch/backends/arm/tosa:arm_partitioner",
17+
":arm_partitioner",
1918
]
2019
)
2120
runtime.python_library(
@@ -26,7 +25,7 @@ runtime.python_library(
2625
"vgf/partitioner.py"
2726
],
2827
deps = [
29-
"//executorch/backends/arm/tosa:arm_partitioner",
28+
":arm_partitioner",
3029
]
3130
)
3231
runtime.python_library(
@@ -51,6 +50,21 @@ runtime.python_library(
5150
"//executorch/exir:lib",
5251
],
5352
)
53+
runtime.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+
)
5468
runtime.python_library(
5569
name = "arm_backend",
5670
srcs = [
@@ -63,6 +77,7 @@ runtime.python_library(
6377
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/serializer:serializer",
6478
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/tosa:tosa",
6579
"fbsource//third-party/tosa_tools/v1.00/serialization_lib/python/tosa:tosa",
80+
":arm_vela",
6681
":process_node",
6782
"//executorch/backends/arm/operators:lib",
6883
"//executorch/backends/arm/operators:node_visitor",

backends/arm/tosa/TARGETS

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,3 @@ runtime.python_library(
5959
":specification",
6060
],
6161
)
62-
63-
runtime.python_library(
64-
name = "arm_partitioner",
65-
srcs = [
66-
"backend.py",
67-
"partitioner.py",
68-
],
69-
deps = [
70-
"//executorch/backends/arm:arm_backend",
71-
"//executorch/backends/arm:constants",
72-
"//executorch/backends/arm:process_node",
73-
"//executorch/backends/arm/debug:schema",
74-
"//executorch/backends/arm/operator_support:operator_support",
75-
"//executorch/backends/arm/_passes:passes",
76-
"//executorch/exir:lib",
77-
],
78-
)

backends/cadence/aot/TARGETS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ load(
1212
"CXX",
1313
)
1414
load("@fbsource//xplat/executorch/codegen:codegen.bzl", "executorch_generated_lib")
15+
load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension")
1516

1617
oncall("odai_jarvis")
1718

codegen/tools/targets.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def define_common_targets(is_fbcode = False):
1717
],
1818
deps = [
1919
"//executorch/codegen:gen_lib",
20-
] + ([] if runtime.is_oss else select({
20+
] + select({
2121
"DEFAULT": [],
22-
"ovr_config//os:linux": ["//executorch/codegen/tools:selective_build"], # TODO(larryliu0820) :selective_build doesn't build in OSS yet
23-
})),
22+
"ovr_config//os:linux": [] if runtime.is_oss else ["//executorch/codegen/tools:selective_build"], # TODO(larryliu0820) :selective_build doesn't build in OSS yet
23+
}),
2424
)
2525

2626
runtime.python_binary(

devtools/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ oncall("executorch")
55
runtime.python_library(
66
name = "lib",
77
srcs = ["__init__.py"],
8-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
98
deps = [
109
"//executorch/devtools/bundled_program:core",
1110
"//executorch/devtools/etrecord:etrecord",

exir/TARGETS

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ runtime.python_library(
77
srcs = [
88
"tracer.py",
99
],
10-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
1110
deps = [
1211
"fbsource//third-party/pypi/typing-extensions:typing-extensions",
1312
":common",
@@ -47,15 +46,13 @@ runtime.python_library(
4746
srcs = [
4847
"scalar_type.py",
4948
],
50-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
5149
)
5250

5351
runtime.python_library(
5452
name = "schema",
5553
srcs = [
5654
"schema.py",
5755
],
58-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
5956
deps = [
6057
":scalar_type",
6158
"//executorch/exir/backend:compile_spec_schema",
@@ -74,7 +71,6 @@ runtime.python_library(
7471
srcs = [
7572
"tensor.py",
7673
],
77-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
7874
deps = [
7975
":error",
8076
":schema",
@@ -88,7 +84,6 @@ runtime.python_library(
8884
srcs = [
8985
"memory.py",
9086
],
91-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
9287
deps = [
9388
"fbsource//third-party/pypi/typing-extensions:typing-extensions",
9489
":tensor",
@@ -116,7 +111,6 @@ runtime.python_library(
116111
"delegate.py",
117112
"delegate.pyi",
118113
],
119-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
120114
deps = [
121115
"//caffe2:torch",
122116
],
@@ -146,7 +140,6 @@ runtime.python_library(
146140
srcs = [
147141
"__init__.py",
148142
],
149-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
150143
deps = [
151144
":tracer",
152145
"//caffe2:torch",
@@ -162,7 +155,6 @@ runtime.python_library(
162155
srcs = [
163156
"memory_planning.py",
164157
],
165-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
166158
deps = [
167159
":control_flow",
168160
":delegate",
@@ -221,7 +213,6 @@ runtime.python_library(
221213
srcs = [
222214
"print_program.py",
223215
],
224-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
225216
deps = [
226217
":error",
227218
":schema",
@@ -234,15 +225,13 @@ runtime.python_library(
234225
srcs = [
235226
"dynamic_shape.py",
236227
],
237-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
238228
)
239229

240230
runtime.python_library(
241231
name = "pass_base",
242232
srcs = [
243233
"pass_base.py",
244234
],
245-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
246235
deps = [
247236
":delegate",
248237
":error",
@@ -257,7 +246,6 @@ runtime.python_library(
257246
srcs = [
258247
"pass_manager.py",
259248
],
260-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
261249
deps = [
262250
"fbsource//third-party/pypi/typing-extensions:typing-extensions",
263251
":error",

exir/_serialize/TARGETS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension")
12
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
23

34
oncall("executorch")
45

56
# TODO(T157145817): Update other flatbuffer serializers to use flatc like
67
# _flatbuffer.py does, and remove this.
7-
runtime.cxx_python_extension(
8+
cpp_python_extension(
89
name = "_bindings",
910
srcs = [
1011
"bindings.cpp",

exir/dialects/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ runtime.python_library(
1010
resources = {
1111
"//executorch/exir/dialects/edge:edge_yaml": "edge.yaml",
1212
},
13-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
1413
deps = [
1514
"//caffe2:torch",
1615
"//caffe2/torchgen:torchgen",

exir/dialects/edge/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ runtime.python_library(
1111
resources = {
1212
":edge_yaml": "edge.yaml",
1313
},
14-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"]
1514
deps = [
1615
"fbsource//third-party/pypi/ruamel-yaml:ruamel-yaml",
1716
"fbsource//third-party/pypi/setuptools:setuptools",

0 commit comments

Comments
 (0)