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

Этот коммит содержится в:
xuchen-amd
2025-09-18 10:48:01 -04:00
коммит произвёл GitHub
родитель 5ac163a811
Коммит d41e115916
3 изменённых файлов: 22 добавлений и 18 удалений
+16 -14
Просмотреть файл
@@ -39,6 +39,7 @@ from config import HIDDEN_COLUMNS, PROJECT_NAME
from rocprof_compute_analyze.analysis_base import OmniAnalyze_Base
from utils import file_io, parser, schema
from utils.gui import build_bar_chart, build_table_chart
from utils.gui_components.memchart import get_memchart
from utils.logger import console_debug, console_error, console_warning, demarcate
@@ -117,11 +118,11 @@ class webui_analysis(OmniAnalyze_Base):
[State("container", "children")],
)
def generate_from_filter(
disp_filt: str,
kernel_filter: str,
gcd_filter: str,
disp_filt: list[str],
kernel_filter: list[str],
gcd_filter: list[str],
norm_filt: str,
top_n_filt: str,
top_n_filt: int,
div_children: list[html.Section],
) -> list[html.Section]:
console_debug("analysis", f"gui normalization is {norm_filt}")
@@ -151,9 +152,15 @@ class webui_analysis(OmniAnalyze_Base):
console_debug("analysis", f"gui gpu filter is {gcd_filter}")
console_debug("analysis", f"gui top-n filter is {top_n_filt}")
base_data[base_run].filter_kernel_ids = [int(kernel_filter)]
base_data[base_run].filter_gpu_ids = [int(gcd_filter)]
base_data[base_run].filter_dispatch_ids = [int(disp_filt)]
base_data[base_run].filter_kernel_ids = (
[str(k) for k in kernel_filter] if kernel_filter else []
)
base_data[base_run].filter_gpu_ids = (
[int(g) for g in gcd_filter] if gcd_filter else []
)
base_data[base_run].filter_dispatch_ids = (
[int(d) for d in disp_filt] if disp_filt else []
)
base_data[base_run].filter_top_n = top_n_filt
# Reload the pmc_kernel_top.csv for Top Stats panel
@@ -198,14 +205,9 @@ class webui_analysis(OmniAnalyze_Base):
# ~~~~~~~~~~~~~~~~~~~~~~~
# Generate GUI content
# ~~~~~~~~~~~~~~~~~~~~~~~
div_children = []
# Append memory chart and roofline
from utils.gui_components.memchart import get_memchart
div_children.append(
div_children = [
get_memchart(panel_configs[300]["data source"], base_data[base_run])
)
]
has_roofline = (Path(self.dest_dir) / "roofline.csv").is_file()
soc = self.get_socs()
+5 -3
Просмотреть файл
@@ -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 = (
+1 -1
Просмотреть файл
@@ -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"]