{"record":{"id":"71920c922a906e7b","repo":"sgl-project/sglang","slug":"minicpm-sala-does-not-support-hierarchical-cache","errorCode":null,"errorMessage":"MiniCPM SALA does not support hierarchical cache","messagePattern":"MiniCPM SALA does not support hierarchical cache","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/overrides.py","lineNumber":1295,"sourceCode":"        \"MossVLForConditionalGeneration requires flashinfer prefill \"\n        \"attention backend for cross-attention custom mask support.\"\n    )\n    return overrides\n\n\n@_register_for(\"MiniCPMForCausalLM\", \"MiniCPMSALAForCausalLM\")\ndef _minicpm_sala_overrides(server_args: Any, hf_config: Any) -> dict:\n    cfg = resolving_view(server_args)\n    if cfg.enable_dp_attention:\n        raise ValueError(\"MiniCPM does not support DP attention\")\n    has_sparse_attention = getattr(hf_config, \"has_minicpm_sparse_attention\", False)\n    has_hybrid_attention = has_sparse_attention or getattr(\n        hf_config, \"has_lightning_layers\", False\n    )\n    overrides: Dict[str, Any] = {}\n    if has_hybrid_attention:\n        if cfg.enable_hierarchical_cache:\n            raise ValueError(\"MiniCPM SALA does not support hierarchical cache\")\n        overrides[\"disable_radix_cache\"] = True\n    if envs.SGLANG_MINICPM_FORCE_DENSE.get():\n        dense_backends = {\n            \"minicpm_flashattn\": (\"fa4\" if is_blackwell_supported() else \"fa3\"),\n            \"minicpm_flashinfer\": \"flashinfer\",\n        }\n        # Literal keys keep the written-field set statically derivable; a loop\n        # variable hides it from the census in test_chain_read_ratchet.py.\n        dense_attention = dense_backends.get(cfg.attention_backend)\n        if dense_attention is not None:\n            overrides[\"attention_backend\"] = dense_attention\n        dense_prefill = dense_backends.get(cfg.prefill_attention_backend)\n        if dense_prefill is not None:\n            overrides[\"prefill_attention_backend\"] = dense_prefill\n        dense_decode = dense_backends.get(cfg.decode_attention_backend)\n        if dense_decode is not None:\n            overrides[\"decode_attention_backend\"] = dense_decode\n    elif has_sparse_attention:","sourceCodeStart":1277,"sourceCodeEnd":1313,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/overrides.py#L1277-L1313","documentation":"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.","triggerScenarios":"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.","commonSituations":"Enabling hierarchical cache for prefix-heavy workloads on a MiniCPM SALA checkpoint; reusing a cache-tuned config across models.","solutions":["Remove --enable-hierarchical-cache","Keep radix cache off (the hook disables it anyway via disable_radix_cache)","Use a different model if hierarchical caching is required"],"exampleFix":"# before\n--enable-hierarchical-cache\n# after\n# (flag removed)","handlingStrategy":"validation","validationCode":"if model_arch.startswith('MiniCPM') and hybrid_attention:\n    server_args.enable_hierarchical_cache = False","typeGuard":null,"tryCatchPattern":"except ValueError as e:\n    if 'hierarchical cache' in str(e): server_args.enable_hierarchical_cache = False; retry()\n    raise","preventionTips":["Gate cache features per model family in serving configs","Check hf_config flags (sparse/lightning layers) before enabling HiCache"],"tags":["minicpm","hierarchical-cache","hicache","sglang"],"backgroundTag":"unsupported-feature-for-model","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}