{"record":{"id":"08903b8ee16b1647","repo":"sgl-project/sglang","slug":"scheme-class-name-is-not-supported-on-xp","errorCode":null,"errorMessage":"{scheme.__class__.__name__} is not supported on XPU (no XPU kernel implementation).","messagePattern":"(.+?) is not supported on XPU \\(no XPU kernel implementation\\)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/compressed_tensors/compressed_tensors.py","lineNumber":982,"sourceCode":"                \"not supported by Compressed Tensors. \"\n                \"Falling back to UnquantizedLinearMethod\"\n            )\n            return None\n\n        else:\n            # Find the quant_scheme\n            scheme = self._get_scheme_from_parts(  # type: ignore\n                weight_quant=weight_quant,\n                input_quant=input_quant,\n                format=scheme_format,\n            )\n\n        # Raise error if device does not support the scheme\n        # (e.g. fp8 needs ada lovelace)\n        # Note: NPU devices do not support min_capability function\n        if _is_xpu:\n            if not isinstance(scheme, CompressedTensorsW8A8Fp8):\n                raise RuntimeError(\n                    f\"{scheme.__class__.__name__} is not supported on XPU \"\n                    \"(no XPU kernel implementation).\"\n                )\n        elif not _is_npu:\n            self._check_scheme_supported(scheme.get_min_capability())\n        logger.debug(\"Using scheme: %s for %s\", scheme.__class__.__name__, layer_name)\n        return scheme\n\n    def get_lm_head_scheme(\n        self, layer: torch.nn.Module, layer_name: Optional[str] = None\n    ) -> Optional[CompressedTensorsLinearScheme]:\n        \"\"\"Resolve the scheme for a ParallelLMHead, or None if the checkpoint\n        stores the head unquantized.\n\n        The head is treated as quantized only when a config target names it by\n        layer name (exact or ``re:`` regex, e.g. ``re:.*lm_head``). Module-type\n        targets like ``Linear`` are not consulted: llm-compressor emits those\n        for decoder linears, and checkpoints following the common convention","sourceCodeStart":964,"sourceCodeEnd":1000,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/compressed_tensors/compressed_tensors.py#L964-L1000","documentation":"On XPU (Intel GPU) devices, only CompressedTensorsW8A8Fp8 has kernel implementations; any other resolved linear scheme (INT8, W4A16, W8A16, etc.) raises RuntimeError naming the scheme class.","triggerScenarios":"Running sglang with an XPU device (torch.xpu available) and a compressed-tensors checkpoint whose linear scheme resolves to anything other than CompressedTensorsW8A8Fp8, e.g. W8A8-Int8 or W4A16 quantized model.","commonSituations":"Serving compressed-tensor-quantized checkpoints on Intel Arc/Flex/PVC GPUs where only the FP8 kernel path is implemented; using NVIDIA-oriented quantized models on XPU.","solutions":["Use an FP8 W8A8 quantized checkpoint on XPU","Use an unquantized model (non-quantized layers fall back to UnquantizedLinearMethod)","Run on CUDA/NPU hardware where the scheme is supported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import torch\n_is_xpu = hasattr(torch, \"xpu\") and torch.xpu.is_available()\ncfg = model_cfg[\"quantization_config\"][\"config\"]\nis_fp8 = cfg.get(\"weights\", {}).get(\"type\") == \"float-8\" or \"fp8\" in str(cfg).lower()\nif _is_xpu and not is_fp8:\n    raise SystemExit(\"XPU supports only W8A8-FP8 compressed-tensors schemes\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use FP8 W8A8 checkpoints on Intel GPUs","Gate CI on device type when validating quantized checkpoints","Run unquantized models on XPU if FP8 quantization is unavailable"],"tags":["xpu","intel-gpu","quantization","hardware-support","fp8"],"backgroundTag":"hardware-unsupported-quantization-scheme","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}