[Intel GPU] refine xpu worker (#32894)

Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
Kunshang Ji
2026-01-29 20:26:52 +08:00
committed by GitHub
parent 8b3f0a99dd
commit 8bb6271c77
2 changed files with 27 additions and 90 deletions

View File

@@ -138,16 +138,18 @@ def xpu_platform_plugin() -> str | None:
if supports_xccl():
dist_backend = "xccl"
else:
dist_backend = "ccl"
import oneccl_bindings_for_pytorch # noqa: F401
if hasattr(torch, "xpu") and torch.xpu.is_available():
is_xpu = True
from vllm.platforms.xpu import XPUPlatform
XPUPlatform.dist_backend = dist_backend
logger.debug("Confirmed %s backend is available.", XPUPlatform.dist_backend)
else:
logger.warning(
"xccl is not enabled in this torch build, "
"communication is not available."
)
if hasattr(torch, "xpu") and torch.xpu.is_available():
is_xpu = True
logger.debug("Confirmed XPU platform is available.")
except Exception as e:
logger.debug("XPU platform is not available because: %s", str(e))