Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TCC on MI200 when introduce rocprofv3 #509

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/rocprof_compute_soc/soc_base.py
Original file line number Diff line number Diff line change
@@ -355,12 +355,17 @@ def perfmon_coalesce(pmc_files_list, perfmon_config, workload_dir, spatial_multi
# Channel counter e.g. TCC_ATOMIC[0]
if "[" in ctr:

# FIXME:
# Remove channel number, append "_sum" so rocprof will
# sum the counters for us instead of specifying every
# channel.
channel = int(ctr.split("[")[1].split("]")[0])
if channel == 0:
counter_name = ctr.split("[")[0] + "_sum"
counter_name = (
ctr.split("[")[0] + "_sum"
if using_v3()
else ctr.split("[")[0] + "_expand"
)

try:
normal_counters[counter_name] += 1
@@ -493,8 +498,23 @@ def perfmon_coalesce(pmc_files_list, perfmon_config, workload_dir, spatial_multi

pmc = []
for block_name in f.blocks.keys():
for ctr in f.blocks[block_name].elements:
pmc.append(ctr)
if not using_v3() and block_name == "TCC":
# Expand and interleve the TCC channel counters
# e.g. TCC_HIT[0] TCC_ATOMIC[0] ... TCC_HIT[1] TCC_ATOMIC[1] ...
channel_counters = []
for ctr in f.blocks[block_name].elements:
if "_expand" in ctr:
channel_counters.append(ctr.split("_expand")[0])
for i in range(0, perfmon_config["TCC_channels"]):
for c in channel_counters:
pmc.append("{}[{}]".format(c, i))
# Handle the rest of the TCC counters
for ctr in f.blocks[block_name].elements:
if "_expand" not in ctr:
pmc.append(ctr)
else:
for ctr in f.blocks[block_name].elements:
pmc.append(ctr)

stext = "pmc: " + " ".join(pmc)