From 2de2faf944a39477ae1a22bb2b106679802cf3b1 Mon Sep 17 00:00:00 2001 From: Ben Richard <143630488+benrichard-amd@users.noreply.github.com> Date: Fri, 25 Oct 2024 18:13:10 -0400 Subject: [PATCH] Add broken mclk workaround for all arch (#453) * Check for missing mclk, use hard-coded values if needed Signed-off-by: benrichard-amd * Fix typo Signed-off-by: benrichard-amd --------- Signed-off-by: benrichard-amd --- src/omniperf_soc/soc_gfx908.py | 6 ++++-- src/omniperf_soc/soc_gfx90a.py | 7 +++++++ src/omniperf_soc/soc_gfx942.py | 10 ++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/omniperf_soc/soc_gfx908.py b/src/omniperf_soc/soc_gfx908.py index 4d94edd81..415502a55 100644 --- a/src/omniperf_soc/soc_gfx908.py +++ b/src/omniperf_soc/soc_gfx908.py @@ -63,8 +63,10 @@ def __init__(self, args, mspec): self._mspec.lds_banks_per_cu = 32 self._mspec.pipes_per_gpu = 4 # --showmclkrange is broken in Mi100, hardcode freq - self._mspec.max_mclk = 1200 - self._mspec.cur_mclk = 1200 + if self._mspec.gpu_model == "MI100": + if self._mspec.max_mclk == None or self._mspec.cur_mclk == None: + self._mspec.max_mclk = 1200 + self._mspec.cur_mclk = 1200 @demarcate def get_profiler_options(self): diff --git a/src/omniperf_soc/soc_gfx90a.py b/src/omniperf_soc/soc_gfx90a.py index 022404f74..9e5fbd04e 100644 --- a/src/omniperf_soc/soc_gfx90a.py +++ b/src/omniperf_soc/soc_gfx90a.py @@ -71,6 +71,13 @@ def __init__(self, args, mspec): ) self.roofline_obj = Roofline(args, self._mspec) + # Workaround for broken --showmclkrange + # MI210/MI250/MI250X have 1600MHz mclk + if self._mspec.gpu_model == "MI200": + if self._mspec.max_mclk == None or self._mspec.cur_mclk == None: + self._mspec.max_mclk = 1600 + self._mspec.cur_mclk = 1600 + # Set arch specific specs self._mspec._l2_banks = 32 self._mspec.lds_banks_per_cu = 32 diff --git a/src/omniperf_soc/soc_gfx942.py b/src/omniperf_soc/soc_gfx942.py index d2ad35eb1..606d9a839 100644 --- a/src/omniperf_soc/soc_gfx942.py +++ b/src/omniperf_soc/soc_gfx942.py @@ -69,10 +69,12 @@ def __init__(self, args, mspec): ) # self.roofline_obj = Roofline(args, self._mspec) - # --showmclkrange is broken in MI308X, hardcode freq - if self._mspec.gpu_model == "MI308X": - self._mspec.max_mclk = 1300 - self._mspec.cur_mclk = 1300 + # Workaround for broken --showmclkrange + # MI300X/MI300A/MI308X have 1300MHz mclk + if self._mspec.gpu_model == "MI300": + if self._mspec.max_mclk == None or self._mspec.cur_mclk == None: + self._mspec.max_mclk = 1300 + self._mspec.cur_mclk = 1300 # Set arch specific specs self._mspec._l2_banks = 16