@@ -27,7 +27,7 @@ limitations under the License.
27
27
#include " tensorflow/compiler/tf2xla/xla_compiler.h"
28
28
#include " tensorflow/compiler/tf2xla/xla_op_registry.h"
29
29
#include " tensorflow/compiler/xla/client/client_library.h"
30
- #include " tensorflow/compiler/xla/client/local_client .h"
30
+ #include " tensorflow/compiler/xla/client/compile_only_client .h"
31
31
#include " tensorflow/compiler/xla/service/compiler.h"
32
32
#include " tensorflow/compiler/xla/service/cpu/cpu_compiler.h"
33
33
#include " tensorflow/compiler/xla/shape_util.h"
@@ -274,7 +274,8 @@ Status CreateXlaArgs(const Graph& graph,
274
274
275
275
// Converts the TensorFlow graph into an XLA computation, by executing the
276
276
// graph symbolically, with each op building up the XLA HLO.
277
- Status ConvertGraphToXla (xla::LocalClient* client, std::unique_ptr<Graph> graph,
277
+ Status ConvertGraphToXla (xla::CompileOnlyClient* client,
278
+ std::unique_ptr<Graph> graph,
278
279
xla::Computation* computation, bool * has_context_arg) {
279
280
// Create a device and context to convert the graph into an XLA computation.
280
281
XlaOpRegistry::RegisterCompilationKernels ();
@@ -333,7 +334,8 @@ Status ConvertGraphToXla(xla::LocalClient* client, std::unique_ptr<Graph> graph,
333
334
}
334
335
335
336
// Compiles the XLA computation into executable code.
336
- Status CompileXla (xla::LocalClient* client, const xla::Computation& computation,
337
+ Status CompileXla (xla::CompileOnlyClient* client,
338
+ const xla::Computation& computation,
337
339
const xla::cpu::CpuAotCompilationOptions& aot_opts,
338
340
CompileResult* compile_result) {
339
341
// Retrieves arg and result layouts from the computation.
@@ -350,7 +352,7 @@ Status CompileXla(xla::LocalClient* client, const xla::Computation& computation,
350
352
for (int i = 0 ; i < pshape->parameters_size (); ++i) {
351
353
arg_layouts.push_back (pshape->mutable_parameters (i));
352
354
}
353
- xla::LocalClient::AheadOfTimeComputationInstance instance;
355
+ xla::CompileOnlyClient::AotComputationInstance instance;
354
356
instance.computation = &computation;
355
357
instance.argument_layouts = std::move (arg_layouts);
356
358
instance.result_layout = &pshape->result ();
@@ -365,7 +367,7 @@ Status CompileXla(xla::LocalClient* client, const xla::Computation& computation,
365
367
std::move (aot_or.ValueOrDie ().back ()));
366
368
compile_result->entry_point = aot_opts.entry_point_name ();
367
369
compile_result->pointer_size =
368
- xla::LocalClient ::PointerSizeForTriple (aot_opts.triple ());
370
+ xla::CompileOnlyClient ::PointerSizeForTriple (aot_opts.triple ());
369
371
return Status::OK ();
370
372
}
371
373
@@ -394,8 +396,9 @@ Status CompileGraph(std::unique_ptr<Graph> graph, const MainFlags& flags,
394
396
namespace gpu = perftools::gputools;
395
397
gpu::Platform* cpu_platform =
396
398
gpu::MultiPlatformManager::PlatformWithName (" Host" ).ValueOrDie ();
397
- xla::LocalClient* client =
398
- xla::ClientLibrary::GetOrCreateLocalClient (cpu_platform).ValueOrDie ();
399
+ xla::CompileOnlyClient* client =
400
+ xla::ClientLibrary::GetOrCreateCompileOnlyClient (cpu_platform)
401
+ .ValueOrDie ();
399
402
xla::Computation computation;
400
403
TF_RETURN_IF_ERROR (ConvertGraphToXla (client, std::move (graph), &computation,
401
404
&compile_result->has_context_arg ));
0 commit comments