sgl-project/sglang · error · ValueError

hpc_ops backend does not support speculative decoding for no

Error message

hpc_ops backend does not support speculative decoding for now.

What it means

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.

Source

Thrown at python/sglang/srt/layers/attention/attention_registry.py:269

@register_attention_backend("trtllm_mha")
def create_trtllm_mha_backend(runner):
    if runner.use_mla_backend:
        raise ValueError("trtllm_mha backend can only be used with non-MLA models.")
    from sglang.srt.layers.attention.trtllm_mha_backend import TRTLLMHAAttnBackend

    return TRTLLMHAAttnBackend(runner)


@register_attention_backend("hpc_ops")
def create_hpc_ops_backend(runner):
    if runner.use_mla_backend:
        raise ValueError("hpc_ops backend can only be used with non-MLA models.")
    if runner.model_config.is_encoder_decoder:
        raise ValueError(
            "Cross attention is not supported in the hpc_ops attention backend."
        )
    if get_spec().speculative_algorithm is not None:
        raise ValueError(
            "hpc_ops backend does not support speculative decoding for now."
        )
    from sglang.srt.layers.attention.hpc_ops_backend import HPCOpsAttnBackend

    return HPCOpsAttnBackend(runner)


@register_attention_backend("intel_amx")
def create_intel_amx_backend(runner):
    from sglang.srt.layers.attention.intel_amx_backend import IntelAMXAttnBackend

    return IntelAMXAttnBackend(runner)


@register_attention_backend("dual_chunk_flash_attn")
def create_dual_chunk_flash_attn_backend(runner):
    from sglang.srt.layers.attention.dual_chunk_flashattention_backend import (
        DualChunkFlashAttentionBackend,

View on GitHub (pinned to 0132848349)

Solutions

  1. Disable speculative decoding (--speculative-algorithm NONE)
  2. Switch to an attention backend that supports speculative decoding on your hardware

Example fix

# before
--attention-backend hpc_ops --speculative-algorithm EAGLE
# after
--attention-backend hpc_ops
Defensive patterns

Strategy: validation

Validate before calling

if server_args.speculative_algorithm is not None and server_args.attention_backend == "hpc_ops":
    raise SystemExit("hpc_ops does not support speculative decoding")

Prevention

When it happens

Trigger: Launching with --attention-backend hpc_ops (or auto-resolving to it) while --speculative-algorithm is set to anything other than NONE.

Common situations: 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.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/3d70911a360a6d3d. Report an issue: GitHub.