From baa9efff4c78350c11bacaeff339e31f39e99dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=96=E9=81=93?= Date: Wed, 30 Jul 2025 16:01:12 +0800 Subject: [PATCH] Fix: cudaGraphLaunch bug --- hta/analyzers/critical_path_analysis.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hta/analyzers/critical_path_analysis.py b/hta/analyzers/critical_path_analysis.py index c5944132..238ccc6f 100644 --- a/hta/analyzers/critical_path_analysis.py +++ b/hta/analyzers/critical_path_analysis.py @@ -1873,8 +1873,14 @@ def critical_path_analysis( f" or (name == {stream_wait_event_id})" ) ) - - clipped_df = trace_df.loc[a.index.union(b.index)].copy() + # Retrieve the kernels initiated by cudaGraphLaunch + if "cudaGraphLaunch" in sym_index: + cudaGraphLaunch_id = sym_index.get("cudaGraphLaunch", -200) + cudaGraphLaunch_event = a[a["name"] == cudaGraphLaunch_id]["correlation"] + graph_launch_kernels = gpu_kernels[gpu_kernels["correlation"].isin(cudaGraphLaunch_event)] + clipped_df = trace_df.loc[a.index.union(b.index).union(graph_launch_kernels.index)].copy() + else: + clipped_df = trace_df.loc[a.index.union(b.index)].copy() logger.info(f"Clipped dataframe has {len(clipped_df)} events")