Skip to content

Commit b67c1cf

Browse files
Allowlist all existing users of //third_party/tensorflow/compiler/jit:jit.
This prevents the jit library from being used in new packages. PiperOrigin-RevId: 729640957
1 parent 2eea663 commit b67c1cf

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

tensorflow/compiler/jit/BUILD

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ load("@local_xla//xla/stream_executor:build_defs.bzl", "if_cuda_or_rocm")
22
load(
33
"@local_xla//xla/tsl:tsl.bzl",
44
"check_deps",
5+
"internal_visibility",
56
)
67
load("//tensorflow:tensorflow.bzl", "if_libtpu", "if_with_tpu_support", "tf_cc_test", "tf_copts", "tf_cuda_cc_test", "tf_cuda_only_cc_test")
78
load("//tensorflow:tensorflow.default.bzl", "cc_header_only_library", "filegroup", "tf_custom_op_py_strict_library")
9+
load("//tensorflow/compiler/jit:package_groups.bzl", "legacy_jit_users_package_group")
810
load("//tensorflow/core/platform:build_config.bzl", "tf_additional_all_protos", "tf_proto_library")
911
load(
1012
"//tensorflow/core/platform:build_config_root.bzl",
@@ -23,6 +25,8 @@ package(
2325
licenses = ["notice"],
2426
)
2527

28+
legacy_jit_users_package_group(name = "legacy_jit_users")
29+
2630
package_group(
2731
name = "internal",
2832
includes = [
@@ -55,12 +59,11 @@ filegroup(
5559
)
5660

5761
# Target that bundles up the XLA CPU and GPU JIT devices.
62+
# This target is deprecated as it pulls in all the XLA devices and bloats the dependencies.
63+
# Please use the individual targets in the deps list as needed. See b/336889334.
5864
cc_library(
5965
name = "jit",
60-
visibility = [
61-
":friends",
62-
"//learning/tfx:__subpackages__",
63-
],
66+
visibility = internal_visibility([":legacy_jit_users"]),
6467
deps = [
6568
":xla_cpu_device",
6669
":xla_cpu_jit",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Tensorflow JIT package_group definitions"""
2+
3+
def legacy_jit_users_package_group(name):
4+
"""Defines visibility group for //third_party/tensorflow/compiler/jit.
5+
6+
Args:
7+
name: package group name
8+
"""
9+
10+
native.package_group(
11+
name = name,
12+
packages = ["//..."],
13+
)

tensorflow/opensource_only.files

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ tf_staging/tensorflow/api_template_v1.__init__:.py
55
tf_staging/tensorflow/cc/saved_model/image_format/README.md:
66
tf_staging/tensorflow/compat_template.__init__:.py
77
tf_staging/tensorflow/compat_template_v1.__init__:.py
8+
tf_staging/tensorflow/compiler/jit/package_groups.bzl:
89
tf_staging/tensorflow/compiler/mlir/glob_lit_test.bzl:
910
tf_staging/tensorflow/compiler/mlir/lite/core/special_rules.bzl:
1011
tf_staging/tensorflow/compiler/mlir/lite/schema/conversion_metadata_generated.h:

0 commit comments

Comments
 (0)