Skip to content

Commit a21b30e

Browse files
adamomainzfacebook-github-bot
authored andcommitted
fixing key error in aggregate data
Summary: for some reason OSS isnt happy with dict.get so im moving to this slightly less pythonic but more exact approach Reviewed By: bertmaher, sfzhu93 Differential Revision: D64698791 fbshipit-source-id: 48cc4b6f7df61287efdc71c30176c2830dfde110
1 parent 0562040 commit a21b30e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torchbenchmark/util/triton_op.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ def userbenchmark_dict(self) -> Dict[str, Any]:
364364
agg_metric_name = (
365365
f"tritonbench_{self.op_name}_{self.op_mode}[{provider}]_{metrics}"
366366
)
367+
if value is None:
368+
continue
367369
agg_data[agg_metric_name] = agg_data.get(agg_metric_name, 0) + value
368370
final_agg_data = {k: v / num_rows for k, v in agg_data.items()}
369371
userbenchmark_metrics_dict.update(final_agg_data)

0 commit comments

Comments
 (0)