From 6d6dda807c539efd59f074ef02d52e0140480c1c Mon Sep 17 00:00:00 2001 From: Kay Zhu Date: Wed, 12 Jul 2017 14:22:54 -0700 Subject: [PATCH] [TF:XLA] Fix an issue where plugin/Executor backend is used by default when TF is built from source with XLA support. See Github issue #11122. The priority of the executor backend is set to be higher than the default (50) and CPUs (<100), and is therefore selected as the default when tf.device is not explicitly specified. PiperOrigin-RevId: 161717173 --- tensorflow/compiler/plugin/executor/device.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tensorflow/compiler/plugin/executor/device.cc b/tensorflow/compiler/plugin/executor/device.cc index bbc39dc03f8..d902f9df6a5 100644 --- a/tensorflow/compiler/plugin/executor/device.cc +++ b/tensorflow/compiler/plugin/executor/device.cc @@ -47,7 +47,12 @@ Status XlaExaDeviceFactory::CreateDevices(const SessionOptions& options, return Status::OK(); } -REGISTER_LOCAL_DEVICE_FACTORY(DEVICE_XLA_EXEC, XlaExaDeviceFactory, 110); +// Set priority to be below the default priority (50), so that Executor is not +// selected as a high priority device over other default devices. +// See constructor comments for Registrar in +// tensorflow/core/common_runtime/device_factory.h for a list of priority for +// devices. +REGISTER_LOCAL_DEVICE_FACTORY(DEVICE_XLA_EXEC, XlaExaDeviceFactory, 40); // Kernel registrations