From c0e2d759ddcfaf2de03ce8ae9cb7e1640276f9a2 Mon Sep 17 00:00:00 2001 From: colramos-amd Date: Wed, 31 Jan 2024 09:34:50 -0600 Subject: [PATCH] profile: fix parsing tcc per channel on mi300 (#234) Co-authored-by: fei.zheng Signed-off-by: colramos-amd [ROCm/rocprofiler-compute commit: f44ce21252f3903cc2e959ba1e3ac870772e0ffb] --- projects/rocprofiler-compute/src/utils/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler-compute/src/utils/utils.py b/projects/rocprofiler-compute/src/utils/utils.py index 71ec26edfb..3d652256b1 100644 --- a/projects/rocprofiler-compute/src/utils/utils.py +++ b/projects/rocprofiler-compute/src/utils/utils.py @@ -492,9 +492,13 @@ def flatten_tcc_info_across_hbm_stacks(file, stack_num, tcc_channel_per_stack): for col in tcc_cols_orig: for i in range(0, stack_num): # filter the channel index only - p = re.compile(r"(\d+)") + p = re.compile(r"\[(\d+)\]") # pick up the 1st element only - r = lambda match: str(int(float(match.group(0))) + i * tcc_channel_per_stack) + r = ( + lambda match: "[" + + str(int(match.group(1)) + i * tcc_channel_per_stack) + + "]" + ) tcc_cols_in_group[i].append(re.sub(pattern=p, repl=r, string=col)) for i in range(0, stack_num):