Skip to content

Commit

Permalink
Limit TSL stack size to 10
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 691971293
  • Loading branch information
changm authored and Google-ML-Automation committed Oct 31, 2024
1 parent e638627 commit d5a760b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xla/service/gpu/metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ void RecordGpuCompilerStacktrace() {
stack.pop_front();
stack.pop_back();

const int kMaxStackDepth = 10;
while (stack.size() > kMaxStackDepth) {
stack.pop_back();
}

// Stack traces with addresses would make too many unique streamz cells.
// We only care about the actual call stack.
// Format chars added by tsl::CurrentStackTrace().
Expand Down

0 comments on commit d5a760b

Please sign in to comment.