Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timezone shift in submission checker for power parsing because timestamps are all in UTC now #995

Open
wants to merge 1 commit into
base: r1.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions tools/submission/submission-checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def check_performance_dir(config, model, path, scenario_fixed):
return is_valid, res, inferred


def check_power_dir(power_path, ranging_path, testing_path, scenario_fixed, more_power_check=False):
def check_power_dir(power_path, ranging_path, testing_path, scenario_fixed, version, more_power_check=False):

is_valid = True
power_metric = 0
Expand All @@ -837,12 +837,18 @@ def check_power_dir(power_path, ranging_path, testing_path, scenario_fixed, more
is_valid = False

# parse the power logs
server_json_fname = os.path.join(power_path, "server.json")
with open(server_json_fname) as f:
server_timezone = datetime.timedelta(seconds=json.load(f)["timezone"])
client_json_fname = os.path.join(power_path, "client.json")
with open(client_json_fname) as f:
client_timezone = datetime.timedelta(seconds=json.load(f)["timezone"])
if version in ["v1.0"]:
server_json_fname = os.path.join(power_path, "server.json")
with open(server_json_fname) as f:
server_timezone = datetime.timedelta(seconds=json.load(f)["timezone"])
client_json_fname = os.path.join(power_path, "client.json")
with open(client_json_fname) as f:
client_timezone = datetime.timedelta(seconds=json.load(f)["timezone"])
else:
# Starting from v1.1, power timestamps are always in UTC, so timezone shift is no longer needed.
server_timezone = datetime.timedelta(seconds=0)
client_timezone = datetime.timedelta(seconds=0)

detail_log_fname = os.path.join(testing_path, "mlperf_log_detail.txt")
mlperf_log = MLPerfLog(detail_log_fname)
datetime_format = '%m-%d-%Y %H:%M:%S.%f'
Expand Down Expand Up @@ -1146,7 +1152,7 @@ def log_result(submitter, available, division, system_type, system_name, system_
if has_power:
try:
ranging_path = os.path.join(name, "performance", "ranging")
power_is_valid, power_metric = check_power_dir(power_path, ranging_path, perf_path, scenario_fixed,
power_is_valid, power_metric = check_power_dir(power_path, ranging_path, perf_path, scenario_fixed, config.version,
more_power_check=config.more_power_check)
if not power_is_valid:
is_valid = False
Expand Down