Adjusted CU % logic to be more robust

[ROCm/amdsmi commit: 9729aba695]
Этот коммит содержится в:
gabrpham_amdeng
2025-06-18 19:37:01 -05:00
коммит произвёл Arif, Maisam
родитель d049815647
Коммит 771e3019ad
2 изменённых файлов: 5 добавлений и 5 удалений
+3 -3
Просмотреть файл
@@ -6602,11 +6602,11 @@ class AMDSMICommands():
market_name = asic_info['market_name']
oam_id = asic_info['oam_id']
# get num_cu now for use later
max_cu = float(asic_info['num_compute_units'])
total_num_cu = float(asic_info['num_compute_units'])
except amdsmi_exception.AmdSmiLibraryException as e:
market_name = "N/A"
oam_id = "N/A"
max_cu = "N/A"
total_num_cu = "N/A"
gpu_info_dict.update({"market_name": market_name})
gpu_info_dict.update({"oam_id": oam_id})
@@ -6705,7 +6705,7 @@ class AMDSMICommands():
proc_info_dict['vram'] = self.helpers.convert_bytes_to_readable(proc['memory_usage']['vram_mem'])
proc_info_dict['mem_usage'] = self.helpers.convert_bytes_to_readable(proc['mem'])
num_cu = float(proc['cu_occupancy'])
proc_info_dict['cu_occupancy'] = {"current_cu": num_cu, "max_cu": max_cu}
proc_info_dict['cu_occupancy'] = {"current_cu": num_cu, "total_num_cu": total_num_cu}
all_process_list.append(proc_info_dict)
except amdsmi_exception.AmdSmiLibraryException as e:
logging.debug("Failed to get process list for gpu %s | %s", gpu_id, e.get_error_info())
+2 -2
Просмотреть файл
@@ -1082,8 +1082,8 @@ class AMDSMILogger():
gtt_mem = str(process['gtt']).rjust(8)
vram_mem = str(process['vram']).rjust(8)
mem_usage = str(process['mem_usage']).rjust(9)
if process['cu_occupancy']['max_cu'] != "N/A":
cu_occupancy = (str(round(process['cu_occupancy']['current_cu'] / process['cu_occupancy']['max_cu'] * 100, 1)) + " %").rjust(7)
if process['cu_occupancy']['total_num_cu'] != "N/A" and process['cu_occupancy']['current_cu'] != "N/A":
cu_occupancy = (str(round(process['cu_occupancy']['current_cu'] / process['cu_occupancy']['total_num_cu'] * 100, 1)) + " %").rjust(7)
else:
cu_occupancy = "N/A"
print("| {0:4.4s} {1:9.9s} {2:19.19s} {3:8.8s} {4:8.8s} {5:9.9s} {6:7.7s} |".format(