aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_module_group_metadata.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-06-11 19:09:42 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-11 19:15:39 -0700
commit5f4be37bebe0343736e800884387cc2147bc55cb (patch)
treecc15852b9bc45b64fadee9a4c8bc03adf6bc57d4 /tensorflow/compiler/xla/service/hlo_module_group_metadata.cc
parentb5fa781337ad8becaab893d001b04f2b995575b5 (diff)
Re-enable trainer TPU test.
PiperOrigin-RevId: 200151330
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_module_group_metadata.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_module_group_metadata.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_module_group_metadata.cc b/tensorflow/compiler/xla/service/hlo_module_group_metadata.cc
index 4f1715e4ca..bf33640db1 100644
--- a/tensorflow/compiler/xla/service/hlo_module_group_metadata.cc
+++ b/tensorflow/compiler/xla/service/hlo_module_group_metadata.cc
@@ -127,9 +127,14 @@ Status HloModuleGroupMetadata::VerifyCompanionSets() const {
for (HloInstruction* instruction : *companions) {
// Go through all the communicating instructions (send, recv) of the given
// companion, and record their device.
+ auto it = tracked_instructions_comms_.find(instruction);
+ if (it == tracked_instructions_comms_.end()) {
+ // Companions can be added even if they have no communicating
+ // instructions, if they are parent of companions.
+ continue;
+ }
std::unordered_set<int64> comm_devices;
- for (HloInstruction* comm_instruction :
- tracked_instructions_comms_.at(instruction)) {
+ for (HloInstruction* comm_instruction : it->second) {
auto device = GetInstructionDevice(*comm_instruction);
TF_RET_CHECK(device) << "Instruction " << comm_instruction->ToString()
<< " does not have a device";