adding runtime metrics / system info additional accelerator support, etc.

This commit is contained in:
Dan Saunders
2025-02-24 19:37:11 +00:00
parent aea0e760e4
commit 61266ab843

View File

@@ -298,15 +298,13 @@ class TelemetryManager:
elif hasattr(torch, "npu") and torch.npu.is_available(): elif hasattr(torch, "npu") and torch.npu.is_available():
accelerator_type = "npu" accelerator_type = "npu"
for i in range(torch.npu.device_count()): for i in range(torch.npu.device_count()):
name = getattr(torch.npu, "get_device_name", lambda x: "NPU")(i)
memory = None memory = None
if hasattr(torch.npu, "get_device_properties"): if hasattr(torch.npu, "get_device_properties"):
memory = torch.npu.get_device_properties(i).total_memory memory = torch.npu.get_device_properties(i).total_memory
gpu_info.append( gpu_info.append(
{ {
"name": name, "name": torch.npu.get_device_name(i),
"memory": memory, "memory": memory,
"type": "npu", "type": "npu",
} }