[Intel GPU] Xpu/weekly simple model enablement 2026 09 21 (#40664)

Co-authored-by: Amrutha M <amrutha.m@intel.com>
Co-authored-by: charlesxu91 <charlesxu.mi@gmail.com>
Co-authored-by: KMS07 <meher.sai.kotthagattu@intel.com>
Co-authored-by: Avi Fenesh <aviarchi1994@gmail.com>
Co-authored-by: Ma Mingfei <mingfei.ma@intel.com>
This commit is contained in:
Meng, Hengyu
2026-09-28 13:49:18 +08:00
committed by GitHub
co-authored by Amrutha M charlesxu91 KMS07 Avi Fenesh Ma Mingfei
parent 34f090053e
commit 6be9c78cf4
12 changed files with 193 additions and 23 deletions
+57 -12
View File
@@ -2,6 +2,7 @@
import importlib.metadata
import os
import platform
import resource
import subprocess
import sys
@@ -10,7 +11,7 @@ from collections import OrderedDict, defaultdict
import torch
from sglang.srt.utils import is_hip, is_mps, is_musa, is_npu
from sglang.srt.utils import is_hip, is_mps, is_musa, is_npu, is_xpu
def is_cuda_v2():
@@ -140,6 +141,19 @@ class BaseEnv:
print(f"{k}: {v}")
class CPUEnv(BaseEnv):
"""Environment checker for CPU-only systems."""
def get_info(self):
return {
"CPU Architecture": platform.machine(),
"CPU Count": os.cpu_count(),
}
def get_topology(self):
return {}
class GPUEnv(BaseEnv):
"""Environment checker for Nvidia GPU"""
@@ -296,6 +310,31 @@ class HIPEnv(BaseEnv):
return {}
class XPUEnv(BaseEnv):
"""Environment checker for Intel XPU."""
def get_info(self):
xpu_info = {"XPU available": torch.xpu.is_available()}
if xpu_info["XPU available"]:
xpu_info["XPU count"] = torch.xpu.device_count()
xpu_info.update(self.get_device_info())
return xpu_info
def get_device_info(self):
devices = defaultdict(list)
for k in range(torch.xpu.device_count()):
devices[torch.xpu.get_device_name(k)].append(str(k))
return {
f"XPU {','.join(device_ids)}": name for name, device_ids in devices.items()
}
def get_topology(self):
return {}
class NPUEnv(BaseEnv):
"""Environment checker for Ascend NPU"""
@@ -580,15 +619,21 @@ class MPSEnv(BaseEnv):
return {}
if __name__ == "__main__":
def _get_env():
if is_cuda_v2():
env = GPUEnv()
elif is_hip():
env = HIPEnv()
elif is_npu():
env = NPUEnv()
elif is_musa():
env = MUSAEnv()
elif is_mps():
env = MPSEnv()
env.check_env()
return GPUEnv()
if is_hip():
return HIPEnv()
if is_npu():
return NPUEnv()
if is_musa():
return MUSAEnv()
if is_xpu():
return XPUEnv()
if is_mps():
return MPSEnv()
return CPUEnv()
if __name__ == "__main__":
_get_env().check_env()
@@ -0,0 +1,17 @@
{
"_comment": "Consistency thresholds for Intel Arc Pro B60 (XPU). The GT images are CUDA-generated, and XPU seeds its initial latent noise from a different RNG stream, so pixels cannot match: the image is semantically identical (CLIP stays high) while ssim/psnr/mean_abs_diff degrade. Per-case entries below are only tuned where an XPU run has actually been measured; the rest are inherited from h100.json and will need the same treatment as they are triaged.",
"cases": {
"qwen_image_t2i_2_gpus": {
"clip_threshold": 0.98,
"ssim_threshold": 0.79,
"psnr_threshold": 15.7,
"mean_abs_diff_threshold": 17.2
},
"fsdp-inference": {
"clip_threshold": 0.97,
"ssim_threshold": 0.6,
"psnr_threshold": 11.0,
"mean_abs_diff_threshold": 37.0
}
}
}
@@ -2,7 +2,7 @@
"metadata": {
"model": "Diffusion Server",
"hardware": "CI Intel Arc Pro B60 (24 GiB) pool: bmg-multigen-models",
"description": "All scenarios re-seeded from XPU multimodal_gen CI run 35563559050 job 106220948594 (PR #39956), with SGLANG_DIFFUSION_SYNC_STAGE_PROFILING=1 so step timings record device time rather than host enqueue. Each value is the max over the 7 attempts of that job. Denoise numbers are stable across attempts (<=2% spread); expected_load_ms is host I/O bound and ranged 21.4-48.0s across attempts, so it is guarded only by the wide e2e tolerance.",
"description": "Core scenarios were re-seeded from XPU multimodal_gen CI run 35563559050 job 106220948594 (PR #39956), with SGLANG_DIFFUSION_SYNC_STAGE_PROFILING=1 so step timings record device time rather than host enqueue. Each core value is the max over the 7 attempts of that job. Denoise numbers are stable across attempts (<=2% spread); expected_load_ms is host I/O bound and ranged 21.4-48.0s across attempts, so it is guarded only by the wide e2e tolerance. The fsdp-inference scenario comes from the dedicated 2x B60 validation in PR #35267.",
"last_updated": "2026-09-21"
},
"tolerances": {
@@ -155,6 +155,31 @@
"expected_median_denoise_ms": 1068.45,
"estimated_full_test_time_s": 103.3
},
"fsdp-inference": {
"stages_ms": {
"InputValidationStage": 0.04,
"TextEncodingStage": 822.67,
"LatentPreparationStage": 0.21,
"TimestepPreparationStage": 34933.02,
"DenoisingStage": 9091.12,
"DecodingStage": 17.8
},
"denoise_step_ms": {
"0": 285.12,
"1": 1096.41,
"2": 1091.69,
"3": 1098.41,
"4": 1124.7,
"5": 1099.74,
"6": 1100.13,
"7": 1095.65,
"8": 1094.18
},
"expected_e2e_ms": 44870.65,
"expected_avg_denoise_ms": 1009.56,
"expected_median_denoise_ms": 1096.41,
"estimated_full_test_time_s": 157.0
},
"wan2_1_t2v_1.3b": {
"estimated_full_test_time_s": 331.5,
"stages_ms": {
@@ -80,6 +80,7 @@ CONSISTENCY_THRESHOLD_FILE_BY_PLATFORM = {
"h100": "h100.json",
"b200": "b200.json",
"5090": "5090.json",
"intel_xpu_b60": "intel_xpu_b60.json",
}
CONSISTENCY_PLATFORM_ALIASES = {
"sm90": "h100",
@@ -91,6 +92,7 @@ CONSISTENCY_PLATFORM_ALIASES = {
"sm120": "5090",
"rtx5090": "5090",
"5090": "5090",
"intelxpub60": "intel_xpu_b60",
}
CLIP_MODEL_NAME = "openai/clip-vit-large-patch14"
DEFAULT_CLIP_THRESHOLD_IMAGE = 0.92
@@ -904,6 +906,8 @@ def get_consistency_platform() -> str:
return "5090"
if current_platform.is_blackwell():
return "b200"
if current_platform.is_xpu():
return "intel_xpu_b60"
return "h100"
+1 -1
View File
@@ -128,7 +128,7 @@ DISAGG_TRANSFER_BACKEND_CHOICES = [
GRAMMAR_BACKEND_CHOICES = ["xgrammar", "outlines", "llguidance", "none"]
SAMPLING_BACKEND_CHOICES = {"flashinfer", "pytorch", "ascend"}
SAMPLING_BACKEND_CHOICES = {"flashinfer", "pytorch", "ascend", "intel_xpu"}
MOE_RUNNER_BACKEND_CHOICES = [
"auto",
@@ -127,6 +127,12 @@ def handle_symm_mem_device_support(server_args: Any):
def handle_xpu_backends(server_args: Any):
cfg = resolving_view(server_args)
if cfg.device == "xpu":
if cfg.sampling_backend is None:
declare_resolution(
server_args,
"_handle_xpu_backends",
sampling_backend="intel_xpu",
)
# Decode graph is opt-in on XPU: unless the user explicitly set
# --cuda-graph-backend-decode (or --cuda-graph-config), keep it
# disabled so the default startup doesn't require graph capture.
@@ -288,6 +288,8 @@ def check_server_args(server_args: Any):
if cfg.enable_quant_communications and cfg.device != "npu":
raise ValueError("Communications quantization is only supported for NPU device")
validate_device_sampling_backend(cfg.sampling_backend, cfg.device)
# grpc_port is None for HTTP-only launches, so the == comparison is
# already False there; no explicit None check needed.
if not (cfg.smg_grpc_mode or cfg.grpc_mode) and cfg.grpc_port == cfg.port:
@@ -406,6 +408,18 @@ def check_load_publish_args(server_args: Any):
raise ValueError(reason)
def validate_device_sampling_backend(
sampling_backend: Optional[str], device: str
) -> None:
# sampler.py binds the intel_xpu kernels only under is_xpu(), so on another
# device the backend either aliases to flashinfer's names or NameErrors on
# the first non-greedy decode.
if sampling_backend == "intel_xpu" and device != "xpu":
raise ValueError(
f"--sampling-backend intel_xpu requires --device xpu, got --device {device}"
)
def validate_ib_devices(device_str: Optional[str]) -> Optional[str]:
"""
Validate IB devices before passing to mooncake.
@@ -309,8 +309,6 @@ class MiniMaxSparseAttnBackend(AttentionBackend):
# that wide. Head split mirrors MiniMaxM3 sparse attention's.
self._idx_group_size = 1
if self.index_cache_enabled:
from sglang.srt.runtime_context import get_parallel
_num_idx_heads = max(
sparse_cfg["sparse_num_index_heads"] // get_parallel().attn_tp_size, 1
)
+5 -2
View File
@@ -2051,9 +2051,12 @@ def biased_grouped_topk_gpu(
and experts_per_group <= 32
and is_power_of_two(num_experts)
):
from sgl_kernel import moe_fused_gate
# aliased: a plain `import moe_fused_gate` here makes the name local
# to the whole function, and the MUSA branch above, which reads the
# module-level mate import, raised UnboundLocalError (ruff F823)
from sgl_kernel import moe_fused_gate as _sgl_kernel_moe_fused_gate
return moe_fused_gate(
return _sgl_kernel_moe_fused_gate(
gating_output.to(torch.float32),
correction_bias.to(torch.float32),
num_expert_group,
+5 -4
View File
@@ -30,6 +30,7 @@ from sglang.srt.utils.common import (
is_hip,
is_musa,
is_npu,
is_xpu,
)
if is_cuda():
@@ -42,7 +43,7 @@ if is_cuda():
top_p_renorm_prob,
)
if is_musa():
if is_musa() or is_xpu():
from sgl_kernel import (
min_p_sampling_from_probs,
top_k_renorm_prob,
@@ -72,7 +73,7 @@ logger = logging.getLogger(__name__)
SYNC_TOKEN_IDS_ACROSS_TP = get_bool_env_var("SYNC_TOKEN_IDS_ACROSS_TP")
SGLANG_RETURN_ORIGINAL_LOGPROB = get_bool_env_var("SGLANG_RETURN_ORIGINAL_LOGPROB")
_CUSTOM_SAMPLER_FACTORIES: Dict[str, Callable[[], "Sampler"]] = {}
_BUILT_IN_SAMPLING_BACKENDS = {"flashinfer", "pytorch", "ascend"}
_BUILT_IN_SAMPLING_BACKENDS = {"flashinfer", "pytorch", "ascend", "intel_xpu"}
def _trace_e2e_sampler(stage: str, **fields) -> None:
@@ -361,9 +362,9 @@ class Sampler(nn.Module):
)
else:
backend = get_exec().kernel.sampling_backend
if backend == "flashinfer":
if backend in ("flashinfer", "intel_xpu"):
assert sampling_info.sampling_seed is None, (
"Sampling seed is not supported for flashinfer backend"
f"Sampling seed is not supported for {backend} backend"
)
if sampling_info.need_min_p_sampling:
probs = top_k_renorm_prob(probs, sampling_info.top_ks)