Skip to content

Commit

Permalink
Add DutyCycleAnalysis for TPUs to OpStats.
Browse files Browse the repository at this point in the history
Fix DutyCycleTracker bugs with idleness and duplicate active times.

PiperOrigin-RevId: 714257416
  • Loading branch information
bmass02 authored and Google-ML-Automation committed Jan 11, 2025
1 parent 0947e8e commit 4caf6e4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xla/tsl/profiler/convert/xla_op_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ inline bool MayHaveInnerOps(absl::string_view category) {
category == kHloWhile || category == kHloMegacoreFusion;
}

inline bool IsOffDutyOp(absl::string_view category) {
return (category == tsl::profiler::kHloInfeed ||
category == tsl::profiler::kHloOutfeed ||
category == tsl::profiler::kHloHostSend ||
category == tsl::profiler::kHloHostSendDone ||
category == tsl::profiler::kHloHostRecv ||
category == tsl::profiler::kHloHostRecvDone ||
category ==
tsl::profiler::kHloMegacoreFusion // Only self-time in megacore
// fusion is off-duty. The op
// time of children is on-duty.
);
}

} // namespace profiler
} // namespace tsl

Expand Down

0 comments on commit 4caf6e4

Please sign in to comment.