From a6085ef158bc7579a1029bd4fa5d20912ac10249 Mon Sep 17 00:00:00 2001 From: JoseSantosAMD Date: Tue, 15 Aug 2023 15:30:39 -0500 Subject: [PATCH] Adding min/max/avg breakdown across dispatches for instruction mix panels Signed-off-by: JoseSantosAMD --- .../1000_compute-unit-instruction-mix.yaml | 100 +++++++++++++----- .../1000_compute-unit-instruction-mix.yaml | 100 +++++++++++++----- .../1000_compute-unit-instruction-mix.yaml | 100 +++++++++++++----- .../1100_compute-unit-compute-pipeline.yaml | 3 +- src/omniperf_analyze/omniperf_analyze.py | 6 +- src/omniperf_analyze/utils/gui.py | 10 +- 6 files changed, 232 insertions(+), 87 deletions(-) diff --git a/src/omniperf_analyze/configs/gfx906/1000_compute-unit-instruction-mix.yaml b/src/omniperf_analyze/configs/gfx906/1000_compute-unit-instruction-mix.yaml index 88386a3de..679acc34d 100644 --- a/src/omniperf_analyze/configs/gfx906/1000_compute-unit-instruction-mix.yaml +++ b/src/omniperf_analyze/configs/gfx906/1000_compute-unit-instruction-mix.yaml @@ -13,7 +13,9 @@ Panel Config: title: Instruction Mix header: metric: Metric - count: Count + avg: Avg + min: Min + max: Max unit: Unit tips: Tips style: @@ -21,35 +23,51 @@ Panel Config: label_txt: (# of instr + $normUnit) metric: VALU - Vector: - count: None # No HW module + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: VMEM: - count: None # No HW module + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: LDS: - count: AVG((SQ_INSTS_LDS / $denom)) + avg: AVG((SQ_INSTS_LDS / $denom)) + min: MIN((SQ_INSTS_LDS / $denom)) + max: MAX((SQ_INSTS_LDS / $denom)) unit: (instr + $normUnit) tips: VALU - MFMA: - count: None # No HW module + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: SALU: - count: AVG((SQ_INSTS_SALU / $denom)) + avg: AVG((SQ_INSTS_SALU / $denom)) + min: MIN((SQ_INSTS_SALU / $denom)) + max: MAX((SQ_INSTS_SALU / $denom)) unit: (instr + $normUnit) tips: SMEM: - count: AVG((SQ_INSTS_SMEM / $denom)) + avg: AVG((SQ_INSTS_SMEM / $denom)) + min: MIN((SQ_INSTS_SMEM / $denom)) + max: MAX((SQ_INSTS_SMEM / $denom)) unit: (instr + $normUnit) tips: Branch: - count: AVG((SQ_INSTS_BRANCH / $denom)) + avg: AVG((SQ_INSTS_BRANCH / $denom)) + min: MIN((SQ_INSTS_BRANCH / $denom)) + max: MAX((SQ_INSTS_BRANCH / $denom)) unit: (instr + $normUnit) tips: GDS: - count: AVG((SQ_INSTS_GDS / $denom)) + avg: AVG((SQ_INSTS_GDS / $denom)) + min: MIN((SQ_INSTS_GDS / $denom)) + max: MAX((SQ_INSTS_GDS / $denom)) unit: (instr + $normUnit) tips: @@ -58,7 +76,9 @@ Panel Config: title: VALU Arithmetic Instr Mix header: metric: Metric - count: Count + avg: Avg + min: Min + max: Max unit: Unit tips: Tips style: @@ -66,63 +86,93 @@ Panel Config: label_txt: (# of instr + $normUnit) metric: INT-32: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: INT-64: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F16-ADD: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F16-Mult: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F16-FMA: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F16-Trans: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F32-ADD: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F32-Mult: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F32-FMA: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F32-Trans: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F64-ADD: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F64-Mult: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F64-FMA: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: F64-Trans: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: Conversion: - count: None # No perf counter + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: diff --git a/src/omniperf_analyze/configs/gfx908/1000_compute-unit-instruction-mix.yaml b/src/omniperf_analyze/configs/gfx908/1000_compute-unit-instruction-mix.yaml index a6e831446..13c27dd20 100644 --- a/src/omniperf_analyze/configs/gfx908/1000_compute-unit-instruction-mix.yaml +++ b/src/omniperf_analyze/configs/gfx908/1000_compute-unit-instruction-mix.yaml @@ -13,7 +13,9 @@ Panel Config: title: Instruction Mix header: metric: Metric - count: Count + avg: Avg + min: Min + max: Max unit: Unit tips: Tips style: @@ -21,35 +23,51 @@ Panel Config: label_txt: (# of instr + $normUnit) metric: VALU - Vector: - count: AVG(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) + avg: AVG(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) + min: MIN(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) + max: MAX(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) unit: (instr + $normUnit) tips: VMEM: - count: AVG(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) + avg: AVG(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) + min: MIN(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) + max: MAX(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) unit: (instr + $normUnit) tips: LDS: - count: AVG((SQ_INSTS_LDS / $denom)) + avg: AVG((SQ_INSTS_LDS / $denom)) + min: MIN((SQ_INSTS_LDS / $denom)) + max: MAX((SQ_INSTS_LDS / $denom)) unit: (instr + $normUnit) tips: VALU - MFMA: - count: None # No HW module + avg: None # No HW module + min: None # No HW module + max: None # No HW module unit: (instr + $normUnit) tips: SALU: - count: AVG((SQ_INSTS_SALU / $denom)) + avg: AVG((SQ_INSTS_SALU / $denom)) + min: MIN((SQ_INSTS_SALU / $denom)) + max: MAX((SQ_INSTS_SALU / $denom)) unit: (instr + $normUnit) tips: SMEM: - count: AVG((SQ_INSTS_SMEM / $denom)) + avg: AVG((SQ_INSTS_SMEM / $denom)) + min: MIN((SQ_INSTS_SMEM / $denom)) + max: MAX((SQ_INSTS_SMEM / $denom)) unit: (instr + $normUnit) tips: Branch: - count: AVG((SQ_INSTS_BRANCH / $denom)) + avg: AVG((SQ_INSTS_BRANCH / $denom)) + min: MIN((SQ_INSTS_BRANCH / $denom)) + max: MAX((SQ_INSTS_BRANCH / $denom)) unit: (instr + $normUnit) tips: GDS: - count: AVG((SQ_INSTS_GDS / $denom)) + avg: AVG((SQ_INSTS_GDS / $denom)) + min: MIN((SQ_INSTS_GDS / $denom)) + max: MAX((SQ_INSTS_GDS / $denom)) unit: (instr + $normUnit) tips: @@ -58,7 +76,9 @@ Panel Config: title: VALU Arithmetic Instr Mix header: metric: Metric - count: Count + avg: Avg + min: Min + max: Max unit: Unit tips: Tips style: @@ -66,63 +86,93 @@ Panel Config: label_txt: (# of instr + $normUnit) metric: INT-32: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: INT-64: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F16-ADD: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F16-Mult: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F16-FMA: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F16-Trans: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F32-ADD: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F32-Mult: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F32-FMA: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F32-Trans: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F64-ADD: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F64-Mult: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F64-FMA: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: F64-Trans: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: Conversion: - count: None # No perf counter + avg: None # No perf counter + min: None # No perf counter + max: None # No perf counter unit: (instr + $normUnit) tips: diff --git a/src/omniperf_analyze/configs/gfx90a/1000_compute-unit-instruction-mix.yaml b/src/omniperf_analyze/configs/gfx90a/1000_compute-unit-instruction-mix.yaml index 35401d2ed..8ffd87d2c 100644 --- a/src/omniperf_analyze/configs/gfx90a/1000_compute-unit-instruction-mix.yaml +++ b/src/omniperf_analyze/configs/gfx90a/1000_compute-unit-instruction-mix.yaml @@ -13,7 +13,9 @@ Panel Config: title: Instruction Mix header: metric: Metric - count: Count + avg: Avg + min: Min + max: Max unit: Unit tips: Tips style: @@ -21,35 +23,51 @@ Panel Config: label_txt: (# of instr + $normUnit) metric: VALU - Vector: - count: AVG(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) + avg: AVG(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) + min: MIN(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) + max: MAX(((SQ_INSTS_VALU - SQ_INSTS_MFMA) / $denom)) unit: (instr + $normUnit) tips: VMEM: - count: AVG(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) + avg: AVG(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) + min: MIN(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) + max: MAX(((SQ_INSTS_VMEM - SQ_INSTS_FLAT_LDS_ONLY) / $denom)) unit: (instr + $normUnit) tips: LDS: - count: AVG((SQ_INSTS_LDS / $denom)) + avg: AVG((SQ_INSTS_LDS / $denom)) + min: MIN((SQ_INSTS_LDS / $denom)) + max: MAX((SQ_INSTS_LDS / $denom)) unit: (instr + $normUnit) tips: VALU - MFMA: - count: AVG((SQ_INSTS_MFMA / $denom)) + avg: AVG((SQ_INSTS_MFMA / $denom)) + min: MIN((SQ_INSTS_MFMA / $denom)) + max: MAX((SQ_INSTS_MFMA / $denom)) unit: (instr + $normUnit) tips: SALU: - count: AVG((SQ_INSTS_SALU / $denom)) + avg: AVG((SQ_INSTS_SALU / $denom)) + min: MIN((SQ_INSTS_SALU / $denom)) + max: MAX((SQ_INSTS_SALU / $denom)) unit: (instr + $normUnit) tips: SMEM: - count: AVG((SQ_INSTS_SMEM / $denom)) + avg: AVG((SQ_INSTS_SMEM / $denom)) + min: MIN((SQ_INSTS_SMEM / $denom)) + max: MAX((SQ_INSTS_SMEM / $denom)) unit: (instr + $normUnit) tips: Branch: - count: AVG((SQ_INSTS_BRANCH / $denom)) + avg: AVG((SQ_INSTS_BRANCH / $denom)) + min: MIN((SQ_INSTS_BRANCH / $denom)) + max: MAX((SQ_INSTS_BRANCH / $denom)) unit: (instr + $normUnit) tips: GDS: - count: AVG((SQ_INSTS_GDS / $denom)) + avg: AVG((SQ_INSTS_GDS / $denom)) + min: MIN((SQ_INSTS_GDS / $denom)) + max: MAX((SQ_INSTS_GDS / $denom)) unit: (instr + $normUnit) tips: @@ -58,7 +76,9 @@ Panel Config: title: VALU Arithmetic Instr Mix header: metric: Metric - count: Count + avg: Avg + min: Min + max: Max unit: Unit tips: Tips style: @@ -66,63 +86,93 @@ Panel Config: label_txt: (# of instr + $normUnit) metric: INT32: - count: AVG((SQ_INSTS_VALU_INT32 / $denom)) + avg: AVG((SQ_INSTS_VALU_INT32 / $denom)) + min: MIN((SQ_INSTS_VALU_INT32 / $denom)) + max: MAX((SQ_INSTS_VALU_INT32 / $denom)) unit: (instr + $normUnit) tips: INT64: - count: AVG((SQ_INSTS_VALU_INT64 / $denom)) + avg: AVG((SQ_INSTS_VALU_INT64 / $denom)) + min: MIN((SQ_INSTS_VALU_INT64 / $denom)) + max: MAX((SQ_INSTS_VALU_INT64 / $denom)) unit: (instr + $normUnit) tips: F16-ADD: - count: AVG((SQ_INSTS_VALU_ADD_F16 / $denom)) + avg: AVG((SQ_INSTS_VALU_ADD_F16 / $denom)) + min: MIN((SQ_INSTS_VALU_ADD_F16 / $denom)) + max: MAX((SQ_INSTS_VALU_ADD_F16 / $denom)) unit: (instr + $normUnit) tips: F16-MUL: - count: AVG((SQ_INSTS_VALU_MUL_F16 / $denom)) + avg: AVG((SQ_INSTS_VALU_MUL_F16 / $denom)) + min: MIN((SQ_INSTS_VALU_MUL_F16 / $denom)) + max: MAX((SQ_INSTS_VALU_MUL_F16 / $denom)) unit: (instr + $normUnit) tips: F16-FMA: - count: AVG((SQ_INSTS_VALU_FMA_F16 / $denom)) + avg: AVG((SQ_INSTS_VALU_FMA_F16 / $denom)) + min: MIN((SQ_INSTS_VALU_FMA_F16 / $denom)) + max: MAX((SQ_INSTS_VALU_FMA_F16 / $denom)) unit: (instr + $normUnit) tips: F16-Trans: - count: AVG((SQ_INSTS_VALU_TRANS_F16 / $denom)) + avg: AVG((SQ_INSTS_VALU_TRANS_F16 / $denom)) + min: MIN((SQ_INSTS_VALU_TRANS_F16 / $denom)) + max: MAX((SQ_INSTS_VALU_TRANS_F16 / $denom)) unit: (instr + $normUnit) tips: F32-ADD: - count: AVG((SQ_INSTS_VALU_ADD_F32 / $denom)) + avg: AVG((SQ_INSTS_VALU_ADD_F32 / $denom)) + min: MIN((SQ_INSTS_VALU_ADD_F32 / $denom)) + max: MAX((SQ_INSTS_VALU_ADD_F32 / $denom)) unit: (instr + $normUnit) tips: F32-MUL: - count: AVG((SQ_INSTS_VALU_MUL_F32 / $denom)) + avg: AVG((SQ_INSTS_VALU_MUL_F32 / $denom)) + min: MIN((SQ_INSTS_VALU_MUL_F32 / $denom)) + max: MAX((SQ_INSTS_VALU_MUL_F32 / $denom)) unit: (instr + $normUnit) tips: F32-FMA: - count: AVG((SQ_INSTS_VALU_FMA_F32 / $denom)) + avg: AVG((SQ_INSTS_VALU_FMA_F32 / $denom)) + min: MIN((SQ_INSTS_VALU_FMA_F32 / $denom)) + max: MAX((SQ_INSTS_VALU_FMA_F32 / $denom)) unit: (instr + $normUnit) tips: F32-Trans: - count: AVG((SQ_INSTS_VALU_TRANS_F32 / $denom)) + avg: AVG((SQ_INSTS_VALU_TRANS_F32 / $denom)) + min: MIN((SQ_INSTS_VALU_TRANS_F32 / $denom)) + max: MAX((SQ_INSTS_VALU_TRANS_F32 / $denom)) unit: (instr + $normUnit) tips: F64-ADD: - count: AVG((SQ_INSTS_VALU_ADD_F64 / $denom)) + avg: AVG((SQ_INSTS_VALU_ADD_F64 / $denom)) + min: MIN((SQ_INSTS_VALU_ADD_F64 / $denom)) + max: MAX((SQ_INSTS_VALU_ADD_F64 / $denom)) unit: (instr + $normUnit) tips: F64-MUL: - count: AVG((SQ_INSTS_VALU_MUL_F64 / $denom)) + avg: AVG((SQ_INSTS_VALU_MUL_F64 / $denom)) + min: MIN((SQ_INSTS_VALU_MUL_F64 / $denom)) + max: MAX((SQ_INSTS_VALU_MUL_F64 / $denom)) unit: (instr + $normUnit) tips: F64-FMA: - count: AVG((SQ_INSTS_VALU_FMA_F64 / $denom)) + avg: AVG((SQ_INSTS_VALU_FMA_F64 / $denom)) + min: MIN((SQ_INSTS_VALU_FMA_F64 / $denom)) + max: MAX((SQ_INSTS_VALU_FMA_F64 / $denom)) unit: (instr + $normUnit) tips: F64-Trans: - count: AVG((SQ_INSTS_VALU_TRANS_F64 / $denom)) + avg: AVG((SQ_INSTS_VALU_TRANS_F64 / $denom)) + min: MIN((SQ_INSTS_VALU_TRANS_F64 / $denom)) + max: MAX((SQ_INSTS_VALU_TRANS_F64 / $denom)) unit: (instr + $normUnit) tips: Conversion: - count: AVG((SQ_INSTS_VALU_CVT / $denom)) + avg: AVG((SQ_INSTS_VALU_CVT / $denom)) + min: MIN((SQ_INSTS_VALU_CVT / $denom)) + max: MAX((SQ_INSTS_VALU_CVT / $denom)) unit: (instr + $normUnit) tips: diff --git a/src/omniperf_analyze/configs/gfx90a/1100_compute-unit-compute-pipeline.yaml b/src/omniperf_analyze/configs/gfx90a/1100_compute-unit-compute-pipeline.yaml index 3e29bc4a2..be1ece043 100644 --- a/src/omniperf_analyze/configs/gfx90a/1100_compute-unit-compute-pipeline.yaml +++ b/src/omniperf_analyze/configs/gfx90a/1100_compute-unit-compute-pipeline.yaml @@ -192,5 +192,4 @@ Panel Config: max: MAX((((64 * (((SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64) + SQ_INSTS_VALU_TRANS_F64) + (SQ_INSTS_VALU_FMA_F64 * 2))) + (512 * SQ_INSTS_VALU_MFMA_MOPS_F64)) / $denom)) unit: (OPs + $normUnit) - tips: - + tips: \ No newline at end of file diff --git a/src/omniperf_analyze/omniperf_analyze.py b/src/omniperf_analyze/omniperf_analyze.py index 0b54a696c..8d94b37d0 100644 --- a/src/omniperf_analyze/omniperf_analyze.py +++ b/src/omniperf_analyze/omniperf_analyze.py @@ -45,7 +45,6 @@ from pathlib import Path from omniperf_analyze.utils import parser, file_io from omniperf_analyze.utils.gui_components.roofline import get_roofline -from utils import csv_converter archConfigs = {} @@ -196,7 +195,7 @@ def run_gui(args, runs): gui.build_layout( app, runs, - archConfigs["gfx90a"], + archConfigs[runs[args.path[0][0]].sys_info.iloc[0]["gpu_soc"]], input_filters, args.decimal, args.time_unit, @@ -222,9 +221,6 @@ def run_cli(args, runs): # which archConfig passed into show_all function. # After decide to how to manage kernels display patterns, we can revisit it. for d in args.path: - # Demangle and overwrite original KernelNames - csv_converter.kernel_name_shortener(d[0], args.kernelVerbose) - file_io.create_df_kernel_top_stats( d[0], runs[d[0]].filter_gpu_ids, diff --git a/src/omniperf_analyze/utils/gui.py b/src/omniperf_analyze/utils/gui.py index ca05bd3ea..4128bf5ad 100644 --- a/src/omniperf_analyze/utils/gui.py +++ b/src/omniperf_analyze/utils/gui.py @@ -154,17 +154,17 @@ def build_bar_chart(display_df, table_config, norm_filt): # Insr Mix bar chart if table_config["id"] in barchart_elements["instr_mix"]: - display_df["Count"] = [ - x.astype(int) if x != "" else int(0) for x in display_df["Count"] + display_df["Avg"] = [ + x.astype(int) if x != "" else int(0) for x in display_df["Avg"] ] df_unit = display_df["Unit"][0] d_figs.append( px.bar( display_df, - x="Count", + x="Avg", y="Metric", - color="Count", - labels={"Count": "# of {}".format(df_unit.lower())}, + color="Avg", + labels={"Avg": "# of {}".format(df_unit.lower())}, height=400, orientation="h", )