message: show breakdown of execution cost with compute and memory cost for op summarization
diff: @@ -850,14 +850,16 @@ Costs VirtualScheduler::Summary() const {
  VLOG(1) << "Expected max per-op streaming buffers: "
  << graph_costs_.max_per_op_streaming;
  - VLOG(1) << "Per-op execution time:";
  + VLOG(1) << "Per-op execution time / compute time / memory time:";
  for (const auto& op_cost_pair : op_to_cost_) {
  const auto& op = op_cost_pair.first;
  const auto& cost = op_cost_pair.second.execution_time.count();
  + const auto& compute_cost = op_cost_pair.second.compute_time.count();
  + const auto& memory_cost = op_cost_pair.second.memory_time.count();
  const bool is_op_cost_accurate = !op_cost_pair.second.inaccurate;
  if (cost) { // Skip printing out zero-cost ops.
  VLOG(1) << " + " << op << " : " << (is_op_cost_accurate ? "" : "~")
  - << cost;
  + << cost << " / " << compute_cost << " / " << memory_cost;
  }
  }
  @@ -898,7 +900,8 @@ Costs VirtualScheduler::Summary() const {
  << ", at the end: "
  << strings::HumanReadableNumBytes(state.memory_usage);
  - VLOG(1) << "Per-op execution time (and memory usage at peak memory usage):";
  + VLOG(1) << "Per-op execution time compute time / memory time "
  + "(and memory usage at peak memory usage):";
  // Profile non-persistent op memory usage.
  for (const auto& node_port : state.mem_usage_snapshot_at_peak) {
  @@ -912,6 +915,8 @@ Costs VirtualScheduler::Summary() const {
  for (const auto& op_cost_pair : state.op_to_cost) {
  const auto& op = op_cost_pair.first;
  const auto& cost = op_cost_pair.second.execution_time.count();
  + const auto& compute_cost = op_cost_pair.second.compute_time.count();
  + const auto& memory_cost = op_cost_pair.second.memory_time.count();
  total_compute_time_ns += op_cost_pair.second.execution_time;
  const bool is_op_cost_accurate = !op_cost_pair.second.inaccurate;
  if (!is_op_cost_accurate) {
  @@ -930,8 +935,9 @@ Costs VirtualScheduler::Summary() const {
  if (cost || mem_usage_percent > 1.0) {
  // Print out only non-zero cost ops or ops with > 1% memory usage.
  VLOG(1) << " + " << op << " : " << (is_op_cost_accurate ? "" : "~")
  - << cost << " (" << strings::HumanReadableNumBytes(op_mem_usage)
  - << " [" << mem_usage_percent << "%] "
  + << cost << " / " << compute_cost << " / " << memory_cost << " ("
  + << strings::HumanReadableNumBytes(op_mem_usage) << " ["
  + << mem_usage_percent << "%] "
  << (persisent_ops.count(op) > 0 ? ": persistent op)" : ")");
  }
  }
  