From 860ae4bf391886356fe26fb565e6debee5f4c253 Mon Sep 17 00:00:00 2001 From: John Bauman Date: Thu, 6 Mar 2025 17:47:06 +0000 Subject: [PATCH] #0: Improve test_pgm_dispatch Add the current clock frequency to the output so we can detect throttling more easily. Also do CloseDevice on some early returns, so later tests that attempt to use the same device don't run into problems. --- .../perf_microbenchmark/dispatch/test_pgm_dispatch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tt_metal/tt_metal/perf_microbenchmark/dispatch/test_pgm_dispatch.cpp b/tests/tt_metal/tt_metal/perf_microbenchmark/dispatch/test_pgm_dispatch.cpp index 0d9c0eefd8f..2ca53fe3dc7 100644 --- a/tests/tt_metal/tt_metal/perf_microbenchmark/dispatch/test_pgm_dispatch.cpp +++ b/tests/tt_metal/tt_metal/perf_microbenchmark/dispatch/test_pgm_dispatch.cpp @@ -11,6 +11,7 @@ #include #include #include +#include "tt_metal/tt_metal/perf_microbenchmark/common/util.hpp" constexpr uint32_t DEFAULT_ITERATIONS = 10000; constexpr uint32_t DEFAULT_WARMUP_ITERATIONS = 100; @@ -344,12 +345,14 @@ static int pgm_dispatch(T& state, TestInfo info) { if constexpr (std::is_same_v) { state.SkipWithError("Program creation failed"); } + tt_metal::CloseDevice(device); return 1; } if (!initialize_program(info, device, program[1], info.fast_kernel_cycles)) { if constexpr (std::is_same_v) { state.SkipWithError("Program creation failed"); } + tt_metal::CloseDevice(device); return 1; } @@ -403,6 +406,7 @@ static int pgm_dispatch(T& state, TestInfo info) { if constexpr (std::is_same_v) { state.counters["IterationTime"] = benchmark::Counter( info.iterations, benchmark::Counter::kIsIterationInvariantRate | benchmark::Counter::kInvert); + state.counters["Clock"] = benchmark::Counter(get_tt_npu_clock(device), benchmark::Counter::kDefaults); } pass &= tt_metal::CloseDevice(device);