MCPcopy
hub / github.com/ModelTC/LightLLM / get_current_device_name

Function get_current_device_name

lightllm/utils/device_utils.py:80–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78
79@lru_cache(maxsize=None)
80def get_current_device_name():
81 import torch
82
83 if torch.cuda.is_available():
84 device = torch.cuda.current_device()
85 gpu_name = torch.cuda.get_device_name(device).replace(" ", "_")
86 return gpu_name
87 else:
88 return None
89
90
91@lru_cache(maxsize=None)

Callers 2

get_config_file_nameMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected