From 97dcbf9410c1df1b7a4d341c4ed021f06f8d5087 Mon Sep 17 00:00:00 2001 From: Kotthagattu Meher Sai Date: Mon, 7 Sep 2026 11:00:22 +0530 Subject: [PATCH] [XPU] Re-add intel xpu on triton paths in diffusion platforms (#36654) --- python/sglang/kernels/ops/diffusion/common/platform.py | 4 ++-- python/sglang/multimodal_gen/runtime/platforms/__init__.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/sglang/kernels/ops/diffusion/common/platform.py b/python/sglang/kernels/ops/diffusion/common/platform.py index 7b763a1b0..8479d7266 100644 --- a/python/sglang/kernels/ops/diffusion/common/platform.py +++ b/python/sglang/kernels/ops/diffusion/common/platform.py @@ -31,7 +31,7 @@ _CUDA_LIKE = frozenset({"cuda", "hip"}) def platform_key() -> str: - """Return the live device family: ``cuda``/``hip``/``npu``/``mps``/``musa``/``cpu``. + """Return the live device family: ``cuda``/``hip``/``npu``/``mps``/``musa``/``xpu``/``cpu``. Deliberately *not* memoized: :func:`select_impl` calls it at module import time, and latching that first answer would freeze the choice before the @@ -40,7 +40,7 @@ def platform_key() -> str: """ from sglang.multimodal_gen.runtime.platforms import current_platform - for name in ("cuda", "hip", "npu", "mps", "musa"): + for name in ("cuda", "hip", "npu", "mps", "musa", "xpu"): if getattr(current_platform, f"is_{name}")(): return name return "cpu" diff --git a/python/sglang/multimodal_gen/runtime/platforms/__init__.py b/python/sglang/multimodal_gen/runtime/platforms/__init__.py index e47eeac80..31ccebc9e 100644 --- a/python/sglang/multimodal_gen/runtime/platforms/__init__.py +++ b/python/sglang/multimodal_gen/runtime/platforms/__init__.py @@ -201,6 +201,7 @@ def resolve_current_platform_cls_qualname() -> str: "mps": "sglang.multimodal_gen.runtime.platforms.mps.MpsPlatform", "npu": "sglang.multimodal_gen.runtime.platforms.npu.NPUPlatformBase", "musa": "sglang.multimodal_gen.runtime.platforms.musa.MusaPlatform", + "xpu": "sglang.multimodal_gen.runtime.platforms.xpu.XpuPlatform", } qualname = forced_map.get(forced_platform.lower()) if qualname is None: