Skip to content

Commit

Permalink
Move tsl/BUILD, tsl.bzl, and tsl.default.bzl to XLA
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 620894314
  • Loading branch information
ddunl authored and copybara-github committed Apr 5, 2024
1 parent b0c6c26 commit 4c8525c
Show file tree
Hide file tree
Showing 128 changed files with 371 additions and 355 deletions.
4 changes: 2 additions & 2 deletions third_party/gloo/gloo.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ cc_library(
"gloo/rendezvous/prefix_store.cc",
"gloo/rendezvous/store.cc",
] + select({
"@tsl//tsl:macos": [],
"@tsl//tsl:windows": [],
"@xla//xla/tsl:macos": [],
"@xla//xla/tsl:windows": [],
"//conditions:default": [
"gloo/common/linux.cc",
],
Expand Down
6 changes: 3 additions & 3 deletions third_party/llvm_openmp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ load(
"libiomp5_cc_binary",
)
load(
"@tsl//tsl:tsl.bzl",
"@xla//xla/tsl:tsl.bzl",
"if_linux_x86_64",
"if_macos",
"if_windows",
Expand All @@ -36,7 +36,7 @@ py_binary(
)

kmp_i18n_os_type = select({
"@tsl//tsl:windows": "win",
"@xla//xla/tsl:windows": "win",
"//conditions:default": "lin",
})

Expand Down Expand Up @@ -114,7 +114,7 @@ omp_vars_win = {
}

omp_all_cmake_vars = select({
"@tsl//tsl:windows": cmake_var_string(
"@xla//xla/tsl:windows": cmake_var_string(
dict_add(
omp_vars,
omp_vars_win,
Expand Down
6 changes: 3 additions & 3 deletions third_party/llvm_openmp/openmp.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def dict_add(*dictionaries):

def select_os_specific(L, M, W):
return select({
"@tsl//tsl:linux_x86_64": L,
"@tsl//tsl:macos": M,
"@tsl//tsl:windows": W,
"@xla//xla/tsl:linux_x86_64": L,
"@xla//xla/tsl:macos": M,
"@xla//xla/tsl:windows": W,
"//conditions:default": L,
})

Expand Down
26 changes: 13 additions & 13 deletions third_party/tsl/third_party/curl.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ cc_library(
"lib/ws.c",
"lib/ws.h",
] + select({
"@tsl//tsl:macos": [
"@xla//xla/tsl:macos": [
"lib/vtls/sectransp.c",
],
"@tsl//tsl:ios": [
"@xla//xla/tsl:ios": [
"lib/vtls/sectransp.c",
],
"@tsl//tsl:windows": CURL_WIN_SRCS,
"@xla//xla/tsl:windows": CURL_WIN_SRCS,
"//conditions:default": [
],
}),
Expand All @@ -378,7 +378,7 @@ cc_library(
"include/curl/websockets.h",
],
copts = select({
"@tsl//tsl:windows": CURL_WIN_COPTS,
"@xla//xla/tsl:windows": CURL_WIN_COPTS,
"//conditions:default": [
"-Iexternal/curl/lib",
"-D_GNU_SOURCE",
Expand All @@ -391,10 +391,10 @@ cc_library(
"-Wno-string-plus-int",
],
}) + select({
"@tsl//tsl:macos": [
"@xla//xla/tsl:macos": [
"-fno-constant-cfstrings",
],
"@tsl//tsl:windows": [
"@xla//xla/tsl:windows": [
# See curl.h for discussion of write size and Windows
"/DCURL_MAX_WRITE_SIZE=16384",
],
Expand All @@ -405,19 +405,19 @@ cc_library(
defines = ["CURL_STATICLIB"],
includes = ["include"],
linkopts = select({
"@tsl//tsl:android": [
"@xla//xla/tsl:android": [
"-pie",
],
"@tsl//tsl:macos": [
"@xla//xla/tsl:macos": [
"-Wl,-framework",
"-Wl,CoreFoundation",
"-Wl,-framework",
"-Wl,SystemConfiguration",
"-Wl,-framework",
"-Wl,Security",
],
"@tsl//tsl:ios": [],
"@tsl//tsl:windows": [
"@xla//xla/tsl:ios": [],
"@xla//xla/tsl:windows": [
"-DEFAULTLIB:ws2_32.lib",
"-DEFAULTLIB:advapi32.lib",
"-DEFAULTLIB:crypt32.lib",
Expand All @@ -431,8 +431,8 @@ cc_library(
deps = [
"@zlib",
] + select({
"@tsl//tsl:ios": [],
"@tsl//tsl:windows": [],
"@xla//xla/tsl:ios": [],
"@xla//xla/tsl:windows": [],
"//conditions:default": [
"@boringssl//:ssl",
],
Expand Down Expand Up @@ -538,7 +538,7 @@ cc_binary(
"src/tool_xattr.h",
],
copts = select({
"@tsl//tsl:windows": CURL_BIN_WIN_COPTS,
"@xla//xla/tsl:windows": CURL_BIN_WIN_COPTS,
"//conditions:default": [
"-Iexternal/curl/lib",
"-D_GNU_SOURCE",
Expand Down
10 changes: 5 additions & 5 deletions third_party/tsl/third_party/hwloc/hwloc.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ expand_template(
name = "include_hwloc_autogen_config_h",
out = "include/hwloc/autogen/config.h",
substitutions = select({
"@tsl//tsl:linux_x86_64": _INCLUDE_HWLOC_AUTOIGEN_CONFIG_H_LINUX_SUBS,
"@xla//xla/tsl:linux_x86_64": _INCLUDE_HWLOC_AUTOIGEN_CONFIG_H_LINUX_SUBS,
"//conditions:default": _INCLUDE_HWLOC_AUTOIGEN_CONFIG_H_COMMON_SUBS,
}),
template = "include/hwloc/autogen/config.h.in",
Expand Down Expand Up @@ -259,21 +259,21 @@ cc_library(
"include/private/private.h",
"include/private/xml.h",
] + select({
"@tsl//tsl:linux_x86_64": [
"@xla//xla/tsl:linux_x86_64": [
"hwloc/topology-linux.c",
"hwloc/topology-x86.c",
"include/hwloc/linux.h",
"include/private/cpuid-x86.h",
],
"@tsl//tsl:linux_aarch64": [
"@xla//xla/tsl:linux_aarch64": [
"hwloc/topology-linux.c",
"include/hwloc/linux.h",
],
"@tsl//tsl:linux_ppc64le": [
"@xla//xla/tsl:linux_ppc64le": [
"hwloc/topology-linux.c",
"include/hwloc/linux.h",
],
"@tsl//tsl:freebsd": [
"@xla//xla/tsl:freebsd": [
"hwloc/topology-freebsd.c",
"hwloc/topology-x86.c",
"include/private/cpuid-x86.h",
Expand Down
6 changes: 3 additions & 3 deletions third_party/tsl/third_party/llvm_openmp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ load(
"libiomp5_cc_binary",
)
load(
"@tsl//tsl:tsl.bzl",
"@xla//xla/tsl:tsl.bzl",
"if_linux_x86_64",
"if_macos",
"if_windows",
Expand All @@ -36,7 +36,7 @@ py_binary(
)

kmp_i18n_os_type = select({
"@tsl//tsl:windows": "win",
"@xla//xla/tsl:windows": "win",
"//conditions:default": "lin",
})

Expand Down Expand Up @@ -114,7 +114,7 @@ omp_vars_win = {
}

omp_all_cmake_vars = select({
"@tsl//tsl:windows": cmake_var_string(
"@xla//xla/tsl:windows": cmake_var_string(
dict_add(
omp_vars,
omp_vars_win,
Expand Down
6 changes: 3 additions & 3 deletions third_party/tsl/third_party/llvm_openmp/openmp.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def dict_add(*dictionaries):

def select_os_specific(L, M, W):
return select({
"@tsl//tsl:linux_x86_64": L,
"@tsl//tsl:macos": M,
"@tsl//tsl:windows": W,
"@xla//xla/tsl:linux_x86_64": L,
"@xla//xla/tsl:macos": M,
"@xla//xla/tsl:windows": W,
"//conditions:default": L,
})

Expand Down
10 changes: 5 additions & 5 deletions third_party/tsl/third_party/mkl_dnn/mkldnn_v1.BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@tsl//third_party/mkl_dnn:build_defs.bzl", "if_mkldnn_openmp")
load("@tsl//tsl:tsl.bzl", "tf_openmp_copts")
load("@xla//xla/tsl:tsl.bzl", "tf_openmp_copts")
load("@xla//xla/tsl/mkl:build_defs.bzl", "if_mkl", "if_mkl_ml")

exports_files(["LICENSE"])
Expand Down Expand Up @@ -102,7 +102,7 @@ expand_template(
)

_COPTS_LIST = select({
"@tsl//tsl:windows": [],
"@xla//xla/tsl:windows": [],
"//conditions:default": ["-fexceptions"],
}) + [
"-UUSE_MKL",
Expand Down Expand Up @@ -171,9 +171,9 @@ cc_library(
includes = _INCLUDES_LIST,
# TODO(penpornk): Use lrt_if_needed from tensorflow.bzl instead.
linkopts = select({
"@tsl//tsl:linux_aarch64": ["-lrt"],
"@tsl//tsl:linux_x86_64": ["-lrt"],
"@tsl//tsl:linux_ppc64le": ["-lrt"],
"@xla//xla/tsl:linux_aarch64": ["-lrt"],
"@xla//xla/tsl:linux_x86_64": ["-lrt"],
"@xla//xla/tsl:linux_ppc64le": ["-lrt"],
"//conditions:default": [],
}),
textual_hdrs = _TEXTUAL_HDRS_LIST,
Expand Down
4 changes: 2 additions & 2 deletions third_party/tsl/third_party/nccl/build_defs.bzl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ def cuda_rdc_library(name, hdrs = None, copts = None, linkstatic = True, **kwarg
out = dlink_cc,
gpu_archs = cuda_gpu_architectures(),
nvlink_args = select({
"@tsl//tsl:linux_x86_64": ["--cpu-arch=X86_64"],
"@tsl//tsl:linux_ppc64le": ["--cpu-arch=PPC64LE"],
"@xla//xla/tsl:linux_x86_64": ["--cpu-arch=X86_64"],
"@xla//xla/tsl:linux_ppc64le": ["--cpu-arch=PPC64LE"],
"//conditions:default": [],
}),
)
Expand Down
4 changes: 2 additions & 2 deletions third_party/tsl/third_party/snappy.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cc_library(
],
hdrs = ["snappy.h"],
copts = ["-DHAVE_CONFIG_H"] + select({
"@tsl//tsl:windows": [],
"@xla//xla/tsl:windows": [],
"//conditions:default": [
"-fno-exceptions",
"-Wno-sign-compare",
Expand All @@ -28,7 +28,7 @@ cc_library(
],
}),
defines = select({
"@tsl//tsl:windows": [],
"@xla//xla/tsl:windows": [],
"//conditions:default": ["HAVE_SYS_UIO_H"],
}),
)
Expand Down
2 changes: 1 addition & 1 deletion third_party/tsl/third_party/zlib.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cc_library(
],
hdrs = ["zlib.h"],
copts = select({
"@tsl//tsl:windows": [],
"@xla//xla/tsl:windows": [],
"//conditions:default": [
"-Wno-shift-negative-value",
"-DZ_HAVE_UNISTD_H",
Expand Down
2 changes: 1 addition & 1 deletion third_party/tsl/tsl/concurrency/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tsl:tsl.default.bzl", "get_compatible_with_portable")
load("@xla//xla/tsl:tsl.default.bzl", "get_compatible_with_portable")
load("//tsl/platform:build_config.bzl", "tsl_cc_test")
load("//tsl/platform:rules_cc.bzl", "cc_library")

Expand Down
4 changes: 2 additions & 2 deletions third_party/tsl/tsl/distributed_runtime/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Distributed runtime modules for machine learning, which allows coordination between multiple
# processes for distributed operations.

load("//tsl:tsl.bzl", "internal_visibility")
load("@xla//xla/tsl:tsl.bzl", "internal_visibility")
load(
"//tsl/platform:rules_cc.bzl",
"cc_library",
Expand All @@ -11,7 +11,7 @@ load(
package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = internal_visibility([
"//tsl:internal",
"@xla//xla/tsl:internal",
]),
licenses = ["notice"],
)
Expand Down
4 changes: 2 additions & 2 deletions third_party/tsl/tsl/distributed_runtime/coordination/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("//tsl:tsl.bzl", "if_oss", "internal_visibility", "tsl_gpu_library")
load("@xla//xla/tsl:tsl.bzl", "if_oss", "internal_visibility", "tsl_gpu_library")
load("//tsl/platform:build_config.bzl", "tf_proto_library", "tsl_cc_test")
load("//tsl/platform:rules_cc.bzl", "cc_library")

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = internal_visibility([
"//tsl:internal",
"@xla//xla/tsl:internal",
]),
licenses = ["notice"],
)
Expand Down
6 changes: 3 additions & 3 deletions third_party/tsl/tsl/distributed_runtime/preemption/BUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("//tsl:tsl.bzl", "internal_visibility")
load("//tsl:tsl.default.bzl", "get_compatible_with_portable", "tsl_grpc_cc_dependencies")
load("@xla//xla/tsl:tsl.bzl", "internal_visibility")
load("@xla//xla/tsl:tsl.default.bzl", "get_compatible_with_portable", "tsl_grpc_cc_dependencies")
load("//tsl/platform:build_config.bzl", "tsl_cc_test")
load("//tsl/platform:rules_cc.bzl", "cc_library")

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = internal_visibility([
"//tsl:internal",
"@xla//xla/tsl:internal",
]),
licenses = ["notice"],
)
Expand Down
6 changes: 3 additions & 3 deletions third_party/tsl/tsl/distributed_runtime/rpc/BUILD
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Description:
# RPC communication interfaces and implementations for TensorFlow.

load("//tsl:tsl.bzl", "internal_visibility")
load("//tsl:tsl.default.bzl", "tsl_grpc_cc_dependencies")
load("@xla//xla/tsl:tsl.bzl", "internal_visibility")
load("@xla//xla/tsl:tsl.default.bzl", "tsl_grpc_cc_dependencies")
load("//tsl/platform:build_config.bzl", "tf_proto_library", "tsl_cc_test")
load("//tsl/platform:rules_cc.bzl", "cc_library")

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = internal_visibility([
"//tsl:internal",
"@xla//xla/tsl:internal",
]),
licenses = ["notice"],
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("//tsl:tsl.bzl", "internal_visibility")
load("//tsl:tsl.default.bzl", "tsl_grpc_cc_dependencies")
load("@xla//xla/tsl:tsl.bzl", "internal_visibility")
load("@xla//xla/tsl:tsl.default.bzl", "tsl_grpc_cc_dependencies")
load("//tsl/platform:rules_cc.bzl", "cc_library")

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = internal_visibility([
"//tsl:internal",
"@xla//xla/tsl:internal",
]),
licenses = ["notice"],
)
Expand Down
4 changes: 2 additions & 2 deletions third_party/tsl/tsl/framework/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# The libraries in this package are not allowed to have ANY dependencies
# to other TF components outside of TSL.

load("//tsl:tsl.bzl", "internal_visibility")
load("//tsl:tsl.default.bzl", "filegroup", "get_compatible_with_portable")
load("@xla//xla/tsl:tsl.bzl", "internal_visibility")
load("@xla//xla/tsl:tsl.default.bzl", "filegroup", "get_compatible_with_portable")
load(
"//tsl/platform:build_config.bzl",
"tsl_cc_test",
Expand Down
Loading

0 comments on commit 4c8525c

Please sign in to comment.