Update WorkerCacheLogger::RecordDataTransfer to not modify the details if provided.

PiperOrigin-RevId: 163761089
This commit is contained in:
A. Unique TensorFlower 2017-07-31 15:54:50 -07:00 committed by TensorFlower Gardener
parent d03ba54f72
commit 2e2a8536d7

View File

@ -102,13 +102,18 @@ void WorkerCacheLogger::RecordDataTransfer(int64 step_id, int64 start_usecs,
const string& transfer_method_name){
NodeExecStats* ns = new NodeExecStats;
ns->set_node_name(transfer_method_name);
string byte_string = strings::StrCat("[", bytes, "B] ");
if (details.empty()) {
auto byte_string = strings::StrCat("[", bytes, "B] ");
if (bytes >= 0.1 * 1048576.0) {
byte_string = strings::Printf("[%.1fMB] ", bytes / 1048576.0);
}
ns->set_timeline_label(strings::StrCat(byte_string, tensor_name, " from ",
src_device, " to ", dst_device,
details));
auto label = strings::StrCat(byte_string, tensor_name, " from ", src_device,
" to ", dst_device);
ns->set_timeline_label(label);
} else {
ns->set_timeline_label(details);
}
ns->set_all_start_micros(start_usecs);
ns->set_op_start_rel_micros(0);
int64 elapsed = end_usecs - start_usecs;
@ -122,5 +127,6 @@ void WorkerCacheLogger::RecordDataTransfer(int64 step_id, int64 start_usecs,
->mutable_allocation_description()
->set_requested_bytes(bytes);
Save(dst_device, step_id, ns);
}
}
} // namespace tensorflow