Skip to content

Commit bcf195f

Browse files
[executorch] Remove EXECUTORCH_CLIENTS visibility gating - Kernels (#16523)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #16476 by @GregoryComer ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/GregoryComer/169/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/GregoryComer/169/head Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/GregoryComer/168/orig Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/GregoryComer/169/orig Differential Revision: [D89902027](https://our.internmc.facebook.com/intern/diff/D89902027/) @diff-train-skip-merge --------- Co-authored-by: Gregory Comer <[email protected]>
1 parent 8c7630a commit bcf195f

File tree

17 files changed

+64
-208
lines changed

17 files changed

+64
-208
lines changed

kernels/aten/targets.bzl

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,12 @@ def define_common_targets():
1010

1111
runtime.export_file(
1212
name = "functions.yaml",
13-
visibility = [
14-
"//executorch/...",
15-
"@EXECUTORCH_CLIENTS",
16-
],
13+
visibility = ["PUBLIC"],
1714
)
1815

1916
runtime.export_file(
2017
name = "edge_dialect_aten_op.yaml",
21-
visibility = [
22-
"//executorch/...",
23-
"@EXECUTORCH_CLIENTS",
24-
],
18+
visibility = ["PUBLIC"],
2519
)
2620

2721
et_operator_library(
@@ -33,10 +27,7 @@ def define_common_targets():
3327
runtime.cxx_library(
3428
name = "operators_edge_dialect_aten",
3529
srcs = [],
36-
visibility = [
37-
"//executorch/...",
38-
"@EXECUTORCH_CLIENTS",
39-
],
30+
visibility = ["PUBLIC"],
4031
exported_deps = [
4132
"//executorch/kernels/aten/cpu:cpu",
4233
],
@@ -61,8 +52,5 @@ def define_common_targets():
6152
custom_ops_yaml_target = "//executorch/kernels/aten:edge_dialect_aten_op.yaml",
6253
define_static_targets = True,
6354
custom_ops_requires_aot_registration = False,
64-
visibility = [
65-
"//executorch/...",
66-
"@EXECUTORCH_CLIENTS",
67-
],
55+
visibility = ["PUBLIC"],
6856
)

kernels/optimized/cpu/targets.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def define_common_targets():
2525
name = "add_sub_impl",
2626
srcs = [],
2727
exported_headers = ["op_add_sub_impl.h"],
28-
visibility = ["//executorch/kernels/optimized/cpu/...", "@EXECUTORCH_CLIENTS",],
28+
visibility = ["PUBLIC"],
2929
exported_deps = [
3030
"//executorch/runtime/core:core",
3131
"//executorch/kernels/portable/cpu/util:broadcast_indexes_range",
@@ -39,15 +39,15 @@ def define_common_targets():
3939
name = "fft_utils",
4040
srcs = [],
4141
exported_headers = ["fft_utils.h"],
42-
visibility = ["//executorch/kernels/optimized/cpu/...", "@EXECUTORCH_CLIENTS",],
42+
visibility = ["PUBLIC"],
4343
exported_deps = [] if runtime.is_oss else ["fbsource//third-party/pocket_fft:pocketfft"],
4444
)
4545

4646
runtime.cxx_library(
4747
name = "binary_ops",
4848
srcs = ["binary_ops.cpp"],
4949
exported_headers = ["binary_ops.h"],
50-
visibility = ["//executorch/kernels/optimized/cpu/...", "@EXECUTORCH_CLIENTS",],
50+
visibility = ["PUBLIC"],
5151
exported_deps = [
5252
"//executorch/runtime/core/exec_aten:lib",
5353
"//executorch/runtime/kernel:kernel_includes",
@@ -68,7 +68,7 @@ def define_common_targets():
6868
name = "moments_utils",
6969
srcs = [],
7070
exported_headers = ["moments_utils.h"],
71-
visibility = ["//executorch/kernels/optimized/...", "@EXECUTORCH_CLIENTS",],
71+
visibility = ["PUBLIC"],
7272
exported_deps = [
7373
"//executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch",
7474
"//executorch/kernels/optimized:libvec",
@@ -80,11 +80,11 @@ def define_common_targets():
8080
runtime.filegroup(
8181
name = "optimized_source_files",
8282
srcs = native.glob(["*.cpp"]),
83-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"],
83+
visibility = ["PUBLIC"],
8484
)
8585

8686
runtime.filegroup(
8787
name = "optimized_header_files",
8888
srcs = native.glob(["*.h"]),
89-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"],
89+
visibility = ["PUBLIC"],
9090
)

kernels/optimized/lib_defs.bzl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,7 @@ def define_libs(is_fbcode=False):
127127
"vec/**/*.h",
128128
]),
129129
header_namespace = "executorch/kernels/optimized",
130-
visibility = [
131-
"//executorch/...",
132-
"@EXECUTORCH_CLIENTS",
133-
],
130+
visibility = ["PUBLIC"],
134131
exported_deps = [
135132
"//executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch",
136133
],
@@ -157,10 +154,7 @@ def define_libs(is_fbcode=False):
157154
"utils/**/*.h",
158155
]),
159156
header_namespace = "executorch/kernels/optimized",
160-
visibility = [
161-
"//executorch/...",
162-
"@EXECUTORCH_CLIENTS",
163-
],
157+
visibility = ["PUBLIC"],
164158
exported_deps = [
165159
# Needed to access the ET_INLINE macro
166160
"//executorch/runtime/platform:compiler",
@@ -222,10 +216,7 @@ def define_libs(is_fbcode=False):
222216
"DEFAULT": ["-Os"],
223217
}),
224218
header_namespace = "executorch/kernels/optimized",
225-
visibility = [
226-
"//executorch/...",
227-
"@EXECUTORCH_CLIENTS",
228-
],
219+
visibility = ["PUBLIC"],
229220
preprocessor_flags = get_preprocessor_flags(),
230221
fbobjc_exported_preprocessor_flags = [
231222
"-DET_BUILD_WITH_BLAS",

kernels/optimized/targets.bzl

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@ def define_common_targets(is_fbcode=False):
1313

1414
runtime.export_file(
1515
name = "optimized.yaml",
16-
visibility = [
17-
"//executorch/...",
18-
"@EXECUTORCH_CLIENTS",
19-
],
16+
visibility = ["PUBLIC"],
2017
)
2118

2219
runtime.cxx_library(
2320
name = "optimized_operators",
2421
srcs = [],
25-
visibility = [
26-
"//executorch/...",
27-
"@EXECUTORCH_CLIENTS",
28-
],
22+
visibility = ["PUBLIC"],
2923
exported_deps = [
3024
"//executorch/kernels/optimized/cpu:cpu_optimized",
3125
],
@@ -34,9 +28,7 @@ def define_common_targets(is_fbcode=False):
3428
et_operator_library(
3529
name = "optimized_oplist",
3630
ops_schema_yaml_target = ":optimized.yaml",
37-
visibility = [
38-
"@EXECUTORCH_CLIENTS",
39-
],
31+
visibility = ["PUBLIC"],
4032
)
4133

4234
# Used mainly for operator testing. In practice, a generated lib specific
@@ -50,8 +42,5 @@ def define_common_targets(is_fbcode=False):
5042
],
5143
functions_yaml_target = ":optimized.yaml",
5244
define_static_targets = True,
53-
visibility = [
54-
"//executorch/...",
55-
"@EXECUTORCH_CLIENTS",
56-
],
45+
visibility = ["PUBLIC"],
5746
)

kernels/portable/cpu/pattern/targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def define_common_targets():
1818
"//executorch/kernels/portable/cpu/pattern:comparison_op",
1919
"//executorch/kernels/portable/cpu/pattern:logical_op"
2020
],
21-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"],
21+
visibility = ["PUBLIC"],
2222
)
2323

2424
runtime.cxx_library(

kernels/portable/cpu/targets.bzl

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ def define_common_targets():
4747
],
4848
srcs = [],
4949
exported_headers = ["vec_ops.h"],
50-
visibility = [
51-
"//executorch/kernels/portable/...",
52-
"//executorch/kernels/quantized/...",
53-
"@EXECUTORCH_CLIENTS",
54-
],
50+
visibility = ["PUBLIC"],
5551
)
5652

5753
# Only for use by targets in this directory. Defines constants like M_PI
@@ -62,23 +58,15 @@ def define_common_targets():
6258
exported_headers = [
6359
"math_constants.h",
6460
],
65-
visibility = [
66-
"//executorch/kernels/portable/...", "@EXECUTORCH_CLIENTS",
67-
],
61+
visibility = ["PUBLIC"],
6862
)
6963

7064
# Only for use by targets in this directory.
7165
runtime.cxx_library(
7266
name = "scalar_utils",
7367
srcs = [],
7468
exported_headers = ["scalar_utils.h", "selective_build.h"],
75-
visibility = [
76-
"//executorch/kernels/fb/...",
77-
"//executorch/kernels/optimized/cpu/...",
78-
"//executorch/kernels/portable/cpu/...",
79-
"//executorch/kernels/portable/test/...",
80-
"@EXECUTORCH_CLIENTS",
81-
],
69+
visibility = ["PUBLIC"],
8270
deps = [
8371
"//executorch/runtime/core/exec_aten/util:scalar_type_util",
8472
],
@@ -91,11 +79,11 @@ def define_common_targets():
9179
runtime.filegroup(
9280
name = "portable_source_files",
9381
srcs = native.glob(["*.cpp"]),
94-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"],
82+
visibility = ["PUBLIC"],
9583
)
9684

9785
runtime.filegroup(
9886
name = "portable_header_files",
9987
srcs = native.glob(["*.h"]),
100-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"],
88+
visibility = ["PUBLIC"],
10189
)

kernels/portable/cpu/util/targets.bzl

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def define_common_targets():
3838
"//executorch/kernels/portable/cpu/util:vectorized_math",
3939
"//executorch/kernels/portable/cpu/util:grid_sampler_2d_util",
4040
],
41-
visibility = ["//executorch/...", "@EXECUTORCH_CLIENTS"],
41+
visibility = ["PUBLIC"],
4242
)
4343

4444
runtime.cxx_library(
@@ -88,7 +88,7 @@ def define_common_targets():
8888
"//executorch/runtime/core/exec_aten/util:tensor_shape_to_c_string",
8989
"//executorch/runtime/core/exec_aten/util:tensor_util",
9090
],
91-
visibility = ["//executorch/kernels/portable/cpu/...", "//executorch/kernels/optimized/cpu/...", "@EXECUTORCH_CLIENTS"],
91+
visibility = ["PUBLIC"],
9292
)
9393

9494
runtime.cxx_library(
@@ -101,7 +101,7 @@ def define_common_targets():
101101
deps = [
102102
"//executorch/runtime/kernel:kernel_includes",
103103
],
104-
visibility = ["//executorch/kernels/portable/cpu/...", "//executorch/kernels/optimized/cpu/...", "@EXECUTORCH_CLIENTS"],
104+
visibility = ["PUBLIC"],
105105
)
106106

107107
runtime.cxx_library(
@@ -124,7 +124,7 @@ def define_common_targets():
124124
deps = [
125125
"//executorch/runtime/kernel:kernel_includes",
126126
],
127-
visibility = ["//executorch/kernels/portable/cpu/...", "//executorch/kernels/optimized/cpu/...", "@EXECUTORCH_CLIENTS"],
127+
visibility = ["PUBLIC"],
128128
)
129129

130130
runtime.cxx_library(
@@ -139,7 +139,7 @@ def define_common_targets():
139139
"//executorch/runtime/core/exec_aten/util:tensor_shape_to_c_string",
140140
"//executorch/runtime/kernel:kernel_includes",
141141
],
142-
visibility = ["//executorch/kernels/portable/cpu/...", "//executorch/kernels/optimized/cpu/...", "@EXECUTORCH_CLIENTS"],
142+
visibility = ["PUBLIC"],
143143
)
144144

145145
runtime.cxx_library(
@@ -262,7 +262,7 @@ def define_common_targets():
262262
"//executorch/runtime/core/exec_aten/util:tensor_util",
263263
":broadcast_util",
264264
],
265-
visibility = ["//executorch/kernels/portable/cpu/...", "//executorch/kernels/quantized/...", "@EXECUTORCH_CLIENTS"],
265+
visibility = ["PUBLIC"],
266266
)
267267

268268
runtime.cxx_library(
@@ -308,7 +308,7 @@ def define_common_targets():
308308
exported_deps = [
309309
"//executorch/runtime/kernel:kernel_includes",
310310
],
311-
visibility = ["//executorch/kernels/portable/cpu/...", "@EXECUTORCH_CLIENTS"],
311+
visibility = ["PUBLIC"],
312312
)
313313

314314
runtime.cxx_library(
@@ -328,10 +328,7 @@ def define_common_targets():
328328
"//executorch/runtime/core/exec_aten:lib",
329329
"//executorch/runtime/core/exec_aten/util:tensor_dimension_limit",
330330
],
331-
visibility = [
332-
"//executorch/...",
333-
"@EXECUTORCH_CLIENTS",
334-
],
331+
visibility = ["PUBLIC"],
335332
)
336333

337334
runtime.cxx_library(
@@ -369,12 +366,7 @@ def define_common_targets():
369366
"//executorch/extension/threadpool:threadpool",
370367
],
371368
exported_preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else [],
372-
visibility = [
373-
"//executorch/extension/llm/custom_ops/...",
374-
"//executorch/kernels/portable/cpu/...",
375-
"//executorch/kernels/quantized/...",
376-
"@EXECUTORCH_CLIENTS",
377-
],
369+
visibility = ["PUBLIC"],
378370
)
379371

380372
runtime.cxx_library(

0 commit comments

Comments
 (0)