Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 623054232
  • Loading branch information
tensorflower-gardener committed Apr 9, 2024
1 parent 2688598 commit c22cbf0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 6 additions & 4 deletions tensorflow/core/profiler/utils/derived_timeline.cc
Expand Up @@ -393,10 +393,12 @@ void DeriveEventsFromHostTrace(
device_event.AddStatValue(group_id_stat_metadata, group_id);
device_event.AddStatValue(num_launches_stat_metadata,
group_info.stat.count());
device_event.AddStatValue(max_launch_time_us_stat_metadata,
PicoToMicro(group_info.stat.max()));
device_event.AddStatValue(avg_launch_time_us_stat_metadata,
PicoToMicro(group_info.stat.avg()));
device_event.AddStatValue(
max_launch_time_us_stat_metadata,
tsl::profiler::PicoToMicro(group_info.stat.max()));
device_event.AddStatValue(
avg_launch_time_us_stat_metadata,
tsl::profiler::PicoToMicro(group_info.stat.avg()));
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/core/profiler/utils/hlo_module_map.cc
Expand Up @@ -46,7 +46,8 @@ int64_t ShapeSize(const xla::Shape& shape) {
HloInstructionWrapper::HloInstructionWrapper(
const xla::HloInstruction* instr, const xla::HloCostAnalysis* cost_analysis)
: instr_(instr),
op_full_name_(TraceMeOp(Metadata().op_name(), Metadata().op_type())) {
op_full_name_(tsl::profiler::TraceMeOp(Metadata().op_name(),
Metadata().op_type())) {
if (cost_analysis != nullptr) {
flops_ = cost_analysis->flop_count(*instr_);
bytes_accessed_ = cost_analysis->bytes_accessed(*instr_);
Expand Down
8 changes: 5 additions & 3 deletions tensorflow/core/profiler/utils/op_metrics_db_utils.cc
Expand Up @@ -253,7 +253,8 @@ OpMetricsDb XEventsOpMetricsDbBuilder::Finalize() {
}

double IdleTimeRatio(const OpMetricsDb& db) {
return 1.0 - SafeDivide(db.total_op_time_ps(), db.total_time_ps());
return 1.0 -
tsl::profiler::SafeDivide(db.total_op_time_ps(), db.total_time_ps());
}

uint64 IdleTimePs(const OpMetricsDb& db) {
Expand All @@ -278,8 +279,9 @@ absl::optional<double> HostInfeedEnqueueRatio(const OpMetricsDb& db) {
if (db.total_host_infeed_enq_start_timestamp_ps_diff() > 0) {
// We use total_host_infeed_enq_start_timestamp_ps_diff to approximate the
// total host time.
return SafeDivide(db.total_host_infeed_enq_duration_ps(),
db.total_host_infeed_enq_start_timestamp_ps_diff());
return tsl::profiler::SafeDivide(
db.total_host_infeed_enq_duration_ps(),
db.total_host_infeed_enq_start_timestamp_ps_diff());
}
return absl::nullopt;
}
Expand Down

0 comments on commit c22cbf0

Please sign in to comment.