Enable single pass counter collection (#833)

[ROCm/rocprofiler-compute commit: 6a77d241ed]
This commit is contained in:
xuchen-amd
2025-08-06 10:35:05 -04:00
committed by GitHub
parent 5084aad00b
commit 34dd26fb07
18 changed files with 778 additions and 56 deletions
@@ -27,7 +27,6 @@
import argparse
import importlib
import os
import shutil
import socket
import sys
import time
@@ -55,6 +54,7 @@ from utils.utils import (
get_submodules,
get_version,
get_version_display,
parse_sets_yaml,
set_locale_encoding,
)
@@ -243,6 +243,53 @@ class RocProfCompute:
else:
console_error("Unsupported arch")
@demarcate
def list_sets(self):
sets_info = parse_sets_yaml(self.__mspec.gpu_arch)
if not sets_info:
console_error("No sets configuration found.")
print("\nAvailable Sets:")
print("=" * 115)
# Print header
print(
f"{'Set Option':<35} {'Set Title':<35} {'Metric Name':<30} {'Metric ID':<10}"
)
print("-" * 115)
# Print data grouped by set
for set_option, set_data in sets_info.items():
title = set_data.get("title", set_option)
metrics = set_data.get("metric", [])
first_row = True
for metric in metrics:
if isinstance(metric, dict) and metric:
metric_id = next(iter(metric.keys()))
metric_name = next(iter(metric.values()))
# Only show set info on first row of each set
set_display = set_option if first_row else ""
title_display = title if first_row else ""
print(
f"{set_display:<35} {title_display:<35} {metric_name:<30} {metric_id:<10}"
)
first_row = False
# Empty line between sets
print()
print("Usage Examples:")
if sets_info:
first_set = next(iter(sets_info.keys()))
print(f" rocprof-compute profile --set {first_set} # Profile this set")
print(f" rocprof-compute profile --list-sets # Show this help")
print()
sys.exit(0)
@demarcate
def run_profiler(self):
self.print_graphic()
@@ -250,6 +297,8 @@ class RocProfCompute:
if self.__args.list_metrics is not None:
self.list_metrics()
elif self.__args.list_sets:
self.list_sets()
elif self.__args.name is None:
sys.exit("Either --list-name or --name is required")