Improve baseline comparison (#817)

* Do not force unsupported metrics to be specified in older gpu
  architectures as None

* Remove metrics which are explicitly set to None

* Update CHANGELOG

* Fix analysis configuration to fix baseline comparisons across all gpu
  architectures
    * Add missing 1812 section for gfx908
    * Add missing 1812 section for gfx90a

* Baseline comparision will only show common metrics
   * First workload will be used to set Metric ID index column

[ROCm/rocprofiler-compute commit: d4c316a730]
This commit is contained in:
vedithal-amd
2025-07-24 11:49:02 -04:00
committed by GitHub
szülő b4c626893f
commit 449a6d41a0
52 fájl változott, egészen pontosan 66 új sor hozzáadva és 2480 régi sor törölve
@@ -75,6 +75,12 @@ def load_panel_configs(dir):
if f.endswith(".yaml"):
with open(str(Path(root).joinpath(f))) as file:
config = yaml.safe_load(file)
# metric key can be None due to some metric tables not having any metrics
# metric key should be empty dict instead of None
for data_source in config["Panel Config"]["data source"]:
metric_table = data_source.get("metric_table")
if metric_table and metric_table["metric"] is None:
metric_table["metric"] = {}
d[config["Panel Config"]["id"]] = config["Panel Config"]
# TODO: sort metrics as the header order in case they are not defined in the same order
@@ -114,6 +114,34 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None):
show_roof_plot(roof_plot)
continue
# Metrics baseline comparison mode
# We cannot guarantee that all runs have the same metrics. Only show common metrics.
if (
type == "metric_table"
and "Metric" in table_config["header"].values()
and len(runs) > 1
):
# Common metrics across all runs
common_metrics = set()
for _, data in runs.items():
if not common_metrics:
common_metrics = set(data.dfs[table_config["id"]]["Metric"])
else:
common_metrics &= set(data.dfs[table_config["id"]]["Metric"])
# Apply common metrics across all runs
# Reindex all runs based on first run
initial_index = None
for key in runs.keys():
runs[key].dfs[table_config["id"]] = (
runs[key]
.dfs[table_config["id"]]
.loc[lambda d: d["Metric"].isin(common_metrics)]
)
if initial_index is None:
initial_index= runs[key].dfs[table_config["id"]].index
else:
runs[key].dfs[table_config["id"]].index = initial_index
# take the 1st run as baseline
base_run, base_data = next(iter(runs.items()))
base_df = base_data.dfs[table_config["id"]]