Add more debugging output for XLA send/recv.

PiperOrigin-RevId: 171041978
This commit is contained in:
A. Unique TensorFlower 2017-10-04 11:58:40 -07:00 committed by TensorFlower Gardener
parent 23992bb091
commit 0578dd65ec
2 changed files with 12 additions and 2 deletions

View File

@ -69,7 +69,10 @@ Status ChannelTracker::RegisterSendInternal(const ChannelHandle& handle) {
}
Channel& channel = opaque_to_channel_[handle.handle()];
if (channel.has_sender) {
return FailedPrecondition("channel handle is already used by a sender");
return FailedPrecondition(
"when registering send, passed a channel handle that is already used "
"by a sender: %lld",
handle.handle());
}
channel.has_sender = true;
return Status::OK();
@ -82,7 +85,10 @@ Status ChannelTracker::RegisterRecvInternal(const ChannelHandle& handle) {
Channel& channel = opaque_to_channel_[handle.handle()];
// TODO(b/33942691): Allow more than 1 receivers for broadcast.
if (channel.receiver_count >= 1) {
return FailedPrecondition("channel handle is already used by a receiver");
return FailedPrecondition(
"when registering recv, passed a channel handle that is already used "
"by a receiver: %lld",
handle.handle());
}
channel.receiver_count += 1;
return Status::OK();

View File

@ -1702,6 +1702,10 @@ std::vector<string> HloInstruction::ExtraAttributesToString() const {
})));
}
if (opcode() == HloOpcode::kSend || opcode() == HloOpcode::kRecv) {
extra.push_back(StrCat("channel_id=", channel_id_));
}
if (opcode() == HloOpcode::kGetTupleElement) {
extra.push_back(StrCat("index=", tuple_index()));
}