Skip to content

Commit

Permalink
[XLA][TPU] Fix an XLA crash
Browse files Browse the repository at this point in the history
This keeps outputs of entry computation when it's fused into another
compuatation.

PiperOrigin-RevId: 637991294
  • Loading branch information
jcai19 authored and tensorflower-gardener committed Jun 11, 2024
1 parent a415715 commit a484212
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions third_party/xla/xla/hlo/ir/hlo_instructions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2365,10 +2365,12 @@ void HloFusionInstruction::MergeFusionInstructionIntoMultiOutput(
break;
}
}
if (has_outside_user) {
new_roots.insert(
FindOrDie(old_to_new, old_fusion_outputs.back().first));
if (!has_outside_user && !user->IsRoot()) {
continue;
}

new_roots.insert(
FindOrDie(old_to_new, old_fusion_outputs.back().first));
}
continue;
}
Expand Down

0 comments on commit a484212

Please sign in to comment.