From bceddb094316a304334f0940c962eee85f011ef3 Mon Sep 17 00:00:00 2001 From: vedithal-amd Date: Fri, 7 Feb 2025 14:54:17 -0500 Subject: [PATCH] Add broken mclk workaround for all arch #453 (#556) * Add the missing commit from #453 * Remove unnecessary conditional and use 'is' operator Co-authored-by: Richard Ben --- src/rocprof_compute_soc/soc_gfx908.py | 5 +++-- src/rocprof_compute_soc/soc_gfx90a.py | 6 ++++++ src/rocprof_compute_soc/soc_gfx942.py | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/rocprof_compute_soc/soc_gfx908.py b/src/rocprof_compute_soc/soc_gfx908.py index c8bcdb59fa..15371c035a 100644 --- a/src/rocprof_compute_soc/soc_gfx908.py +++ b/src/rocprof_compute_soc/soc_gfx908.py @@ -65,8 +65,9 @@ class gfx908_soc(OmniSoC_Base): 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.max_mclk is None or self._mspec.cur_mclk is None: + self._mspec.max_mclk = 1200 + self._mspec.cur_mclk = 1200 @demarcate def get_profiler_options(self): diff --git a/src/rocprof_compute_soc/soc_gfx90a.py b/src/rocprof_compute_soc/soc_gfx90a.py index 4147314614..734ea0505b 100644 --- a/src/rocprof_compute_soc/soc_gfx90a.py +++ b/src/rocprof_compute_soc/soc_gfx90a.py @@ -74,6 +74,12 @@ class gfx90a_soc(OmniSoC_Base): ) self.roofline_obj = Roofline(args, self._mspec) + # Workaround for broken --showmclkrange + # MI210/MI250/MI250X have 1600MHz mclk + if self._mspec.max_mclk is None or self._mspec.cur_mclk is 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/rocprof_compute_soc/soc_gfx942.py b/src/rocprof_compute_soc/soc_gfx942.py index 8e1ee003e9..425fedffd8 100644 --- a/src/rocprof_compute_soc/soc_gfx942.py +++ b/src/rocprof_compute_soc/soc_gfx942.py @@ -75,8 +75,9 @@ class gfx942_soc(OmniSoC_Base): ) self.roofline_obj = Roofline(args, self._mspec) - # --showmclkrange is broken in MI308X, hardcode freq - if self._mspec.gpu_model == "MI308X": + # Workaround for broken --showmclkrange + # MI300X/MI300A/MI308X have 1300MHz mclk + if self._mspec.max_mclk is None or self._mspec.cur_mclk is None: self._mspec.max_mclk = 1300 self._mspec.cur_mclk = 1300