Skip to content

Commit

Permalink
Ensure only AsyncStart defines the output.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 681066552
  • Loading branch information
Google-ML-Automation committed Oct 1, 2024
1 parent 43a6d82 commit 869808b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions xla/service/latency_hiding_scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ bool InstructionDefinesValue(const HloInstruction* instruction,
}
// Also check if the instruction is a call to a computation that defines the
// value. This is needed in cases, e.g., where we wrap a value-defining
// instruction in a async call for offloading, and the async call itself will
// instruction in a async call for offloading, and the async start itself will
// effectively define the value in the current scope that the scheduler is
// running in.
if (instruction->opcode() == HloOpcode::kAsyncStart ||
instruction->opcode() == HloOpcode::kAsyncDone) {
if (instruction->opcode() == HloOpcode::kAsyncStart) {
if (instruction->async_wrapped_opcode() == HloOpcode::kCall) {
return instruction->async_wrapped_instruction()
->called_computations()[0]
Expand All @@ -114,8 +113,7 @@ bool InstructionFirstDefinesBuffer(
}
// Similar to logic above, also check if the instruction is a call to a
// computation that defines the value.
if (instruction->opcode() == HloOpcode::kAsyncStart ||
instruction->opcode() == HloOpcode::kAsyncDone) {
if (instruction->opcode() == HloOpcode::kAsyncStart) {
if (instruction->async_wrapped_opcode() == HloOpcode::kCall) {
return instruction->async_wrapped_instruction()
->called_computations()[0]
Expand Down

0 comments on commit 869808b

Please sign in to comment.