Added comment to all-reduce simplifier.

PiperOrigin-RevId: 282757340
Change-Id: I10f79c315dcd97cad2c28720f9797929d1d2ead0
This commit is contained in:
Davide Libenzi 2019-11-27 06:27:24 -08:00 committed by TensorFlower Gardener
parent 6fa83d70b7
commit d81dc812bd

View File

@ -34,6 +34,9 @@ StatusOr<bool> AllReduceSimplifier::Run(HloModule* module) {
for (HloInstruction* inst : computation->MakeInstructionPostOrder()) {
if (!inst->shape().IsArray()) {
// We currently do not change tuple-shaped all-reduce.
// Until XLA will support Token fed AllReduce(), the PyTorch client code
// uses a fake data token (constant) which relies on this pass to not
// optimize out (being fed within a tuple input).
continue;
}
if (inst->IsCrossReplicaAllReduce() &&