Skip to content

Commit

Permalink
[XLA:HOST_OFFLOAD] Add Copy to the list of movable opcodes between ho…
Browse files Browse the repository at this point in the history
…st to

device and dynamic slice.

PiperOrigin-RevId: 610968466
  • Loading branch information
blakehechtman authored and tensorflower-gardener committed May 11, 2024
1 parent acb4ea8 commit 905c4a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions third_party/xla/xla/service/hlo_verifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,9 @@ Status ShapeVerifier::CheckShape(const HloInstruction* instruction,
}
}
}();
CHECK(equal) << "Expected instruction to have shape equal to "
<< StringifyShape(inferred_shape) << ", actual shape is "
<< StringifyShape(instruction->shape());
if (!equal) {
return Internal(
"Expected instruction to have shape equal to %s, actual "
Expand Down
3 changes: 2 additions & 1 deletion third_party/xla/xla/service/host_offloader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ absl::StatusOr<std::vector<HloInstruction*>> GetBufferUsersOfType(
// And the buffer is passed through the first operand.
// This is used to trace the graph between an annotation and its relevant slice.
bool CanTraverseOpBetweenAnnotation(HloInstruction* hlo) {
if (hlo->opcode() == HloOpcode::kBitcast) {
if (hlo->opcode() == HloOpcode::kBitcast ||
hlo->opcode() == HloOpcode::kCopy) {
return true;
} else if (hlo->opcode() == HloOpcode::kReshape) {
return ShapeUtil::ReshapeIsBitcast(hlo->operand(0)->shape(), hlo->shape());
Expand Down

0 comments on commit 905c4a6

Please sign in to comment.