MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ToString

Method ToString

tensorflow/compiler/xla/service/hlo_rematerialization.cc:1022–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020}
1021
1022string MemoryUsageTracker::ToString() const {
1023 string output =
1024 absl::StrCat("MemoryUsageTracker for ", computation_->name(), "\n");
1025 absl::StrAppend(&output,
1026 "Memory usage: ", HumanReadableNumBytes(memory_usage()), " (",
1027 memory_usage(), " bytes)");
1028 for (auto* item = instruction_list_.first(); item != nullptr;
1029 item = instruction_list_.next(item)) {
1030 const HloInstruction* instruction = item->instruction;
1031 string inprogress = item == in_progress_item_ ? " in-progress" : "";
1032 string placed = item->placed ? " placed" : "";
1033 absl::StrAppend(&output, " ", instruction->name(), inprogress, placed,
1034 "\n Defines:\n");
1035 for (BufferId buffer_id : item->buffers_defined) {
1036 const Buffer& buffer = buffers_[buffer_id];
1037 string live = IsCurrentlyLive(buffer_id) ? " live" : "";
1038 absl::StrAppend(&output, " ", buffer.ToString(), live, ", ",
1039 buffer.unfinished_user_count, " unfinished uses\n");
1040 }
1041 absl::StrAppend(&output, " Uses:\n");
1042 for (BufferId buffer_id : item->buffers_used) {
1043 absl::StrAppend(&output, " ", buffers_[buffer_id].ToString(), "\n");
1044 }
1045 }
1046 return output;
1047}
1048
1049StatusOr<Shape> MemoryUsageTracker::GetCompactShape(const HloInstruction* hlo) {
1050 auto it = compact_shape_.find(hlo);

Callers 7

MemoryUsageTrackerClass · 0.45
BeginInstructionMethod · 0.45
EndInstructionMethod · 0.45
CheckMethod · 0.45
CompressInstructionFunction · 0.45
RunMethod · 0.45

Calls 6

nameMethod · 0.65
StrCatFunction · 0.50
StrAppendFunction · 0.50
HumanReadableNumBytesFunction · 0.50
firstMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected