Skip to content

Commit

Permalink
Temporarily disable host memory offload of tensors which have a tuple…
Browse files Browse the repository at this point in the history
… as a direct user.

PiperOrigin-RevId: 565802826
  • Loading branch information
SandSnip3r authored and copybara-github committed Sep 15, 2023
1 parent 1bbd88f commit de6e187
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions xla/service/hlo_rematerialization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1694,12 +1694,21 @@ std::optional<int64_t> MemoryUsageTracker::GetCostOfHostOffload(
return {};
}

// TODO(b/291823800): Bitcasts complicate things. Skip for now.
// TODO(b/291823800): Bitcasts and tuples complicate things. Skip for now.
for (auto buffer_id : candidate_item->buffers_defined) {
for (auto use : buffers_.at(buffer_id).users) {
if (use.user->instruction->opcode() == HloOpcode::kBitcast) {
VLOG(3) << " " << candidate_item->instruction->name()
<< " has a user which is a bitcast instruction; cannot offload "
<< " has a user which is a bitcast instruction("
<< use.user->instruction->name()
<< "); cannot offload "
"to host.";
return {};
} else if (use.user->instruction->opcode() == HloOpcode::kTuple) {
VLOG(3) << " " << candidate_item->instruction->name()
<< " has a user which is a tuple instruction("
<< use.user->instruction->name()
<< "); cannot offload "
"to host.";
return {};
}
Expand Down

0 comments on commit de6e187

Please sign in to comment.