Skip to content

Commit 9b8bd50

Browse files
Amoghavarsha Sureshfacebook-github-bot
Amoghavarsha Suresh
authored andcommitted
Fixing Unary Op evaluate issue (#112)
Summary: Pull Request resolved: #112 Without this diff, the critical_path_analysis on some traces fails with the error: `'UnaryOp' object has no attribute 'evaluate'` This is apparently a pandas bug: pandas-dev/pandas#16363, which has been solved a few times, but appears in different forms time, and again. Reframing the query is solving the problem in critical_path_analysis for the time being. Reviewed By: briancoutinho Differential Revision: D54828775 fbshipit-source-id: 0bb52d1da7b5b143949c464b453955a666d31581
1 parent 8b11f1b commit 9b8bd50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hta/analyzers/critical_path_analysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ def _get_cuda_event_record_df(self) -> Optional[pd.DataFrame]:
464464

465465
def _previous_launch(ts: int, pid: int, tid: int) -> Optional[int]:
466466
"""Find the previous CUDA launch on same pid and tid"""
467-
df = runtime_calls.query(f"pid == {pid} and tid == {tid}")
467+
pid_match_df = runtime_calls[runtime_calls.pid == pid]
468+
df = pid_match_df[pid_match_df.tid == tid]
468469
lower_neighbors = df[df["ts"] < ts]["ts"]
469470
return lower_neighbors.idxmax() if len(lower_neighbors) else None
470471

0 commit comments

Comments
 (0)