[MUSA][4/N] Add common device utilities, distributed backend, and custom op wiring (#17246)

Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
This commit is contained in:
R0CKSTAR
2026-01-29 15:13:24 +08:00
committed by GitHub
parent 9409c43593
commit d3cdee0a04
7 changed files with 109 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ class DeviceConfig:
gpu_id: Optional[int]
def __init__(self, device: str = "cuda", gpu_id: int = -1) -> None:
if device in ["cuda", "xpu", "hpu", "cpu", "npu"]:
if device in ["cuda", "xpu", "hpu", "cpu", "npu", "musa"]:
self.device_type = device
else:
raise RuntimeError(f"Not supported device type: {device}")