sgl-project/sglang · error · ValueError

hpc_ops backend can only be used with non-MLA models.

Error message

hpc_ops backend can only be used with non-MLA models.

What it means

The hpc_ops attention backend only supports non-MLA architectures. When runner.use_mla_backend is true the factory raises immediately, since the HPC-ops kernels have no MLA-absorbed decode path.

Source

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

def create_cutlass_mla_backend(runner):
    from sglang.srt.layers.attention.cutlass_mla_backend import CutlassMLABackend

    return CutlassMLABackend(runner)


@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)

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove the hpc_ops backend override for MLA models
  2. Pick an MLA-capable backend supported on your hardware for the MLA checkpoint

Example fix

# before
--model DeepSeek-V3 --attention-backend hpc_ops
# after
--model DeepSeek-V3  # use an MLA-capable backend
Defensive patterns

Strategy: validation

Validate before calling

if model_runner.use_mla_backend and server_args.attention_backend == "hpc_ops":
    raise SystemExit("hpc_ops only supports non-MLA models")

Type guard

def is_mla_model(runner) -> bool:
    return bool(getattr(runner, "use_mla_backend", False))

Prevention

When it happens

Trigger: Selecting the 'hpc_ops' backend (typically on Ascend NPU) for an MLA model such as DeepSeek.

Common situations: NPU deployments that force hpc_ops for performance, then loading an MLA checkpoint; or defaulting to hpc_ops when the model actually needs an MLA backend.

Related errors


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