{"record":{"id":"3d70911a360a6d3d","repo":"sgl-project/sglang","slug":"hpc-ops-backend-does-not-support-speculative-decod","errorCode":null,"errorMessage":"hpc_ops backend does not support speculative decoding for now.","messagePattern":"hpc_ops backend does not support speculative decoding for now\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/attention/attention_registry.py","lineNumber":269,"sourceCode":"@register_attention_backend(\"trtllm_mha\")\ndef create_trtllm_mha_backend(runner):\n    if runner.use_mla_backend:\n        raise ValueError(\"trtllm_mha backend can only be used with non-MLA models.\")\n    from sglang.srt.layers.attention.trtllm_mha_backend import TRTLLMHAAttnBackend\n\n    return TRTLLMHAAttnBackend(runner)\n\n\n@register_attention_backend(\"hpc_ops\")\ndef create_hpc_ops_backend(runner):\n    if runner.use_mla_backend:\n        raise ValueError(\"hpc_ops backend can only be used with non-MLA models.\")\n    if runner.model_config.is_encoder_decoder:\n        raise ValueError(\n            \"Cross attention is not supported in the hpc_ops attention backend.\"\n        )\n    if get_spec().speculative_algorithm is not None:\n        raise ValueError(\n            \"hpc_ops backend does not support speculative decoding for now.\"\n        )\n    from sglang.srt.layers.attention.hpc_ops_backend import HPCOpsAttnBackend\n\n    return HPCOpsAttnBackend(runner)\n\n\n@register_attention_backend(\"intel_amx\")\ndef create_intel_amx_backend(runner):\n    from sglang.srt.layers.attention.intel_amx_backend import IntelAMXAttnBackend\n\n    return IntelAMXAttnBackend(runner)\n\n\n@register_attention_backend(\"dual_chunk_flash_attn\")\ndef create_dual_chunk_flash_attn_backend(runner):\n    from sglang.srt.layers.attention.dual_chunk_flashattention_backend import (\n        DualChunkFlashAttentionBackend,","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/attention/attention_registry.py#L251-L287","documentation":"The hpc_ops attention backend has no speculative-decoding support in its kernels, so the factory rejects it whenever server_args resolves a non-None speculative_algorithm. This is a hard capability gap, not a tuning issue.","triggerScenarios":"Launching with --attention-backend hpc_ops (or auto-resolving to it) while --speculative-algorithm is set to anything other than NONE.","commonSituations":"Turning on EAGLE/MTP spec decoding on NPU where hpc_ops was previously selected for throughput; combining draft-model flags with a hardware-specific backend override.","solutions":["Disable speculative decoding (--speculative-algorithm NONE)","Switch to an attention backend that supports speculative decoding on your hardware"],"exampleFix":"# before\n--attention-backend hpc_ops --speculative-algorithm EAGLE\n# after\n--attention-backend hpc_ops","handlingStrategy":"validation","validationCode":"if server_args.speculative_algorithm is not None and server_args.attention_backend == \"hpc_ops\":\n    raise SystemExit(\"hpc_ops does not support speculative decoding\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate speculative-decoding flags behind a backend capability check in your launcher","Test flag combinations in CI before rolling them to production NPU fleets"],"tags":["attention-backend","hpc-ops","speculative-decoding","npu","sglang"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}