Fix memory clock detection with amd-smi (#824)

[ROCm/rocprofiler-compute commit: 0fdd186dd5]
Esse commit está contido em:
vedithal-amd
2025-07-22 13:46:06 -04:00
commit de GitHub
commit e40141f2ba
2 arquivos alterados com 10 adições e 7 exclusões
+1
Ver Arquivo
@@ -93,6 +93,7 @@ Full documentation for ROCm Compute Profiler is available at [https://rocm.docs.
* Fixed kernel name and kernel dispatch filtering when using rocprof v3
* Fixed not collecting TCC channel counters in rocprof v3
* Fixed peak FLOPS of F8 I8 F16 and BF16 on MI300
* Fixed not detecting memory clock issue when using amd-smi
### Known issues
@@ -24,6 +24,7 @@
import ctypes
import glob
import json
import math
import os
import re
@@ -166,13 +167,14 @@ class OmniSoC_Base:
)
)
# we get the max mclk from amd-smi --showmclkrange
# Regular expression to extract the max memory clock (third frequency level in MEM)
memory_clock_pattern = (
r"MEM:\s*[^:]*FREQUENCY_LEVELS:\s*(?:\d+: \d+ MHz\s*){2}(\d+)\s*MHz"
)
amd_smi_mclk = run(["amd-smi", "static"], exit_on_error=True)
self._mspec.max_mclk = search(memory_clock_pattern, amd_smi_mclk)
# Parse json from amd-smi static --clock
amd_smi_mclk = run(["amd-smi", "static", "--clock", "--json"], exit_on_error=True)
amd_smi_mclk = json.loads(amd_smi_mclk)
amd_smi_mclk = amd_smi_mclk["gpu_data"][0]["clock"]["mem"]["frequency_levels"]
# Choose the highest level of memory clock frequency
amd_smi_mclk = amd_smi_mclk[sorted(amd_smi_mclk.keys())[-1]]
# 100 Mhz -> 100
self._mspec.max_mclk = amd_smi_mclk.split(" ")[0]
console_debug("max mem clock is {}".format(self._mspec.max_mclk))