sgl-project/sglang · error · ValueError

MiniCPM SALA does not support hierarchical cache

Error message

MiniCPM SALA does not support hierarchical cache

What it means

MiniCPM SALA sparse/hybrid attention variants require radix cache to be disabled and do not support SGLang's hierarchical (HiCache) KV storage. When the HF config indicates sparse or lightning (hybrid) attention, enabling hierarchical cache is rejected.

Source

Thrown at python/sglang/srt/arg_groups/overrides.py:1295

        "MossVLForConditionalGeneration requires flashinfer prefill "
        "attention backend for cross-attention custom mask support."
    )
    return overrides


@_register_for("MiniCPMForCausalLM", "MiniCPMSALAForCausalLM")
def _minicpm_sala_overrides(server_args: Any, hf_config: Any) -> dict:
    cfg = resolving_view(server_args)
    if cfg.enable_dp_attention:
        raise ValueError("MiniCPM does not support DP attention")
    has_sparse_attention = getattr(hf_config, "has_minicpm_sparse_attention", False)
    has_hybrid_attention = has_sparse_attention or getattr(
        hf_config, "has_lightning_layers", False
    )
    overrides: Dict[str, Any] = {}
    if has_hybrid_attention:
        if cfg.enable_hierarchical_cache:
            raise ValueError("MiniCPM SALA does not support hierarchical cache")
        overrides["disable_radix_cache"] = True
    if envs.SGLANG_MINICPM_FORCE_DENSE.get():
        dense_backends = {
            "minicpm_flashattn": ("fa4" if is_blackwell_supported() else "fa3"),
            "minicpm_flashinfer": "flashinfer",
        }
        # Literal keys keep the written-field set statically derivable; a loop
        # variable hides it from the census in test_chain_read_ratchet.py.
        dense_attention = dense_backends.get(cfg.attention_backend)
        if dense_attention is not None:
            overrides["attention_backend"] = dense_attention
        dense_prefill = dense_backends.get(cfg.prefill_attention_backend)
        if dense_prefill is not None:
            overrides["prefill_attention_backend"] = dense_prefill
        dense_decode = dense_backends.get(cfg.decode_attention_backend)
        if dense_decode is not None:
            overrides["decode_attention_backend"] = dense_decode
    elif has_sparse_attention:

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove --enable-hierarchical-cache
  2. Keep radix cache off (the hook disables it anyway via disable_radix_cache)
  3. Use a different model if hierarchical caching is required

Example fix

# before
--enable-hierarchical-cache
# after
# (flag removed)
Defensive patterns

Strategy: validation

Validate before calling

if model_arch.startswith('MiniCPM') and hybrid_attention:
    server_args.enable_hierarchical_cache = False

Try / catch

except ValueError as e:
    if 'hierarchical cache' in str(e): server_args.enable_hierarchical_cache = False; retry()
    raise

Prevention

When it happens

Trigger: MiniCPM with has_minicpm_sparse_attention or has_lightning_layers in hf_config, plus --enable-hierarchical-cache; raised in _minicpm_sala_overrides before the server starts.

Common situations: Enabling hierarchical cache for prefix-heavy workloads on a MiniCPM SALA checkpoint; reusing a cache-tuned config across models.

Related errors


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