From 4054425c9d2e3a990ae9ab4e21bcdd98022e6045 Mon Sep 17 00:00:00 2001 From: Pablo Gonzalez Date: Thu, 16 May 2024 15:07:08 -0500 Subject: [PATCH] Set power_measurement_stop to last measurement --- mlperf_logging/result_summarizer/result_summarizer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mlperf_logging/result_summarizer/result_summarizer.py b/mlperf_logging/result_summarizer/result_summarizer.py index 766df4c..e5fe303 100644 --- a/mlperf_logging/result_summarizer/result_summarizer.py +++ b/mlperf_logging/result_summarizer/result_summarizer.py @@ -516,6 +516,7 @@ def _compute_total_power(benchmark_folder, result_file, time_to_train, ruleset): def _compute_power_node(loglines, time_to_train): prev_timestamp = 0 + max_timestamp = 0 power_start = 0 power_stop = 0 agg_power = 0 @@ -527,6 +528,7 @@ def _compute_power_node(loglines, time_to_train): if logline.key == "power_reading": agg_power += (logline.value['value'] * (logline.timestamp - prev_timestamp)) prev_timestamp = logline.timestamp + max_timestamp = max(max_timestamp, logline.timestamp) if logline.key == "power_measurement_stop": power_stop = logline.timestamp break @@ -534,6 +536,7 @@ def _compute_power_node(loglines, time_to_train): conversion_eff = logline.value['value'] # Compute the result, convert ms to s + power_stop = max(power_stop, max_timestamp) result = conversion_eff * agg_power * time_to_train / (power_stop - power_start) / 1000 return result