From 10d7b2605a5caad379d1bcb878942eacfedc17f1 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Fri, 8 Aug 2025 16:29:37 -0500 Subject: [PATCH 01/14] per kernel analysis Roofline --- projects/rocprofiler-compute/src/config.py | 2 +- .../rocprof_compute_analyze/analysis_base.py | 15 + .../rocprof_compute_analyze/analysis_cli.py | 144 ++- .../gfx908/0400_roofline.yaml | 196 ++- .../gfx90a/0400_roofline.yaml | 191 ++- .../gfx940/0400_roofline.yaml | 196 ++- .../gfx941/0400_roofline.yaml | 196 ++- .../gfx942/0400_roofline.yaml | 196 ++- .../gfx950/0400_roofline.yaml | 202 +++- .../src/rocprof_compute_soc/soc_gfx941.py | 2 +- .../src/rocprof_compute_soc/soc_gfx942.py | 2 +- projects/rocprofiler-compute/src/roofline.py | 7 +- .../rocprofiler-compute/src/utils/file_io.py | 11 + .../rocprofiler-compute/src/utils/parser.py | 22 +- .../src/utils/roofline_calc.py | 215 +++- .../rocprofiler-compute/src/utils/schema.py | 1 + projects/rocprofiler-compute/src/utils/tty.py | 91 +- .../utils/autogen_hash.yaml | 12 +- .../utils/unified_config.yaml | 1077 ++++++++++++++++- 19 files changed, 2703 insertions(+), 75 deletions(-) diff --git a/projects/rocprofiler-compute/src/config.py b/projects/rocprofiler-compute/src/config.py index c6b2da9daee9..cccdee37fd15 100644 --- a/projects/rocprofiler-compute/src/config.py +++ b/projects/rocprofiler-compute/src/config.py @@ -34,6 +34,6 @@ HIDDEN_COLUMNS = ["coll_level"] HIDDEN_COLUMNS_CLI = ["Description", "coll_level"] HIDDEN_COLUMNS_TUI = ["Description", "coll_level"] -HIDDEN_SECTIONS = [400, 1900, 2000] +HIDDEN_SECTIONS = [1900, 2000] TIME_UNITS = {"s": 10**9, "ms": 10**6, "us": 10**3, "ns": 1} diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py index 55a691b5a106..5df7e466b141 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py @@ -189,6 +189,21 @@ def initalize_runs(self, normalization_filter=None): else file_io.find_1st_sub_dir(d[0]) ) w.sys_info = file_io.load_sys_info(sysinfo_path.joinpath("sysinfo.csv")) + + if not getattr(self.get_args(), "no_roof", False): + try: + roofline_path = sysinfo_path.joinpath("roofline.csv") + roofline_df = file_io.load_roofline_peaks(roofline_path) + + # Use the original column names from roofline.csv directly + w.roofline_peaks = roofline_df + + except FileNotFoundError: + console_warning(f"roofline.csv not found.") + w.roofline_peaks = file_io.create_empty_dataframe() + else: + w.roofline_peaks = file_io.create_empty_dataframe() + arch = w.sys_info.iloc[0]["gpu_arch"] mspec = self.get_socs()[arch]._mspec if self.__args.specs_correction: diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py index 5d711482ff88..412b38e82abf 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py @@ -27,7 +27,7 @@ from rocprof_compute_analyze.analysis_base import OmniAnalyze_Base from utils import file_io, parser, tty from utils.kernel_name_shortener import kernel_name_shortener -from utils.logger import console_error, demarcate +from utils.logger import console_error, console_log, console_warning, demarcate class cli_analysis(OmniAnalyze_Base): @@ -41,9 +41,9 @@ def pre_processing(self): if self.get_args().random_port: console_error("--gui flag is required to enable --random-port") for d in self.get_args().path: - + workload = self._runs[d[0]] # create 'mega dataframe' - self._runs[d[0]].raw_pmc = file_io.create_df_pmc( + workload.raw_pmc = file_io.create_df_pmc( d[0], self.get_args().nodes, self.get_args().spatial_multiplexing, @@ -51,18 +51,18 @@ def pre_processing(self): self.get_args().verbose, self._profiling_config, ) - + if self.get_args().spatial_multiplexing: - self._runs[d[0]].raw_pmc = self.spatial_multiplex_merge_counters( - self._runs[d[0]].raw_pmc + workload.raw_pmc = self.spatial_multiplex_merge_counters( + workload.raw_pmc ) file_io.create_df_kernel_top_stats( - df_in=self._runs[d[0]].raw_pmc, + df_in=workload.raw_pmc, raw_data_dir=d[0], - filter_gpu_ids=self._runs[d[0]].filter_gpu_ids, - filter_dispatch_ids=self._runs[d[0]].filter_dispatch_ids, - filter_nodes=self._runs[d[0]].filter_nodes, + filter_gpu_ids=workload.filter_gpu_ids, + filter_dispatch_ids=workload.filter_dispatch_ids, + filter_nodes=workload.filter_nodes, time_unit=self.get_args().time_unit, max_stat_num=self.get_args().max_stat_num, kernel_verbose=self.get_args().kernel_verbose, @@ -70,18 +70,102 @@ def pre_processing(self): # demangle and overwrite original 'Kernel_Name' kernel_name_shortener( - self._runs[d[0]].raw_pmc, self.get_args().kernel_verbose + workload.raw_pmc, self.get_args().kernel_verbose ) + + if len(self.get_args().path) == 1: + self.calculate_per_kernel_roofline_tables(d[0]) # create the loaded table parser.load_table_data( - workload=self._runs[d[0]], + workload=workload, dir=d[0], is_gui=False, args=self.get_args(), config=self._profiling_config, ) + + def calculate_per_kernel_roofline_tables(self, run_dir): + """ + Calculate per-kernel roofline metrics using the eval_metric engine. + """ + workload = self._runs[run_dir] + arch = workload.sys_info.iloc[0]["gpu_arch"] + + # Check for architecture and panel compatibility + if arch not in self._arch_configs or 400 not in self._arch_configs[arch].panel_configs: + return + + arch_config = self._arch_configs[arch] + roofline_panel = arch_config.panel_configs[400] + + # Find the two roofline tables from the config + roofline_tables = {} + for data_source in roofline_panel.get("data source", []): + if "metric_table" in data_source: + table_config = data_source["metric_table"] + if table_config.get("cli_style") == "Roofline": + roofline_tables[table_config["id"]] = table_config + + if not roofline_tables: + return + + console_log("Calculating per-kernel roofline metrics...") + + workload.per_kernel_roofline = {'performance_rates': [], 'calculation_data': []} + + # We need a function to get the top kernels list. Assuming one exists in file_io. + # Let's define a helper for this. + kernel_top_df = file_io.create_df_from_file(run_dir, "pmc_kernel_top.csv") + if kernel_top_df.empty: + console_warning("pmc_kernel_top.csv not found for per-kernel roofline. Skipping.") + return + + unique_kernels = kernel_top_df.head(self.get_args().max_stat_num) + + # MAIN LOOP: Iterate through each kernel + for kernel_idx, kernel_row in unique_kernels.iterrows(): + kernel_name = kernel_row['Kernel_Name'] + + single_kernel_pmc_df = workload.raw_pmc[workload.raw_pmc['pmc_perf']['Kernel_Name'] == kernel_name] + if single_kernel_pmc_df.empty: + continue + + perf_results, calc_results = {}, {} + for table_id, table_config in roofline_tables.items(): + temp_df = workload.dfs[table_id].copy() + + parser.eval_metric( + {table_id: temp_df}, {table_id: "metric_table"}, + workload.sys_info.iloc[0], + workload.roofline_peaks, # <-- This comes from the base class now! + single_kernel_pmc_df, + self.get_args().debug, self._profiling_config, + ) + + if table_id == 401: perf_results = temp_df.set_index('Metric').to_dict('index') + elif table_id == 402: calc_results = temp_df.set_index('Metric').to_dict('index') + + # Structure results for TTY + perf_metrics_for_tty = [ + {'name': name, 'value': data['Value'], 'unit': data['Unit'], 'peak': data.get('Peak (Empirical)')} + for name, data in perf_results.items() + ] + calc_metrics_for_tty = [ + {'name': name, 'value': data['Value'], 'unit': data['Unit']} + for name, data in calc_results.items() + ] + + workload.per_kernel_roofline['performance_rates'].append({ + 'kernel_idx': kernel_idx, 'kernel_name': kernel_name, 'metrics': perf_metrics_for_tty + }) + workload.per_kernel_roofline['calculation_data'].append({ + 'kernel_idx': kernel_idx, 'kernel_name': kernel_name, 'metrics': calc_metrics_for_tty + }) + + console_log(f"Finished calculating per-kernel roofline for {len(unique_kernels)} kernels.") + @demarcate def run_analysis(self): """Run CLI analysis.""" @@ -99,30 +183,24 @@ def run_analysis(self): else: roof_plot = None # 1. check if not baseline && compatible soc: - if (len(self.get_args().path)) == 1 and self._runs[ - self.get_args().path[0][0] - ].sys_info.iloc[0]["gpu_arch"] in [ - "gfx90a", - "gfx940", - "gfx941", - "gfx942", - "gfx950", - ]: - # add roofline plot to cli output - roof_obj = self.get_socs()[ - self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"] - ].roofline_obj - - if roof_obj: - # NOTE: using default data type - roof_plot = roof_obj.cli_generate_plot(roof_obj.get_dtype()[0]) - + if len(self.get_args().path) == 1: + workload = self._runs[self.get_args().path[0][0]] + arch = workload.sys_info.iloc[0]["gpu_arch"] + + if arch in ["gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]: + roof_obj = self.get_socs()[arch].roofline_obj + + if roof_obj: + roof_obj._workload = workload + roof_obj._arch_config = self._arch_configs[arch] + roof_obj._profiling_config = self._profiling_config + + roof_plot = roof_obj.cli_generate_plot(roof_obj.get_dtype()[0]) + tty.show_all( self.get_args(), self._runs, - self._arch_configs[ - self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"] - ], + self._arch_configs[workload.sys_info.iloc[0]["gpu_arch"]], self._output, self._profiling_config, roof_plot=roof_plot, diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml index 41c8bac54757..4325ae31046f 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml @@ -2,8 +2,198 @@ Panel Config: id: 400 title: Roofline - metrics_description: {} + metrics_description: + VALU FLOPs: 'The total floating-point operations executed per second on the VALU. + This is also presented as a percent of the peak theoretical FLOPs achievable + on the specific accelerator. Note: this does not include any floating-point + operations from MFMA instructions.' + MFMA FLOPs (F8): The total number of 8-bit brain floating point MFMA operations + executed per second. This does not include any 16-bit brain floating point operations + from VALU instructions. The peak empirically measured F8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison. It is supported + on AMD Instinct MI300 series and later only. + MFMA FLOPs (BF16): 'The total number of 16-bit brain floating point MFMA operations + executed per second. Note: this does not include any 16-bit brain floating point + operations from VALU instructions. The peak empirically measured BF16 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F16): 'The total number of 16-bit floating point MFMA operations executed + per second. Note: this does not include any 16-bit floating point operations + from VALU instructions. The peak empirically measured F16 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F32): 'The total number of 32-bit floating point MFMA operations executed + per second. Note: this does not include any 32-bit floating point operations + from VALU instructions. The peak empirically measured F32 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F64): 'The total number of 64-bit floating point MFMA operations executed + per second. Note: this does not include any 64-bit floating point operations + from VALU instructions. The peak empirically measured F64 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA IOPs (Int8): 'The total number of 8-bit integer MFMA operations executed + per second. Note: this does not include any 8-bit integer operations from VALU + instructions. The peak empirically measured INT8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + HBM Bandwidth: '' + L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. + The number of bytes is calculated as the number of cache lines requested multiplied + by the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + L1 Cache Bandwidth: The number of bytes looked up in the vL1D cache as a result + of VMEM instructions per unit time. The number of bytes is calculated as the + number of cache lines requested multiplied by the cache line size. This value + does not consider partial requests, so e.g., if only a single value is requested + in a cache line, the data movement will still be counted as a full cache line. + The peak empirically measured bandwidth achievable on the specific accelerator + is displayed alongside for comparison. + LDS Bandwidth: Indicates the maximum amount of bytes that could have been loaded + from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth + example for more detail). The peak empirically measured LDS bandwidth achievable + on the specific accelerator is displayed alongside for comparison. + Total Flops: '' + Total VALU FLOPs: '' + Total HBM Data: '' + Total L2 Cache Data: '' + Total L1 Cache Data: '' + Total LDS Data: '' + AI HBM: '' + Performance GFLOPs: '' data source: - - None: + - metric_table: id: 401 - title: Roofline + title: Roofline Performance Rates + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + peak: Peak (Empirical) + metric: + VALU FLOPs: + value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64)) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + - metric_table: + id: 402 + title: Roofline Calculation Data + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + metric: + Total Flops: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + unit: Bytes + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 + unit: GFLOP/s diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml index 41c8bac54757..ef4358b495eb 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml @@ -2,8 +2,193 @@ Panel Config: id: 400 title: Roofline - metrics_description: {} + metrics_description: + VALU FLOPs: 'The total floating-point operations executed per second on the VALU. + This is also presented as a percent of the peak theoretical FLOPs achievable + on the specific accelerator. Note: this does not include any floating-point + operations from MFMA instructions.' + MFMA FLOPs (F8): The total number of 8-bit brain floating point MFMA operations + executed per second. This does not include any 16-bit brain floating point operations + from VALU instructions. The peak empirically measured F8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison. It is supported + on AMD Instinct MI300 series and later only. + MFMA FLOPs (BF16): 'The total number of 16-bit brain floating point MFMA operations + executed per second. Note: this does not include any 16-bit brain floating point + operations from VALU instructions. The peak empirically measured BF16 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F16): 'The total number of 16-bit floating point MFMA operations executed + per second. Note: this does not include any 16-bit floating point operations + from VALU instructions. The peak empirically measured F16 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F32): 'The total number of 32-bit floating point MFMA operations executed + per second. Note: this does not include any 32-bit floating point operations + from VALU instructions. The peak empirically measured F32 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F64): 'The total number of 64-bit floating point MFMA operations executed + per second. Note: this does not include any 64-bit floating point operations + from VALU instructions. The peak empirically measured F64 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA IOPs (Int8): 'The total number of 8-bit integer MFMA operations executed + per second. Note: this does not include any 8-bit integer operations from VALU + instructions. The peak empirically measured INT8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + HBM Bandwidth: '' + L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. + The number of bytes is calculated as the number of cache lines requested multiplied + by the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + L1 Cache Bandwidth: The number of bytes looked up in the vL1D cache as a result + of VMEM instructions per unit time. The number of bytes is calculated as the + number of cache lines requested multiplied by the cache line size. This value + does not consider partial requests, so e.g., if only a single value is requested + in a cache line, the data movement will still be counted as a full cache line. + The peak empirically measured bandwidth achievable on the specific accelerator + is displayed alongside for comparison. + LDS Bandwidth: Indicates the maximum amount of bytes that could have been loaded + from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth + example for more detail). The peak empirically measured LDS bandwidth achievable + on the specific accelerator is displayed alongside for comparison. + Total Flops: '' + Total VALU FLOPs: '' + Total HBM Data: '' + Total L2 Cache Data: '' + Total L1 Cache Data: '' + Total LDS Data: '' + AI HBM: '' + Performance GFLOPs: '' data source: - - None: + - metric_table: id: 401 - title: Roofline + title: Roofline Performance Rates + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + peak: Peak (Empirical) + metric: + VALU FLOPs: + value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: 0 + unit: GFLOP/s + peak: 0 + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((( (TCC_EA_RDREQ_32B_sum * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) + * 64) + (TCC_EA_WRREQ_64B_sum * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) + * 32) ))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64)) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + - metric_table: + id: 402 + title: Roofline Calculation Data + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + metric: + Total Flops: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) ))) + unit: FLOPs + Total HBM Data: + value: SUM((( (TCC_EA_RDREQ_32B_sum * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) + * 64) + (TCC_EA_WRREQ_64B_sum * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) + * 32) ))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + unit: Bytes + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM( (TCC_EA_RDREQ_32B_sum + * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + (TCC_EA_WRREQ_64B_sum + * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) ) ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / (SUM(End_Timestamp - Start_Timestamp) + / 1e9) ) / 1e9 + unit: GFLOP/s diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml index 41c8bac54757..4325ae31046f 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml @@ -2,8 +2,198 @@ Panel Config: id: 400 title: Roofline - metrics_description: {} + metrics_description: + VALU FLOPs: 'The total floating-point operations executed per second on the VALU. + This is also presented as a percent of the peak theoretical FLOPs achievable + on the specific accelerator. Note: this does not include any floating-point + operations from MFMA instructions.' + MFMA FLOPs (F8): The total number of 8-bit brain floating point MFMA operations + executed per second. This does not include any 16-bit brain floating point operations + from VALU instructions. The peak empirically measured F8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison. It is supported + on AMD Instinct MI300 series and later only. + MFMA FLOPs (BF16): 'The total number of 16-bit brain floating point MFMA operations + executed per second. Note: this does not include any 16-bit brain floating point + operations from VALU instructions. The peak empirically measured BF16 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F16): 'The total number of 16-bit floating point MFMA operations executed + per second. Note: this does not include any 16-bit floating point operations + from VALU instructions. The peak empirically measured F16 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F32): 'The total number of 32-bit floating point MFMA operations executed + per second. Note: this does not include any 32-bit floating point operations + from VALU instructions. The peak empirically measured F32 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F64): 'The total number of 64-bit floating point MFMA operations executed + per second. Note: this does not include any 64-bit floating point operations + from VALU instructions. The peak empirically measured F64 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA IOPs (Int8): 'The total number of 8-bit integer MFMA operations executed + per second. Note: this does not include any 8-bit integer operations from VALU + instructions. The peak empirically measured INT8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + HBM Bandwidth: '' + L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. + The number of bytes is calculated as the number of cache lines requested multiplied + by the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + L1 Cache Bandwidth: The number of bytes looked up in the vL1D cache as a result + of VMEM instructions per unit time. The number of bytes is calculated as the + number of cache lines requested multiplied by the cache line size. This value + does not consider partial requests, so e.g., if only a single value is requested + in a cache line, the data movement will still be counted as a full cache line. + The peak empirically measured bandwidth achievable on the specific accelerator + is displayed alongside for comparison. + LDS Bandwidth: Indicates the maximum amount of bytes that could have been loaded + from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth + example for more detail). The peak empirically measured LDS bandwidth achievable + on the specific accelerator is displayed alongside for comparison. + Total Flops: '' + Total VALU FLOPs: '' + Total HBM Data: '' + Total L2 Cache Data: '' + Total L1 Cache Data: '' + Total LDS Data: '' + AI HBM: '' + Performance GFLOPs: '' data source: - - None: + - metric_table: id: 401 - title: Roofline + title: Roofline Performance Rates + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + peak: Peak (Empirical) + metric: + VALU FLOPs: + value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64)) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + - metric_table: + id: 402 + title: Roofline Calculation Data + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + metric: + Total Flops: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + unit: Bytes + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 + unit: GFLOP/s diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml index 41c8bac54757..4325ae31046f 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml @@ -2,8 +2,198 @@ Panel Config: id: 400 title: Roofline - metrics_description: {} + metrics_description: + VALU FLOPs: 'The total floating-point operations executed per second on the VALU. + This is also presented as a percent of the peak theoretical FLOPs achievable + on the specific accelerator. Note: this does not include any floating-point + operations from MFMA instructions.' + MFMA FLOPs (F8): The total number of 8-bit brain floating point MFMA operations + executed per second. This does not include any 16-bit brain floating point operations + from VALU instructions. The peak empirically measured F8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison. It is supported + on AMD Instinct MI300 series and later only. + MFMA FLOPs (BF16): 'The total number of 16-bit brain floating point MFMA operations + executed per second. Note: this does not include any 16-bit brain floating point + operations from VALU instructions. The peak empirically measured BF16 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F16): 'The total number of 16-bit floating point MFMA operations executed + per second. Note: this does not include any 16-bit floating point operations + from VALU instructions. The peak empirically measured F16 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F32): 'The total number of 32-bit floating point MFMA operations executed + per second. Note: this does not include any 32-bit floating point operations + from VALU instructions. The peak empirically measured F32 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F64): 'The total number of 64-bit floating point MFMA operations executed + per second. Note: this does not include any 64-bit floating point operations + from VALU instructions. The peak empirically measured F64 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA IOPs (Int8): 'The total number of 8-bit integer MFMA operations executed + per second. Note: this does not include any 8-bit integer operations from VALU + instructions. The peak empirically measured INT8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + HBM Bandwidth: '' + L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. + The number of bytes is calculated as the number of cache lines requested multiplied + by the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + L1 Cache Bandwidth: The number of bytes looked up in the vL1D cache as a result + of VMEM instructions per unit time. The number of bytes is calculated as the + number of cache lines requested multiplied by the cache line size. This value + does not consider partial requests, so e.g., if only a single value is requested + in a cache line, the data movement will still be counted as a full cache line. + The peak empirically measured bandwidth achievable on the specific accelerator + is displayed alongside for comparison. + LDS Bandwidth: Indicates the maximum amount of bytes that could have been loaded + from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth + example for more detail). The peak empirically measured LDS bandwidth achievable + on the specific accelerator is displayed alongside for comparison. + Total Flops: '' + Total VALU FLOPs: '' + Total HBM Data: '' + Total L2 Cache Data: '' + Total L1 Cache Data: '' + Total LDS Data: '' + AI HBM: '' + Performance GFLOPs: '' data source: - - None: + - metric_table: id: 401 - title: Roofline + title: Roofline Performance Rates + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + peak: Peak (Empirical) + metric: + VALU FLOPs: + value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64)) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + - metric_table: + id: 402 + title: Roofline Calculation Data + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + metric: + Total Flops: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + unit: Bytes + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 + unit: GFLOP/s diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml index 41c8bac54757..4325ae31046f 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml @@ -2,8 +2,198 @@ Panel Config: id: 400 title: Roofline - metrics_description: {} + metrics_description: + VALU FLOPs: 'The total floating-point operations executed per second on the VALU. + This is also presented as a percent of the peak theoretical FLOPs achievable + on the specific accelerator. Note: this does not include any floating-point + operations from MFMA instructions.' + MFMA FLOPs (F8): The total number of 8-bit brain floating point MFMA operations + executed per second. This does not include any 16-bit brain floating point operations + from VALU instructions. The peak empirically measured F8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison. It is supported + on AMD Instinct MI300 series and later only. + MFMA FLOPs (BF16): 'The total number of 16-bit brain floating point MFMA operations + executed per second. Note: this does not include any 16-bit brain floating point + operations from VALU instructions. The peak empirically measured BF16 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F16): 'The total number of 16-bit floating point MFMA operations executed + per second. Note: this does not include any 16-bit floating point operations + from VALU instructions. The peak empirically measured F16 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F32): 'The total number of 32-bit floating point MFMA operations executed + per second. Note: this does not include any 32-bit floating point operations + from VALU instructions. The peak empirically measured F32 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F64): 'The total number of 64-bit floating point MFMA operations executed + per second. Note: this does not include any 64-bit floating point operations + from VALU instructions. The peak empirically measured F64 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA IOPs (Int8): 'The total number of 8-bit integer MFMA operations executed + per second. Note: this does not include any 8-bit integer operations from VALU + instructions. The peak empirically measured INT8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + HBM Bandwidth: '' + L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. + The number of bytes is calculated as the number of cache lines requested multiplied + by the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + L1 Cache Bandwidth: The number of bytes looked up in the vL1D cache as a result + of VMEM instructions per unit time. The number of bytes is calculated as the + number of cache lines requested multiplied by the cache line size. This value + does not consider partial requests, so e.g., if only a single value is requested + in a cache line, the data movement will still be counted as a full cache line. + The peak empirically measured bandwidth achievable on the specific accelerator + is displayed alongside for comparison. + LDS Bandwidth: Indicates the maximum amount of bytes that could have been loaded + from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth + example for more detail). The peak empirically measured LDS bandwidth achievable + on the specific accelerator is displayed alongside for comparison. + Total Flops: '' + Total VALU FLOPs: '' + Total HBM Data: '' + Total L2 Cache Data: '' + Total L1 Cache Data: '' + Total LDS Data: '' + AI HBM: '' + Performance GFLOPs: '' data source: - - None: + - metric_table: id: 401 - title: Roofline + title: Roofline Performance Rates + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + peak: Peak (Empirical) + metric: + VALU FLOPs: + value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64)) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + - metric_table: + id: 402 + title: Roofline Calculation Data + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + metric: + Total Flops: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + unit: Bytes + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 + unit: GFLOP/s diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml index 41c8bac54757..c167086e15f8 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml @@ -2,8 +2,204 @@ Panel Config: id: 400 title: Roofline - metrics_description: {} + metrics_description: + VALU FLOPs: 'The total floating-point operations executed per second on the VALU. + This is also presented as a percent of the peak theoretical FLOPs achievable + on the specific accelerator. Note: this does not include any floating-point + operations from MFMA instructions.' + MFMA FLOPs (F8): The total number of 8-bit brain floating point MFMA operations + executed per second. This does not include any 16-bit brain floating point operations + from VALU instructions. The peak empirically measured F8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison. It is supported + on AMD Instinct MI300 series and later only. + MFMA FLOPs (BF16): 'The total number of 16-bit brain floating point MFMA operations + executed per second. Note: this does not include any 16-bit brain floating point + operations from VALU instructions. The peak empirically measured BF16 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F16): 'The total number of 16-bit floating point MFMA operations executed + per second. Note: this does not include any 16-bit floating point operations + from VALU instructions. The peak empirically measured F16 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F32): 'The total number of 32-bit floating point MFMA operations executed + per second. Note: this does not include any 32-bit floating point operations + from VALU instructions. The peak empirically measured F32 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA FLOPs (F64): 'The total number of 64-bit floating point MFMA operations executed + per second. Note: this does not include any 64-bit floating point operations + from VALU instructions. The peak empirically measured F64 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + MFMA IOPs (Int8): 'The total number of 8-bit integer MFMA operations executed + per second. Note: this does not include any 8-bit integer operations from VALU + instructions. The peak empirically measured INT8 MFMA operations achievable + on the specific accelerator is displayed alongside for comparison.' + HBM Bandwidth: '' + L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. + The number of bytes is calculated as the number of cache lines requested multiplied + by the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + L1 Cache Bandwidth: The number of bytes looked up in the vL1D cache as a result + of VMEM instructions per unit time. The number of bytes is calculated as the + number of cache lines requested multiplied by the cache line size. This value + does not consider partial requests, so e.g., if only a single value is requested + in a cache line, the data movement will still be counted as a full cache line. + The peak empirically measured bandwidth achievable on the specific accelerator + is displayed alongside for comparison. + LDS Bandwidth: Indicates the maximum amount of bytes that could have been loaded + from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth + example for more detail). The peak empirically measured LDS bandwidth achievable + on the specific accelerator is displayed alongside for comparison. + Total Flops: '' + Total VALU FLOPs: '' + Total HBM Data: '' + Total L2 Cache Data: '' + Total L1 Cache Data: '' + Total LDS Data: '' + AI HBM: '' + Performance GFLOPs: '' data source: - - None: + - metric_table: id: 401 - title: Roofline + title: Roofline Performance Rates + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + peak: Peak (Empirical) + metric: + VALU FLOPs: + value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMA_FLOPs_F6F4_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64)) / ((End_Timestamp + - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) + / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + - metric_table: + id: 402 + title: Roofline Calculation Data + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + metric: + Total Flops: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) + unit: Bytes + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) ) / SUM( (TCC_BUBBLE_sum + * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum + - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) + * 32) + (TCC_EA0_WRREQ_64B_sum * 64) ) ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) ) / (SUM(End_Timestamp - + Start_Timestamp) / 1e9) ) / 1e9 + unit: GFLOP/s diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py index 9012fb3449e8..6cb6171dd631 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py @@ -44,7 +44,7 @@ def __init__(self, args, mspec): Path(str(config.rocprof_compute_home)).joinpath( "rocprof_compute_soc", "profile_configs", - "gfx940", + "gfx941", "roofline", ) ) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py index 96243ec7ca6a..58ff295c6b8e 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py @@ -44,7 +44,7 @@ def __init__(self, args, mspec): Path(str(config.rocprof_compute_home)).joinpath( "rocprof_compute_soc", "profile_configs", - "gfx940", + "gfx942", "roofline", ) ) diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index 0900913e326d..29c177f3791f 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -50,6 +50,7 @@ PEAK_OPS_DATATYPES, SUPPORTED_DATATYPES, calc_ai, + calc_ai_profile, constuct_roof, ) from utils.utils import mibench @@ -177,8 +178,10 @@ def empirical_roofline( self.roof_setup() console_debug("roofline", "Path: %s" % self.__run_parameters.get("workload_dir")) - self.__ai_data = calc_ai( - self.__mspec, self.__run_parameters.get("sort_type"), ret_df + self.__ai_data = calc_ai_profile( + self.__mspec, + self.__run_parameters.get("sort_type"), + ret_df ) msg = "AI at each mem level:" diff --git a/projects/rocprofiler-compute/src/utils/file_io.py b/projects/rocprofiler-compute/src/utils/file_io.py index 63015379a023..dd35ec5b514c 100644 --- a/projects/rocprofiler-compute/src/utils/file_io.py +++ b/projects/rocprofiler-compute/src/utils/file_io.py @@ -61,6 +61,17 @@ def load_sys_info(f): """ return pd.read_csv(f) +def load_roofline_peaks(f): + """ + Load empirical roofline peak values from a csv file to a df. + """ + return pd.read_csv(f) + +def create_empty_dataframe(): + """ + Returns an empty pandas DataFrame. + """ + return pd.DataFrame() def load_panel_configs(dir): """ diff --git a/projects/rocprofiler-compute/src/utils/parser.py b/projects/rocprofiler-compute/src/utils/parser.py index 70b86b854393..5c424d105852 100644 --- a/projects/rocprofiler-compute/src/utils/parser.py +++ b/projects/rocprofiler-compute/src/utils/parser.py @@ -102,6 +102,7 @@ "STD": "to_std", # functions apply to whole column of df or a single value "TO_INT": "to_int", + "SUM": "to_sum", # Support the below with 2 inputs "ROUND": "to_round", "QUANTILE": "to_quantile", @@ -193,6 +194,18 @@ def to_int(a): # return int(a) else: raise Exception("to_int: unsupported type.") + +def to_sum(a): + if str(type(a)) == "": + return np.nan + elif np.isnan(a).all(): + return np.nan + elif a.empty: + return np.nan + elif isinstance(a, pd.core.series.Series): + return a.sum() + else: + raise Exception("to_sum: unsupported type.") def to_round(a, b): @@ -708,7 +721,7 @@ def build_metric_value_string(dfs, dfs_type, normal_unit, profiling_config): @demarcate -def eval_metric(dfs, dfs_type, sys_info, raw_pmc_df, debug, config): +def eval_metric(dfs, dfs_type, sys_info, empirical_peaks_df, raw_pmc_df, debug, config): """ Execute the expr string for each metric in the df. """ @@ -798,6 +811,12 @@ def eval_metric(dfs, dfs_type, sys_info, raw_pmc_df, debug, config): console_warning( "wave_size is not available in sysinfo.csv, please provide the correct value using --specs-correction" ) + + if not empirical_peaks_df.empty: + peak_data_row = empirical_peaks_df.iloc[0] + for metric_name in empirical_peaks_df.columns: + var_name = f"ammolite__{metric_name}_empirical_peak" + locals()[var_name] = peak_data_row[metric_name] # TODO: fix all $normUnit in Unit column or title @@ -1475,6 +1494,7 @@ def load_table_data(workload, dir, is_gui, args, config, skipKernelTop=False): workload.dfs, workload.dfs_type, workload.sys_info.iloc[0], + workload.roofline_peaks, apply_filters(workload, dir, is_gui, args.debug), args.debug, config, diff --git a/projects/rocprofiler-compute/src/utils/roofline_calc.py b/projects/rocprofiler-compute/src/utils/roofline_calc.py index 603003bf1e53..ff024fb7ed2d 100644 --- a/projects/rocprofiler-compute/src/utils/roofline_calc.py +++ b/projects/rocprofiler-compute/src/utils/roofline_calc.py @@ -29,6 +29,7 @@ from pathlib import Path from utils.logger import console_debug +from utils import file_io, parser, schema ################################################ # Global vars @@ -254,8 +255,220 @@ def calc_ceilings(roofline_parameters, dtype, benchmark_data): # Overlay application performance # ------------------------------------------------------------------------------------- # Calculate relevant metrics for ai calculation -def calc_ai(mspec, sort_type, ret_df): +def calc_ai(mspec, sort_type, ret_df, workload=None, arch_config=None, profiling_config=None): + + """ + Calculate arithmetic intensity for roofline analysis. + + RETURNS: + - AI plot data dict (same format as before for compatibility) + + SIDE EFFECT: + - Stores per-kernel metrics in workload.per_kernel_roofline (for tables) + + This single function handles both legacy and YAML-based calculation. + """ + + # Try YAML-based calculation if all configs provided + if workload and arch_config and profiling_config: + print("Using YAML-based roofline calculation!!!!!!!!!!!!") + try: + arch = workload.sys_info.iloc[0]["gpu_arch"] + + # Get roofline configuration from YAML + if 400 not in arch_config.panel_configs: + raise ValueError("Roofline panel 400 not found") + + roofline_panel = arch_config.panel_configs[400] + + # Find tables 401 (performance rates) and 402 (calculation data) + table_401_config = None + table_402_config = None + + for data_source in roofline_panel["data source"]: + if "metric_table" in data_source: + table_config = data_source["metric_table"] + if table_config["id"] == 401: + table_401_config = table_config + elif table_config["id"] == 402: + table_402_config = table_config + + if not table_401_config or not table_402_config: + raise ValueError("Tables 401/402 not found") + + # Initialize plot data (same format as legacy for compatibility) + ai_data = { + "ai_hbm": [[], []], # [[x_values], [y_values]] + "ai_l2": [[], []], + "ai_l1": [[], []], + "ai_lds": [[], []], + "kernelNames": [] + } + + # Initialize per-kernel metrics storage (for tables) + per_kernel_metrics = { + 'performance_rates': [], # Table 401 data + 'calculation_data': [] # Table 402 data + } + + raw_pmc = ret_df.get("pmc_perf", pd.DataFrame()) + if raw_pmc.empty: + return ai_data + + # Get metrics configuration for this architecture + metrics_401 = table_401_config["metric"].get(arch, {}) + metrics_402 = table_402_config["metric"].get(arch, {}) + + # PROCESS EACH KERNEL + for kernel_idx in raw_pmc.index: + kernel_name = raw_pmc.loc[kernel_idx, 'Kernel_Name'] + ai_data["kernelNames"].append(kernel_name) + + # Create single-kernel DataFrame + single_kernel_df = raw_pmc.loc[[kernel_idx]].copy() + + # ===== EVALUATE TABLE 401 (Performance Rates with peaks) ===== + df_401 = pd.DataFrame() + headers_401 = ["Metric_ID", "Metric", "value", "unit", "coll_level", "peak"] + data_401 = [] + + for i, (metric_name, metric_def) in enumerate(metrics_401.items()): + data_401.append([ + f"40100{i:02d}", + metric_name, + metric_def.get('value', ''), + metric_def.get('unit', ''), + 'pmc_perf', + metric_def.get('peak', '') + ]) + + df_401 = pd.DataFrame(data_401, columns=headers_401) + df_401.set_index("Metric_ID", inplace=True) + + # ===== EVALUATE TABLE 402 (Calculation Data without peaks) ===== + df_402 = pd.DataFrame() + headers_402 = ["Metric_ID", "Metric", "value", "unit", "coll_level"] + data_402 = [] + + for i, (metric_name, metric_def) in enumerate(metrics_402.items()): + data_402.append([ + f"40200{i:02d}", + metric_name, + metric_def.get('value', ''), + metric_def.get('unit', ''), + 'pmc_perf' + ]) + + df_402 = pd.DataFrame(data_402, columns=headers_402) + df_402.set_index("Metric_ID", inplace=True) + + # Prepare for eval_metric + temp_dfs = {401: df_401, 402: df_402} + temp_dfs_type = {401: "metric_table", 402: "metric_table"} + + # Build evaluation strings + parser.build_metric_value_string( + temp_dfs, + temp_dfs_type, + "per_kernel", + profiling_config + ) + + # Create raw_pmc structure for this kernel + kernel_raw_pmc = {"pmc_perf": single_kernel_df} + + # EVALUATE using existing eval_metric (this does all the work!) + parser.eval_metric( + temp_dfs, + temp_dfs_type, + workload.sys_info.iloc[0], + workload.roofline_peaks, # Has empirical peaks from roofline.csv + kernel_raw_pmc, + False, # debug + profiling_config + ) + + # ===== EXTRACT RESULTS FOR TABLE DISPLAY ===== + perf_metrics = { + 'kernel_idx': kernel_idx, + 'kernel_name': kernel_name, + 'metrics': [] + } + + for idx, row in temp_dfs[401].iterrows(): + value = row.get('value', 0) + if pd.isna(value) or value == float('inf'): + value = 0.0 + + # Peak is already evaluated by eval_metric! + peak = row.get('peak', None) + if pd.isna(peak) or peak == 0: + peak = None + + perf_metrics['metrics'].append({ + 'name': row['Metric'], + 'value': float(value), + 'unit': row.get('unit', ''), + 'peak': float(peak) if peak else None + }) + + calc_metrics = { + 'kernel_idx': kernel_idx, + 'kernel_name': kernel_name, + 'metrics': [] + } + + for idx, row in temp_dfs[402].iterrows(): + value = row.get('value', 0) + if pd.isna(value) or value == float('inf'): + value = 0.0 + + calc_metrics['metrics'].append({ + 'name': row['Metric'], + 'value': float(value), + 'unit': row.get('unit', ''), + 'peak': None # No peaks for calculation data + }) + + per_kernel_metrics['performance_rates'].append(perf_metrics) + per_kernel_metrics['calculation_data'].append(calc_metrics) + + # ===== EXTRACT VALUES FOR PLOT ===== + calc_dict = {m['name']: m['value'] for m in calc_metrics['metrics']} + + total_flops = calc_dict.get('Total_FLOPs', 0) + perf_gflops = calc_dict.get('Performance_GFLOPs', 0) + + # Calculate AI for each memory level + for mem_level, data_key in [ + ('ai_hbm', 'Total_HBM_Data'), + ('ai_l2', 'Total L2 Cache Data'), + ('ai_l1', 'Total L1 Cache Data'), + ('ai_lds', 'Total LDS Data') + ]: + mem_data = calc_dict.get(data_key, 0) + if mem_data > 0: + ai_data[mem_level][0].append(total_flops / mem_data) + ai_data[mem_level][1].append(perf_gflops) + else: + ai_data[mem_level][0].append(0) + ai_data[mem_level][1].append(0) + + # STORE PER-KERNEL METRICS (side effect for table display) + workload.per_kernel_roofline = per_kernel_metrics + + console_log("Using YAML-based per-kernel roofline calculation") + return ai_data + + except Exception as e: + console_warning(f"YAML-based calc_ai failed: {e}, falling back to legacy") + + return calc_ai_profile(mspec, sort_type, ret_df) + + +def calc_ai_profile(mspec, sort_type, ret_df): """Given counter data, calculate arithmetic intensity for each kernel in the application.""" + print("Starting legacy roofline calculation (froom roofline calc)") df = ret_df["pmc_perf"] # Sort by top kernels or top dispatches? df = df.sort_values(by=["Kernel_Name"]) diff --git a/projects/rocprofiler-compute/src/utils/schema.py b/projects/rocprofiler-compute/src/utils/schema.py index 65c8e9b791ab..e521235644d9 100644 --- a/projects/rocprofiler-compute/src/utils/schema.py +++ b/projects/rocprofiler-compute/src/utils/schema.py @@ -84,6 +84,7 @@ class Workload: "Avg", "Pct of Peak", "Peak", + "Peak (Empirical)", "Count", "Mean", "Pct", diff --git a/projects/rocprofiler-compute/src/utils/tty.py b/projects/rocprofiler-compute/src/utils/tty.py index 70feb6014283..0a5ef8df0338 100644 --- a/projects/rocprofiler-compute/src/utils/tty.py +++ b/projects/rocprofiler-compute/src/utils/tty.py @@ -145,6 +145,35 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): continue ss = "" # store content of all data_source from one panel + if panel_id == 400: + print("\n" + "=" * 80, "PANEL 400: Roofline", "=" * 80) + # Check for cli_style: Roofline in tables + has_roofline_style = False + for data_source in panel["data source"]: + if "metric_table" in data_source: + if data_source["metric_table"].get("cli_style") == "Roofline": + has_roofline_style = True + break + print(has_roofline_style) + if has_roofline_style: + # Display per-kernel roofline tables + print(runs.items()) + for run, workload in runs.items(): + + if hasattr(workload, 'per_kernel_roofline'): + display_per_kernel_roofline_tables( + workload.per_kernel_roofline, + args, + output + ) + break + + # Show roofline plot (uses same data) + if roof_plot: + show_roof_plot(roof_plot) + continue + + for data_source in panel["data source"]: for type, table_config in data_source.items(): # If block filtering was used during analysis, then dont use profiling config @@ -169,15 +198,6 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): ) continue - # Show roofline - # Check if we have filter_metrics for analyze stage: - # no filter_metrics = show all, filter_metrics containing "4" = user requesting roofline chart - if panel_id == 400 and ( - not args.filter_metrics or "4" in args.filter_metrics - ): - show_roof_plot(roof_plot) - continue - # Metrics baseline comparison mode # We cannot guarantee that all runs have the same metrics. Only show common metrics. if ( @@ -479,3 +499,56 @@ def show_kernel_stats(args, runs, archConfigs, output): get_table_string(df, transpose=False, decimal=args.decimal), file=output, ) + + +def display_per_kernel_roofline_tables(per_kernel_data, args, output): + print("Entering display_per_kernel_roofline_tables") + """Display per-kernel roofline metrics in two-section format.""" + + print("\n" + "=" * 80, file=output) + print("Per-Kernel Roofline Analysis", file=output) + print("=" * 80, file=output) + + num_kernels = len(per_kernel_data['performance_rates']) + max_show = min(args.max_stat_num, num_kernels) + + for i in range(max_show): + perf = per_kernel_data['performance_rates'][i] + calc = per_kernel_data['calculation_data'][i] + + print(f"\n{'─' * 80}", file=output) + print(f"Kernel {perf['kernel_idx']}: {perf['kernel_name'][:60]}...", file=output) + print(f"{'─' * 80}", file=output) + + # Performance Rates table (with peaks) + perf_rows = [] + for m in perf['metrics']: + if m['peak'] is not None: + pct = (m['value'] / m['peak'] * 100) if m['peak'] > 0 else 0 + perf_rows.append([ + m['name'], + f"{m['value']:.2f}", + m['unit'], + f"{m['peak']:.2f}", + f"{pct:.2f}%" + ]) + + if perf_rows: + print("\nPerformance Rates (with Empirical Peaks):", file=output) + df = pd.DataFrame(perf_rows, + columns=['Metric', 'Value', 'Unit', 'Peak', '% of Peak']) + print(get_table_string(df), file=output) + + # Calculation Data table (no peaks) + calc_rows = [] + for m in calc['metrics']: + calc_rows.append([ + m['name'], + f"{m['value']:.2e}" if m['value'] > 1e6 else f"{m['value']:.2f}", + m['unit'] + ]) + + if calc_rows: + print("\nCalculation Data:", file=output) + df = pd.DataFrame(calc_rows, columns=['Metric', 'Value', 'Unit']) + print(get_table_string(df), file=output) diff --git a/projects/rocprofiler-compute/utils/autogen_hash.yaml b/projects/rocprofiler-compute/utils/autogen_hash.yaml index a078e5122d40..89422ea5cdf6 100644 --- a/projects/rocprofiler-compute/utils/autogen_hash.yaml +++ b/projects/rocprofiler-compute/utils/autogen_hash.yaml @@ -23,12 +23,12 @@ src/rocprof_compute_soc/analysis_configs/gfx940/0300_memory_chart.yaml: f3c235b5 src/rocprof_compute_soc/analysis_configs/gfx941/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6 src/rocprof_compute_soc/analysis_configs/gfx942/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6 src/rocprof_compute_soc/analysis_configs/gfx950/0300_memory_chart.yaml: deeb8671c4628aaad3046391975c9c62547460dcf18eb179ef7dc6b2729919e2 -src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e +src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 +src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: ca705bca747a236ba9f658fcc45018bb6004f9fa99796f703279357fa896e7d3 +src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 +src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 +src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 +src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: b57cb7ab0d626cc3c3d270143f44f9aa7f6efa98da98872e4640d3472b5c62da src/rocprof_compute_soc/analysis_configs/gfx908/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx90a/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx940/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb diff --git a/projects/rocprofiler-compute/utils/unified_config.yaml b/projects/rocprofiler-compute/utils/unified_config.yaml index 0f3e89e78182..d5ced799e51b 100644 --- a/projects/rocprofiler-compute/utils/unified_config.yaml +++ b/projects/rocprofiler-compute/utils/unified_config.yaml @@ -2795,9 +2795,1082 @@ panels: - id: 400 title: Roofline data source: - - None: + - metric_table: id: 401 - title: Roofline + title: Roofline Performance Rates + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + peak: Peak (Empirical) + metric: + gfx90a: + # ================================================================== + # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX90a + # Logic derived from calc_ai function. + # ================================================================== + + # --- Compute Rates --- + VALU FLOPs: + value: AVG((($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: 0 + unit: GFLOP/s + peak: 0 + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + + # --- Bandwidth Rates --- + # HBM calculation for gfx90a (MI200) uses TCC_EA_* counters per calc_ai script + HBM Bandwidth: + value: AVG(((( + (TCC_EA_RDREQ_32B_sum * 32) + + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + + (TCC_EA_WRREQ_64B_sum * 64) + + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) + ))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + gfx908: + # ================================================================== + # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX908 + # Logic is identical to gfx942 per calc_ai function + # ================================================================== + VALU FLOPs: + value: AVG((($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + gfx940: + # ================================================================== + # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX940 + # Logic falls into the default case in calc_ai, identical to gfx942 + # ================================================================== + VALU FLOPs: + value: AVG((($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + gfx941: + # ================================================================== + # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX941 + # Logic falls into the default case in calc_ai, identical to gfx942 + # ================================================================== + VALU FLOPs: + value: AVG((($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + gfx942: + # ================================================================== + # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks + # These should be AVERAGED across all dispatches. + # ================================================================== + + # --- Compute Rates --- + VALU FLOPs: + value: AVG((($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + + # --- Bandwidth Rates --- + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + gfx950: + # ================================================================== + # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX950 + # Logic derived from calc_ai function. + # ================================================================== + + # --- Compute Rates --- + VALU FLOPs: + value: AVG((($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) + MFMA FLOPs (F64): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF64Flops_empirical_peak + MFMA FLOPs (F32): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F32 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF32Flops_empirical_peak + MFMA FLOPs (F16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF16Flops_empirical_peak + MFMA FLOPs (BF16): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMABF16Flops_empirical_peak + MFMA FLOPs (F8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GFLOP/s + peak: $MFMA_FLOPs_F6F4_empirical_peak + MFMA IOPs (Int8): + value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GIOP/s + peak: $MFMAI8Ops_empirical_peak + + # --- Bandwidth Rates --- + # HBM calculation for gfx950 uses the default path in calc_ai script + HBM Bandwidth: + value: AVG(((((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $HBMBw_empirical_peak + L2 Cache Bandwidth: + value: AVG(((((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L2Bw_empirical_peak + L1 Cache Bandwidth: + value: AVG((((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $L1Bw_empirical_peak + LDS Bandwidth: + value: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + unit: GB/s + peak: $LDSBw_empirical_peak + - metric_table: + id: 402 + title: Roofline Calculation Data + cli_style: Roofline + tui_style: Roofline + header: + metric: Metric + value: Value + unit: Unit + metric: + gfx90a: + # ================================================================== + # TABLE 2: (RAW COUNTS) for GFX90a + # These should be SUMMED across all dispatches to get a total. + # ================================================================== + Total Flops: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + ))) + unit: FLOPs + Total HBM Data: + value: SUM((( + (TCC_EA_RDREQ_32B_sum * 32) + + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + + (TCC_EA_WRREQ_64B_sum * 64) + + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) + ))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) + unit: Bytes + + # ================================================================== + # FINAL ROOFLINE METRICS for GFX90a + # These use the SUM of flops and SUM of bytes. + # ================================================================== + AI HBM: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / + SUM( + (TCC_EA_RDREQ_32B_sum * 32) + + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + + (TCC_EA_WRREQ_64B_sum * 64) + + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) + ) + ) + unit: FLOPs/Byte + + Performance GFLOPs: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / + (SUM(End_Timestamp - Start_Timestamp) / 1e9) + ) / 1e9 + unit: GFLOP/s + gfx908: + # ================================================================== + # TABLE 2: (RAW COUNTS) for GFX908 + # ================================================================== + Total Flops: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) + unit: Bytes + AI HBM: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + SUM( + (TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64) + ) + ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + (SUM(End_Timestamp - Start_Timestamp) / 1e9) + ) / 1e9 + unit: GFLOP/s + gfx940: + # ================================================================== + # TABLE 2: (RAW COUNTS) for GFX940 + # ================================================================== + Total Flops: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) + unit: Bytes + # ================================================================== + # FINAL ROOFLINE METRICS for GFX940 + # ================================================================== + AI HBM: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + SUM( + (TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64) + ) + ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + (SUM(End_Timestamp - Start_Timestamp) / 1e9) + ) / 1e9 + unit: GFLOP/s + gfx941: + # ================================================================== + # TABLE 2: (RAW COUNTS) for GFX941 + # ================================================================== + Total Flops: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) + unit: Bytes + # ================================================================== + # FINAL ROOFLINE METRICS for GFX941 + # ================================================================== + AI HBM: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + SUM( + (TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64) + ) + ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + (SUM(End_Timestamp - Start_Timestamp) / 1e9) + ) / 1e9 + unit: GFLOP/s + gfx942: + # ================================================================== + # TABLE 2: (RAW COUNTS) + # Summed across all dispatches to get a total. + # ================================================================== + Total Flops: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) + unit: Bytes + + # ================================================================== + # FINAL ROOFLINE METRICS + # These use the SUM of flops and SUM of bytes. + # ================================================================== + AI HBM: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + SUM( + (TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64) + ) + ) + unit: FLOPs/Byte + + Performance GFLOPs: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + (SUM(End_Timestamp - Start_Timestamp) / 1e9) + ) / 1e9 + unit: GFLOP/s + gfx950: + # ================================================================== + # TABLE 2: (RAW COUNTS) for GFX950 + # These should be SUMMED across all dispatches to get a total. + # ================================================================== + Total Flops: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512)) + unit: FLOPs + Total VALU FLOPs: + value: SUM(($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + ))) + unit: FLOPs + Total HBM Data: + value: SUM(((TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64))) + unit: Bytes + Total L2 Cache Data: + value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * + 64)) + unit: Bytes + Total L1 Cache Data: + value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) + unit: Bytes + Total LDS Data: + value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * + 4 * $lds_banks_per_cu)) + unit: Bytes + + # ================================================================== + # FINAL ROOFLINE METRICS for GFX950 + # These use the SUM of flops and SUM of bytes. + # ================================================================== + AI HBM: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) + ) / + SUM( + (TCC_BUBBLE_sum * 128) + + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + + (TCC_EA0_WRREQ_64B_sum * 64) + ) + ) + unit: FLOPs/Byte + Performance GFLOPs: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) + ) / + (SUM(End_Timestamp - Start_Timestamp) / 1e9) + ) / 1e9 + unit: GFLOP/s + metrics_description: + VALU FLOPs: + plain: 'The total floating-point operations executed per second on the VALU. + This is also presented as a percent of the peak theoretical FLOPs achievable + on the specific accelerator. Note: this does not include any floating-point + operations from MFMA instructions.' + rst: 'The total floating-point operations executed per second on the :ref:`VALU + `. This is also presented as a percent of the peak theoretical + FLOPs achievable on the specific accelerator. Note: this does not include + any floating-point operations from :ref:`MFMA ` instructions.' + unit: GFLOPs + MFMA FLOPs (F8): + plain: The total number of 8-bit brain floating point MFMA operations executed + per second. This does not include any 16-bit brain floating point operations + from VALU instructions. The peak empirically measured F8 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison. + It is supported on AMD Instinct MI300 series and later only. + rst: 'The total number of 8-bit brain floating point :ref:`MFMA ` + operations executed per second. Note: this does not include any 16-bit brain + floating point operations from :ref:`VALU ` instructions. The + peak empirically measured F8 MFMA operations achievable on the specific + accelerator is displayed alongside for comparison. It is supported on AMD + Instinct MI300 series and later only.' + unit: GFLOPs + MFMA FLOPs (BF16): + plain: 'The total number of 16-bit brain floating point MFMA operations executed + per second. Note: this does not include any 16-bit brain floating point + operations from VALU instructions. The peak empirically measured BF16 MFMA + operations achievable on the specific accelerator is displayed alongside + for comparison.' + rst: 'The total number of 16-bit brain floating point :ref:`MFMA ` + operations executed per second. Note: this does not include any 16-bit brain + floating point operations from :ref:`VALU ` instructions. The + peak empirically measured BF16 MFMA operations achievable on the specific + accelerator is displayed alongside for comparison.' + unit: GFLOPs + MFMA FLOPs (F16): + plain: 'The total number of 16-bit floating point MFMA operations executed per + second. Note: this does not include any 16-bit floating point operations from + VALU instructions. The peak empirically measured F16 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + rst: 'The total number of 16-bit floating point :ref:`MFMA ` operations + executed per second. Note: this does not include any 16-bit floating point + operations from :ref:`VALU ` instructions. The peak empirically + measured F16 MFMA operations achievable on the specific accelerator is + displayed alongside for comparison.' + unit: GFLOPs + MFMA FLOPs (F32): + plain: 'The total number of 32-bit floating point MFMA operations executed per + second. Note: this does not include any 32-bit floating point operations from + VALU instructions. The peak empirically measured F32 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + rst: 'The total number of 32-bit floating point :ref:`MFMA ` operations + executed per second. Note: this does not include any 32-bit floating point + operations from :ref:`VALU ` instructions. The peak empirically + measured F32 MFMA operations achievable on the specific accelerator is + displayed alongside for comparison.' + unit: GFLOPs + MFMA FLOPs (F64): + plain: 'The total number of 64-bit floating point MFMA operations executed per + second. Note: this does not include any 64-bit floating point operations from + VALU instructions. The peak empirically measured F64 MFMA operations + achievable on the specific accelerator is displayed alongside for comparison.' + rst: 'The total number of 64-bit floating point :ref:`MFMA ` operations + executed per second. Note: this does not include any 64-bit floating point + operations from :ref:`VALU ` instructions. The peak empirically + measured F64 MFMA operations achievable on the specific accelerator is + displayed alongside for comparison.' + unit: GFLOPs + MFMA IOPs (Int8): + plain: 'The total number of 8-bit integer MFMA operations executed per second. + Note: this does not include any 8-bit integer operations from VALU instructions. + The peak empirically measured INT8 MFMA operations achievable on the specific + accelerator is displayed alongside for comparison.' + rst: 'The total number of 8-bit integer :ref:`MFMA ` operations executed + per second. Note: this does not include any 8-bit integer operations from + :ref:`VALU ` instructions. The peak empirically measured INT8 MFMA + operations achievable on the specific accelerator is displayed alongside + for comparison.' + unit: GIOPs + HBM Bandwidth: + plain: '' + rst: '' + unit: GB/s + L2 Cache Bandwidth: + plain: The number of bytes looked up in the L2 cache per unit time. The number + of bytes is calculated as the number of cache lines requested multiplied by + the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + rst: The number of bytes looked up in the L2 cache per unit time. The number of + bytes is calculated as the number of cache lines requested multiplied by + the cache line size. This value does not consider partial requests, so e.g., + if only a single value is requested in a cache line, the data movement will + still be counted as a full cache line. The peak empirically measured + bandwidth achievable on the specific accelerator is displayed alongside + for comparison. + unit: GB/s + L1 Cache Bandwidth: + plain: The number of bytes looked up in the vL1D cache as a result of VMEM + instructions per unit time. The number of bytes is calculated as the number + of cache lines requested multiplied by the cache line size. This value does + not consider partial requests, so e.g., if only a single value is requested + in a cache line, the data movement will still be counted as a full cache line. + The peak empirically measured bandwidth achievable on the specific accelerator + is displayed alongside for comparison. + rst: The number of bytes looked up in the vL1D cache as a result of :ref:`VMEM + ` instructions per unit time. The number of bytes is calculated + as the number of cache lines requested multiplied by the cache line size. + This value does not consider partial requests, so e.g., if only a single + value is requested in a cache line, the data movement will still be counted + as a full cache line. The peak empirically measured bandwidth achievable on + the specific accelerator is displayed alongside for comparison. + unit: GB/s + LDS Bandwidth: + plain: Indicates the maximum amount of bytes that could have been loaded from, + stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth + example for more detail). The peak empirically measured LDS bandwidth + achievable on the specific accelerator is displayed alongside for comparison. + rst: Indicates the maximum amount of bytes that could have been loaded from, + stored to, or atomically updated in the LDS per unit time (see :ref:`LDS + Bandwidth ` example for more detail). The peak empirically + measured LDS bandwidth achievable on the specific accelerator is displayed + alongside for comparison. + unit: GB/s + Total Flops: + plain: '' + rst: '' + unit: FLOPs + Total VALU FLOPs: + plain: '' + rst: '' + unit: FLOPs + Total HBM Data: + plain: '' + rst: '' + unit: Bytes + Total L2 Cache Data: + plain: '' + rst: '' + unit: Bytes + Total L1 Cache Data: + plain: '' + rst: '' + unit: Bytes + Total LDS Data: + plain: '' + rst: '' + unit: Bytes + AI HBM: + plain: '' + rst: '' + unit: FLOPs/Byte + Performance GFLOPs: + plain: '' + rst: '' + unit: GFLOP/s - id: 500 title: Command Processor (CPC/CPF) data source: From d90c54874b7b4cddc092e0891144f224ff06fbc0 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Mon, 11 Aug 2025 12:04:38 -0500 Subject: [PATCH 02/14] added per-kernel eval_metric calculation with display --- .../rocprof_compute_analyze/analysis_cli.py | 131 ++----- .../gfx908/0400_roofline.yaml | 10 +- .../gfx90a/0400_roofline.yaml | 10 +- .../gfx940/0400_roofline.yaml | 10 +- .../gfx941/0400_roofline.yaml | 10 +- .../gfx942/0400_roofline.yaml | 57 ++- .../gfx950/0400_roofline.yaml | 10 +- projects/rocprofiler-compute/src/roofline.py | 49 ++- .../src/utils/roofline_calc.py | 333 +++++++----------- projects/rocprofiler-compute/src/utils/tty.py | 198 +++++------ .../utils/autogen_hash.yaml | 12 +- .../utils/unified_config.yaml | 152 +++----- 12 files changed, 363 insertions(+), 619 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py index 412b38e82abf..3092310add38 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py @@ -73,8 +73,8 @@ def pre_processing(self): workload.raw_pmc, self.get_args().kernel_verbose ) - if len(self.get_args().path) == 1: - self.calculate_per_kernel_roofline_tables(d[0]) + #update path + self._runs[d[0]].path = d[0] # create the loaded table parser.load_table_data( @@ -85,87 +85,6 @@ def pre_processing(self): config=self._profiling_config, ) - - def calculate_per_kernel_roofline_tables(self, run_dir): - """ - Calculate per-kernel roofline metrics using the eval_metric engine. - """ - workload = self._runs[run_dir] - arch = workload.sys_info.iloc[0]["gpu_arch"] - - # Check for architecture and panel compatibility - if arch not in self._arch_configs or 400 not in self._arch_configs[arch].panel_configs: - return - - arch_config = self._arch_configs[arch] - roofline_panel = arch_config.panel_configs[400] - - # Find the two roofline tables from the config - roofline_tables = {} - for data_source in roofline_panel.get("data source", []): - if "metric_table" in data_source: - table_config = data_source["metric_table"] - if table_config.get("cli_style") == "Roofline": - roofline_tables[table_config["id"]] = table_config - - if not roofline_tables: - return - - console_log("Calculating per-kernel roofline metrics...") - - workload.per_kernel_roofline = {'performance_rates': [], 'calculation_data': []} - - # We need a function to get the top kernels list. Assuming one exists in file_io. - # Let's define a helper for this. - kernel_top_df = file_io.create_df_from_file(run_dir, "pmc_kernel_top.csv") - if kernel_top_df.empty: - console_warning("pmc_kernel_top.csv not found for per-kernel roofline. Skipping.") - return - - unique_kernels = kernel_top_df.head(self.get_args().max_stat_num) - - # MAIN LOOP: Iterate through each kernel - for kernel_idx, kernel_row in unique_kernels.iterrows(): - kernel_name = kernel_row['Kernel_Name'] - - single_kernel_pmc_df = workload.raw_pmc[workload.raw_pmc['pmc_perf']['Kernel_Name'] == kernel_name] - if single_kernel_pmc_df.empty: - continue - - perf_results, calc_results = {}, {} - for table_id, table_config in roofline_tables.items(): - temp_df = workload.dfs[table_id].copy() - - parser.eval_metric( - {table_id: temp_df}, {table_id: "metric_table"}, - workload.sys_info.iloc[0], - workload.roofline_peaks, # <-- This comes from the base class now! - single_kernel_pmc_df, - self.get_args().debug, self._profiling_config, - ) - - if table_id == 401: perf_results = temp_df.set_index('Metric').to_dict('index') - elif table_id == 402: calc_results = temp_df.set_index('Metric').to_dict('index') - - # Structure results for TTY - perf_metrics_for_tty = [ - {'name': name, 'value': data['Value'], 'unit': data['Unit'], 'peak': data.get('Peak (Empirical)')} - for name, data in perf_results.items() - ] - calc_metrics_for_tty = [ - {'name': name, 'value': data['Value'], 'unit': data['Unit']} - for name, data in calc_results.items() - ] - - workload.per_kernel_roofline['performance_rates'].append({ - 'kernel_idx': kernel_idx, 'kernel_name': kernel_name, 'metrics': perf_metrics_for_tty - }) - workload.per_kernel_roofline['calculation_data'].append({ - 'kernel_idx': kernel_idx, 'kernel_name': kernel_name, 'metrics': calc_metrics_for_tty - }) - - console_log(f"Finished calculating per-kernel roofline for {len(unique_kernels)} kernels.") - @demarcate def run_analysis(self): """Run CLI analysis.""" @@ -183,25 +102,31 @@ def run_analysis(self): else: roof_plot = None # 1. check if not baseline && compatible soc: - if len(self.get_args().path) == 1: - workload = self._runs[self.get_args().path[0][0]] - arch = workload.sys_info.iloc[0]["gpu_arch"] + if (len(self.get_args().path)) == 1: + workload_path = self.get_args().path[0][0] + workload = self._runs[workload_path] + gpu_arch = workload.sys_info.iloc[0]["gpu_arch"] + + if gpu_arch in ["gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]: + roof_obj = self.get_socs()[gpu_arch].roofline_obj - if arch in ["gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]: - roof_obj = self.get_socs()[arch].roofline_obj + if roof_obj: + #store path in workload for calc_ai_analyze + workload.path = workload_path - if roof_obj: - roof_obj._workload = workload - roof_obj._arch_config = self._arch_configs[arch] - roof_obj._profiling_config = self._profiling_config - - roof_plot = roof_obj.cli_generate_plot(roof_obj.get_dtype()[0]) - - tty.show_all( - self.get_args(), - self._runs, - self._arch_configs[workload.sys_info.iloc[0]["gpu_arch"]], - self._output, - self._profiling_config, - roof_plot=roof_plot, - ) + # NOTE: using default data type + roof_plot = roof_obj.cli_generate_plot( + dtype=roof_obj.get_dtype()[0], + workload=workload, + config=self._profiling_config, + arch_config=self._arch_configs[gpu_arch] + ) + + tty.show_all( + self.get_args(), + self._runs, + self._arch_configs[self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"]], + self._output, + self._profiling_config, + roof_plot=roof_plot, + ) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml index 4325ae31046f..8c82e233a835 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml @@ -50,12 +50,8 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - Total Flops: '' - Total VALU FLOPs: '' - Total HBM Data: '' - Total L2 Cache Data: '' - Total L1 Cache Data: '' - Total LDS Data: '' + AI L1: '' + AI L2: '' AI HBM: '' Performance GFLOPs: '' data source: @@ -134,7 +130,7 @@ Panel Config: peak: $LDSBw_empirical_peak - metric_table: id: 402 - title: Roofline Calculation Data + title: Roofline Plot Points cli_style: Roofline tui_style: Roofline header: diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml index ef4358b495eb..557acf7c87fa 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml @@ -50,12 +50,8 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - Total Flops: '' - Total VALU FLOPs: '' - Total HBM Data: '' - Total L2 Cache Data: '' - Total L1 Cache Data: '' - Total LDS Data: '' + AI L1: '' + AI L2: '' AI HBM: '' Performance GFLOPs: '' data source: @@ -132,7 +128,7 @@ Panel Config: peak: $LDSBw_empirical_peak - metric_table: id: 402 - title: Roofline Calculation Data + title: Roofline Plot Points cli_style: Roofline tui_style: Roofline header: diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml index 4325ae31046f..8c82e233a835 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml @@ -50,12 +50,8 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - Total Flops: '' - Total VALU FLOPs: '' - Total HBM Data: '' - Total L2 Cache Data: '' - Total L1 Cache Data: '' - Total LDS Data: '' + AI L1: '' + AI L2: '' AI HBM: '' Performance GFLOPs: '' data source: @@ -134,7 +130,7 @@ Panel Config: peak: $LDSBw_empirical_peak - metric_table: id: 402 - title: Roofline Calculation Data + title: Roofline Plot Points cli_style: Roofline tui_style: Roofline header: diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml index 4325ae31046f..8c82e233a835 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml @@ -50,12 +50,8 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - Total Flops: '' - Total VALU FLOPs: '' - Total HBM Data: '' - Total L2 Cache Data: '' - Total L1 Cache Data: '' - Total LDS Data: '' + AI L1: '' + AI L2: '' AI HBM: '' Performance GFLOPs: '' data source: @@ -134,7 +130,7 @@ Panel Config: peak: $LDSBw_empirical_peak - metric_table: id: 402 - title: Roofline Calculation Data + title: Roofline Plot Points cli_style: Roofline tui_style: Roofline header: diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml index 4325ae31046f..11009963a0b5 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml @@ -50,12 +50,8 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - Total Flops: '' - Total VALU FLOPs: '' - Total HBM Data: '' - Total L2 Cache Data: '' - Total L1 Cache Data: '' - Total LDS Data: '' + AI L1: '' + AI L2: '' AI HBM: '' Performance GFLOPs: '' data source: @@ -134,7 +130,7 @@ Panel Config: peak: $LDSBw_empirical_peak - metric_table: id: 402 - title: Roofline Calculation Data + title: Roofline Plot Points cli_style: Roofline tui_style: Roofline header: @@ -142,39 +138,31 @@ Panel Config: value: Value unit: Unit metric: - Total Flops: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) + unit: FLOPs/Byte + AI L2: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum - + TCP_TCC_READ_REQ_sum) * 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) - unit: Bytes - AI HBM: + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 ) ) + unit: FLOPs/Byte + AI L1: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) @@ -182,12 +170,9 @@ Panel Config: + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) - + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) - + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum - * 64) ) ) + * 512) ) / SUM( TCP_TOTAL_CACHE_ACCESSES_sum * 64 ) ) unit: FLOPs/Byte - Performance GFLOPs: + Performance (GFLOPs): value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml index c167086e15f8..d87ff259abec 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml @@ -50,12 +50,8 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - Total Flops: '' - Total VALU FLOPs: '' - Total HBM Data: '' - Total L2 Cache Data: '' - Total L1 Cache Data: '' - Total LDS Data: '' + AI L1: '' + AI L2: '' AI HBM: '' Performance GFLOPs: '' data source: @@ -139,7 +135,7 @@ Panel Config: peak: $LDSBw_empirical_peak - metric_table: id: 402 - title: Roofline Calculation Data + title: Roofline Plot Points cli_style: Roofline tui_style: Roofline header: diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index 29c177f3791f..cbd2a4c8c740 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -49,7 +49,7 @@ MFMA_DATATYPES, PEAK_OPS_DATATYPES, SUPPORTED_DATATYPES, - calc_ai, + calc_ai_analyze, calc_ai_profile, constuct_roof, ) @@ -609,7 +609,7 @@ def generate_plot(self, dtype, fig=None) -> go.Figure(): return fig - def cli_generate_plot(self, dtype): + def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None): """ Plot CLI mode roofline analysis in terminal using plotext @@ -629,6 +629,41 @@ def cli_generate_plot(self, dtype): ) return + #if workload is detected, utilize Roofline yamls. If not, fallback to legacy calc_ai + if workload is not None: + self.__ai_data = calc_ai_analyze( + workload=workload, + mspec=self.__mspec, + sort_type=self.__run_parameters.get("sort_type"), + config=config, + arch_config=arch_config + ) + + self.__ceiling_data = constuct_roof( + roofline_parameters=self.__run_parameters, + dtype=dtype + ) + + else: + pmc_perf_csv = base_path / "pmc_perf.csv" + if not pmc_perf_csv.is_file(): + console_error("roofline", "{} does not exist".format(pmc_perf_csv)) + t_df = OrderedDict() + t_df["pmc_perf"] = pd.read_csv(pmc_perf_csv) + + self.__ai_data = calc_ai_profile( + self.__mspec, + self.__run_parameters["sort_type"], + t_df + ) + self.__ceiling_data = constuct_roof( + roofline_parameters=self.__run_parameters, + dtype=dtype + ) + + console_debug(f"AI data: {self.__ai_data}") + console_debug(f"Kernel names: {self.__ai_data.get('kernelNames', [])}") + # Normalize workload_dir to get the base directory workload_dir = self.__run_parameters.get("workload_dir") if workload_dir is None: @@ -674,11 +709,6 @@ def cli_generate_plot(self, dtype): console_log("roofline", "{} does not exist".format(roofline_csv)) return - pmc_perf_csv = base_path / "pmc_perf.csv" - if not pmc_perf_csv.is_file(): - console_error("roofline", "{} does not exist".format(pmc_perf_csv)) - t_df = OrderedDict() - t_df["pmc_perf"] = pd.read_csv(pmc_perf_csv) profiling_config = file_io.load_profiling_config(self.__args.path[0][0]) if profiling_config.get("format_rocprof_output") == "rocpd": t_df["pmc_perf"] = rocpd_data.process_rocpd_csv(t_df["pmc_perf"]) @@ -701,11 +731,6 @@ def cli_generate_plot(self, dtype): 5: "atom", } - self.__ceiling_data = constuct_roof( - roofline_parameters=self.__run_parameters, - dtype=dtype, - ) - self.__ai_data = calc_ai(self.__mspec, self.__run_parameters["sort_type"], t_df) plt.clf() plt.plotsize(plt.tw(), plt.th()) diff --git a/projects/rocprofiler-compute/src/utils/roofline_calc.py b/projects/rocprofiler-compute/src/utils/roofline_calc.py index ff024fb7ed2d..421bd2ff90ad 100644 --- a/projects/rocprofiler-compute/src/utils/roofline_calc.py +++ b/projects/rocprofiler-compute/src/utils/roofline_calc.py @@ -27,6 +27,7 @@ import csv from dataclasses import dataclass from pathlib import Path +import pandas as pd from utils.logger import console_debug from utils import file_io, parser, schema @@ -255,219 +256,141 @@ def calc_ceilings(roofline_parameters, dtype, benchmark_data): # Overlay application performance # ------------------------------------------------------------------------------------- # Calculate relevant metrics for ai calculation -def calc_ai(mspec, sort_type, ret_df, workload=None, arch_config=None, profiling_config=None): - +def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): + """ + Calculate per-kernel metrics and AI points with Roofine yamls using eval_metric. """ - Calculate arithmetic intensity for roofline analysis. - RETURNS: - - AI plot data dict (same format as before for compatibility) - - SIDE EFFECT: - - Stores per-kernel metrics in workload.per_kernel_roofline (for tables) + plot_points = { + "ai_l1": [[], []], + "ai_l2": [[], []], + "ai_hbm": [[], []], + "kernelNames": [] + } - This single function handles both legacy and YAML-based calculation. - """ + workload.roofline_metrics = {} + filtered_pmc = parser.apply_filters( + workload, + workload.path, + is_gui=False, + debug=False + ) - # Try YAML-based calculation if all configs provided - if workload and arch_config and profiling_config: - print("Using YAML-based roofline calculation!!!!!!!!!!!!") - try: - arch = workload.sys_info.iloc[0]["gpu_arch"] - - # Get roofline configuration from YAML - if 400 not in arch_config.panel_configs: - raise ValueError("Roofline panel 400 not found") - - roofline_panel = arch_config.panel_configs[400] - - # Find tables 401 (performance rates) and 402 (calculation data) - table_401_config = None - table_402_config = None - - for data_source in roofline_panel["data source"]: - if "metric_table" in data_source: - table_config = data_source["metric_table"] - if table_config["id"] == 401: - table_401_config = table_config - elif table_config["id"] == 402: - table_402_config = table_config - - if not table_401_config or not table_402_config: - raise ValueError("Tables 401/402 not found") - - # Initialize plot data (same format as legacy for compatibility) - ai_data = { - "ai_hbm": [[], []], # [[x_values], [y_values]] - "ai_l2": [[], []], - "ai_l1": [[], []], - "ai_lds": [[], []], - "kernelNames": [] - } - - # Initialize per-kernel metrics storage (for tables) - per_kernel_metrics = { - 'performance_rates': [], # Table 401 data - 'calculation_data': [] # Table 402 data - } - - raw_pmc = ret_df.get("pmc_perf", pd.DataFrame()) - if raw_pmc.empty: - return ai_data - - # Get metrics configuration for this architecture - metrics_401 = table_401_config["metric"].get(arch, {}) - metrics_402 = table_402_config["metric"].get(arch, {}) - - # PROCESS EACH KERNEL - for kernel_idx in raw_pmc.index: - kernel_name = raw_pmc.loc[kernel_idx, 'Kernel_Name'] - ai_data["kernelNames"].append(kernel_name) - - # Create single-kernel DataFrame - single_kernel_df = raw_pmc.loc[[kernel_idx]].copy() - - # ===== EVALUATE TABLE 401 (Performance Rates with peaks) ===== - df_401 = pd.DataFrame() - headers_401 = ["Metric_ID", "Metric", "value", "unit", "coll_level", "peak"] - data_401 = [] - - for i, (metric_name, metric_def) in enumerate(metrics_401.items()): - data_401.append([ - f"40100{i:02d}", - metric_name, - metric_def.get('value', ''), - metric_def.get('unit', ''), - 'pmc_perf', - metric_def.get('peak', '') - ]) - - df_401 = pd.DataFrame(data_401, columns=headers_401) - df_401.set_index("Metric_ID", inplace=True) - - # ===== EVALUATE TABLE 402 (Calculation Data without peaks) ===== - df_402 = pd.DataFrame() - headers_402 = ["Metric_ID", "Metric", "value", "unit", "coll_level"] - data_402 = [] - - for i, (metric_name, metric_def) in enumerate(metrics_402.items()): - data_402.append([ - f"40200{i:02d}", - metric_name, - metric_def.get('value', ''), - metric_def.get('unit', ''), - 'pmc_perf' - ]) - - df_402 = pd.DataFrame(data_402, columns=headers_402) - df_402.set_index("Metric_ID", inplace=True) - - # Prepare for eval_metric - temp_dfs = {401: df_401, 402: df_402} - temp_dfs_type = {401: "metric_table", 402: "metric_table"} - - # Build evaluation strings - parser.build_metric_value_string( - temp_dfs, - temp_dfs_type, - "per_kernel", - profiling_config - ) - - # Create raw_pmc structure for this kernel - kernel_raw_pmc = {"pmc_perf": single_kernel_df} - - # EVALUATE using existing eval_metric (this does all the work!) - parser.eval_metric( - temp_dfs, - temp_dfs_type, - workload.sys_info.iloc[0], - workload.roofline_peaks, # Has empirical peaks from roofline.csv - kernel_raw_pmc, - False, # debug - profiling_config - ) - - # ===== EXTRACT RESULTS FOR TABLE DISPLAY ===== - perf_metrics = { - 'kernel_idx': kernel_idx, - 'kernel_name': kernel_name, - 'metrics': [] - } - - for idx, row in temp_dfs[401].iterrows(): - value = row.get('value', 0) - if pd.isna(value) or value == float('inf'): - value = 0.0 - - # Peak is already evaluated by eval_metric! - peak = row.get('peak', None) - if pd.isna(peak) or peak == 0: - peak = None - - perf_metrics['metrics'].append({ - 'name': row['Metric'], - 'value': float(value), - 'unit': row.get('unit', ''), - 'peak': float(peak) if peak else None - }) - - calc_metrics = { - 'kernel_idx': kernel_idx, - 'kernel_name': kernel_name, - 'metrics': [] - } - - for idx, row in temp_dfs[402].iterrows(): - value = row.get('value', 0) - if pd.isna(value) or value == float('inf'): - value = 0.0 - - calc_metrics['metrics'].append({ - 'name': row['Metric'], - 'value': float(value), - 'unit': row.get('unit', ''), - 'peak': None # No peaks for calculation data - }) - - per_kernel_metrics['performance_rates'].append(perf_metrics) - per_kernel_metrics['calculation_data'].append(calc_metrics) - - # ===== EXTRACT VALUES FOR PLOT ===== - calc_dict = {m['name']: m['value'] for m in calc_metrics['metrics']} - - total_flops = calc_dict.get('Total_FLOPs', 0) - perf_gflops = calc_dict.get('Performance_GFLOPs', 0) - - # Calculate AI for each memory level - for mem_level, data_key in [ - ('ai_hbm', 'Total_HBM_Data'), - ('ai_l2', 'Total L2 Cache Data'), - ('ai_l1', 'Total L1 Cache Data'), - ('ai_lds', 'Total LDS Data') - ]: - mem_data = calc_dict.get(data_key, 0) - if mem_data > 0: - ai_data[mem_level][0].append(total_flops / mem_data) - ai_data[mem_level][1].append(perf_gflops) - else: - ai_data[mem_level][0].append(0) - ai_data[mem_level][1].append(0) - - # STORE PER-KERNEL METRICS (side effect for table display) - workload.per_kernel_roofline = per_kernel_metrics - - console_log("Using YAML-based per-kernel roofline calculation") - return ai_data - - except Exception as e: - console_warning(f"YAML-based calc_ai failed: {e}, falling back to legacy") + kernel_ids_to_process = [] + kernel_top_table_id = 1 + + if workload.filter_kernel_ids: + kernel_ids_to_process = workload.filter_kernel_ids + else: + if kernel_top_table_id in workload.dfs: + kernel_top_df = workload.dfs[kernel_top_table_id] + kernel_ids_to_process = kernel_top_df.index.tolist() + console_debug("roofline", f"Found {len(kernel_ids_to_process)} kernels to process") - return calc_ai_profile(mspec, sort_type, ret_df) + if not kernel_ids_to_process: + console_warning("No kernels found to process for roofline") + return plot_points + + for kernel_id in kernel_ids_to_process: + if kernel_top_table_id in workload.dfs: + kernel_top_df = workload.dfs[kernel_top_table_id] + if kernel_id in kernel_top_df.index: + kernel_name = kernel_top_df.loc[kernel_id, "Kernel_Name"] + else: + continue + else: + continue + + console_debug("roofline", f"Processing kernel {kernel_id}: {kernel_name[:50]}") + + #filter PMC data for specific kernel + kernel_pmc_df = filtered_pmc[ + filtered_pmc["pmc_perf"]["Kernel_Name"] == kernel_name + ] + + if kernel_pmc_df.empty: + console_debug("roofline", f"No PMC data for kernel {kernel_id}") + continue + + kernel_only_data = {"pmc_perf": kernel_pmc_df["pmc_perf"]} + + kernel_dfs = {} + kernel_dfs_type = {} + + for table_id in [401, 402]: + if table_id in arch_config.dfs: + kernel_dfs[table_id] = arch_config.dfs[table_id].copy() + kernel_dfs_type[table_id] = arch_config.dfs_type[table_id] + + #eval metrics for single kernel only + parser.eval_metric( + kernel_dfs, + kernel_dfs_type, + workload.sys_info.iloc[0], + workload.roofline_peaks, + kernel_only_data, + debug=False, + config=config + ) + + #DEBUG + if 402 in kernel_dfs: + console_debug("roofline", f"Table 402 for kernel {kernel_id}:") + for idx, row in kernel_dfs[402].iterrows(): + console_debug("roofline", f" {row.get('Metric', '')}: {row.get('Value', '')}") + + ai_hbm = ai_l2 = ai_l1 = performance = 0 + + if 402 in kernel_dfs: + for idx, row in kernel_dfs[402].iterrows(): + metric = row.get('Metric', '') + value = row.get('Value', 0) + if metric == 'AI HBM': + ai_hbm = value if value and value != '' else 0 + elif metric == 'AI L2': + ai_l2 = value if value and value != '' else 0 + elif metric == 'AI L1': + ai_l1 = value if value and value != '' else 0 + elif metric == 'Performance (GFLOPs)': + performance = value if value and value != '' else 0 + + console_debug("roofline", f"Kernel {kernel_id}: AI_HBM={ai_hbm:.2f}, AI_L2={ai_l2:.2f}, AI_L1={ai_l1:.2f}, Performance={performance:.2e} FLOP/s") + + #add to plot points if we have valid data + if performance > 0: + if ai_hbm > 0: + plot_points["ai_hbm"][0].append(ai_hbm) + plot_points["ai_hbm"][1].append(performance) + if ai_l2 > 0: + plot_points["ai_l2"][0].append(ai_l2) + plot_points["ai_l2"][1].append(performance) + if ai_l1 > 0: + plot_points["ai_l1"][0].append(ai_l1) + plot_points["ai_l1"][1].append(performance) + plot_points["kernelNames"].append(f"K{kernel_id}") + console_debug("roofline", f"Added kernel {kernel_id} to plot points") + else: + console_debug("roofline", f"Skipping kernel {kernel_id} - no performance data") + + #store metrics for display + workload.roofline_metrics[kernel_id] = { + 'name': kernel_name, + 'ai_table': kernel_dfs.get(401, pd.DataFrame()), + 'calc_table': kernel_dfs.get(402, pd.DataFrame()) + } + + console_debug("roofline", f"Generated {len(plot_points['kernelNames'])} plot points") + console_debug("roofline", f"Plot points: {plot_points}") + return plot_points def calc_ai_profile(mspec, sort_type, ret_df): - """Given counter data, calculate arithmetic intensity for each kernel in the application.""" + """Given counter data, calculate arithmetic intensity for each kernel in the application. + Leverage hard-coded equations to calculate AI values. + + Used during profiling stage to generate roofline PDF, since Roofline yamls are not available + in the profiling stage.""" + print("Starting legacy roofline calculation (froom roofline calc)") df = ret_df["pmc_perf"] # Sort by top kernels or top dispatches? diff --git a/projects/rocprofiler-compute/src/utils/tty.py b/projects/rocprofiler-compute/src/utils/tty.py index 0a5ef8df0338..6bf3f497a227 100644 --- a/projects/rocprofiler-compute/src/utils/tty.py +++ b/projects/rocprofiler-compute/src/utils/tty.py @@ -32,7 +32,7 @@ from tabulate import tabulate import config -from utils import mem_chart, parser +from utils import mem_chart, parser, kernel_name_shortener from utils.logger import console_error, console_log, console_warning from utils.utils import convert_metric_id_to_panel_info @@ -108,6 +108,14 @@ def convert_time_columns(df, time_unit): return df_copy +def shorten_kernel_name(kernel_name, verbosity_level): + """Helper function to shorten kernel names""" + if verbosity_level < 5: + temp_df = pd.DataFrame({'Kernel_Name': [kernel_name]}) + utils.kernel_name_shortener(temp_df, verbosity_level) + return temp_df.loc[0, 'Kernel_Name'] + return kernel_name + def has_time_data(df): """ @@ -146,33 +154,77 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): ss = "" # store content of all data_source from one panel if panel_id == 400: - print("\n" + "=" * 80, "PANEL 400: Roofline", "=" * 80) - # Check for cli_style: Roofline in tables - has_roofline_style = False - for data_source in panel["data source"]: - if "metric_table" in data_source: - if data_source["metric_table"].get("cli_style") == "Roofline": - has_roofline_style = True - break - print(has_roofline_style) - if has_roofline_style: - # Display per-kernel roofline tables - print(runs.items()) - for run, workload in runs.items(): - - if hasattr(workload, 'per_kernel_roofline'): - display_per_kernel_roofline_tables( - workload.per_kernel_roofline, - args, - output - ) - break + has_roofline_style = any( + data_source.get(type, {}).get("cli_style") == "Roofline" + for data_source in panel["data source"] + for type in data_source + ) - # Show roofline plot (uses same data) - if roof_plot: - show_roof_plot(roof_plot) - continue - + if has_roofline_style and (not args.filter_metrics or "4" in args.filter_metrics): + print("\n" + "=" * 80, file=output) + print("4. Roofline", file=output) + print("=" * 80, file=output) + + for run_path, workload in runs.items(): + if hasattr(workload, 'roofline_metrics') and workload.roofline_metrics: + print("\nPer-Kernel Roofline Metrics (4.1) and AI Plot Points (4.2)", file=output) + print("-" * 80, file=output) + + kernel_top_df = workload.dfs.get(1, pd.DataFrame()) + + for i, (kernel_id, metrics) in enumerate(workload.roofline_metrics.items()): + if not kernel_top_df.empty and kernel_id in kernel_top_df.index: + kernel_name = kernel_top_df.loc[kernel_id, "Kernel_Name"] + kernel_pct = kernel_top_df.loc[kernel_id, "Pct"] if "Pct" in kernel_top_df.columns else 0 + else: + kernel_name = metrics.get('name', f'Kernel {kernel_id}') + kernel_pct = 0 + + shortened_name = shorten_kernel_name(kernel_name, args.kernel_verbose) + + print(f"\nKernel {kernel_id}: {shortened_name[:60]}{'...' if len(shortened_name) > 60 else ''} ({kernel_pct:.1f}%)", file=output) + + base_indent = " " + table_indent_prefix = f"{base_indent}| " + + table_order = [401, 402] + table_names = {401: "4.1 Roofline Rate Metrics:", 402: "4.2 Roofline AI Plot Points:"} + + print(f"{base_indent}|") + + for table_id in table_order: + if table_id == 402: + df = metrics.get('calc_table', pd.DataFrame()) + elif table_id == 401: + df = metrics.get('ai_table', pd.DataFrame()) + else: + continue + + if df.empty: + continue + + connector = "├─ " + print(f"{base_indent}{connector}{table_names.get(table_id, '')}", file=output) + + display_df = df.copy() + + for col in hidden_cols: + if col in display_df.columns: + display_df = display_df.drop(columns=[col]) + + table_string = get_table_string(display_df, transpose=False, decimal=args.decimal) + + indented_table_string = textwrap.indent(table_string, table_indent_prefix) + + print(indented_table_string, file=output) + + else: + print("\nNo per-kernel metrics available", file=output) + + # Show the roofline plot + if roof_plot: + show_roof_plot(roof_plot) + continue for data_source in panel["data source"]: for type, table_config in data_source.items(): @@ -457,98 +509,12 @@ def show_roof_plot(roof_plot): # TODO: short term solution to display roofline plot print("\n" + "-" * 80) print("4. Roofline") - print("4.1 Roofline") + print("4.3 Roofline Plot") if roof_plot: print(roof_plot) else: console_error( - "Cannot create roofline plot for CLI with incomplete/missing roofline profiling data.", + "Cannot create roofline plot for CLI with incomplete/missing " + "roofline profiling data.", exit=False, ) - - -def show_kernel_stats(args, runs, archConfigs, output): - """ - Show the kernels and dispatches from "Top Stats" section. - """ - - df = pd.DataFrame() - for panel_id, panel in archConfigs.panel_configs.items(): - for data_source in panel["data source"]: - for type, table_config in data_source.items(): - for run, data in runs.items(): - df = pd.DataFrame() - single_df = data.dfs[table_config["id"]] - # NB: - # For pmc_kernel_top.csv, have to sort here if not - # sorted when load_table_data. - if table_config["id"] == 1: - print("\n" + "-" * 80, file=output) - print( - "Detected Kernels (sorted descending by duration)", - file=output, - ) - df = pd.concat([df, single_df["Kernel_Name"]], axis=1) - - if table_config["id"] == 2: - print("\n" + "-" * 80, file=output) - print("Dispatch list", file=output) - df = single_df - - print( - get_table_string(df, transpose=False, decimal=args.decimal), - file=output, - ) - - -def display_per_kernel_roofline_tables(per_kernel_data, args, output): - print("Entering display_per_kernel_roofline_tables") - """Display per-kernel roofline metrics in two-section format.""" - - print("\n" + "=" * 80, file=output) - print("Per-Kernel Roofline Analysis", file=output) - print("=" * 80, file=output) - - num_kernels = len(per_kernel_data['performance_rates']) - max_show = min(args.max_stat_num, num_kernels) - - for i in range(max_show): - perf = per_kernel_data['performance_rates'][i] - calc = per_kernel_data['calculation_data'][i] - - print(f"\n{'─' * 80}", file=output) - print(f"Kernel {perf['kernel_idx']}: {perf['kernel_name'][:60]}...", file=output) - print(f"{'─' * 80}", file=output) - - # Performance Rates table (with peaks) - perf_rows = [] - for m in perf['metrics']: - if m['peak'] is not None: - pct = (m['value'] / m['peak'] * 100) if m['peak'] > 0 else 0 - perf_rows.append([ - m['name'], - f"{m['value']:.2f}", - m['unit'], - f"{m['peak']:.2f}", - f"{pct:.2f}%" - ]) - - if perf_rows: - print("\nPerformance Rates (with Empirical Peaks):", file=output) - df = pd.DataFrame(perf_rows, - columns=['Metric', 'Value', 'Unit', 'Peak', '% of Peak']) - print(get_table_string(df), file=output) - - # Calculation Data table (no peaks) - calc_rows = [] - for m in calc['metrics']: - calc_rows.append([ - m['name'], - f"{m['value']:.2e}" if m['value'] > 1e6 else f"{m['value']:.2f}", - m['unit'] - ]) - - if calc_rows: - print("\nCalculation Data:", file=output) - df = pd.DataFrame(calc_rows, columns=['Metric', 'Value', 'Unit']) - print(get_table_string(df), file=output) diff --git a/projects/rocprofiler-compute/utils/autogen_hash.yaml b/projects/rocprofiler-compute/utils/autogen_hash.yaml index 89422ea5cdf6..923349bcc5f7 100644 --- a/projects/rocprofiler-compute/utils/autogen_hash.yaml +++ b/projects/rocprofiler-compute/utils/autogen_hash.yaml @@ -23,12 +23,12 @@ src/rocprof_compute_soc/analysis_configs/gfx940/0300_memory_chart.yaml: f3c235b5 src/rocprof_compute_soc/analysis_configs/gfx941/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6 src/rocprof_compute_soc/analysis_configs/gfx942/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6 src/rocprof_compute_soc/analysis_configs/gfx950/0300_memory_chart.yaml: deeb8671c4628aaad3046391975c9c62547460dcf18eb179ef7dc6b2729919e2 -src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 -src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: ca705bca747a236ba9f658fcc45018bb6004f9fa99796f703279357fa896e7d3 -src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 -src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 -src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: c236262efaff7700c2ad8844a475b042a52c6e9ef4b3424f5d605f86a5755f17 -src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: b57cb7ab0d626cc3c3d270143f44f9aa7f6efa98da98872e4640d3472b5c62da +src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 1a18e30c8cd90359833ffb8b62a3ddcd1014e2e2dbe90f62ceaa24b18160b34e +src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: f0aa148c2ef3204c4060ecbc3365474c28fb5009e2d7af659d976f202b4f09f4 +src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: 1a18e30c8cd90359833ffb8b62a3ddcd1014e2e2dbe90f62ceaa24b18160b34e +src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: 1a18e30c8cd90359833ffb8b62a3ddcd1014e2e2dbe90f62ceaa24b18160b34e +src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: 6f1a14da5fbd928591cbb4277b6c7cbb69dcf71be2afaf3cf266e7683fe11f9f +src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 4acd9db7c8c455c7da52468048297927f78c9473e573c8fcd0d27b38e2d7bd13 src/rocprof_compute_soc/analysis_configs/gfx908/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx90a/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx940/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb diff --git a/projects/rocprofiler-compute/utils/unified_config.yaml b/projects/rocprofiler-compute/utils/unified_config.yaml index d5ced799e51b..07416d3ccf38 100644 --- a/projects/rocprofiler-compute/utils/unified_config.yaml +++ b/projects/rocprofiler-compute/utils/unified_config.yaml @@ -3187,7 +3187,7 @@ panels: peak: $LDSBw_empirical_peak - metric_table: id: 402 - title: Roofline Calculation Data + title: Roofline Plot Points cli_style: Roofline tui_style: Roofline header: @@ -3534,93 +3534,49 @@ panels: ) / 1e9 unit: GFLOP/s gfx942: - # ================================================================== - # TABLE 2: (RAW COUNTS) - # Summed across all dispatches to get a total. - # ================================================================== - Total Flops: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + - (TCC_EA0_RDREQ_32B_sum * 32) + - ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + - ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + - TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * - 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * - 4 * $lds_banks_per_cu)) - unit: Bytes - - # ================================================================== - # FINAL ROOFLINE METRICS - # These use the SUM of flops and SUM of bytes. - # ================================================================== AI HBM: - value: ( - SUM( - ($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) - ) / - SUM( - (TCC_BUBBLE_sum * 128) + - (TCC_EA0_RDREQ_32B_sum * 32) + - ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + - ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64) - ) - ) + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) unit: FLOPs/Byte - - Performance GFLOPs: - value: ( - SUM( - ($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) - ) / - (SUM(End_Timestamp - Start_Timestamp) / 1e9) - ) / 1e9 + AI L2: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 ) ) + unit: FLOPs/Byte + AI L1: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( TCP_TOTAL_CACHE_ACCESSES_sum * 64 ) ) + unit: FLOPs/Byte + Performance (GFLOPs): + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 unit: GFLOP/s gfx950: # ================================================================== @@ -3839,30 +3795,14 @@ panels: measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. unit: GB/s - Total Flops: - plain: '' - rst: '' - unit: FLOPs - Total VALU FLOPs: + AI L1: plain: '' rst: '' - unit: FLOPs - Total HBM Data: - plain: '' - rst: '' - unit: Bytes - Total L2 Cache Data: - plain: '' - rst: '' - unit: Bytes - Total L1 Cache Data: - plain: '' - rst: '' - unit: Bytes - Total LDS Data: + unit: FLOPs/Byte + AI L2: plain: '' rst: '' - unit: Bytes + unit: FLOPs/Byte AI HBM: plain: '' rst: '' From a879d9ab34840be121a9db82e9a53ca066f9b882 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Mon, 11 Aug 2025 12:15:48 -0500 Subject: [PATCH 03/14] fixed typo --- projects/rocprofiler-compute/src/roofline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index fe58047ccb07..7f00341355ba 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -185,7 +185,7 @@ def empirical_roofline( self.__mspec, self.__run_parameters.get("sort_type"), ret_df - + ) msg = "AI at each mem level:" for i in self.__ai_data: msg += "\n\t%s -> %s" % (i, self.__ai_data[i]) From e16366194157894b1eddb71523fc29a87c29e952 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Mon, 11 Aug 2025 12:21:01 -0500 Subject: [PATCH 04/14] updated tty.py show_all() --- projects/rocprofiler-compute/src/utils/tty.py | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/projects/rocprofiler-compute/src/utils/tty.py b/projects/rocprofiler-compute/src/utils/tty.py index f72d04d178c6..c5845c7010fd 100644 --- a/projects/rocprofiler-compute/src/utils/tty.py +++ b/projects/rocprofiler-compute/src/utils/tty.py @@ -183,7 +183,7 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): shortened_name = shorten_kernel_name(kernel_name, args.kernel_verbose) - print(f"\nKernel {kernel_id}: {shortened_name[:60]}{'...' if len(shortened_name) > 60 else ''} ({kernel_pct:.1f}%)", file=output) + print(f"\nKernel {kernel_id}: {shortened_name[:80]}{'...' if len(shortened_name) > 80 else ''} ({kernel_pct:.1f}%)", file=output) base_indent = " " table_indent_prefix = f"{base_indent}| " @@ -534,3 +534,37 @@ def show_roof_plot(roof_plot): "roofline profiling data.", exit=False, ) + + +def show_kernel_stats(args, runs, archConfigs, output): + """ + Show the kernels and dispatches from "Top Stats" section. + """ + + df = pd.DataFrame() + for panel_id, panel in archConfigs.panel_configs.items(): + for data_source in panel["data source"]: + for type, table_config in data_source.items(): + for run, data in runs.items(): + df = pd.DataFrame() + single_df = data.dfs[table_config["id"]] + # NB: + # For pmc_kernel_top.csv, have to sort here if not + # sorted when load_table_data. + if table_config["id"] == 1: + print("\n" + "-" * 80, file=output) + print( + "Detected Kernels (sorted descending by duration)", + file=output, + ) + df = pd.concat([df, single_df["Kernel_Name"]], axis=1) + + if table_config["id"] == 2: + print("\n" + "-" * 80, file=output) + print("Dispatch list", file=output) + df = single_df + + print( + get_table_string(df, transpose=False, decimal=args.decimal), + file=output, + ) From 5138ae8d4c73affb42cbbc3977e845a2d384a721 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Mon, 11 Aug 2025 12:25:14 -0500 Subject: [PATCH 05/14] formatting --- .../rocprof_compute_analyze/analysis_base.py | 6 +- .../rocprof_compute_analyze/analysis_cli.py | 14 +-- .../src/rocprof_compute_base.py | 2 +- projects/rocprofiler-compute/src/roofline.py | 4 +- .../rocprofiler-compute/src/utils/parser.py | 2 +- .../src/utils/roofline_calc.py | 53 ++++++------ projects/rocprofiler-compute/src/utils/tty.py | 86 +++++++++---------- .../rocprofiler-compute/src/utils/utils.py | 2 +- .../rocprofiler-compute/tests/test_utils.py | 3 +- 9 files changed, 86 insertions(+), 86 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py index d56f0b321042..60d41f48b3db 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py @@ -189,7 +189,7 @@ def initalize_runs(self, normalization_filter=None): else file_io.find_1st_sub_dir(d[0]) ) w.sys_info = file_io.load_sys_info(sysinfo_path.joinpath("sysinfo.csv")) - + if not getattr(self.get_args(), "no_roof", False): try: roofline_path = sysinfo_path.joinpath("roofline.csv") @@ -199,11 +199,11 @@ def initalize_runs(self, normalization_filter=None): w.roofline_peaks = roofline_df except FileNotFoundError: - console_warning(f"roofline.csv not found.") + console_warning("roofline.csv not found.") w.roofline_peaks = file_io.create_empty_dataframe() else: w.roofline_peaks = file_io.create_empty_dataframe() - + arch = w.sys_info.iloc[0]["gpu_arch"] mspec = self.get_socs()[arch]._mspec if self.__args.specs_correction: diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py index 04a2c2c56da3..b48877b1dc1a 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py @@ -26,7 +26,7 @@ from rocprof_compute_analyze.analysis_base import OmniAnalyze_Base from utils import file_io, parser, tty from utils.kernel_name_shortener import kernel_name_shortener -from utils.logger import console_error, console_log, console_warning, demarcate +from utils.logger import console_error, demarcate class cli_analysis(OmniAnalyze_Base): @@ -50,7 +50,7 @@ def pre_processing(self): self.get_args().verbose, self._profiling_config, ) - + if self.get_args().spatial_multiplexing: workload.raw_pmc = self.spatial_multiplex_merge_counters( workload.raw_pmc @@ -71,7 +71,7 @@ def pre_processing(self): kernel_name_shortener( workload.raw_pmc, self.get_args().kernel_verbose ) - + #update path self._runs[d[0]].path = d[0] @@ -105,14 +105,14 @@ def run_analysis(self): workload_path = self.get_args().path[0][0] workload = self._runs[workload_path] gpu_arch = workload.sys_info.iloc[0]["gpu_arch"] - + if gpu_arch in ["gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]: roof_obj = self.get_socs()[gpu_arch].roofline_obj - + if roof_obj: #store path in workload for calc_ai_analyze workload.path = workload_path - + # NOTE: using default data type roof_plot = roof_obj.cli_generate_plot( dtype=roof_obj.get_dtype()[0], @@ -120,7 +120,7 @@ def run_analysis(self): config=self._profiling_config, arch_config=self._arch_configs[gpu_arch] ) - + tty.show_all( self.get_args(), self._runs, diff --git a/projects/rocprofiler-compute/src/rocprof_compute_base.py b/projects/rocprofiler-compute/src/rocprof_compute_base.py index a2b06c82636d..ab9021d5d289 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_base.py @@ -289,7 +289,7 @@ def list_sets(self): if sets_info: first_set = next(iter(sets_info.keys())) print(f" rocprof-compute profile --set {first_set} # Profile this set") - print(f" rocprof-compute profile --list-sets # Show this help") + print(" rocprof-compute profile --list-sets # Show this help") print() sys.exit(0) diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index 7f00341355ba..0fcde69bb287 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -650,12 +650,12 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) config=config, arch_config=arch_config ) - + self.__ceiling_data = constuct_roof( roofline_parameters=self.__run_parameters, dtype=dtype ) - + else: pmc_perf_csv = base_path / "pmc_perf.csv" if not pmc_perf_csv.is_file(): diff --git a/projects/rocprofiler-compute/src/utils/parser.py b/projects/rocprofiler-compute/src/utils/parser.py index 83bd42130d9f..efc1d8e0a95e 100644 --- a/projects/rocprofiler-compute/src/utils/parser.py +++ b/projects/rocprofiler-compute/src/utils/parser.py @@ -195,7 +195,7 @@ def to_int(a): # return int(a) else: raise Exception("to_int: unsupported type.") - + def to_sum(a): if str(type(a)) == "": return np.nan diff --git a/projects/rocprofiler-compute/src/utils/roofline_calc.py b/projects/rocprofiler-compute/src/utils/roofline_calc.py index 421bd2ff90ad..05ce39f1cef0 100644 --- a/projects/rocprofiler-compute/src/utils/roofline_calc.py +++ b/projects/rocprofiler-compute/src/utils/roofline_calc.py @@ -27,10 +27,11 @@ import csv from dataclasses import dataclass from pathlib import Path + import pandas as pd +from utils import parser from utils.logger import console_debug -from utils import file_io, parser, schema ################################################ # Global vars @@ -260,25 +261,25 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): """ Calculate per-kernel metrics and AI points with Roofine yamls using eval_metric. """ - + plot_points = { "ai_l1": [[], []], "ai_l2": [[], []], "ai_hbm": [[], []], "kernelNames": [] } - + workload.roofline_metrics = {} filtered_pmc = parser.apply_filters( - workload, + workload, workload.path, is_gui=False, debug=False ) - + kernel_ids_to_process = [] kernel_top_table_id = 1 - + if workload.filter_kernel_ids: kernel_ids_to_process = workload.filter_kernel_ids else: @@ -286,11 +287,11 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): kernel_top_df = workload.dfs[kernel_top_table_id] kernel_ids_to_process = kernel_top_df.index.tolist() console_debug("roofline", f"Found {len(kernel_ids_to_process)} kernels to process") - + if not kernel_ids_to_process: console_warning("No kernels found to process for roofline") return plot_points - + for kernel_id in kernel_ids_to_process: if kernel_top_table_id in workload.dfs: kernel_top_df = workload.dfs[kernel_top_table_id] @@ -300,28 +301,28 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): continue else: continue - + console_debug("roofline", f"Processing kernel {kernel_id}: {kernel_name[:50]}") - + #filter PMC data for specific kernel kernel_pmc_df = filtered_pmc[ filtered_pmc["pmc_perf"]["Kernel_Name"] == kernel_name ] - + if kernel_pmc_df.empty: console_debug("roofline", f"No PMC data for kernel {kernel_id}") continue - + kernel_only_data = {"pmc_perf": kernel_pmc_df["pmc_perf"]} - + kernel_dfs = {} kernel_dfs_type = {} - + for table_id in [401, 402]: if table_id in arch_config.dfs: kernel_dfs[table_id] = arch_config.dfs[table_id].copy() kernel_dfs_type[table_id] = arch_config.dfs_type[table_id] - + #eval metrics for single kernel only parser.eval_metric( kernel_dfs, @@ -332,15 +333,15 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): debug=False, config=config ) - + #DEBUG if 402 in kernel_dfs: console_debug("roofline", f"Table 402 for kernel {kernel_id}:") for idx, row in kernel_dfs[402].iterrows(): console_debug("roofline", f" {row.get('Metric', '')}: {row.get('Value', '')}") - + ai_hbm = ai_l2 = ai_l1 = performance = 0 - + if 402 in kernel_dfs: for idx, row in kernel_dfs[402].iterrows(): metric = row.get('Metric', '') @@ -353,9 +354,9 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): ai_l1 = value if value and value != '' else 0 elif metric == 'Performance (GFLOPs)': performance = value if value and value != '' else 0 - + console_debug("roofline", f"Kernel {kernel_id}: AI_HBM={ai_hbm:.2f}, AI_L2={ai_l2:.2f}, AI_L1={ai_l1:.2f}, Performance={performance:.2e} FLOP/s") - + #add to plot points if we have valid data if performance > 0: if ai_hbm > 0: @@ -367,30 +368,30 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): if ai_l1 > 0: plot_points["ai_l1"][0].append(ai_l1) plot_points["ai_l1"][1].append(performance) - + plot_points["kernelNames"].append(f"K{kernel_id}") console_debug("roofline", f"Added kernel {kernel_id} to plot points") else: console_debug("roofline", f"Skipping kernel {kernel_id} - no performance data") - + #store metrics for display workload.roofline_metrics[kernel_id] = { 'name': kernel_name, 'ai_table': kernel_dfs.get(401, pd.DataFrame()), 'calc_table': kernel_dfs.get(402, pd.DataFrame()) } - + console_debug("roofline", f"Generated {len(plot_points['kernelNames'])} plot points") console_debug("roofline", f"Plot points: {plot_points}") - return plot_points - + return plot_points + def calc_ai_profile(mspec, sort_type, ret_df): """Given counter data, calculate arithmetic intensity for each kernel in the application. Leverage hard-coded equations to calculate AI values. Used during profiling stage to generate roofline PDF, since Roofline yamls are not available in the profiling stage.""" - + print("Starting legacy roofline calculation (froom roofline calc)") df = ret_df["pmc_perf"] # Sort by top kernels or top dispatches? diff --git a/projects/rocprofiler-compute/src/utils/tty.py b/projects/rocprofiler-compute/src/utils/tty.py index c5845c7010fd..cce27fe1c768 100644 --- a/projects/rocprofiler-compute/src/utils/tty.py +++ b/projects/rocprofiler-compute/src/utils/tty.py @@ -31,7 +31,7 @@ from tabulate import tabulate import config -from utils import mem_chart, parser, kernel_name_shortener +from utils import mem_chart, parser from utils.logger import console_error, console_log, console_warning from utils.utils import convert_metric_id_to_panel_info @@ -160,19 +160,19 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): for data_source in panel["data source"] for type in data_source ) - + if has_roofline_style and (not args.filter_metrics or "4" in args.filter_metrics): print("\n" + "=" * 80, file=output) print("4. Roofline", file=output) print("=" * 80, file=output) - + for run_path, workload in runs.items(): if hasattr(workload, 'roofline_metrics') and workload.roofline_metrics: print("\nPer-Kernel Roofline Metrics (4.1) and AI Plot Points (4.2)", file=output) print("-" * 80, file=output) - + kernel_top_df = workload.dfs.get(1, pd.DataFrame()) - + for i, (kernel_id, metrics) in enumerate(workload.roofline_metrics.items()): if not kernel_top_df.empty and kernel_id in kernel_top_df.index: kernel_name = kernel_top_df.loc[kernel_id, "Kernel_Name"] @@ -180,9 +180,9 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): else: kernel_name = metrics.get('name', f'Kernel {kernel_id}') kernel_pct = 0 - + shortened_name = shorten_kernel_name(kernel_name, args.kernel_verbose) - + print(f"\nKernel {kernel_id}: {shortened_name[:80]}{'...' if len(shortened_name) > 80 else ''} ({kernel_pct:.1f}%)", file=output) base_indent = " " @@ -190,7 +190,7 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): table_order = [401, 402] table_names = {401: "4.1 Roofline Rate Metrics:", 402: "4.2 Roofline AI Plot Points:"} - + print(f"{base_indent}|") for table_id in table_order: @@ -200,10 +200,10 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): df = metrics.get('ai_table', pd.DataFrame()) else: continue - + if df.empty: continue - + connector = "├─ " print(f"{base_indent}{connector}{table_names.get(table_id, '')}", file=output) @@ -212,16 +212,16 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): for col in hidden_cols: if col in display_df.columns: display_df = display_df.drop(columns=[col]) - + table_string = get_table_string(display_df, transpose=False, decimal=args.decimal) - + indented_table_string = textwrap.indent(table_string, table_indent_prefix) - + print(indented_table_string, file=output) else: print("\nNo per-kernel metrics available", file=output) - + # Show the roofline plot if roof_plot: show_roof_plot(roof_plot) @@ -536,35 +536,35 @@ def show_roof_plot(roof_plot): ) -def show_kernel_stats(args, runs, archConfigs, output): +def show_kernel_stats(args, runs, archConfigs, output): """ Show the kernels and dispatches from "Top Stats" section. - """ + """ - df = pd.DataFrame() - for panel_id, panel in archConfigs.panel_configs.items(): - for data_source in panel["data source"]: - for type, table_config in data_source.items(): - for run, data in runs.items(): - df = pd.DataFrame() - single_df = data.dfs[table_config["id"]] - # NB: - # For pmc_kernel_top.csv, have to sort here if not - # sorted when load_table_data. - if table_config["id"] == 1: - print("\n" + "-" * 80, file=output) - print( - "Detected Kernels (sorted descending by duration)", - file=output, - ) - df = pd.concat([df, single_df["Kernel_Name"]], axis=1) - - if table_config["id"] == 2: - print("\n" + "-" * 80, file=output) - print("Dispatch list", file=output) - df = single_df - - print( - get_table_string(df, transpose=False, decimal=args.decimal), - file=output, - ) + df = pd.DataFrame() + for panel_id, panel in archConfigs.panel_configs.items(): + for data_source in panel["data source"]: + for type, table_config in data_source.items(): + for run, data in runs.items(): + df = pd.DataFrame() + single_df = data.dfs[table_config["id"]] + # NB: + # For pmc_kernel_top.csv, have to sort here if not + # sorted when load_table_data. + if table_config["id"] == 1: + print("\n" + "-" * 80, file=output) + print( + "Detected Kernels (sorted descending by duration)", + file=output, + ) + df = pd.concat([df, single_df["Kernel_Name"]], axis=1) + + if table_config["id"] == 2: + print("\n" + "-" * 80, file=output) + print("Dispatch list", file=output) + df = single_df + + print( + get_table_string(df, transpose=False, decimal=args.decimal), + file=output, + ) diff --git a/projects/rocprofiler-compute/src/utils/utils.py b/projects/rocprofiler-compute/src/utils/utils.py index e0d20539433a..d2d8c41df02b 100644 --- a/projects/rocprofiler-compute/src/utils/utils.py +++ b/projects/rocprofiler-compute/src/utils/utils.py @@ -745,7 +745,7 @@ def run_prof( config.rocprof_compute_home / "rocprof_compute_soc" / "profile_configs" - / f"counter_defs.yaml", + / "counter_defs.yaml", "r", ) as file: counter_defs = yaml.safe_load(file) diff --git a/projects/rocprofiler-compute/tests/test_utils.py b/projects/rocprofiler-compute/tests/test_utils.py index 4b530ce333bc..a57f659c3df0 100644 --- a/projects/rocprofiler-compute/tests/test_utils.py +++ b/projects/rocprofiler-compute/tests/test_utils.py @@ -30,18 +30,17 @@ import locale import logging import os -import tempfile import pathlib import re import shutil import subprocess +import tempfile from pathlib import Path from types import SimpleNamespace from unittest import mock import pandas as pd import pytest -import yaml import utils.utils as utils From ec912064ac69ef27e693a51febb8cddcc68ad6a3 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Tue, 12 Aug 2025 13:37:53 -0500 Subject: [PATCH 06/14] fixed ctest failures and updated equations --- .../rocprof_compute_analyze/analysis_base.py | 2 +- .../rocprof_compute_analyze/analysis_cli.py | 48 +- .../gfx908/0400_roofline.yaml | 65 +- .../gfx90a/0400_roofline.yaml | 52 +- .../gfx940/0400_roofline.yaml | 59 +- .../gfx941/0400_roofline.yaml | 57 +- .../gfx942/0400_roofline.yaml | 8 +- .../gfx950/0400_roofline.yaml | 51 +- .../src/rocprof_compute_soc/soc_gfx941.py | 2 +- .../src/rocprof_compute_soc/soc_gfx942.py | 2 +- projects/rocprofiler-compute/src/roofline.py | 70 +-- .../rocprofiler-compute/src/utils/parser.py | 20 +- projects/rocprofiler-compute/src/utils/tty.py | 6 +- .../utils/autogen_hash.yaml | 12 +- .../utils/unified_config.yaml | 559 +++++++++--------- 15 files changed, 481 insertions(+), 532 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py index 60d41f48b3db..5d3dc3db085a 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py @@ -31,7 +31,7 @@ from pathlib import Path from utils import file_io, parser, schema -from utils.logger import console_debug, console_error, console_log, demarcate +from utils.logger import console_warning, console_debug, console_error, console_log, demarcate from utils.utils import is_workload_empty, merge_counters_spatial_multiplex diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py index b48877b1dc1a..47b6cf8eaca1 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py @@ -101,31 +101,31 @@ def run_analysis(self): else: roof_plot = None # 1. check if not baseline && compatible soc: - if (len(self.get_args().path)) == 1: - workload_path = self.get_args().path[0][0] - workload = self._runs[workload_path] - gpu_arch = workload.sys_info.iloc[0]["gpu_arch"] + if (len(self.get_args().path)) == 1: + workload_path = self.get_args().path[0][0] + workload = self._runs[workload_path] + gpu_arch = workload.sys_info.iloc[0]["gpu_arch"] - if gpu_arch in ["gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]: - roof_obj = self.get_socs()[gpu_arch].roofline_obj + if gpu_arch in ["gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]: + roof_obj = self.get_socs()[gpu_arch].roofline_obj - if roof_obj: - #store path in workload for calc_ai_analyze - workload.path = workload_path + if roof_obj: + #store path in workload for calc_ai_analyze + workload.path = workload_path - # NOTE: using default data type - roof_plot = roof_obj.cli_generate_plot( - dtype=roof_obj.get_dtype()[0], - workload=workload, - config=self._profiling_config, - arch_config=self._arch_configs[gpu_arch] - ) + # NOTE: using default data type + roof_plot = roof_obj.cli_generate_plot( + dtype=roof_obj.get_dtype()[0], + workload=workload, + config=self._profiling_config, + arch_config=self._arch_configs[gpu_arch] + ) - tty.show_all( - self.get_args(), - self._runs, - self._arch_configs[self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"]], - self._output, - self._profiling_config, - roof_plot=roof_plot, - ) + tty.show_all( + self.get_args(), + self._runs, + self._arch_configs[self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"]], + self._output, + self._profiling_config, + roof_plot=roof_plot, + ) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml index 8c82e233a835..c6931e166689 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml @@ -96,19 +96,22 @@ Panel Config: unit: GFLOP/s peak: $MFMABF16Flops_empirical_peak MFMA FLOPs (F8): - value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) - / 1e9)) / 1e9) + value: 0 + unit: GFLOP/s + peak: 0 + MFMA FLOPs (F6F4): + value: 0 unit: GFLOP/s - peak: $MFMAF8Flops_empirical_peak + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + value: AVG((( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak @@ -138,50 +141,38 @@ Panel Config: value: Value unit: Unit metric: - Total Flops: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * - 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM( (TCC_BUBBLE_sum * + 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum + - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) + * 32) + (TCC_EA0_WRREQ_64B_sum * 64) ) ) + unit: FLOPs/Byte + AI L2: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum - + TCP_TCC_READ_REQ_sum) * 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) - unit: Bytes - AI HBM: + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM( (TCP_TCC_WRITE_REQ_sum + + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64 ) ) + unit: FLOPs/Byte + AI L1: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * - 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) - + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) - + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum - * 64) ) ) + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM(TCP_TOTAL_CACHE_ACCESSES_sum + * 64) ) unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 @@ -190,6 +181,6 @@ Panel Config: + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * - 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / (SUM(End_Timestamp - Start_Timestamp) + / 1e9) ) / 1e9 unit: GFLOP/s diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml index 557acf7c87fa..64d6f96b70b3 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml @@ -99,15 +99,19 @@ Panel Config: value: 0 unit: GFLOP/s peak: 0 + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((( (TCC_EA_RDREQ_32B_sum * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) + value: AVG((( (TCC_EA_RDREQ_32B_sum * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + (TCC_EA_WRREQ_64B_sum * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) - * 32) ))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + * 32) ) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak L2 Cache Bandwidth: @@ -136,47 +140,37 @@ Panel Config: value: Value unit: Unit metric: - Total Flops: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * - 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM( (TCC_EA_RDREQ_32B_sum + * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + (TCC_EA_WRREQ_64B_sum + * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) ) ) + unit: FLOPs/Byte + AI L2: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) ))) - unit: FLOPs - Total HBM Data: - value: SUM((( (TCC_EA_RDREQ_32B_sum * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) - * 64) + (TCC_EA_WRREQ_64B_sum * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) - * 32) ))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum - + TCP_TCC_READ_REQ_sum) * 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) - unit: Bytes - AI HBM: + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM( (TCP_TCC_WRITE_REQ_sum + + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64 ) ) + unit: FLOPs/Byte + AI L1: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * - 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM( (TCC_EA_RDREQ_32B_sum - * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + (TCC_EA_WRREQ_64B_sum - * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) ) ) + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM(TCP_TOTAL_CACHE_ACCESSES_sum + * 64) ) unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml index 8c82e233a835..a441e625d9ad 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml @@ -67,11 +67,11 @@ Panel Config: peak: Peak (Empirical) metric: VALU FLOPs: - value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + value: AVG(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + + SQ_INSTS_VALU_TRANS_F64) ) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) @@ -100,15 +100,19 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + value: AVG((( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak @@ -138,50 +142,39 @@ Panel Config: value: Value unit: Unit metric: - Total Flops: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) + unit: FLOPs/Byte + AI L2: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum - + TCP_TCC_READ_REQ_sum) * 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) - unit: Bytes - AI HBM: + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / SUM( (TCP_TCC_WRITE_REQ_sum + + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64 ) ) + unit: FLOPs/Byte + AI L1: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * - 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) - + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) - + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum - * 64) ) ) + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / SUM(TCP_TOTAL_CACHE_ACCESSES_sum + * 64) ) unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml index 8c82e233a835..9bcda18c56c7 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml @@ -67,11 +67,11 @@ Panel Config: peak: Peak (Empirical) metric: VALU FLOPs: - value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + value: AVG(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) )) / ((End_Timestamp - Start_Timestamp) / 1e9)) + + SQ_INSTS_VALU_TRANS_F64) ) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) @@ -100,15 +100,19 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + value: AVG((( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak @@ -138,39 +142,31 @@ Panel Config: value: Value unit: Unit metric: - Total Flops: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum + * 64) ) ) + unit: FLOPs/Byte + AI L2: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum - + TCP_TCC_READ_REQ_sum) * 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) - unit: Bytes - AI HBM: + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) ) / SUM( (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 ) ) + unit: FLOPs/Byte + AI L1: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) @@ -178,10 +174,7 @@ Panel Config: + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) - + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) - + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum - * 64) ) ) + * 512) ) / SUM(TCP_TOTAL_CACHE_ACCESSES_sum * 64) ) unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml index 11009963a0b5..f2cc09ffff74 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml @@ -100,15 +100,19 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + value: AVG((( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml index d87ff259abec..8f47e8be5881 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml @@ -111,9 +111,9 @@ Panel Config: unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum + value: AVG((( (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp + - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak @@ -143,39 +143,32 @@ Panel Config: value: Value unit: Unit metric: - Total Flops: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + AI HBM: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) ) / SUM( (TCC_BUBBLE_sum + * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum + - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) + * 32) + (TCC_EA0_WRREQ_64B_sum * 64) ) ) + unit: FLOPs/Byte + AI L2: + value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) - + SQ_INSTS_VALU_TRANS_F64) ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - - TCC_EA0_WRREQ_64B_sum) * 32) + (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum - + TCP_TCC_READ_REQ_sum) * 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4 * $lds_banks_per_cu)) - unit: Bytes - AI HBM: + + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * + 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 + * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) ) / SUM( (TCP_TCC_WRITE_REQ_sum + + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + + TCP_TCC_READ_REQ_sum) * 64 ) ) + unit: FLOPs/Byte + AI L1: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) @@ -183,10 +176,8 @@ Panel Config: + SQ_INSTS_VALU_TRANS_F64) )) + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F8 - * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) ) / SUM( (TCC_BUBBLE_sum - * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) - * 32) + (TCC_EA0_WRREQ_64B_sum * 64) ) ) + * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) ) / SUM(TCP_TOTAL_CACHE_ACCESSES_sum + * 64) ) unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( ($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py index 4b4b71a8b54b..688302b41079 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx941.py @@ -43,7 +43,7 @@ def __init__(self, args, mspec): Path(str(config.rocprof_compute_home)).joinpath( "rocprof_compute_soc", "profile_configs", - "gfx941", + "gfx940", "roofline", ) ) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py index 93731a75c62b..48e01ba6833a 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_gfx942.py @@ -43,7 +43,7 @@ def __init__(self, args, mspec): Path(str(config.rocprof_compute_home)).joinpath( "rocprof_compute_soc", "profile_configs", - "gfx942", + "gfx940", "roofline", ) ) diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index 0fcde69bb287..1d81bfcabc17 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -641,6 +641,41 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) ) return + # Normalize workload_dir to get the base directory + workload_dir = self.__run_parameters.get("workload_dir") + if workload_dir is None: + console_error( + "workload_dir is not set", + exit=False, + ) + return + + # Extract base directory path regardless of- + # whether workload_dir is list or string + if isinstance(workload_dir, list): + if not workload_dir or not workload_dir[0]: + console_error( + "workload_dir list is empty or contains invalid entries", + exit=False, + ) + return + # Handle nested list structure [0][0] or simple list [0] + base_dir = ( + workload_dir[0][0] + if isinstance(workload_dir[0], (list, tuple)) + else workload_dir[0] + ) + else: + # workload_dir is a string + base_dir = workload_dir + # Convert to Path object for easier manipulation + base_path = Path(base_dir) + + roofline_csv = base_path / "roofline.csv" + if not roofline_csv.is_file(): + console_log("roofline", "{} does not exist".format(roofline_csv)) + return + #if workload is detected, utilize Roofline yamls. If not, fallback to legacy calc_ai if workload is not None: self.__ai_data = calc_ai_analyze( @@ -676,38 +711,8 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) console_debug(f"AI data: {self.__ai_data}") console_debug(f"Kernel names: {self.__ai_data.get('kernelNames', [])}") - # Normalize workload_dir to get the base directory - workload_dir = self.__run_parameters.get("workload_dir") - if workload_dir is None: - console_error( - "workload_dir is not set", - exit=False, - ) - return - - # Extract base directory path regardless of- - # whether workload_dir is list or string - if isinstance(workload_dir, list): - if not workload_dir or not workload_dir[0]: - console_error( - "workload_dir list is empty or contains invalid entries", - exit=False, - ) - return - # Handle nested list structure [0][0] or simple list [0] - base_dir = ( - workload_dir[0][0] - if isinstance(workload_dir[0], (list, tuple)) - else workload_dir[0] - ) - else: - # workload_dir is a string - base_dir = workload_dir self.roof_setup() - # Convert to Path object for easier manipulation - base_path = Path(base_dir) - # Check proper datatype input - takes single str if not isinstance(dtype, str): console_error("Unsupported datatype input - must be str") @@ -717,11 +722,6 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) self.__run_parameters["mem_level"].remove("vL1D") self.__run_parameters["mem_level"].append("L1") - roofline_csv = base_path / "roofline.csv" - if not roofline_csv.is_file(): - console_log("roofline", "{} does not exist".format(roofline_csv)) - return - profiling_config = file_io.load_profiling_config(self.__args.path[0][0]) if profiling_config.get("format_rocprof_output") == "rocpd": t_df["pmc_perf"] = rocpd_data.process_rocpd_csv(t_df["pmc_perf"]) diff --git a/projects/rocprofiler-compute/src/utils/parser.py b/projects/rocprofiler-compute/src/utils/parser.py index efc1d8e0a95e..99fe0cbb191a 100644 --- a/projects/rocprofiler-compute/src/utils/parser.py +++ b/projects/rocprofiler-compute/src/utils/parser.py @@ -195,7 +195,7 @@ def to_int(a): # return int(a) else: raise Exception("to_int: unsupported type.") - + def to_sum(a): if str(type(a)) == "": return np.nan @@ -878,6 +878,16 @@ def eval_metric(dfs, dfs_type, sys_info, empirical_peaks_df, raw_pmc_df, debug, for metric_name in empirical_peaks_df.columns: var_name = f"ammolite__{metric_name}_empirical_peak" locals()[var_name] = peak_data_row[metric_name] + else: + default_peaks = [ + 'MFMAF64Flops', 'MFMAF32Flops', 'MFMAF16Flops', + 'MFMABF16Flops', 'MFMAF8Flops', 'MFMAI8Ops', + 'HBMBw', 'L2Bw', 'L1Bw', 'LDSBw', 'MFMA_FLOPs_F6F4', + ] + # set values to 0 if no no empirical peaks from roofline.csv are provided + for peak_name in default_peaks: + var_name = f"ammolite__{peak_name}_empirical_peak" + exec(f"{var_name} = 0", globals(), locals()) # TODO: fix all $normUnit in Unit column or title @@ -1003,8 +1013,12 @@ def eval_metric(dfs, dfs_type, sys_info, empirical_peaks_df, raw_pmc_df, debug, row[expr] = "" else: row[expr] = out - except TypeError: - row[expr] = "" + except (TypeError, NameError) as e: + if "empirical_peak" in str(e): + console_warning(f"Missing empirical peak data: {e}. Using empty value.") + row[expr] = "" + else: + row[expr] = "" except AttributeError as ae: if ( str(ae) diff --git a/projects/rocprofiler-compute/src/utils/tty.py b/projects/rocprofiler-compute/src/utils/tty.py index cce27fe1c768..8990bff08065 100644 --- a/projects/rocprofiler-compute/src/utils/tty.py +++ b/projects/rocprofiler-compute/src/utils/tty.py @@ -32,6 +32,7 @@ import config from utils import mem_chart, parser +from utils.kernel_name_shortener import kernel_name_shortener from utils.logger import console_error, console_log, console_warning from utils.utils import convert_metric_id_to_panel_info @@ -113,11 +114,10 @@ def shorten_kernel_name(kernel_name, verbosity_level): """Helper function to shorten kernel names""" if verbosity_level < 5: temp_df = pd.DataFrame({'Kernel_Name': [kernel_name]}) - utils.kernel_name_shortener(temp_df, verbosity_level) + kernel_name_shortener(temp_df, verbosity_level) return temp_df.loc[0, 'Kernel_Name'] return kernel_name - def has_time_data(df): """ Check if the dataframe contains time data by looking at the Unit column. @@ -168,7 +168,7 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): for run_path, workload in runs.items(): if hasattr(workload, 'roofline_metrics') and workload.roofline_metrics: - print("\nPer-Kernel Roofline Metrics (4.1) and AI Plot Points (4.2)", file=output) + print("\n(4.1) Per-Kernel Roofline Metrics and (4.2) AI Plot Points", file=output) print("-" * 80, file=output) kernel_top_df = workload.dfs.get(1, pd.DataFrame()) diff --git a/projects/rocprofiler-compute/utils/autogen_hash.yaml b/projects/rocprofiler-compute/utils/autogen_hash.yaml index 9635a4d30fda..d3fed4cc5e58 100644 --- a/projects/rocprofiler-compute/utils/autogen_hash.yaml +++ b/projects/rocprofiler-compute/utils/autogen_hash.yaml @@ -23,12 +23,12 @@ src/rocprof_compute_soc/analysis_configs/gfx940/0300_memory_chart.yaml: f3c235b5 src/rocprof_compute_soc/analysis_configs/gfx941/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6 src/rocprof_compute_soc/analysis_configs/gfx942/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6 src/rocprof_compute_soc/analysis_configs/gfx950/0300_memory_chart.yaml: deeb8671c4628aaad3046391975c9c62547460dcf18eb179ef7dc6b2729919e2 -src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 1a18e30c8cd90359833ffb8b62a3ddcd1014e2e2dbe90f62ceaa24b18160b34e -src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: f0aa148c2ef3204c4060ecbc3365474c28fb5009e2d7af659d976f202b4f09f4 -src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: 1a18e30c8cd90359833ffb8b62a3ddcd1014e2e2dbe90f62ceaa24b18160b34e -src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: 1a18e30c8cd90359833ffb8b62a3ddcd1014e2e2dbe90f62ceaa24b18160b34e -src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: 6f1a14da5fbd928591cbb4277b6c7cbb69dcf71be2afaf3cf266e7683fe11f9f -src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 4acd9db7c8c455c7da52468048297927f78c9473e573c8fcd0d27b38e2d7bd13 +src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 08c2fa4e254a2192496415289eb1fcfd55693c8a9f943199eab6bd46c4a1037b +src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: 6aab0e9e150316d109043ad4317214ed81b75dabe89b2c94dcebf5e1e270012b +src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: aa76c3a4e8982493be308f63c577670810d38512bb071e09ea09a8ede1da0d54 +src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: 0b369c4366ed6d5a7369603041247c5b138646a2cd1f3aa0ffc25425f1e36309 +src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: 8f0e1fa1ed2515912289d4ff19331e431630ea896f509fe700fa83bd4843d2a8 +src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 2e66ae88f1a8f417189812b836617f600c8f259717e39a55e4982eebe69ebd87 src/rocprof_compute_soc/analysis_configs/gfx908/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx90a/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx940/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb diff --git a/projects/rocprofiler-compute/utils/unified_config.yaml b/projects/rocprofiler-compute/utils/unified_config.yaml index 868e51be4154..27ae4e14e897 100644 --- a/projects/rocprofiler-compute/utils/unified_config.yaml +++ b/projects/rocprofiler-compute/utils/unified_config.yaml @@ -2807,12 +2807,6 @@ panels: peak: Peak (Empirical) metric: gfx90a: - # ================================================================== - # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX90a - # Logic derived from calc_ai function. - # ================================================================== - - # --- Compute Rates --- VALU FLOPs: value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + @@ -2841,20 +2835,21 @@ panels: value: 0 unit: GFLOP/s peak: 0 + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak - - # --- Bandwidth Rates --- - # HBM calculation for gfx90a (MI200) uses TCC_EA_* counters per calc_ai script HBM Bandwidth: - value: AVG(((( + value: AVG((( (TCC_EA_RDREQ_32B_sum * 32) + ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + (TCC_EA_WRREQ_64B_sum * 64) + ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) - ))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + ) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak L2 Cache Bandwidth: @@ -2873,10 +2868,6 @@ panels: unit: GB/s peak: $LDSBw_empirical_peak gfx908: - # ================================================================== - # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX908 - # Logic is identical to gfx942 per calc_ai function - # ================================================================== VALU FLOPs: value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + @@ -2902,19 +2893,24 @@ panels: unit: GFLOP/s peak: $MFMABF16Flops_empirical_peak MFMA FLOPs (F8): - value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + value: 0 unit: GFLOP/s - peak: $MFMAF8Flops_empirical_peak + peak: 0 + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + + value: AVG((( + (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak L2 Cache Bandwidth: @@ -2933,16 +2929,12 @@ panels: unit: GB/s peak: $LDSBw_empirical_peak gfx940: - # ================================================================== - # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX940 - # Logic falls into the default case in calc_ai, identical to gfx942 - # ================================================================== VALU FLOPs: - value: AVG((($wave_size * ( + value: AVG(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + ) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) MFMA FLOPs (F64): @@ -2965,16 +2957,21 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + + value: AVG((( + (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak L2 Cache Bandwidth: @@ -2993,16 +2990,12 @@ panels: unit: GB/s peak: $LDSBw_empirical_peak gfx941: - # ================================================================== - # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX941 - # Logic falls into the default case in calc_ai, identical to gfx942 - # ================================================================== VALU FLOPs: - value: AVG((($wave_size * ( + value: AVG(($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + ) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: (((($max_sclk * $cu_per_gpu) * 64) * 2) / 1000) MFMA FLOPs (F64): @@ -3025,16 +3018,21 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + + value: AVG((( + (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak L2 Cache Bandwidth: @@ -3053,12 +3051,6 @@ panels: unit: GB/s peak: $LDSBw_empirical_peak gfx942: - # ================================================================== - # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks - # These should be AVERAGED across all dispatches. - # ================================================================== - - # --- Compute Rates --- VALU FLOPs: value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + @@ -3087,18 +3079,21 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak + MFMA FLOPs (F6F4): + value: 0 + unit: GFLOP/s + peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak - - # --- Bandwidth Rates --- HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + + value: AVG((( + (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak L2 Cache Bandwidth: @@ -3117,12 +3112,6 @@ panels: unit: GB/s peak: $LDSBw_empirical_peak gfx950: - # ================================================================== - # GROUP 1: PERFORMANCE RATES (PER SECOND) + Peaks for GFX950 - # Logic derived from calc_ai function. - # ================================================================== - - # --- Compute Rates --- VALU FLOPs: value: AVG((($wave_size * ( (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + @@ -3159,15 +3148,13 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s peak: $MFMAI8Ops_empirical_peak - - # --- Bandwidth Rates --- - # HBM calculation for gfx950 uses the default path in calc_ai script HBM Bandwidth: - value: AVG(((((TCC_BUBBLE_sum * 128) + + value: AVG((( + (TCC_BUBBLE_sum * 128) + (TCC_EA0_RDREQ_32B_sum * 32) + ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) + (TCC_EA0_WRREQ_64B_sum * 64)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GB/s peak: $HBMBw_empirical_peak L2 Cache Bandwidth: @@ -3196,53 +3183,6 @@ panels: unit: Unit metric: gfx90a: - # ================================================================== - # TABLE 2: (RAW COUNTS) for GFX90a - # These should be SUMMED across all dispatches to get a total. - # ================================================================== - Total Flops: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - ))) - unit: FLOPs - Total HBM Data: - value: SUM((( - (TCC_EA_RDREQ_32B_sum * 32) + - ((TCC_EA_RDREQ_sum - TCC_EA_RDREQ_32B_sum) * 64) + - (TCC_EA_WRREQ_64B_sum * 64) + - ((TCC_EA_WRREQ_sum - TCC_EA_WRREQ_64B_sum) * 32) - ))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + - TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * - 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * - 4 * $lds_banks_per_cu)) - unit: Bytes - - # ================================================================== - # FINAL ROOFLINE METRICS for GFX90a - # These use the SUM of flops and SUM of bytes. - # ================================================================== AI HBM: value: ( SUM( @@ -3264,7 +3204,41 @@ panels: ) ) unit: FLOPs/Byte - + AI L2: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / + SUM( + (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 + ) + ) + unit: FLOPs/Byte + AI L1: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / + SUM(TCP_TOTAL_CACHE_ACCESSES_sum * 64) + ) + unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( @@ -3282,47 +3256,6 @@ panels: ) / 1e9 unit: GFLOP/s gfx908: - # ================================================================== - # TABLE 2: (RAW COUNTS) for GFX908 - # ================================================================== - Total Flops: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + - (TCC_EA0_RDREQ_32B_sum * 32) + - ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + - ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + - TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * - 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * - 4 * $lds_banks_per_cu)) - unit: Bytes AI HBM: value: ( SUM( @@ -3334,8 +3267,7 @@ panels: (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / SUM( (TCC_BUBBLE_sum * 128) + @@ -3346,6 +3278,41 @@ panels: ) ) unit: FLOPs/Byte + AI L2: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / + SUM( + (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 + ) + ) + unit: FLOPs/Byte + AI L1: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + ) / + SUM(TCP_TOTAL_CACHE_ACCESSES_sum * 64) + ) + unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( @@ -3357,57 +3324,12 @@ panels: (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 unit: GFLOP/s gfx940: - # ================================================================== - # TABLE 2: (RAW COUNTS) for GFX940 - # ================================================================== - Total Flops: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + - (TCC_EA0_RDREQ_32B_sum * 32) + - ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + - ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + - TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * - 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * - 4 * $lds_banks_per_cu)) - unit: Bytes - # ================================================================== - # FINAL ROOFLINE METRICS for GFX940 - # ================================================================== AI HBM: value: ( SUM( @@ -3431,6 +3353,41 @@ panels: ) ) unit: FLOPs/Byte + AI L2: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + ) / + SUM( + (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 + ) + ) + unit: FLOPs/Byte + AI L1: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + ) / + SUM(TCP_TOTAL_CACHE_ACCESSES_sum * 64) + ) + unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( @@ -3449,50 +3406,6 @@ panels: ) / 1e9 unit: GFLOP/s gfx941: - # ================================================================== - # TABLE 2: (RAW COUNTS) for GFX941 - # ================================================================== - Total Flops: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + - (TCC_EA0_RDREQ_32B_sum * 32) + - ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + - ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + - TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * - 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * - 4 * $lds_banks_per_cu)) - unit: Bytes - # ================================================================== - # FINAL ROOFLINE METRICS for GFX941 - # ================================================================== AI HBM: value: ( SUM( @@ -3516,6 +3429,43 @@ panels: ) ) unit: FLOPs/Byte + AI L2: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + SUM( + (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 + ) + ) + unit: FLOPs/Byte + AI L1: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + ) / + SUM(TCP_TOTAL_CACHE_ACCESSES_sum * 64) + ) + unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( @@ -3579,54 +3529,6 @@ panels: * 512) ) / (SUM(End_Timestamp - Start_Timestamp) / 1e9) ) / 1e9 unit: GFLOP/s gfx950: - # ================================================================== - # TABLE 2: (RAW COUNTS) for GFX950 - # These should be SUMMED across all dispatches to get a total. - # ================================================================== - Total Flops: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - )) + - (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + - (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512)) - unit: FLOPs - Total VALU FLOPs: - value: SUM(($wave_size * ( - (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + - (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + - (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) - ))) - unit: FLOPs - Total HBM Data: - value: SUM(((TCC_BUBBLE_sum * 128) + - (TCC_EA0_RDREQ_32B_sum * 32) + - ((TCC_EA0_RDREQ_sum - TCC_BUBBLE_sum - TCC_EA0_RDREQ_32B_sum) * 64) + - ((TCC_EA0_WRREQ_sum - TCC_EA0_WRREQ_64B_sum) * 32) + - (TCC_EA0_WRREQ_64B_sum * 64))) - unit: Bytes - Total L2 Cache Data: - value: SUM(((TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + - TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * - 64)) - unit: Bytes - Total L1 Cache Data: - value: SUM((TCP_TOTAL_CACHE_ACCESSES_sum * 64)) - unit: Bytes - Total LDS Data: - value: SUM(((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * - 4 * $lds_banks_per_cu)) - unit: Bytes - - # ================================================================== - # FINAL ROOFLINE METRICS for GFX950 - # These use the SUM of flops and SUM of bytes. - # ================================================================== AI HBM: value: ( SUM( @@ -3651,6 +3553,45 @@ panels: ) ) unit: FLOPs/Byte + AI L2: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) + ) / + SUM( + (TCP_TCC_WRITE_REQ_sum + TCP_TCC_ATOMIC_WITH_RET_REQ_sum + + TCP_TCC_ATOMIC_WITHOUT_RET_REQ_sum + TCP_TCC_READ_REQ_sum) * 64 + ) + ) + unit: FLOPs/Byte + AI L1: + value: ( + SUM( + ($wave_size * ( + (SQ_INSTS_VALU_ADD_F16 + SQ_INSTS_VALU_MUL_F16 + (2 * SQ_INSTS_VALU_FMA_F16) + SQ_INSTS_VALU_TRANS_F16) + + (SQ_INSTS_VALU_ADD_F32 + SQ_INSTS_VALU_MUL_F32 + (2 * SQ_INSTS_VALU_FMA_F32) + SQ_INSTS_VALU_TRANS_F32) + + (SQ_INSTS_VALU_ADD_F64 + SQ_INSTS_VALU_MUL_F64 + (2 * SQ_INSTS_VALU_FMA_F64) + SQ_INSTS_VALU_TRANS_F64) + )) + + (SQ_INSTS_VALU_MFMA_MOPS_F16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F32 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F64 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F8 * 512) + + (SQ_INSTS_VALU_MFMA_MOPS_F6F4 * 512) + ) / + SUM(TCP_TOTAL_CACHE_ACCESSES_sum * 64) + ) + unit: FLOPs/Byte Performance GFLOPs: value: ( SUM( @@ -3750,8 +3691,12 @@ panels: for comparison.' unit: GIOPs HBM Bandwidth: - plain: '' - rst: '' + plain: 'The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison.' + rst: 'The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison.' unit: GB/s L2 Cache Bandwidth: plain: The number of bytes looked up in the L2 cache per unit time. The number @@ -3796,20 +3741,44 @@ panels: alongside for comparison. unit: GB/s AI L1: - plain: '' - rst: '' + plain: 'The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline.' + rst: 'The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline.' unit: FLOPs/Byte AI L2: - plain: '' - rst: '' + plain: 'The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for + the L2 roofline.' + rst: 'The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for + the L2 roofline.' unit: FLOPs/Byte AI HBM: - plain: '' - rst: '' + plain: 'The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes + transferred between HBM and the L2 cache. This value is used as the x-coordinate + for the HBM roofline.' + rst: 'The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes + transferred between HBM and the L2 cache. This value is used as the x-coordinate + for the HBM roofline.' unit: FLOPs/Byte Performance GFLOPs: - plain: '' - rst: '' + plain: 'The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel''s point on the Roofline plot.' + rst: 'The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel''s point on the Roofline plot.' unit: GFLOP/s - id: 500 title: Command Processor (CPC/CPF) From 4bdc6cde3611527525fe21b162d9006f38901dc3 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Tue, 12 Aug 2025 13:40:08 -0500 Subject: [PATCH 07/14] formatting --- .../src/rocprof_compute_analyze/analysis_base.py | 10 ++++++++-- projects/rocprofiler-compute/src/roofline.py | 2 +- projects/rocprofiler-compute/src/utils/parser.py | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py index 5d3dc3db085a..a76e948508ff 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py @@ -31,7 +31,13 @@ from pathlib import Path from utils import file_io, parser, schema -from utils.logger import console_warning, console_debug, console_error, console_log, demarcate +from utils.logger import ( + console_debug, + console_error, + console_log, + console_warning, + demarcate, +) from utils.utils import is_workload_empty, merge_counters_spatial_multiplex @@ -195,7 +201,7 @@ def initalize_runs(self, normalization_filter=None): roofline_path = sysinfo_path.joinpath("roofline.csv") roofline_df = file_io.load_roofline_peaks(roofline_path) - # Use the original column names from roofline.csv directly + #use original column names from roofline.csv directly w.roofline_peaks = roofline_df except FileNotFoundError: diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index 1d81bfcabc17..58f4c08d5dba 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -670,7 +670,7 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) base_dir = workload_dir # Convert to Path object for easier manipulation base_path = Path(base_dir) - + roofline_csv = base_path / "roofline.csv" if not roofline_csv.is_file(): console_log("roofline", "{} does not exist".format(roofline_csv)) diff --git a/projects/rocprofiler-compute/src/utils/parser.py b/projects/rocprofiler-compute/src/utils/parser.py index 99fe0cbb191a..cc774f613b8b 100644 --- a/projects/rocprofiler-compute/src/utils/parser.py +++ b/projects/rocprofiler-compute/src/utils/parser.py @@ -195,7 +195,7 @@ def to_int(a): # return int(a) else: raise Exception("to_int: unsupported type.") - + def to_sum(a): if str(type(a)) == "": return np.nan @@ -880,7 +880,7 @@ def eval_metric(dfs, dfs_type, sys_info, empirical_peaks_df, raw_pmc_df, debug, locals()[var_name] = peak_data_row[metric_name] else: default_peaks = [ - 'MFMAF64Flops', 'MFMAF32Flops', 'MFMAF16Flops', + 'MFMAF64Flops', 'MFMAF32Flops', 'MFMAF16Flops', 'MFMABF16Flops', 'MFMAF8Flops', 'MFMAI8Ops', 'HBMBw', 'L2Bw', 'L1Bw', 'LDSBw', 'MFMA_FLOPs_F6F4', ] From 7b049a4ab9697c43af5d7409a2e73ffc0b1d2014 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Tue, 12 Aug 2025 16:27:11 -0500 Subject: [PATCH 08/14] updated metric descriptoins --- .../gfx908/0400_roofline.yaml | 24 +++++++++++++++---- .../gfx90a/0400_roofline.yaml | 24 +++++++++++++++---- .../gfx940/0400_roofline.yaml | 24 +++++++++++++++---- .../gfx941/0400_roofline.yaml | 24 +++++++++++++++---- .../gfx942/0400_roofline.yaml | 24 +++++++++++++++---- .../gfx950/0400_roofline.yaml | 24 +++++++++++++++---- .../utils/autogen_hash.yaml | 12 +++++----- 7 files changed, 120 insertions(+), 36 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml index c6931e166689..040de400a7f6 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml @@ -32,7 +32,9 @@ Panel Config: per second. Note: this does not include any 8-bit integer operations from VALU instructions. The peak empirically measured INT8 MFMA operations achievable on the specific accelerator is displayed alongside for comparison.' - HBM Bandwidth: '' + HBM Bandwidth: The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison. L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. The number of bytes is calculated as the number of cache lines requested multiplied by the cache line size. This value does not consider partial requests, so e.g., @@ -50,10 +52,22 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - AI L1: '' - AI L2: '' - AI HBM: '' - Performance GFLOPs: '' + AI L1: The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline. + AI L2: The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for the + L2 roofline. + AI HBM: The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes transferred + between HBM and the L2 cache. This value is used as the x-coordinate for the + HBM roofline. + Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per + second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel's point on the Roofline plot. data source: - metric_table: id: 401 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml index 64d6f96b70b3..d096de31f356 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml @@ -32,7 +32,9 @@ Panel Config: per second. Note: this does not include any 8-bit integer operations from VALU instructions. The peak empirically measured INT8 MFMA operations achievable on the specific accelerator is displayed alongside for comparison.' - HBM Bandwidth: '' + HBM Bandwidth: The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison. L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. The number of bytes is calculated as the number of cache lines requested multiplied by the cache line size. This value does not consider partial requests, so e.g., @@ -50,10 +52,22 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - AI L1: '' - AI L2: '' - AI HBM: '' - Performance GFLOPs: '' + AI L1: The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline. + AI L2: The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for the + L2 roofline. + AI HBM: The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes transferred + between HBM and the L2 cache. This value is used as the x-coordinate for the + HBM roofline. + Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per + second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel's point on the Roofline plot. data source: - metric_table: id: 401 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml index a441e625d9ad..b551e7537dec 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml @@ -32,7 +32,9 @@ Panel Config: per second. Note: this does not include any 8-bit integer operations from VALU instructions. The peak empirically measured INT8 MFMA operations achievable on the specific accelerator is displayed alongside for comparison.' - HBM Bandwidth: '' + HBM Bandwidth: The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison. L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. The number of bytes is calculated as the number of cache lines requested multiplied by the cache line size. This value does not consider partial requests, so e.g., @@ -50,10 +52,22 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - AI L1: '' - AI L2: '' - AI HBM: '' - Performance GFLOPs: '' + AI L1: The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline. + AI L2: The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for the + L2 roofline. + AI HBM: The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes transferred + between HBM and the L2 cache. This value is used as the x-coordinate for the + HBM roofline. + Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per + second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel's point on the Roofline plot. data source: - metric_table: id: 401 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml index 9bcda18c56c7..740f4a8019fb 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml @@ -32,7 +32,9 @@ Panel Config: per second. Note: this does not include any 8-bit integer operations from VALU instructions. The peak empirically measured INT8 MFMA operations achievable on the specific accelerator is displayed alongside for comparison.' - HBM Bandwidth: '' + HBM Bandwidth: The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison. L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. The number of bytes is calculated as the number of cache lines requested multiplied by the cache line size. This value does not consider partial requests, so e.g., @@ -50,10 +52,22 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - AI L1: '' - AI L2: '' - AI HBM: '' - Performance GFLOPs: '' + AI L1: The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline. + AI L2: The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for the + L2 roofline. + AI HBM: The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes transferred + between HBM and the L2 cache. This value is used as the x-coordinate for the + HBM roofline. + Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per + second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel's point on the Roofline plot. data source: - metric_table: id: 401 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml index f2cc09ffff74..34f8ab630977 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml @@ -32,7 +32,9 @@ Panel Config: per second. Note: this does not include any 8-bit integer operations from VALU instructions. The peak empirically measured INT8 MFMA operations achievable on the specific accelerator is displayed alongside for comparison.' - HBM Bandwidth: '' + HBM Bandwidth: The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison. L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. The number of bytes is calculated as the number of cache lines requested multiplied by the cache line size. This value does not consider partial requests, so e.g., @@ -50,10 +52,22 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - AI L1: '' - AI L2: '' - AI HBM: '' - Performance GFLOPs: '' + AI L1: The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline. + AI L2: The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for the + L2 roofline. + AI HBM: The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes transferred + between HBM and the L2 cache. This value is used as the x-coordinate for the + HBM roofline. + Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per + second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel's point on the Roofline plot. data source: - metric_table: id: 401 diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml index 8f47e8be5881..f81e195a3e5a 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml @@ -32,7 +32,9 @@ Panel Config: per second. Note: this does not include any 8-bit integer operations from VALU instructions. The peak empirically measured INT8 MFMA operations achievable on the specific accelerator is displayed alongside for comparison.' - HBM Bandwidth: '' + HBM Bandwidth: The total number of bytes read from and written to High-Bandwidth + Memory (HBM) per second. The peak empirically measured bandwidth achievable + on the specific accelerator is displayed alongside for comparison. L2 Cache Bandwidth: The number of bytes looked up in the L2 cache per unit time. The number of bytes is calculated as the number of cache lines requested multiplied by the cache line size. This value does not consider partial requests, so e.g., @@ -50,10 +52,22 @@ Panel Config: from, stored to, or atomically updated in the LDS per unit time (see LDS Bandwidth example for more detail). The peak empirically measured LDS bandwidth achievable on the specific accelerator is displayed alongside for comparison. - AI L1: '' - AI L2: '' - AI HBM: '' - Performance GFLOPs: '' + AI L1: The Arithmetic Intensity (AI) relative to the L1 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L1 cache and the processing units. This value is used as the x-coordinate + for the L1 roofline. + AI L2: The Arithmetic Intensity (AI) relative to the L2 Cache. It is the ratio + of total floating-point operations (FLOPs) to total bytes transferred between + the L2 cache and the L1 cache. This value is used as the x-coordinate for the + L2 roofline. + AI HBM: The Arithmetic Intensity (AI) relative to High-Bandwidth Memory (HBM). + It is the ratio of total floating-point operations (FLOPs) to total bytes transferred + between HBM and the L2 cache. This value is used as the x-coordinate for the + HBM roofline. + Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per + second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + operations divided by the total execution time. This value is used as the y-coordinate + for the kernel's point on the Roofline plot. data source: - metric_table: id: 401 diff --git a/projects/rocprofiler-compute/utils/autogen_hash.yaml b/projects/rocprofiler-compute/utils/autogen_hash.yaml index 3a4e66320ce9..484687afa60f 100644 --- a/projects/rocprofiler-compute/utils/autogen_hash.yaml +++ b/projects/rocprofiler-compute/utils/autogen_hash.yaml @@ -23,12 +23,12 @@ src/rocprof_compute_soc/analysis_configs/gfx940/0300_memory_chart.yaml: cff5509a src/rocprof_compute_soc/analysis_configs/gfx941/0300_memory_chart.yaml: cff5509ac8502bad6dbd75e3058159fe429aece5d93279c66b2a6a8c887b43b6 src/rocprof_compute_soc/analysis_configs/gfx942/0300_memory_chart.yaml: cff5509ac8502bad6dbd75e3058159fe429aece5d93279c66b2a6a8c887b43b6 src/rocprof_compute_soc/analysis_configs/gfx950/0300_memory_chart.yaml: 643b31ffa43bc3613d6f90b0c23d95093d0d0aa5bc8e72d9a0fbc1b739a08b67 -src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e -src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e +src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 2c16d4ba7fc5b8522b944948a4536ef8ca0006d3db715efd6e225249dd7c2d24 +src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: 43210f5b0080ea99d9771c9119b878a24342d429839881f8e82629348f68041f +src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: de95374b305f4028889e264f2951c621afdcd6c1d18cdde5bd19929355b76db4 +src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: a7c56663b065c2575b32cd416b7ee1a63e2b31afd4a2bdc868cff892c5e9b580 +src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: c38229da1301bc4dd1319e45c23ad8df8ddb2cec44b548d5d5d23c594f7cb207 +src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 8123ae6caffa5c54392247f974a127e3d607da6b5830925518dc040afadccc27 src/rocprof_compute_soc/analysis_configs/gfx908/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx90a/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx940/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb From f83f20f6be8f280985bddc16fe645e6251cc94c1 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Wed, 13 Aug 2025 13:31:38 -0500 Subject: [PATCH 09/14] review tweaks --- .../rocprof_compute_analyze/analysis_cli.py | 20 +++++------ .../gfx908/0400_roofline.yaml | 12 ++----- .../gfx90a/0400_roofline.yaml | 12 ++----- .../gfx940/0400_roofline.yaml | 8 ++--- .../gfx941/0400_roofline.yaml | 8 ++--- .../gfx942/0400_roofline.yaml | 8 ++--- .../gfx950/0400_roofline.yaml | 4 +-- projects/rocprofiler-compute/src/roofline.py | 9 ++--- .../src/utils/roofline_calc.py | 8 ++--- projects/rocprofiler-compute/src/utils/tty.py | 35 ++++++------------- .../utils/autogen_hash.yaml | 12 +++---- .../utils/unified_config.yaml | 30 +--------------- 12 files changed, 43 insertions(+), 123 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py index 47b6cf8eaca1..aa90dc02d3c1 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py @@ -72,9 +72,6 @@ def pre_processing(self): workload.raw_pmc, self.get_args().kernel_verbose ) - #update path - self._runs[d[0]].path = d[0] - # create the loaded table parser.load_table_data( workload=workload, @@ -89,23 +86,22 @@ def run_analysis(self): """Run CLI analysis.""" super().run_analysis() + workload_path = self.get_args().path[0][0] + workload = self._runs[workload_path] + gpu_arch = workload.sys_info.iloc[0]["gpu_arch"] + arch_config = self._arch_configs[gpu_arch] + if self.get_args().list_stats: tty.show_kernel_stats( self.get_args(), self._runs, - self._arch_configs[ - self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"] - ], + arch_config, self._output, ) else: roof_plot = None # 1. check if not baseline && compatible soc: if (len(self.get_args().path)) == 1: - workload_path = self.get_args().path[0][0] - workload = self._runs[workload_path] - gpu_arch = workload.sys_info.iloc[0]["gpu_arch"] - if gpu_arch in ["gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]: roof_obj = self.get_socs()[gpu_arch].roofline_obj @@ -118,13 +114,13 @@ def run_analysis(self): dtype=roof_obj.get_dtype()[0], workload=workload, config=self._profiling_config, - arch_config=self._arch_configs[gpu_arch] + arch_config=arch_config ) tty.show_all( self.get_args(), self._runs, - self._arch_configs[self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"]], + arch_config, self._output, self._profiling_config, roof_plot=roof_plot, diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml index 040de400a7f6..66c656fb4ced 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml @@ -64,8 +64,8 @@ Panel Config: It is the ratio of total floating-point operations (FLOPs) to total bytes transferred between HBM and the L2 cache. This value is used as the x-coordinate for the HBM roofline. - Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per - second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + Performance (GFLOPs): The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point operations divided by the total execution time. This value is used as the y-coordinate for the kernel's point on the Roofline plot. data source: @@ -109,14 +109,6 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMABF16Flops_empirical_peak - MFMA FLOPs (F8): - value: 0 - unit: GFLOP/s - peak: 0 - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml index d096de31f356..38af3367e9f5 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml @@ -64,8 +64,8 @@ Panel Config: It is the ratio of total floating-point operations (FLOPs) to total bytes transferred between HBM and the L2 cache. This value is used as the x-coordinate for the HBM roofline. - Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per - second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + Performance (GFLOPs): The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point operations divided by the total execution time. This value is used as the y-coordinate for the kernel's point on the Roofline plot. data source: @@ -109,14 +109,6 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMABF16Flops_empirical_peak - MFMA FLOPs (F8): - value: 0 - unit: GFLOP/s - peak: 0 - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml index b551e7537dec..839c04fd2ef3 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml @@ -64,8 +64,8 @@ Panel Config: It is the ratio of total floating-point operations (FLOPs) to total bytes transferred between HBM and the L2 cache. This value is used as the x-coordinate for the HBM roofline. - Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per - second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + Performance (GFLOPs): The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point operations divided by the total execution time. This value is used as the y-coordinate for the kernel's point on the Roofline plot. data source: @@ -114,10 +114,6 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml index 740f4a8019fb..f9f4d7cc19ee 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml @@ -64,8 +64,8 @@ Panel Config: It is the ratio of total floating-point operations (FLOPs) to total bytes transferred between HBM and the L2 cache. This value is used as the x-coordinate for the HBM roofline. - Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per - second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + Performance (GFLOPs): The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point operations divided by the total execution time. This value is used as the y-coordinate for the kernel's point on the Roofline plot. data source: @@ -114,10 +114,6 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml index 34f8ab630977..9ba1e6f1fa7b 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml @@ -64,8 +64,8 @@ Panel Config: It is the ratio of total floating-point operations (FLOPs) to total bytes transferred between HBM and the L2 cache. This value is used as the x-coordinate for the HBM roofline. - Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per - second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + Performance (GFLOPs): The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point operations divided by the total execution time. This value is used as the y-coordinate for the kernel's point on the Roofline plot. data source: @@ -114,10 +114,6 @@ Panel Config: / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml index f81e195a3e5a..500c7ff8059d 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml @@ -64,8 +64,8 @@ Panel Config: It is the ratio of total floating-point operations (FLOPs) to total bytes transferred between HBM and the L2 cache. This value is used as the x-coordinate for the HBM roofline. - Performance GFLOPs: The overall achieved performance, measured in GigaFLOPs per - second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point + Performance (GFLOPs): The overall achieved performance, measured in GigaFLOPs + per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point operations divided by the total execution time. This value is used as the y-coordinate for the kernel's point on the Roofline plot. data source: diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index 58f4c08d5dba..18d8c3be1509 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -686,11 +686,6 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) arch_config=arch_config ) - self.__ceiling_data = constuct_roof( - roofline_parameters=self.__run_parameters, - dtype=dtype - ) - else: pmc_perf_csv = base_path / "pmc_perf.csv" if not pmc_perf_csv.is_file(): @@ -703,11 +698,11 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) self.__run_parameters["sort_type"], t_df ) - self.__ceiling_data = constuct_roof( + + self.__ceiling_data = constuct_roof( roofline_parameters=self.__run_parameters, dtype=dtype ) - console_debug(f"AI data: {self.__ai_data}") console_debug(f"Kernel names: {self.__ai_data.get('kernelNames', [])}") diff --git a/projects/rocprofiler-compute/src/utils/roofline_calc.py b/projects/rocprofiler-compute/src/utils/roofline_calc.py index 05ce39f1cef0..f5500479dfa7 100644 --- a/projects/rocprofiler-compute/src/utils/roofline_calc.py +++ b/projects/rocprofiler-compute/src/utils/roofline_calc.py @@ -30,8 +30,8 @@ import pandas as pd -from utils import parser from utils.logger import console_debug +from utils.parser import apply_filters, eval_metric ################################################ # Global vars @@ -270,7 +270,7 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): } workload.roofline_metrics = {} - filtered_pmc = parser.apply_filters( + filtered_pmc = apply_filters( workload, workload.path, is_gui=False, @@ -324,7 +324,7 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): kernel_dfs_type[table_id] = arch_config.dfs_type[table_id] #eval metrics for single kernel only - parser.eval_metric( + eval_metric( kernel_dfs, kernel_dfs_type, workload.sys_info.iloc[0], @@ -355,7 +355,7 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): elif metric == 'Performance (GFLOPs)': performance = value if value and value != '' else 0 - console_debug("roofline", f"Kernel {kernel_id}: AI_HBM={ai_hbm:.2f}, AI_L2={ai_l2:.2f}, AI_L1={ai_l1:.2f}, Performance={performance:.2e} FLOP/s") + console_debug("roofline", f"Kernel {kernel_id}: AI_HBM={ai_hbm:.2f}, AI_L2={ai_l2:.2f}, AI_L1={ai_l1:.2f}, Performance={performance:.2e} GFLOP/s") #add to plot points if we have valid data if performance > 0: diff --git a/projects/rocprofiler-compute/src/utils/tty.py b/projects/rocprofiler-compute/src/utils/tty.py index 8990bff08065..da18ee5a6099 100644 --- a/projects/rocprofiler-compute/src/utils/tty.py +++ b/projects/rocprofiler-compute/src/utils/tty.py @@ -110,14 +110,6 @@ def convert_time_columns(df, time_unit): return df_copy -def shorten_kernel_name(kernel_name, verbosity_level): - """Helper function to shorten kernel names""" - if verbosity_level < 5: - temp_df = pd.DataFrame({'Kernel_Name': [kernel_name]}) - kernel_name_shortener(temp_df, verbosity_level) - return temp_df.loc[0, 'Kernel_Name'] - return kernel_name - def has_time_data(df): """ Check if the dataframe contains time data by looking at the Unit column. @@ -172,6 +164,8 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): print("-" * 80, file=output) kernel_top_df = workload.dfs.get(1, pd.DataFrame()) + if not kernel_top_df.empty: + kernel_name_shortener(kernel_top_df, args.kernel_verbose) for i, (kernel_id, metrics) in enumerate(workload.roofline_metrics.items()): if not kernel_top_df.empty and kernel_id in kernel_top_df.index: @@ -181,31 +175,24 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): kernel_name = metrics.get('name', f'Kernel {kernel_id}') kernel_pct = 0 - shortened_name = shorten_kernel_name(kernel_name, args.kernel_verbose) - - print(f"\nKernel {kernel_id}: {shortened_name[:80]}{'...' if len(shortened_name) > 80 else ''} ({kernel_pct:.1f}%)", file=output) + display_name = kernel_name[:80] + '...' if len(kernel_name) > 80 else kernel_name + print(f"\nKernel {kernel_id}: {display_name} ({kernel_pct:.1f}%)", file=output) base_indent = " " table_indent_prefix = f"{base_indent}| " - table_order = [401, 402] - table_names = {401: "4.1 Roofline Rate Metrics:", 402: "4.2 Roofline AI Plot Points:"} + tables = { + 401: ("4.1 Roofline Rate Metrics:", metrics.get('ai_table', pd.DataFrame())), + 402: ("4.2 Roofline AI Plot Points:", metrics.get('calc_table', pd.DataFrame())) + } print(f"{base_indent}|") - for table_id in table_order: - if table_id == 402: - df = metrics.get('calc_table', pd.DataFrame()) - elif table_id == 401: - df = metrics.get('ai_table', pd.DataFrame()) - else: - continue - + for table_id, (table_name, df) in tables.items(): if df.empty: continue - connector = "├─ " - print(f"{base_indent}{connector}{table_names.get(table_id, '')}", file=output) + print(f"{base_indent}├─ {table_name}", file=output) display_df = df.copy() @@ -214,9 +201,7 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): display_df = display_df.drop(columns=[col]) table_string = get_table_string(display_df, transpose=False, decimal=args.decimal) - indented_table_string = textwrap.indent(table_string, table_indent_prefix) - print(indented_table_string, file=output) else: diff --git a/projects/rocprofiler-compute/utils/autogen_hash.yaml b/projects/rocprofiler-compute/utils/autogen_hash.yaml index 484687afa60f..6de2ea2fad9c 100644 --- a/projects/rocprofiler-compute/utils/autogen_hash.yaml +++ b/projects/rocprofiler-compute/utils/autogen_hash.yaml @@ -23,12 +23,12 @@ src/rocprof_compute_soc/analysis_configs/gfx940/0300_memory_chart.yaml: cff5509a src/rocprof_compute_soc/analysis_configs/gfx941/0300_memory_chart.yaml: cff5509ac8502bad6dbd75e3058159fe429aece5d93279c66b2a6a8c887b43b6 src/rocprof_compute_soc/analysis_configs/gfx942/0300_memory_chart.yaml: cff5509ac8502bad6dbd75e3058159fe429aece5d93279c66b2a6a8c887b43b6 src/rocprof_compute_soc/analysis_configs/gfx950/0300_memory_chart.yaml: 643b31ffa43bc3613d6f90b0c23d95093d0d0aa5bc8e72d9a0fbc1b739a08b67 -src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 2c16d4ba7fc5b8522b944948a4536ef8ca0006d3db715efd6e225249dd7c2d24 -src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: 43210f5b0080ea99d9771c9119b878a24342d429839881f8e82629348f68041f -src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: de95374b305f4028889e264f2951c621afdcd6c1d18cdde5bd19929355b76db4 -src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: a7c56663b065c2575b32cd416b7ee1a63e2b31afd4a2bdc868cff892c5e9b580 -src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: c38229da1301bc4dd1319e45c23ad8df8ddb2cec44b548d5d5d23c594f7cb207 -src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 8123ae6caffa5c54392247f974a127e3d607da6b5830925518dc040afadccc27 +src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 6406ce67cd55064f0d2db2a3511c6536cc1625314ddb31366900fbf3c60ed523 +src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: 100d555cf9e70b892e22f92ddd9c0a5d1f914d07077c4a8d35941e8ad62b5b30 +src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: f8bf66f43c9afede4fd1f17c279050cc27cc6fbc1cdb53a71ae8ceb0eb84dc37 +src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: 6fae04dcf4bcabe4a71f5d9eefc379a38d30cdf05fbb14e2c276e1c272fdb3f6 +src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: c8dfe7df24f94dfa229ffa2035b802c6833ce98f7710e0889bc5710f2167d4c0 +src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 734fdfa818bfd8a87e01a0dd795c502a567c72158ca9b7bfe01e99451e8aa537 src/rocprof_compute_soc/analysis_configs/gfx908/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx90a/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb src/rocprof_compute_soc/analysis_configs/gfx940/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb diff --git a/projects/rocprofiler-compute/utils/unified_config.yaml b/projects/rocprofiler-compute/utils/unified_config.yaml index f486320ae64c..4d1964dcb7e3 100644 --- a/projects/rocprofiler-compute/utils/unified_config.yaml +++ b/projects/rocprofiler-compute/utils/unified_config.yaml @@ -2837,14 +2837,6 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMABF16Flops_empirical_peak - MFMA FLOPs (F8): - value: 0 - unit: GFLOP/s - peak: 0 - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s @@ -2898,14 +2890,6 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_BF16 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMABF16Flops_empirical_peak - MFMA FLOPs (F8): - value: 0 - unit: GFLOP/s - peak: 0 - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s @@ -2963,10 +2947,6 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s @@ -3024,10 +3004,6 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s @@ -3085,10 +3061,6 @@ panels: value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_F8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GFLOP/s peak: $MFMAF8Flops_empirical_peak - MFMA FLOPs (F6F4): - value: 0 - unit: GFLOP/s - peak: 0 MFMA IOPs (Int8): value: AVG((((SQ_INSTS_VALU_MFMA_MOPS_I8 * 512)) / ((End_Timestamp - Start_Timestamp) / 1e9)) / 1e9) unit: GIOP/s @@ -3776,7 +3748,7 @@ panels: transferred between HBM and the L2 cache. This value is used as the x-coordinate for the HBM roofline.' unit: FLOPs/Byte - Performance GFLOPs: + Performance (GFLOPs): plain: 'The overall achieved performance, measured in GigaFLOPs per second (GFLOP/s). This is calculated as the sum of all VALU and MFMA floating-point operations divided by the total execution time. This value is used as the y-coordinate From a628f50353da3fb655b8d9e1dc9750798e1c727a Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Thu, 14 Aug 2025 12:05:54 -0500 Subject: [PATCH 10/14] update docs --- .../docs/how-to/analyze/cli.rst | 68 ++++++++++++++++++- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler-compute/docs/how-to/analyze/cli.rst b/projects/rocprofiler-compute/docs/how-to/analyze/cli.rst index 2c494840e309..767e5c03652d 100644 --- a/projects/rocprofiler-compute/docs/how-to/analyze/cli.rst +++ b/projects/rocprofiler-compute/docs/how-to/analyze/cli.rst @@ -19,6 +19,9 @@ This section provides an overview of ROCm Compute Profiler's CLI analysis featur * :ref:`Filtering `: Hone in on a particular kernel, GPU ID, or dispatch ID via post-process filtering. +* :ref:`Per-kernel roofline analysis `: Detailed arithmetic + intensity and performance analysis for individual kernels. + Run ``rocprof-compute analyze -h`` for more details. .. _cli-walkthrough: @@ -32,7 +35,7 @@ There are three high-level GPU analysis views: * System Speed-of-Light: Key GPU performance metrics to show overall GPU performance and utilization. * Memory chart: Shows memory transactions and throughput on each cache hierarchical level. -* Empirical hierarchical roofline: Roofline model that compares achieved throughput with attainable peak hardware limits, more specifically peak compute throughput and memory bandwidth (on L1/LDS/L2/HBM). +* Empirical hierarchical roofline: Roofline model that compares achieved throughput with attainable peak hardware limits, more specifically peak compute throughput and memory bandwidth (on L1/LDS/L2/HBM). When combined with kernel filtering, provides detailed per-kernel arithmetic intensity analysis and performance breakdowns. **System Speed-of-Light:** @@ -67,7 +70,7 @@ There are three high-level GPU analysis views: .. note:: * Visualized memory chart and Roofline chart are only supported in single run analysis. In multiple runs comparison mode, both are switched back to basic table view. * Visualized memory chart requires the width of the terminal output to be greater than or equal to 234 to display the whole chart properly. - * Visualized Roofline chart is adapted to the initial terminal size only. If it is not clear, you may need to adjust the terminal size and regenerate it to check the display effect. + * Visualized Roofline chart is adapted to the initial terminal size only. If it is not clear, you may need to adjust the terminal size and regenerate it to check the display effect. Roofline analysis provides detailed, structured table output with measured empirical peak values for comparison. .. _cli-list-metrics: @@ -309,6 +312,67 @@ Filter kernels You should see your filtered kernels indicated by an asterisk in the **Top Stats** table. +.. _per-kernel-roofline: + +Per-kernel roofline analysis + When analyzing specific kernels, the roofline analysis provides detailed metrics for each filtered kernel: + + .. code-block:: shell-session + $ rocprof-compute analyze -p workloads/vcopy/MI200/ -k 0 -b 4 + This generates enhanced roofline output showing per-kernel performance rates and arithmetic intensity calculations: + + .. code-block:: text + ================================================================================ + 4. Roofline + ================================================================================ + (4.1) Per-Kernel Roofline Metrics and (4.2) AI Plot Points + -------------------------------------------------------------------------------- + Kernel 0: vecCopy(double*, double*, double*, int, int) (100.0%) + | + ├─ 4.1 Roofline Rate Metrics: + | ╒═════════════╤════════════════════╤═══════════════════╤═════════╤════════════════════╕ + | │ Metric_ID │ Metric │ Value │ Unit │ Peak (Empirical) │ + | ╞═════════════╪════════════════════╪═══════════════════╪═════════╪════════════════════╡ + | │ 4.1.0 │ VALU FLOPs │ │ Gflop/s │ 61286.40 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.1 │ MFMA FLOPs (F64) │ │ Gflop/s │ 108544.33 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.2 │ MFMA FLOPs (F32) │ │ Gflop/s │ 104531.42 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.3 │ MFMA FLOPs (F16) │ │ Gflop/s │ 709169.38 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.4 │ MFMA FLOPs (BF16) │ 0.0 │ Gflop/s │ 388161.09 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.5 │ MFMA FLOPs (F8) │ 0.0 │ Gflop/s │ 1446089.60 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.6 │ MFMA IOPs (Int8) │ │ Giop/s │ 737317.94 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.7 │ HBM Bandwidth │ │ Gb/s │ 3231.95 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.8 │ L2 Cache Bandwidth │ │ Gb/s │ 19096.81 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.9 │ L1 Cache Bandwidth │ 3880.358726762844 │ Gb/s │ 25006.24 │ + | ├─────────────┼────────────────────┼───────────────────┼─────────┼────────────────────┤ + | │ 4.1.10 │ LDS Bandwidth │ │ Gb/s │ 54920.88 │ + | ╘═════════════╧════════════════════╧═══════════════════╧═════════╧════════════════════╛ + ├─ 4.2 Roofline AI Plot Points: + | ╒═════════════╤══════════════════════╤═════════╤════════════╕ + | │ Metric_ID │ Metric │ Value │ Unit │ + | ╞═════════════╪══════════════════════╪═════════╪════════════╡ + | │ 4.2.0 │ AI HBM │ │ Flops/byte │ + | ├─────────────┼──────────────────────┼─────────┼────────────┤ + | │ 4.2.1 │ AI L2 │ │ Flops/byte │ + | ├─────────────┼──────────────────────┼─────────┼────────────┤ + | │ 4.2.2 │ AI L1 │ │ Flops/byte │ + | ├─────────────┼──────────────────────┼─────────┼────────────┤ + | │ 4.2.3 │ Performance (GFLOPs) │ │ Gflop/s │ + | ╘═════════════╧══════════════════════╧═════════╧════════════╛ + The per-kernel analysis uses YAML-based metric evaluation for accurate calculations. + + Analyze multiple kernels for comparison: + + .. code-block:: shell-session + $ rocprof-compute analyze -p workloads/vcopy/MI200/ -k 0 1 2 -b 4 Baseline comparison .. code-block:: shell From 84e99772887ff59cef23e24bac0a917dca1ed49b Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Fri, 15 Aug 2025 13:49:09 -0500 Subject: [PATCH 11/14] added roofline gui analysis --- .../src/rocprof_compute_analyze/analysis_webui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py index 283d19c9add2..babd079d978c 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py @@ -48,7 +48,7 @@ def __init__(self, args, supported_archs): self.dest_dir = str(Path(args.path[0][0]).absolute().resolve()) self.arch = None - self.__hidden_sections = ["Memory Chart", "Roofline"] + self.__hidden_sections = ["Memory Chart"] self.__hidden_columns = HIDDEN_COLUMNS # define different types of bar charts self.__barchart_elements = { @@ -151,7 +151,7 @@ def generate_from_filter( # Only display basic metrics if no filters are applied if not (disp_filt or kernel_filter or gcd_filter): temp = {} - keep = [1, 2, 101, 201, 301, 401] + keep = [1, 2, 101, 201, 301, 401, 402] for key in base_data[base_run].dfs: if keep.count(key) != 0: temp[key] = base_data[base_run].dfs[key] @@ -219,8 +219,8 @@ def generate_from_filter( .lower() ) html_section = [] - if panel["title"] not in self.__hidden_sections: + print("panel ", panel["title"]) # Iterate over each table per section for data_source in panel["data source"]: for t_type, table_config in data_source.items(): From 5617226ba8d1d03e0a3224e8387d75686ed37eac Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Fri, 15 Aug 2025 14:32:29 -0500 Subject: [PATCH 12/14] updated GUI docs --- .../rocprofiler-compute/docs/how-to/analyze/standalone-gui.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/rocprofiler-compute/docs/how-to/analyze/standalone-gui.rst b/projects/rocprofiler-compute/docs/how-to/analyze/standalone-gui.rst index 1c79c816d9bb..5454080951c0 100644 --- a/projects/rocprofiler-compute/docs/how-to/analyze/standalone-gui.rst +++ b/projects/rocprofiler-compute/docs/how-to/analyze/standalone-gui.rst @@ -83,6 +83,7 @@ application's profiling data: #. Top Stats (Top Kernel Statistics) #. System Info #. System Speed-of-Light +#. Roofline AI Data Metrics To dive deeper, use the dropdown menus at the top of the screen to isolate particular kernels or dispatches. You should see the web page update with From 3c7560f354c8965648ee530505c1693658e09565 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Mon, 18 Aug 2025 09:06:41 -0500 Subject: [PATCH 13/14] updated print statement --- .../src/rocprof_compute_analyze/analysis_webui.py | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py index babd079d978c..904b09890af6 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py @@ -220,7 +220,6 @@ def generate_from_filter( ) html_section = [] if panel["title"] not in self.__hidden_sections: - print("panel ", panel["title"]) # Iterate over each table per section for data_source in panel["data source"]: for t_type, table_config in data_source.items(): From ef66f08d106cdf7d0b3db33160d69d4526281d56 Mon Sep 17 00:00:00 2001 From: James Siddeley Date: Mon, 18 Aug 2025 14:34:05 -0500 Subject: [PATCH 14/14] comment tweaks and ran ruff formatting --- projects/rocprofiler-compute/src/argparser.py | 2 +- .../rocprof_compute_analyze/analysis_base.py | 10 +- .../rocprof_compute_analyze/analysis_cli.py | 8 +- .../src/rocprof_compute_soc/soc_base.py | 12 +-- projects/rocprofiler-compute/src/roofline.py | 22 ++--- .../rocprofiler-compute/src/utils/file_io.py | 11 --- .../rocprofiler-compute/src/utils/parser.py | 25 +++-- .../src/utils/roofline_calc.py | 98 +++++++++++-------- projects/rocprofiler-compute/src/utils/tty.py | 69 ++++++++++--- .../tests/test_profile_general.py | 10 +- .../rocprofiler-compute/utils/split_config.py | 10 +- 11 files changed, 160 insertions(+), 117 deletions(-) diff --git a/projects/rocprofiler-compute/src/argparser.py b/projects/rocprofiler-compute/src/argparser.py index ec8569e3df74..27cbc45c7414 100644 --- a/projects/rocprofiler-compute/src/argparser.py +++ b/projects/rocprofiler-compute/src/argparser.py @@ -307,7 +307,7 @@ def validate_block(value): "\t\t\t For stochastic sampling, the interval is in cycles.\n" "\t\t\t For host_trap sampling, the interval is in microsecond " "(DEFAULT: 1048576)." - ) + ), ) profile_group.add_argument( diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py index a76e948508ff..ea7539f42b30 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_base.py @@ -30,6 +30,8 @@ from collections import OrderedDict from pathlib import Path +import pandas as pd + from utils import file_io, parser, schema from utils.logger import ( console_debug, @@ -199,16 +201,16 @@ def initalize_runs(self, normalization_filter=None): if not getattr(self.get_args(), "no_roof", False): try: roofline_path = sysinfo_path.joinpath("roofline.csv") - roofline_df = file_io.load_roofline_peaks(roofline_path) + roofline_df = pd.read_csv(roofline_path) - #use original column names from roofline.csv directly + # use original column names from roofline.csv directly w.roofline_peaks = roofline_df except FileNotFoundError: console_warning("roofline.csv not found.") - w.roofline_peaks = file_io.create_empty_dataframe() + w.roofline_peaks = pd.DataFrame() else: - w.roofline_peaks = file_io.create_empty_dataframe() + w.roofline_peaks = pd.DataFrame() arch = w.sys_info.iloc[0]["gpu_arch"] mspec = self.get_socs()[arch]._mspec diff --git a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py index aa90dc02d3c1..573cc5b25017 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py @@ -68,9 +68,7 @@ def pre_processing(self): ) # demangle and overwrite original 'Kernel_Name' - kernel_name_shortener( - workload.raw_pmc, self.get_args().kernel_verbose - ) + kernel_name_shortener(workload.raw_pmc, self.get_args().kernel_verbose) # create the loaded table parser.load_table_data( @@ -106,7 +104,7 @@ def run_analysis(self): roof_obj = self.get_socs()[gpu_arch].roofline_obj if roof_obj: - #store path in workload for calc_ai_analyze + # store path in workload for calc_ai_analyze workload.path = workload_path # NOTE: using default data type @@ -114,7 +112,7 @@ def run_analysis(self): dtype=roof_obj.get_dtype()[0], workload=workload, config=self._profiling_config, - arch_config=arch_config + arch_config=arch_config, ) tty.show_all( diff --git a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_base.py b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_base.py index f5790ffb484b..05c8633c1a89 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_soc/soc_base.py @@ -377,14 +377,10 @@ def detect_counters(self): if counter_name.startswith("TCC") and counter_name.endswith("["): counters.remove(counter_name) counter_name = counter_name.split("[")[0] - counters = counters.union( - { - f"{counter_name}[{i}]" - for i in range( - num_xcd_for_pmc_file * int(self._mspec._l2_banks) - ) - } - ) + counters = counters.union({ + f"{counter_name}[{i}]" + for i in range(num_xcd_for_pmc_file * int(self._mspec._l2_banks)) + }) return counters diff --git a/projects/rocprofiler-compute/src/roofline.py b/projects/rocprofiler-compute/src/roofline.py index 18d8c3be1509..1f6c43d35adf 100644 --- a/projects/rocprofiler-compute/src/roofline.py +++ b/projects/rocprofiler-compute/src/roofline.py @@ -180,11 +180,11 @@ def empirical_roofline( ): self.roof_setup() - console_debug("roofline", "Path: %s" % self.__run_parameters.get("workload_dir")) + console_debug( + "roofline", "Path: %s" % self.__run_parameters.get("workload_dir") + ) self.__ai_data = calc_ai_profile( - self.__mspec, - self.__run_parameters.get("sort_type"), - ret_df + self.__mspec, self.__run_parameters.get("sort_type"), ret_df ) msg = "AI at each mem level:" for i in self.__ai_data: @@ -676,14 +676,14 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) console_log("roofline", "{} does not exist".format(roofline_csv)) return - #if workload is detected, utilize Roofline yamls. If not, fallback to legacy calc_ai + # if workload is detected, utilize Roofline yamls. If not, fallback to legacy calc_ai if workload is not None: self.__ai_data = calc_ai_analyze( workload=workload, mspec=self.__mspec, sort_type=self.__run_parameters.get("sort_type"), config=config, - arch_config=arch_config + arch_config=arch_config, ) else: @@ -694,15 +694,12 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) t_df["pmc_perf"] = pd.read_csv(pmc_perf_csv) self.__ai_data = calc_ai_profile( - self.__mspec, - self.__run_parameters["sort_type"], - t_df + self.__mspec, self.__run_parameters["sort_type"], t_df ) self.__ceiling_data = constuct_roof( - roofline_parameters=self.__run_parameters, - dtype=dtype - ) + roofline_parameters=self.__run_parameters, dtype=dtype + ) console_debug(f"AI data: {self.__ai_data}") console_debug(f"Kernel names: {self.__ai_data.get('kernelNames', [])}") @@ -739,7 +736,6 @@ def cli_generate_plot(self, dtype, workload=None, config=None, arch_config=None) 5: "atom", } - plt.clf() plt.plotsize(plt.tw(), plt.th()) diff --git a/projects/rocprofiler-compute/src/utils/file_io.py b/projects/rocprofiler-compute/src/utils/file_io.py index 5072db029ee1..fdab58ca4927 100644 --- a/projects/rocprofiler-compute/src/utils/file_io.py +++ b/projects/rocprofiler-compute/src/utils/file_io.py @@ -62,17 +62,6 @@ def load_sys_info(f): """ return pd.read_csv(f) -def load_roofline_peaks(f): - """ - Load empirical roofline peak values from a csv file to a df. - """ - return pd.read_csv(f) - -def create_empty_dataframe(): - """ - Returns an empty pandas DataFrame. - """ - return pd.DataFrame() def load_panel_configs(dir): """ diff --git a/projects/rocprofiler-compute/src/utils/parser.py b/projects/rocprofiler-compute/src/utils/parser.py index cc774f613b8b..3a470b69a860 100644 --- a/projects/rocprofiler-compute/src/utils/parser.py +++ b/projects/rocprofiler-compute/src/utils/parser.py @@ -196,6 +196,7 @@ def to_int(a): else: raise Exception("to_int: unsupported type.") + def to_sum(a): if str(type(a)) == "": return np.nan @@ -880,9 +881,17 @@ def eval_metric(dfs, dfs_type, sys_info, empirical_peaks_df, raw_pmc_df, debug, locals()[var_name] = peak_data_row[metric_name] else: default_peaks = [ - 'MFMAF64Flops', 'MFMAF32Flops', 'MFMAF16Flops', - 'MFMABF16Flops', 'MFMAF8Flops', 'MFMAI8Ops', - 'HBMBw', 'L2Bw', 'L1Bw', 'LDSBw', 'MFMA_FLOPs_F6F4', + "MFMAF64Flops", + "MFMAF32Flops", + "MFMAF16Flops", + "MFMABF16Flops", + "MFMAF8Flops", + "MFMAI8Ops", + "HBMBw", + "L2Bw", + "L1Bw", + "LDSBw", + "MFMA_FLOPs_F6F4", ] # set values to 0 if no no empirical peaks from roofline.csv are provided for peak_name in default_peaks: @@ -987,8 +996,7 @@ def eval_metric(dfs, dfs_type, sys_info, empirical_peaks_df, raw_pmc_df, debug, except TypeError: console_warning( "Skipping entry. Encountered a missing " - "counter\n{} has been assigned to None\n{}" - .format( + "counter\n{} has been assigned to None\n{}".format( expr, np.nan, ) @@ -1015,7 +1023,9 @@ def eval_metric(dfs, dfs_type, sys_info, empirical_peaks_df, raw_pmc_df, debug, row[expr] = out except (TypeError, NameError) as e: if "empirical_peak" in str(e): - console_warning(f"Missing empirical peak data: {e}. Using empty value.") + console_warning( + f"Missing empirical peak data: {e}. Using empty value." + ) row[expr] = "" else: row[expr] = "" @@ -1076,8 +1086,7 @@ def apply_filters(workload, dir, is_gui, debug): for kernel_id in workload.filter_kernel_ids: if kernel_id >= len(kernels_df["Kernel_Name"]): console_error( - "{} is an invalid kernel id. Please enter an id between 0-{}" - .format( + "{} is an invalid kernel id. Please enter an id between 0-{}".format( kernel_id, len(kernels_df["Kernel_Name"]) - 1, ) diff --git a/projects/rocprofiler-compute/src/utils/roofline_calc.py b/projects/rocprofiler-compute/src/utils/roofline_calc.py index f5500479dfa7..0fa4b104284e 100644 --- a/projects/rocprofiler-compute/src/utils/roofline_calc.py +++ b/projects/rocprofiler-compute/src/utils/roofline_calc.py @@ -259,23 +259,18 @@ def calc_ceilings(roofline_parameters, dtype, benchmark_data): # Calculate relevant metrics for ai calculation def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): """ - Calculate per-kernel metrics and AI points with Roofine yamls using eval_metric. + Calculate per-kernel metrics and AI points with Roofline yamls using eval_metric. """ - + console_debug("calc_ai_analyze: Starting calc_ai analysis using Roofline yamls") plot_points = { "ai_l1": [[], []], "ai_l2": [[], []], "ai_hbm": [[], []], - "kernelNames": [] + "kernelNames": [], } workload.roofline_metrics = {} - filtered_pmc = apply_filters( - workload, - workload.path, - is_gui=False, - debug=False - ) + filtered_pmc = apply_filters(workload, workload.path, is_gui=False, debug=False) kernel_ids_to_process = [] kernel_top_table_id = 1 @@ -286,7 +281,9 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): if kernel_top_table_id in workload.dfs: kernel_top_df = workload.dfs[kernel_top_table_id] kernel_ids_to_process = kernel_top_df.index.tolist() - console_debug("roofline", f"Found {len(kernel_ids_to_process)} kernels to process") + console_debug( + "roofline", f"Found {len(kernel_ids_to_process)} kernels to process" + ) if not kernel_ids_to_process: console_warning("No kernels found to process for roofline") @@ -304,7 +301,7 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): console_debug("roofline", f"Processing kernel {kernel_id}: {kernel_name[:50]}") - #filter PMC data for specific kernel + # filter PMC data for specific kernel kernel_pmc_df = filtered_pmc[ filtered_pmc["pmc_perf"]["Kernel_Name"] == kernel_name ] @@ -323,7 +320,7 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): kernel_dfs[table_id] = arch_config.dfs[table_id].copy() kernel_dfs_type[table_id] = arch_config.dfs_type[table_id] - #eval metrics for single kernel only + # eval metrics for single kernel only eval_metric( kernel_dfs, kernel_dfs_type, @@ -331,33 +328,38 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): workload.roofline_peaks, kernel_only_data, debug=False, - config=config + config=config, ) - #DEBUG + # DEBUG if 402 in kernel_dfs: console_debug("roofline", f"Table 402 for kernel {kernel_id}:") for idx, row in kernel_dfs[402].iterrows(): - console_debug("roofline", f" {row.get('Metric', '')}: {row.get('Value', '')}") + console_debug( + "roofline", f" {row.get('Metric', '')}: {row.get('Value', '')}" + ) ai_hbm = ai_l2 = ai_l1 = performance = 0 if 402 in kernel_dfs: for idx, row in kernel_dfs[402].iterrows(): - metric = row.get('Metric', '') - value = row.get('Value', 0) - if metric == 'AI HBM': - ai_hbm = value if value and value != '' else 0 - elif metric == 'AI L2': - ai_l2 = value if value and value != '' else 0 - elif metric == 'AI L1': - ai_l1 = value if value and value != '' else 0 - elif metric == 'Performance (GFLOPs)': - performance = value if value and value != '' else 0 - - console_debug("roofline", f"Kernel {kernel_id}: AI_HBM={ai_hbm:.2f}, AI_L2={ai_l2:.2f}, AI_L1={ai_l1:.2f}, Performance={performance:.2e} GFLOP/s") - - #add to plot points if we have valid data + metric = row.get("Metric", "") + value = row.get("Value", 0) + if metric == "AI HBM": + ai_hbm = value if value and value != "" else 0 + elif metric == "AI L2": + ai_l2 = value if value and value != "" else 0 + elif metric == "AI L1": + ai_l1 = value if value and value != "" else 0 + elif metric == "Performance (GFLOPs)": + performance = value if value and value != "" else 0 + + console_debug( + "roofline", + f"Kernel {kernel_id}: AI_HBM={ai_hbm:.2f}, AI_L2={ai_l2:.2f}, AI_L1={ai_l1:.2f}, Performance={performance:.2e} GFLOP/s", + ) + + # add to plot points if we have valid data if performance > 0: if ai_hbm > 0: plot_points["ai_hbm"][0].append(ai_hbm) @@ -372,27 +374,34 @@ def calc_ai_analyze(workload, mspec, sort_type, config, arch_config): plot_points["kernelNames"].append(f"K{kernel_id}") console_debug("roofline", f"Added kernel {kernel_id} to plot points") else: - console_debug("roofline", f"Skipping kernel {kernel_id} - no performance data") + console_debug( + "roofline", f"Skipping kernel {kernel_id} - no performance data" + ) - #store metrics for display + # store metrics for display workload.roofline_metrics[kernel_id] = { - 'name': kernel_name, - 'ai_table': kernel_dfs.get(401, pd.DataFrame()), - 'calc_table': kernel_dfs.get(402, pd.DataFrame()) + "name": kernel_name, + "ai_table": kernel_dfs.get(401, pd.DataFrame()), + "calc_table": kernel_dfs.get(402, pd.DataFrame()), } - console_debug("roofline", f"Generated {len(plot_points['kernelNames'])} plot points") + console_debug( + "roofline", f"Generated {len(plot_points['kernelNames'])} plot points" + ) console_debug("roofline", f"Plot points: {plot_points}") return plot_points + def calc_ai_profile(mspec, sort_type, ret_df): """Given counter data, calculate arithmetic intensity for each kernel in the application. - Leverage hard-coded equations to calculate AI values. - + Leverage hard-coded equations to calculate AI values. + Used during profiling stage to generate roofline PDF, since Roofline yamls are not available in the profiling stage.""" - print("Starting legacy roofline calculation (froom roofline calc)") + console_debug( + "calc_ai_profile: Starting legacy roofline calculation (from roofline_calc)" + ) df = ret_df["pmc_perf"] # Sort by top kernels or top dispatches? df = df.sort_values(by=["Kernel_Name"]) @@ -579,7 +588,10 @@ def calc_ai_profile(mspec, sort_type, ret_df): * 64 ) + ( - (df["TCC_EA0_WRREQ_sum"][idx] - df["TCC_EA0_WRREQ_64B_sum"][idx]) + ( + df["TCC_EA0_WRREQ_sum"][idx] + - df["TCC_EA0_WRREQ_64B_sum"][idx] + ) * 32 ) + (df["TCC_EA0_WRREQ_64B_sum"][idx] * 64) @@ -596,7 +608,9 @@ def calc_ai_profile(mspec, sort_type, ret_df): calls += 1 - if sort_type == "kernels" and (at_end == True or (kernelName != next_kernelName)): + if sort_type == "kernels" and ( + at_end == True or (kernelName != next_kernelName) + ): myList.append( AI_Data( kernelName, @@ -744,9 +758,7 @@ def constuct_roof(roofline_parameters, dtype): # ----------------------------------------------------- # Initialize roofline data dictionary from roofline.csv # ----------------------------------------------------- - benchmark_data = ( - {} - ) # TODO: consider changing this to an ordered dict for consistency over py versions + benchmark_data = {} # TODO: consider changing this to an ordered dict for consistency over py versions headers = [] try: with open(benchmark_results, "r") as csvfile: diff --git a/projects/rocprofiler-compute/src/utils/tty.py b/projects/rocprofiler-compute/src/utils/tty.py index da18ee5a6099..88bd6ea36781 100644 --- a/projects/rocprofiler-compute/src/utils/tty.py +++ b/projects/rocprofiler-compute/src/utils/tty.py @@ -110,6 +110,7 @@ def convert_time_columns(df, time_unit): return df_copy + def has_time_data(df): """ Check if the dataframe contains time data by looking at the Unit column. @@ -153,37 +154,69 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): for type in data_source ) - if has_roofline_style and (not args.filter_metrics or "4" in args.filter_metrics): + if has_roofline_style and ( + not args.filter_metrics or "4" in args.filter_metrics + ): print("\n" + "=" * 80, file=output) print("4. Roofline", file=output) print("=" * 80, file=output) for run_path, workload in runs.items(): - if hasattr(workload, 'roofline_metrics') and workload.roofline_metrics: - print("\n(4.1) Per-Kernel Roofline Metrics and (4.2) AI Plot Points", file=output) + if ( + hasattr(workload, "roofline_metrics") + and workload.roofline_metrics + ): + print( + "\n(4.1) Per-Kernel Roofline Metrics and (4.2) AI Plot Points", + file=output, + ) print("-" * 80, file=output) kernel_top_df = workload.dfs.get(1, pd.DataFrame()) if not kernel_top_df.empty: kernel_name_shortener(kernel_top_df, args.kernel_verbose) - for i, (kernel_id, metrics) in enumerate(workload.roofline_metrics.items()): - if not kernel_top_df.empty and kernel_id in kernel_top_df.index: - kernel_name = kernel_top_df.loc[kernel_id, "Kernel_Name"] - kernel_pct = kernel_top_df.loc[kernel_id, "Pct"] if "Pct" in kernel_top_df.columns else 0 + for i, (kernel_id, metrics) in enumerate( + workload.roofline_metrics.items() + ): + if ( + not kernel_top_df.empty + and kernel_id in kernel_top_df.index + ): + kernel_name = kernel_top_df.loc[ + kernel_id, "Kernel_Name" + ] + kernel_pct = ( + kernel_top_df.loc[kernel_id, "Pct"] + if "Pct" in kernel_top_df.columns + else 0 + ) else: - kernel_name = metrics.get('name', f'Kernel {kernel_id}') + kernel_name = metrics.get("name", f"Kernel {kernel_id}") kernel_pct = 0 - display_name = kernel_name[:80] + '...' if len(kernel_name) > 80 else kernel_name - print(f"\nKernel {kernel_id}: {display_name} ({kernel_pct:.1f}%)", file=output) + display_name = ( + kernel_name[:80] + "..." + if len(kernel_name) > 80 + else kernel_name + ) + print( + f"\nKernel {kernel_id}: {display_name} ({kernel_pct:.1f}%)", + file=output, + ) base_indent = " " table_indent_prefix = f"{base_indent}| " tables = { - 401: ("4.1 Roofline Rate Metrics:", metrics.get('ai_table', pd.DataFrame())), - 402: ("4.2 Roofline AI Plot Points:", metrics.get('calc_table', pd.DataFrame())) + 401: ( + "4.1 Roofline Rate Metrics:", + metrics.get("ai_table", pd.DataFrame()), + ), + 402: ( + "4.2 Roofline AI Plot Points:", + metrics.get("calc_table", pd.DataFrame()), + ), } print(f"{base_indent}|") @@ -200,8 +233,12 @@ def show_all(args, runs, archConfigs, output, profiling_config, roof_plot=None): if col in display_df.columns: display_df = display_df.drop(columns=[col]) - table_string = get_table_string(display_df, transpose=False, decimal=args.decimal) - indented_table_string = textwrap.indent(table_string, table_indent_prefix) + table_string = get_table_string( + display_df, transpose=False, decimal=args.decimal + ) + indented_table_string = textwrap.indent( + table_string, table_indent_prefix + ) print(indented_table_string, file=output) else: @@ -522,8 +559,8 @@ def show_roof_plot(roof_plot): def show_kernel_stats(args, runs, archConfigs, output): - """ - Show the kernels and dispatches from "Top Stats" section. + """ + Show the kernels and dispatches from "Top Stats" section. """ df = pd.DataFrame() diff --git a/projects/rocprofiler-compute/tests/test_profile_general.py b/projects/rocprofiler-compute/tests/test_profile_general.py index 51dcdd50c7f9..33dcd2f3c3d1 100644 --- a/projects/rocprofiler-compute/tests/test_profile_general.py +++ b/projects/rocprofiler-compute/tests/test_profile_general.py @@ -1676,9 +1676,9 @@ def test_memory_throughput_set(self, binary_handler_profile_rocprof_compute): memory_metrics = ["16.1.2", "17.1.0"] for metric_id in memory_metrics: - assert ( - metric_id in open(Path(workload_dir) / "log.txt", "r").read() - ), f"Expected memory metric {metric_id} not found" + assert metric_id in open(Path(workload_dir) / "log.txt", "r").read(), ( + f"Expected memory metric {metric_id} not found" + ) test_utils.clean_output_dir(config["cleanup"], workload_dir) @@ -1745,7 +1745,9 @@ def test_invalid_set_error_handling(self, binary_handler_profile_rocprof_compute assert returncode == 1 test_utils.clean_output_dir(config["cleanup"], workload_dir) - def test_set_and_block_mutual_exclusion(self, binary_handler_profile_rocprof_compute): + def test_set_and_block_mutual_exclusion( + self, binary_handler_profile_rocprof_compute + ): options = ["--set", "compute_thruput_util", "--block", "12"] workload_dir = test_utils.get_output_dir() diff --git a/projects/rocprofiler-compute/utils/split_config.py b/projects/rocprofiler-compute/utils/split_config.py index 0c9f8647021a..336e54aa7408 100644 --- a/projects/rocprofiler-compute/utils/split_config.py +++ b/projects/rocprofiler-compute/utils/split_config.py @@ -87,7 +87,9 @@ def update_analysis_config(): data_source_config["metric_table"]["metric"], gfx_version, ) - new_panel_config["Panel Config"]["data source"].append(data_source_config) + 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") @@ -134,9 +136,9 @@ def update_sets_config(): } for metric_id in sets["metric"][gfx_version]: - current_set["metric"].append( - {metric_id: METRIC_ID_TO_NAME_MAP[gfx_version][str(metric_id)]} - ) + current_set["metric"].append({ + metric_id: METRIC_ID_TO_NAME_MAP[gfx_version][str(metric_id)] + }) new_sets["sets"].append(current_set)