Skip to content

Commit 4ebf887

Browse files
[Automated Commit] Format Codebase
1 parent f0b08f2 commit 4ebf887

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

tools/submission/generate_final_report.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ def main():
101101
"singlestream": "SingleStream",
102102
"multistream": "MultiStream",
103103
"server": "Server",
104-
"interactive":"Interactive",
104+
"interactive": "Interactive",
105105
"offline": "Offline",
106106
}
107-
df["Scenario"] = df["Scenario"].apply(lambda x: scenario_map.get(str(x).lower(), x))
108-
107+
df["Scenario"] = df["Scenario"].apply(
108+
lambda x: scenario_map.get(str(x).lower(), x))
109109

110110
output = args.input[:-4]
111111
writer = pd.ExcelWriter(output + ".xlsx", engine="xlsxwriter")

tools/submission/submission_checker/checks/performance_check.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ def missing_check(self):
8585
self.log.error("Performance log missing at %s", self.path)
8686
return False
8787
return True
88-
88+
8989
def scenarios_check(self):
9090
if self.submission_logs.loader_data.get("check_scenarios", False):
9191
return True
9292
else:
93-
missing_scenarios = self.submission_logs.loader_data.get("missing_scenarios", [])
94-
unknown_scenarios = self.submission_logs.loader_data.get("unknown_scenarios", [])
93+
missing_scenarios = self.submission_logs.loader_data.get(
94+
"missing_scenarios", [])
95+
unknown_scenarios = self.submission_logs.loader_data.get(
96+
"unknown_scenarios", [])
9597
if len(missing_scenarios) > 0:
9698
self.log.error(
9799
"%s does not have all required scenarios, missing %s",
@@ -116,7 +118,8 @@ def loadgen_errors_check(self):
116118
bool: True if no blocking Loadgen errors are present,
117119
False otherwise.
118120
"""
119-
compliance_skip = self.submission_logs.loader_data.get("compliance_skip", False)
121+
compliance_skip = self.submission_logs.loader_data.get(
122+
"compliance_skip", False)
120123
if self.mlperf_log.has_error():
121124
has_critical_errors = False
122125
if self.config.ignore_uncommited:
@@ -127,7 +130,7 @@ def loadgen_errors_check(self):
127130
):
128131
has_critical_errors = True
129132
if (
130-
not compliance_skip
133+
not compliance_skip
131134
and "Multiple conf files are used" in error["value"]
132135
):
133136
has_critical_errors = True
@@ -454,7 +457,7 @@ def inferred_check(self):
454457
("singlestream", "offline")
455458
]
456459
if (self.scenario.lower(), self.scenario_fixed.lower()
457-
) not in list_inferred:
460+
) not in list_inferred:
458461
self.log.error(
459462
"Result for scenario %s can not be inferred from %s for: %s",
460463
self.scenario_fixed,
@@ -543,12 +546,12 @@ def get_inferred_result(self, res):
543546
res = qps_wo_loadgen_overhead
544547

545548
if (self.scenario_fixed in ["Offline"]
546-
) and self.scenario in ["MultiStream"]:
549+
) and self.scenario in ["MultiStream"]:
547550
inferred = True
548551
res = samples_per_query * S_TO_MS / (latency_mean / MS_TO_NS)
549552

550553
if (self.scenario_fixed in ["MultiStream"]
551-
) and self.scenario in ["SingleStream"]:
554+
) and self.scenario in ["SingleStream"]:
552555
inferred = True
553556
# samples_per_query does not match with the one reported in the logs
554557
# when inferring MultiStream from SingleStream
@@ -565,6 +568,6 @@ def get_inferred_result(self, res):
565568
else:
566569
res = (latency_99_percentile * samples_per_query) / MS_TO_NS
567570
if (self.scenario_fixed in ["Interactive"]
568-
) and self.scenario not in ["Server"]:
571+
) and self.scenario not in ["Server"]:
569572
is_valid = False
570573
return res, is_valid

tools/submission/submission_checker/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,12 +1132,12 @@
11321132
"84",
11331133
"59",
11341134
"12",
1135-
"31",
1135+
"31",
11361136
"86",
1137-
"122",
1138-
"233",
1137+
"122",
1138+
"233",
11391139
"96",
1140-
]
1140+
]
11411141
},
11421142
}
11431143
}

tools/submission/submission_checker/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,19 @@ def is_number(s):
112112
return True
113113
except ValueError:
114114
return False
115-
115+
116+
116117
def lower_list(l):
117118
return [str(e).lower() for e in l]
118119

120+
119121
def contains_list(l1, l2):
120122
# Check if l1 contains all elements of l2
121123
missing = []
122124
for e in l2:
123125
if e not in l1:
124126
missing.append(e)
125-
return missing, len(missing) == 0
127+
return missing, len(missing) == 0
126128

127129

128130
def get_performance_metric(
@@ -322,7 +324,7 @@ def get_power_metric(config, scenario_fixed, log_path, is_valid, res):
322324
samples_per_query = 8
323325

324326
if (scenario_fixed in ["MultiStream"]
325-
) and scenario in ["SingleStream"]:
327+
) and scenario in ["SingleStream"]:
326328
power_metric = (
327329
avg_power * power_duration * samples_per_query * 1000 / num_queries
328330
)

0 commit comments

Comments
 (0)