Isha Arkatkar 79cd2fd4ac Update check for multiple devices found to check whether there is a single device colocated with the default_device.
If multiple devices are found in the cluster, but there is a single device colocated with default_device, the single colocated device would be used by placer. This change relaxes the current check to account for parent device scope.

For example,
@tf.function()
def replica_fn()
  with tf.device("gpu:0")

with tf.device("worker1"):
   replica_fn()

In this case there may be multiple gpu:0 in the cluster, but gpu:0 on worker 1 should be picked. In this case, we should not receive multiple devices found error.

PiperOrigin-RevId: 357996270
Change-Id: I6a19deb5f26d7741ba7f7adff7f14550679b3d6d
2021-02-17 11:48:37 -08:00
..
2021-02-09 14:03:25 -08:00