Skip to content

Commit

Permalink
[benchmarks] Guard empty metrics on verifier runs. (pytorch#7809)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysiraichi authored Aug 8, 2024
1 parent b4335f8 commit 9fbd64a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmarks/result_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def extract_metrics_jsonl(self, file: str):

if "error" not in dataline["metrics"]:
d["dimensions"]["run_status"] = "success"
d["metrics"] = self.get_calculated_metrics(d["metrics"], dataline)
if len(dataline["metrics"]) > 0:
d["metrics"] = self.get_calculated_metrics(d["metrics"], dataline)
else:
d["dimensions"]["run_status"] = "failure"
d["metrics"]["median_total_time"] = -1
Expand Down Expand Up @@ -216,7 +217,7 @@ def extract_metrics_csv(self, file: str, metric_df: Optional[pd.DataFrame]):
if "error" in dataline["metrics"] and not self._args.hide_errors:
d["error_message"] = dataline["metrics"]["error"]

if "error" not in dataline["metrics"]:
if len(dataline["metrics"]) > 0 and "error" not in dataline["metrics"]:
d = self.get_calculated_metrics(d, dataline)

new_row = pd.Series(d)
Expand Down

0 comments on commit 9fbd64a

Please sign in to comment.