Add long_name field to OpMetrics

PiperOrigin-RevId: 329108530
Change-Id: Ifa7df2939dac238fe96f475df16eceb137d7d8b5
This commit is contained in:
Jose Baiocchi 2020-08-29 10:57:24 -07:00 committed by TensorFlower Gardener
parent eed8f6c094
commit 976f9b4605
3 changed files with 8 additions and 2 deletions

View File

@ -36,6 +36,9 @@ void CopyOpMetricsMetadata(const OpMetrics& src, OpMetrics* dst) {
DCHECK(dst != nullptr);
DCHECK_EQ(src.hlo_module_id(), dst->hlo_module_id());
DCHECK_EQ(src.name(), dst->name());
if (dst->long_name().empty()) {
dst->set_long_name(src.long_name());
}
if (dst->category().empty()) {
dst->set_category(src.category());
}

View File

@ -234,7 +234,8 @@ OverviewPageAnalysis ComputeAnalysisResult(const OpStats& op_stats) {
uint64 outside_compilation_device_op_time_ps = 0;
for (const OpMetrics& metrics :
op_stats.device_op_metrics_db().metrics_db()) {
if (!IsOutsideCompilationOp(metrics.provenance(), metrics.name())) continue;
if (!IsOutsideCompilationOp(metrics.provenance(), metrics.long_name()))
continue;
outside_compilation_device_op_time_ps += metrics.self_time_ps();
}
uint64 num_total_tf_ops = num_host_tf_ops + num_device_tf_ops;

View File

@ -26,12 +26,14 @@ message LayoutAnalysis {
}
// Metrics for an operation (accumulated over all occurrences).
// Next ID: 20
// Next ID: 21
message OpMetrics {
// HLO module id. 0 for TF ops.
uint64 hlo_module_id = 13;
// Name of this op.
string name = 6;
// Long name of this op (e.g., HLO expression).
string long_name = 20;
// Category of this op.
string category = 11;
// Provenance of this op (e.g., if HLO op, original TF op).