Skip to content

Commit 925a377

Browse files
akuegelGoogle-ML-Automation
authored andcommitted
Add comment to explain why code is correct (NFC).
PiperOrigin-RevId: 736033271
1 parent 2e238e5 commit 925a377

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

xla/service/collective_combiner_utils.h

+3
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ absl::StatusOr<bool> CombineInstructionsByKey(
125125
// We can't combine dependent instructions.
126126
bool is_reachable =
127127
absl::c_any_of(to_combine, [&](HloInstruction* to_combine_inst) {
128+
// We don't need a call to IsConnected() here because we iterate
129+
// through instructions in topological order, which implies that
130+
// IsReachable(instruction, to_combine_inst) would return false.
128131
bool reachable =
129132
reachability->IsReachable(to_combine_inst, instruction);
130133
if (reachable) {

0 commit comments

Comments
 (0)