[rocprofiler-compute][webui] bug fix (#1047)

This commit is contained in:
xuchen-amd
2025-09-18 10:48:01 -04:00
committed by GitHub
parent 5ac163a811
commit d41e115916
3 changed files with 22 additions and 18 deletions
@@ -118,13 +118,15 @@ def create_df_kernel_top_stats(
# NB: support ignoring the 1st n dispatched execution by '> n'
# The better way may be parsing python slice string
first_filter = filter_dispatch_ids[0]
if first_filter.startswith(">"):
match = re.match(r">\s*(\d+)", first_filter)
if isinstance(first_filter, str) and first_filter.startswith(">"):
match = re.match(r">\s*(\d+)", str(first_filter))
if match:
threshold = int(match.group(1))
df = df[df["Dispatch_ID"] > threshold]
else:
df = df.loc[df["Dispatch_ID"].astype(str).isin(filter_dispatch_ids)]
filter_strings = [str(f) for f in filter_dispatch_ids]
df = df.loc[df["Dispatch_ID"].astype(str).isin(filter_strings)]
# First, create a dispatches file used to populate global vars
dispatch_columns = (
@@ -1174,7 +1174,7 @@ def apply_dispatch_filter(df: pd.DataFrame, workload: schema.Workload) -> pd.Dat
if int(dispatch_id) >= len(df): # subtract 2 bc of the two header rows
console_error("analysis", f"{dispatch_id} is an invalid dispatch id.")
if ">" in workload.filter_dispatch_ids[0]:
if isinstance(workload.filter_dispatch_ids[0], str) and ">" in workload.filter_dispatch_ids[0]:
dispatch_match = re.match(r"\> (\d+)", workload.filter_dispatch_ids[0])
df = df[
df[schema.PMC_PERF_FILE_PREFIX]["Dispatch_ID"]