Enable single pass counter collection (#833)
[ROCm/rocprofiler-compute commit: 6a77d241ed]
This commit is contained in:
@@ -107,4 +107,10 @@ src/rocprof_compute_soc/analysis_configs/gfx940/2100_pc_sampling.yaml: 4f3af5504
|
||||
src/rocprof_compute_soc/analysis_configs/gfx941/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
|
||||
src/rocprof_compute_soc/analysis_configs/gfx942/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
|
||||
src/rocprof_compute_soc/analysis_configs/gfx950/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
|
||||
src/rocprof_compute_soc/profile_configs/sets/gfx908_sets.yaml: ee28989e70d0537db8b0f0a4bc5499444b44ff0e73d3e7f2926943be11d0aeda
|
||||
src/rocprof_compute_soc/profile_configs/sets/gfx90a_sets.yaml: 9c9533174a3f7bd5c8e09ec998743c7bb2642c4ce3f818b546673be9cafc40a8
|
||||
src/rocprof_compute_soc/profile_configs/sets/gfx940_sets.yaml: 44cd2b32b050cafa73d0ead5703b82836edf25a057c21699046b6b8b8918b242
|
||||
src/rocprof_compute_soc/profile_configs/sets/gfx941_sets.yaml: 44cd2b32b050cafa73d0ead5703b82836edf25a057c21699046b6b8b8918b242
|
||||
src/rocprof_compute_soc/profile_configs/sets/gfx942_sets.yaml: 44cd2b32b050cafa73d0ead5703b82836edf25a057c21699046b6b8b8918b242
|
||||
src/rocprof_compute_soc/profile_configs/sets/gfx950_sets.yaml: 238d9dc8a98cfead3fc904885bfe413e5bcb4f1af31e9820cd640388bcd1e1c2
|
||||
docs/data/metrics_description.yaml: 819c08a584ae8b418e6983aa51108b95e43eda4f3b7892eab336c61d844b20bf
|
||||
|
||||
@@ -17,14 +17,23 @@ import yaml
|
||||
ROOT_DIR = Path(__file__).parent.parent
|
||||
SOURCE_DIR = ROOT_DIR.joinpath("utils")
|
||||
TARGET_DIR = ROOT_DIR.joinpath("src", "rocprof_compute_soc", "analysis_configs")
|
||||
SETS_TARGET_DIR = ROOT_DIR.joinpath(
|
||||
"src", "rocprof_compute_soc", "profile_configs", "sets"
|
||||
)
|
||||
DOC_TARGET_DIR = ROOT_DIR.joinpath("docs", "data")
|
||||
AUTOGEN_TEXT = "# AUTOGENERATED FILE. Only edit for testing purposes, not for development. Generated from utils/unified_config.yaml. Generated by utils/split_config.py\n"
|
||||
HASH_FILE = ROOT_DIR.joinpath("utils", "autogen_hash.yaml")
|
||||
HASH_FILE_MAP = {}
|
||||
GFX_VERSIONS = ["gfx908", "gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]
|
||||
METRIC_ID_TO_NAME_MAP = {gfx_version: {} for gfx_version in GFX_VERSIONS}
|
||||
|
||||
|
||||
def get_autogen_text(config_file="utils/unified_config.yaml"):
|
||||
return f"# AUTOGENERATED FILE. Only edit for testing purposes, not for development. Generated from {config_file}. Generated by utils/split_config.py\n"
|
||||
|
||||
|
||||
def update_analysis_config():
|
||||
global METRIC_ID_TO_NAME_MAP
|
||||
|
||||
# Read the unified config file
|
||||
with open(SOURCE_DIR.joinpath("unified_config.yaml")) as file:
|
||||
unified_config = yaml.safe_load(file)
|
||||
@@ -38,6 +47,7 @@ def update_analysis_config():
|
||||
key: value["plain"]
|
||||
for key, value in panel_config.get("metrics_description", {}).items()
|
||||
}
|
||||
panel_id_int = panel_config["id"]
|
||||
# Convert int into str with 4 digits
|
||||
panel_id = str(panel_config["id"]).zfill(4)
|
||||
# Replace parentehsis, hyphen, slash and space with underscore
|
||||
@@ -57,19 +67,28 @@ def update_analysis_config():
|
||||
|
||||
# Select metrics from current gfx arch
|
||||
new_panel_config["Panel Config"]["data source"] = []
|
||||
for data_source_config in panel_config["data source"]:
|
||||
for data_source_index, data_source_config in enumerate(
|
||||
panel_config["data source"]
|
||||
):
|
||||
data_source_config = copy.deepcopy(data_source_config)
|
||||
if "metric_table" in data_source_config:
|
||||
data_source_config["metric_table"]["metric"] = data_source_config[
|
||||
"metric_table"
|
||||
]["metric"][gfx_version]
|
||||
|
||||
build_metric_id_mapping(
|
||||
panel_id_int,
|
||||
data_source_index,
|
||||
data_source_config["metric_table"]["metric"],
|
||||
gfx_version,
|
||||
)
|
||||
new_panel_config["Panel Config"]["data source"].append(data_source_config)
|
||||
# Write panel config to file
|
||||
filename = Path(
|
||||
TARGET_DIR.joinpath(gfx_version, f"{panel_id}_{panel_title}.yaml")
|
||||
)
|
||||
with open(filename, "w") as file:
|
||||
file.write(AUTOGEN_TEXT)
|
||||
file.write(get_autogen_text())
|
||||
yaml.dump(new_panel_config, file, sort_keys=False)
|
||||
print(f"File write: {filename}")
|
||||
# Calculate hash of filename
|
||||
@@ -78,6 +97,56 @@ def update_analysis_config():
|
||||
).hexdigest()
|
||||
|
||||
|
||||
def build_metric_id_mapping(panel_id, data_source_index, metrics, gfx_version):
|
||||
# Build metric id to metric name mapping
|
||||
global METRIC_ID_TO_NAME_MAP
|
||||
for metric_index, metric_name in enumerate(metrics.keys()):
|
||||
metric_id = f"{panel_id // 100}.{data_source_index + 1}.{metric_index}"
|
||||
METRIC_ID_TO_NAME_MAP[gfx_version][str(metric_id)] = metric_name
|
||||
|
||||
|
||||
def update_sets_config():
|
||||
# Create directory if it doesn't exist
|
||||
if not SETS_TARGET_DIR.exists():
|
||||
SETS_TARGET_DIR.mkdir()
|
||||
print(f"Created directory: {SETS_TARGET_DIR}")
|
||||
|
||||
# Read the unified config file
|
||||
with open(SOURCE_DIR.joinpath("unified_sets.yaml")) as file:
|
||||
unified_sets = yaml.safe_load(file)
|
||||
|
||||
# Create per gfx version file
|
||||
for gfx_version in GFX_VERSIONS:
|
||||
new_sets = {"sets": []}
|
||||
|
||||
for sets in unified_sets["sets"]:
|
||||
# Create new set object for each set
|
||||
current_set = {
|
||||
"title": sets["title"],
|
||||
"set_option": sets["set_option"],
|
||||
"description": sets["description"],
|
||||
"metric": [],
|
||||
}
|
||||
|
||||
for metric_id in sets["metric"][gfx_version]:
|
||||
current_set["metric"].append(
|
||||
{metric_id: METRIC_ID_TO_NAME_MAP[gfx_version][str(metric_id)]}
|
||||
)
|
||||
|
||||
new_sets["sets"].append(current_set)
|
||||
|
||||
# Write gfx version sets to file
|
||||
filename = Path(SETS_TARGET_DIR.joinpath(f"{gfx_version}_sets.yaml"))
|
||||
with open(filename, "w") as file:
|
||||
file.write(get_autogen_text("utils/unified_sets.yaml"))
|
||||
yaml.dump(new_sets, file, sort_keys=False)
|
||||
print(f"File write: {filename}")
|
||||
# Calculate hash of filename
|
||||
HASH_FILE_MAP[str(filename.relative_to(ROOT_DIR))] = hashlib.sha256(
|
||||
filename.read_bytes()
|
||||
).hexdigest()
|
||||
|
||||
|
||||
def update_documentation():
|
||||
# Documentation sections
|
||||
section_panel_map = {
|
||||
@@ -153,7 +222,7 @@ def update_documentation():
|
||||
# Write documentation metrics description file
|
||||
filename = Path(DOC_TARGET_DIR.joinpath("metrics_description.yaml"))
|
||||
with open(filename, "w") as file:
|
||||
file.write(AUTOGEN_TEXT)
|
||||
file.write(get_autogen_text())
|
||||
yaml.dump(section_metric_map, file, sort_keys=False)
|
||||
print(f"File write: {filename}")
|
||||
# Calculate hash of filename
|
||||
@@ -165,12 +234,13 @@ def update_documentation():
|
||||
def update_hash():
|
||||
# Write hash file
|
||||
with open(HASH_FILE, "w") as file:
|
||||
file.write(AUTOGEN_TEXT)
|
||||
file.write(get_autogen_text())
|
||||
yaml.dump(HASH_FILE_MAP, file, sort_keys=False)
|
||||
print(f"File write: {HASH_FILE}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
update_analysis_config()
|
||||
update_sets_config()
|
||||
update_documentation()
|
||||
update_hash()
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
---
|
||||
# Pre-defined sets containing a collection of relevant metrics that can be collected in a single pass.
|
||||
# To profile customized set(s), append to this yaml file.
|
||||
|
||||
sets:
|
||||
- title: Compute Throughput Utilization
|
||||
set_option: compute_thruput_util
|
||||
description: Placeholder
|
||||
metric:
|
||||
gfx908:
|
||||
- 11.2.2
|
||||
- 11.2.3
|
||||
gfx90a:
|
||||
- 11.2.3
|
||||
- 11.2.4
|
||||
- 11.2.5
|
||||
- 11.2.6
|
||||
gfx940:
|
||||
- 11.2.2
|
||||
- 11.2.3
|
||||
- 11.2.4
|
||||
- 11.2.5
|
||||
gfx941:
|
||||
- 11.2.2
|
||||
- 11.2.3
|
||||
- 11.2.4
|
||||
- 11.2.5
|
||||
gfx942:
|
||||
- 11.2.2
|
||||
- 11.2.3
|
||||
- 11.2.4
|
||||
- 11.2.5
|
||||
gfx950:
|
||||
- 11.2.2
|
||||
- 11.2.3
|
||||
- 11.2.5
|
||||
- 11.2.6
|
||||
|
||||
- title: Compute Throughput FLOPS
|
||||
set_option: compute_thruput_flops
|
||||
description: Placeholder
|
||||
metric:
|
||||
gfx908:
|
||||
- 2.1.2
|
||||
- 2.1.3
|
||||
- 2.1.4
|
||||
- 2.1.5
|
||||
- 2.1.6
|
||||
gfx90a:
|
||||
- 2.1.2
|
||||
- 2.1.3
|
||||
- 2.1.4
|
||||
- 2.1.5
|
||||
- 2.1.6
|
||||
gfx940:
|
||||
- 2.1.2
|
||||
- 2.1.3
|
||||
- 2.1.4
|
||||
- 2.1.5
|
||||
- 2.1.6
|
||||
- 2.1.7
|
||||
gfx941:
|
||||
- 2.1.2
|
||||
- 2.1.3
|
||||
- 2.1.4
|
||||
- 2.1.5
|
||||
- 2.1.6
|
||||
- 2.1.7
|
||||
gfx942:
|
||||
- 2.1.2
|
||||
- 2.1.3
|
||||
- 2.1.4
|
||||
- 2.1.5
|
||||
- 2.1.6
|
||||
- 2.1.7
|
||||
gfx950:
|
||||
- 2.1.2
|
||||
- 2.1.3
|
||||
- 2.1.4
|
||||
- 2.1.5
|
||||
- 2.1.6
|
||||
- 2.1.8
|
||||
|
||||
- title: Memory Throughput
|
||||
set_option: mem_thruput
|
||||
description: Placeholder
|
||||
metric:
|
||||
gfx908:
|
||||
- 2.1.16
|
||||
- 2.1.17
|
||||
- 16.1.2
|
||||
- 17.1.0
|
||||
gfx90a:
|
||||
- 2.1.16
|
||||
- 2.1.17
|
||||
- 16.1.2
|
||||
- 17.1.0
|
||||
gfx940:
|
||||
- 2.1.17
|
||||
- 2.1.18
|
||||
- 16.1.2
|
||||
- 17.1.0
|
||||
gfx941:
|
||||
- 2.1.17
|
||||
- 2.1.18
|
||||
- 16.1.2
|
||||
- 17.1.0
|
||||
gfx942:
|
||||
- 2.1.17
|
||||
- 2.1.18
|
||||
- 16.1.2
|
||||
- 17.1.0
|
||||
gfx950:
|
||||
- 2.1.18
|
||||
- 2.1.19
|
||||
- 16.1.2
|
||||
- 17.1.0
|
||||
|
||||
- title: Launch Stats
|
||||
set_option: launch_stats
|
||||
description: Placeholder
|
||||
metric:
|
||||
gfx908:
|
||||
- 7.1.0
|
||||
- 7.1.1
|
||||
- 7.1.2
|
||||
- 7.1.5
|
||||
- 7.1.6
|
||||
- 7.1.7
|
||||
- 7.1.8
|
||||
- 7.1.9
|
||||
gfx90a:
|
||||
- 7.1.0
|
||||
- 7.1.1
|
||||
- 7.1.2
|
||||
- 7.1.5
|
||||
- 7.1.6
|
||||
- 7.1.7
|
||||
- 7.1.8
|
||||
- 7.1.9
|
||||
gfx940:
|
||||
- 7.1.0
|
||||
- 7.1.1
|
||||
- 7.1.2
|
||||
- 7.1.5
|
||||
- 7.1.6
|
||||
- 7.1.7
|
||||
- 7.1.8
|
||||
- 7.1.9
|
||||
gfx941:
|
||||
- 7.1.0
|
||||
- 7.1.1
|
||||
- 7.1.2
|
||||
- 7.1.5
|
||||
- 7.1.6
|
||||
- 7.1.7
|
||||
- 7.1.8
|
||||
- 7.1.9
|
||||
gfx942:
|
||||
- 7.1.0
|
||||
- 7.1.1
|
||||
- 7.1.2
|
||||
- 7.1.5
|
||||
- 7.1.6
|
||||
- 7.1.7
|
||||
- 7.1.8
|
||||
- 7.1.9
|
||||
gfx950:
|
||||
- 7.1.0
|
||||
- 7.1.1
|
||||
- 7.1.2
|
||||
- 7.1.5
|
||||
- 7.1.6
|
||||
- 7.1.7
|
||||
- 7.1.8
|
||||
- 7.1.9
|
||||
مرجع در شماره جدید
Block a user