[V1] Move usage stats to worker and start logging TPU hardware (#16211)
This commit is contained in:
@@ -174,6 +174,15 @@ class UsageMessage:
|
||||
cuda_get_device_properties(0, ("name", "total_memory")))
|
||||
if current_platform.is_cuda():
|
||||
self.cuda_runtime = torch.version.cuda
|
||||
if current_platform.is_tpu():
|
||||
try:
|
||||
import torch_xla
|
||||
self.gpu_count = torch_xla.runtime.world_size()
|
||||
self.gpu_type = torch_xla.tpu.get_tpu_type()
|
||||
self.gpu_memory_per_device = (
|
||||
torch_xla.core.xla_model.get_memory_info()["bytes_limit"])
|
||||
except Exception:
|
||||
pass
|
||||
self.provider = _detect_cloud_provider()
|
||||
self.architecture = platform.machine()
|
||||
self.platform = platform.platform()
|
||||
|
||||
Reference in New Issue
Block a user