[rocprofiler-compute] Improve roofline logging for roofline.csv (#2390)
* enhanced roofline log output for graceful exit * addressed comment, added block filtering * ruff format
This commit is contained in:
committed by
GitHub
vanhempi
3f004c9237
commit
53fd27c0ed
@@ -293,10 +293,9 @@ class OmniAnalyze_Base:
|
||||
)
|
||||
w.roofline_peaks = pd.DataFrame()
|
||||
else:
|
||||
console_error(
|
||||
console_log(
|
||||
"roofline",
|
||||
f"Roofline analysis skipped: {error_msg}",
|
||||
exit=False,
|
||||
)
|
||||
w.roofline_peaks = pd.DataFrame()
|
||||
else:
|
||||
|
||||
@@ -494,6 +494,21 @@ def show_all(
|
||||
if not csv_dir.exists():
|
||||
csv_dir.mkdir()
|
||||
|
||||
# Check for valid roofline data once (used to skip roofline tables in the loop)
|
||||
has_valid_roofline = any(
|
||||
hasattr(workload, "roofline_peaks") and not workload.roofline_peaks.empty
|
||||
for workload in runs.values()
|
||||
)
|
||||
roofline_warning_shown = False
|
||||
|
||||
# True if roofline (block 4) is in the active filter
|
||||
# or no filter is applied
|
||||
roofline_in_filter = (
|
||||
any(str(m).split(".")[0] == "4" for m in args.filter_metrics)
|
||||
if args.filter_metrics
|
||||
else (not filter_panel_ids or 400 in filter_panel_ids)
|
||||
)
|
||||
|
||||
for panel_id, panel in arch_configs.panel_configs.items():
|
||||
# Skip panels that don't support baseline comparison
|
||||
if len(args.path) > 1 and panel_id in config.HIDDEN_SECTIONS:
|
||||
@@ -510,18 +525,14 @@ def show_all(
|
||||
for data_source in panel["data source"]:
|
||||
for table_type, table_config in data_source.items():
|
||||
# Skip roofline tables (401, 402) if roofline data is invalid
|
||||
if table_config["id"] in [401, 402]:
|
||||
has_valid_roofline = any(
|
||||
hasattr(workload, "roofline_peaks")
|
||||
and not workload.roofline_peaks.empty
|
||||
for workload in runs.values()
|
||||
)
|
||||
if not has_valid_roofline:
|
||||
if table_config["id"] in [401, 402] and not has_valid_roofline:
|
||||
if not roofline_warning_shown and roofline_in_filter:
|
||||
console_warning(
|
||||
f"Not showing Roofline table {table_config['id']} "
|
||||
"due to invalid roofline data."
|
||||
"Roofline",
|
||||
"Not showing roofline table due to invalid roofline data",
|
||||
)
|
||||
continue
|
||||
roofline_warning_shown = True
|
||||
continue
|
||||
|
||||
# Block-filter logic:
|
||||
# - If analysis used --filter-metrics, ignore profiling block filters
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user