[MUSA][Feat] torch.accelerator support (#3101)

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
Signed-off-by: Canlin Guo <961750412@qq.com>
Co-authored-by: Canlin Guo <961750412@qq.com>
This commit is contained in:
R0CKSTARandCanlin Guo authored and GitHub committed 2026-04-24 15:31:45 +00:00
1 parent 7b876324c2
commit d388583e0b
7 files changed
+9 -242

No files matched your search

+3 -18
View File
@@ -601,23 +601,6 @@ def load_deploy_config(path: str | Path) -> DeployConfig:
return DeployConfig(**kwargs)
def _detect_platform() -> str | None:
"""Return "npu", "rocm", "xpu", or None (CUDA default)."""
try:
from vllm.platforms import current_platform
name = current_platform.device_name.lower()
if "npu" in name:
return "npu"
if "rocm" in name or "amd" in name:
return "rocm"
if "xpu" in name:
return "xpu"
except Exception as e:
logger.debug("Platform auto-detect failed, falling back to CUDA: %s", e)
return None
def _extract_platform_overrides(ps: dict[str, Any]) -> tuple[dict[str, Any], str | None]:
"""Return ``(overrides, devices)`` from a platform stage entry.
@@ -636,7 +619,9 @@ def _apply_platform_overrides(
) -> DeployConfig:
"""Merge platform-specific stage overrides into deploy config."""
if platform is None:
platform = _detect_platform()
from vllm_omni.platforms import current_omni_platform
platform = current_omni_platform.device_name.lower()
if platform is None or deploy.platforms is None:
return deploy
platform_section = deploy.platforms.get(platform)