• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Description:
2#   XLA client libraries.
3
4load("//tensorflow:tensorflow.bzl", "tf_cc_test")
5
6package(
7    default_visibility = ["//visibility:public"],
8    licenses = ["notice"],  # Apache 2.0
9)
10
11package_group(
12    name = "friends",
13    includes = [
14        "//tensorflow/compiler/xla:friends",
15    ],
16)
17
18# Filegroup used to collect source files for dependency checking.
19filegroup(
20    name = "c_srcs",
21    data = glob([
22        "**/*.cc",
23        "**/*.h",
24    ]),
25)
26
27cc_library(
28    name = "global_data",
29    srcs = ["global_data.cc"],
30    hdrs = ["global_data.h"],
31    deps = [
32        "//tensorflow/compiler/xla:service_interface",
33        "//tensorflow/compiler/xla:types",
34        "//tensorflow/compiler/xla:xla_data_proto_cc",
35        "//tensorflow/compiler/xla:xla_proto_cc",
36        "//tensorflow/core:lib",
37        "@com_google_absl//absl/container:flat_hash_map",
38        "@com_google_absl//absl/types:span",
39    ],
40)
41
42cc_library(
43    name = "padding",
44    srcs = ["padding.cc"],
45    hdrs = ["padding.h"],
46    deps = [
47        "//tensorflow/compiler/xla:statusor",
48        "//tensorflow/compiler/xla:types",
49        "//tensorflow/compiler/xla:util",
50        "//tensorflow/core:lib",
51        "@com_google_absl//absl/types:span",
52    ],
53)
54
55tf_cc_test(
56    name = "padding_test",
57    srcs = ["padding_test.cc"],
58    deps = [
59        ":padding",
60        "//tensorflow/core:test",
61        "//tensorflow/core:test_main",
62    ],
63)
64
65cc_library(
66    name = "client",
67    srcs = ["client.cc"],
68    hdrs = ["client.h"],
69    deps = [
70        ":global_data",
71        ":xla_computation",
72        "//tensorflow/compiler/xla:debug_options_flags",
73        "//tensorflow/compiler/xla:execution_options_util",
74        "//tensorflow/compiler/xla:literal",
75        "//tensorflow/compiler/xla:service_interface",
76        "//tensorflow/compiler/xla:status_macros",
77        "//tensorflow/compiler/xla:statusor",
78        "//tensorflow/compiler/xla:types",
79        "//tensorflow/compiler/xla:xla_data_proto_cc",
80        "//tensorflow/compiler/xla:xla_proto_cc",
81        "//tensorflow/compiler/xla/service:hlo_proto_cc",
82        "//tensorflow/core:lib",
83        "@com_google_absl//absl/memory",
84        "@com_google_absl//absl/strings",
85        "@com_google_absl//absl/types:optional",
86        "@com_google_absl//absl/types:span",
87    ],
88)
89
90cc_library(
91    name = "executable_build_options",
92    srcs = ["executable_build_options.cc"],
93    hdrs = ["executable_build_options.h"],
94    deps = [
95        "//tensorflow/compiler/xla:debug_options_flags",
96        "//tensorflow/compiler/xla:shape_util",
97        "//tensorflow/compiler/xla:util",
98        "//tensorflow/compiler/xla:xla_data_proto_cc",
99        "//tensorflow/compiler/xla:xla_proto_cc",
100        "//tensorflow/stream_executor:device_memory_allocator",
101        "@com_google_absl//absl/strings",
102        "@com_google_absl//absl/strings:str_format",
103        "@com_google_absl//absl/types:optional",
104    ],
105)
106
107cc_library(
108    name = "local_client",
109    srcs = ["local_client.cc"],
110    hdrs = ["local_client.h"],
111    deps = [
112        ":client",
113        ":executable_build_options",
114        ":xla_computation",
115        "//tensorflow/compiler/xla:executable_run_options",
116        "//tensorflow/compiler/xla:shape_tree",
117        "//tensorflow/compiler/xla:status_macros",
118        "//tensorflow/compiler/xla:statusor",
119        "//tensorflow/compiler/xla:xla_data_proto_cc",
120        "//tensorflow/compiler/xla/service:backend",
121        "//tensorflow/compiler/xla/service:compiler",
122        "//tensorflow/compiler/xla/service:dump",
123        "//tensorflow/compiler/xla/service:executable",
124        "//tensorflow/compiler/xla/service:hlo_proto_cc",
125        "//tensorflow/compiler/xla/service:local_service",
126        "//tensorflow/compiler/xla/service:maybe_owning_device_memory",
127        "//tensorflow/compiler/xla/service:shaped_buffer",
128        "//tensorflow/compiler/xla/service:source_map_util",
129        "//tensorflow/compiler/xla/service:stream_pool",
130        "//tensorflow/core:stream_executor_no_cuda",
131        "//tensorflow/stream_executor:device_memory_allocator",
132        "@com_google_absl//absl/memory",
133        "@com_google_absl//absl/types:span",
134        "@llvm-project//llvm:support",
135    ],
136)
137
138cc_library(
139    name = "compile_only_client",
140    srcs = ["compile_only_client.cc"],
141    hdrs = ["compile_only_client.h"],
142    deps = [
143        ":client",
144        ":xla_computation",
145        "//tensorflow/compiler/xla:status_macros",
146        "//tensorflow/compiler/xla:statusor",
147        "//tensorflow/compiler/xla:xla_data_proto_cc",
148        "//tensorflow/compiler/xla/service:compile_only_service",
149        "//tensorflow/compiler/xla/service:compiler",
150        "//tensorflow/core:stream_executor_no_cuda",
151        "@com_google_absl//absl/memory",
152        "@llvm-project//llvm:support",
153    ],
154)
155
156# This target is used to instantiate the XLA service in-process and create
157# a client for it.
158cc_library(
159    name = "client_library",
160    srcs = ["client_library.cc"],
161    hdrs = ["client_library.h"],
162    deps = [
163        ":compile_only_client",
164        ":local_client",
165        "//tensorflow/compiler/xla:status_macros",
166        "//tensorflow/compiler/xla:statusor",
167        "//tensorflow/compiler/xla:types",
168        "//tensorflow/compiler/xla:util",
169        "//tensorflow/compiler/xla/service:backend",
170        "//tensorflow/compiler/xla/service:compile_only_service",
171        "//tensorflow/compiler/xla/service:local_service",
172        "//tensorflow/compiler/xla/service:platform_util",
173        "//tensorflow/core:lib",
174        "//tensorflow/core:stream_executor_no_cuda",
175        "//tensorflow/stream_executor:device_memory_allocator",
176        "@com_google_absl//absl/memory",
177        "@com_google_absl//absl/types:optional",
178    ],
179)
180
181cc_library(
182    name = "sharding_builder",
183    srcs = ["sharding_builder.cc"],
184    hdrs = ["sharding_builder.h"],
185    deps = [
186        "//tensorflow/compiler/xla:array",
187        "//tensorflow/compiler/xla:shape_tree",
188        "//tensorflow/compiler/xla:shape_util",
189        "//tensorflow/compiler/xla:types",
190        "//tensorflow/compiler/xla:util",
191        "//tensorflow/compiler/xla:xla_data_proto_cc",
192    ],
193)
194
195cc_library(
196    name = "xla_computation",
197    srcs = ["xla_computation.cc"],
198    hdrs = ["xla_computation.h"],
199    visibility = ["//visibility:public"],
200    deps = [
201        "//tensorflow/compiler/xla:shape_util",
202        "//tensorflow/compiler/xla:status_macros",
203        "//tensorflow/compiler/xla:util",
204        "//tensorflow/compiler/xla:xla_data_proto_cc",
205        "//tensorflow/compiler/xla/service:hlo_proto_cc",
206        "@com_google_absl//absl/memory",
207    ],
208)
209
210cc_library(
211    name = "xla_builder",
212    srcs = ["xla_builder.cc"],
213    hdrs = ["xla_builder.h"],
214    visibility = ["//visibility:public"],
215    deps = [
216        ":padding",
217        ":sharding_builder",
218        ":xla_computation",
219        "//tensorflow/compiler/xla:comparison_util",
220        "//tensorflow/compiler/xla:execution_options_util",
221        "//tensorflow/compiler/xla:literal",
222        "//tensorflow/compiler/xla:literal_util",
223        "//tensorflow/compiler/xla:shape_util",
224        "//tensorflow/compiler/xla:status_macros",
225        "//tensorflow/compiler/xla:statusor",
226        "//tensorflow/compiler/xla:types",
227        "//tensorflow/compiler/xla:util",
228        "//tensorflow/compiler/xla:xla_data_proto_cc",
229        "//tensorflow/compiler/xla/service:hlo",
230        "//tensorflow/compiler/xla/service:hlo_proto_cc",
231        "//tensorflow/compiler/xla/service:shape_inference",
232        "//tensorflow/core:lib",
233        "@com_google_absl//absl/algorithm:container",
234        "@com_google_absl//absl/container:flat_hash_map",
235        "@com_google_absl//absl/container:flat_hash_set",
236        "@com_google_absl//absl/memory",
237        "@com_google_absl//absl/strings",
238        "@com_google_absl//absl/types:span",
239    ],
240)
241
242tf_cc_test(
243    name = "xla_builder_test",
244    srcs = ["xla_builder_test.cc"],
245    deps = [
246        ":xla_builder",
247        ":xla_computation",
248        "//tensorflow/compiler/xla:debug_options_flags",
249        "//tensorflow/compiler/xla:literal",
250        "//tensorflow/compiler/xla:shape_util",
251        "//tensorflow/compiler/xla:status_macros",
252        "//tensorflow/compiler/xla:test",
253        "//tensorflow/compiler/xla:test_helpers",
254        "//tensorflow/compiler/xla:util",
255        "//tensorflow/compiler/xla:xla_data_proto_cc",
256        "//tensorflow/compiler/xla/service:hlo",
257        "//tensorflow/compiler/xla/service:hlo_matchers",
258        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
259        "//tensorflow/core:test",
260    ],
261)
262