diff --git a/tensorflow/compiler/xla/service/cpu/cpu_executable.cc b/tensorflow/compiler/xla/service/cpu/cpu_executable.cc index 4dba87f4990..f62353bee7b 100644 --- a/tensorflow/compiler/xla/service/cpu/cpu_executable.cc +++ b/tensorflow/compiler/xla/service/cpu/cpu_executable.cc @@ -234,7 +234,7 @@ Status CpuExecutable::ExecuteComputeFunction( for (auto hlo_prof_idx : hlo_to_profile_idx_) { const HloInstruction* hlo = hlo_prof_idx.first; uint64 cycles_taken = profile_counters[hlo_prof_idx.second]; - hlo_execution_profile->AddProfileResult(hlo, cycles_taken); + hlo_execution_profile->SetCyclesTakenBy(hlo, cycles_taken); } } return Status::OK(); diff --git a/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc b/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc index adedc1c37fd..8c443b1409d 100644 --- a/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc +++ b/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc @@ -463,7 +463,7 @@ Status ParallelCpuExecutable::ExecuteComputeFunctions( for (auto hlo_prof_idx : hlo_to_profile_idx_) { const HloInstruction* hlo = hlo_prof_idx.first; uint64 cycles_taken = profile_counters[hlo_prof_idx.second]; - hlo_execution_profile->AddProfileResult(hlo, cycles_taken); + hlo_execution_profile->SetCyclesTakenBy(hlo, cycles_taken); } } diff --git a/tensorflow/compiler/xla/service/gpu/gpu_executable.cc b/tensorflow/compiler/xla/service/gpu/gpu_executable.cc index 2c4d5150741..254d0d77056 100644 --- a/tensorflow/compiler/xla/service/gpu/gpu_executable.cc +++ b/tensorflow/compiler/xla/service/gpu/gpu_executable.cc @@ -88,7 +88,7 @@ class HloExecutionProfiler { if (do_profile_) { stream_->ThenStopTimer(per_op_timer_.get()); stream_->BlockHostUntilDone(); - profile_->AddProfileResult( + profile_->SetCyclesTakenBy( hlo_instruction, per_op_timer_->Nanoseconds() * clock_rate_ghz_); } } diff --git a/tensorflow/compiler/xla/service/hlo_execution_profile.cc b/tensorflow/compiler/xla/service/hlo_execution_profile.cc index eaeb352183b..bf19bc9309b 100644 --- a/tensorflow/compiler/xla/service/hlo_execution_profile.cc +++ b/tensorflow/compiler/xla/service/hlo_execution_profile.cc @@ -27,13 +27,13 @@ limitations under the License. namespace xla { -void HloExecutionProfile::AddProfileResult(const HloInstruction* hlo, +void HloExecutionProfile::SetCyclesTakenBy(const HloInstruction* hlo, uint64 cycles_taken) { hlo_to_cycles_taken_[hlo] = cycles_taken; profiled_computations_.insert(hlo->parent()); } -uint64 HloExecutionProfile::GetProfileResult(const HloInstruction& hlo) const { +uint64 HloExecutionProfile::GetCyclesTakenBy(const HloInstruction& hlo) const { auto iter = hlo_to_cycles_taken_.find(&hlo); if (iter == hlo_to_cycles_taken_.end()) { return 0; diff --git a/tensorflow/compiler/xla/service/hlo_execution_profile.h b/tensorflow/compiler/xla/service/hlo_execution_profile.h index a980c1617f3..cdce77cff42 100644 --- a/tensorflow/compiler/xla/service/hlo_execution_profile.h +++ b/tensorflow/compiler/xla/service/hlo_execution_profile.h @@ -36,11 +36,11 @@ class HloExecutionProfile { using DeviceDescription = perftools::gputools::DeviceDescription; // Record how many cycles this HLO took to execute. - void AddProfileResult(const HloInstruction* hlo, uint64 cycles_taken); + void SetCyclesTakenBy(const HloInstruction* hlo, uint64 cycles_taken); // Returns how many cycles this HLO took to execute. Profiling information // may not be available for some instructions in which case zero is returned. - uint64 GetProfileResult(const HloInstruction& hlo) const; + uint64 GetCyclesTakenBy(const HloInstruction& hlo) const; // Return the number of cycles this computation took to execute. uint64 total_cycles_executed(const HloComputation& computation) const { diff --git a/tensorflow/compiler/xla/service/hlo_graph_dumper.cc b/tensorflow/compiler/xla/service/hlo_graph_dumper.cc index d7bdd4117d9..5f13cf67ad9 100644 --- a/tensorflow/compiler/xla/service/hlo_graph_dumper.cc +++ b/tensorflow/compiler/xla/service/hlo_graph_dumper.cc @@ -1070,7 +1070,7 @@ string HloDotDumper::GetInstructionNodeExtraInfo(const HloInstruction* instr) { lines.push_back(Printf("[%p]", instr)); } if (profile_ != nullptr) { - double hlo_cycles_executed = profile_->GetProfileResult(*instr); + double hlo_cycles_executed = profile_->GetCyclesTakenBy(*instr); double total_cycles_executed = profile_->total_cycles_executed(*instr->parent()); if (hlo_cycles_executed > 0 && total_cycles_executed > 0) {