Skip to content

Commit 60ee209

Browse files
committed
Add exception get_metrics_from_trace_tpu.
1 parent 5c64843 commit 60ee209

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"python-envs.defaultEnvManager": "ms-python.python:pyenv",
3+
"python-envs.pythonProjects": []
4+
}

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)