Skip to content

Commit 6ef9e45

Browse files
committed
Add exception get_metrics_from_trace_tpu.
1 parent 5c64843 commit 6ef9e45

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/benchmark_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ def get_metrics_from_trace(trace: dict[str, Any], task: str) -> list[float]:
7272
# Check if the given task name is a collective with corresponding TPU opertion.
7373
# This is a workaround and should be reverted or refactored in future.
7474
if task in TARGET_TASK_NAME_COLLECTIVES_MAP:
75-
task = TARGET_TASK_NAME_COLLECTIVES_MAP[task]
76-
return get_metrics_from_trace_tpu(trace, task)
75+
try:
76+
task = TARGET_TASK_NAME_COLLECTIVES_MAP[task]
77+
return get_metrics_from_trace_tpu(trace, task)
78+
except:
79+
return [-1.]
7780
event_matcher = re.compile(task)
7881

7982
if "traceEvents" not in trace:

0 commit comments

Comments
 (0)