Skip to content

Commit

Permalink
Set power_measurement_stop to last measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
pgmpablo157321 committed May 21, 2024
1 parent ced0239 commit 4054425
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mlperf_logging/result_summarizer/result_summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -527,13 +528,15 @@ 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
if logline.key == "conversion_eff":
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

Expand Down

0 comments on commit 4054425

Please sign in to comment.