From c763228d35c8b763165a3c4c68ffda19f96961eb Mon Sep 17 00:00:00 2001 From: Giovanni LB Date: Wed, 15 Mar 2023 17:17:57 -0300 Subject: [PATCH] SWDEV-389002: Remove quadratic wave lookup Change-Id: Ie401b46091b31c3b9e4473a15791e4bf2af4d73e [ROCm/rocprofiler commit: 5674997fdabf7df84d2adb236750f8d7f8124b63] --- projects/rocprofiler/plugin/att/trace_view.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/projects/rocprofiler/plugin/att/trace_view.py b/projects/rocprofiler/plugin/att/trace_view.py index 4996c1ab8e..f4b7c62a92 100755 --- a/projects/rocprofiler/plugin/att/trace_view.py +++ b/projects/rocprofiler/plugin/att/trace_view.py @@ -255,8 +255,15 @@ def extract_data(df, output_ui, se_number, code, jumps): cu_waves = extract_waves(df) all_filenames = [] flight_count = [] + maxgrade = [{df['wave_slot'][wave_id]: -1 for wave_id in df['id']} for k in range(4)] + non_stitched = [{df['wave_slot'][wave_id]: -1 for wave_id in df['id']} for k in range(4)] + + print('Number of waves:', len(df['id'])) for wave_id in df['id']: + if non_stitched[df['simd'][wave_id]][df['wave_slot'][wave_id]] == 0: + continue + print(f"Parsing :{se_number}-{df['simd'][wave_id]}-{df['wave_slot'][wave_id]}") insts, timeline = [], [] if len(df['instructions'][wave_id]) == 0 or len(df['timeline'][wave_id]) == 0: continue @@ -267,6 +274,12 @@ def extract_data(df, output_ui, se_number, code, jumps): timeline.append(extract_tuple(x, 2)) stitched, loopCount, mem_unroll, count = stitch(insts, code, jumps) + srate = len(stitched)**2 / max(len(insts), 1) + if srate <= maxgrade[df['simd'][wave_id]][df['wave_slot'][wave_id]]: + continue + + maxgrade[df['simd'][wave_id]][df['wave_slot'][wave_id]] = srate + non_stitched[df['simd'][wave_id]][df['wave_slot'][wave_id]] = len(insts) - len(stitched) flight_count.append(count) wave_entry = {