{"record":{"id":"2f42a01d0ead73b1","repo":"sgl-project/sglang","slug":"host-pool-retraction-does-not-support-mamba-models","errorCode":null,"errorMessage":"Host-pool retraction does not support Mamba models.","messagePattern":"Host-pool retraction does not support Mamba models\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/registry.py","lineNumber":154,"sourceCode":"\n        # Honor a CLI --flexkv-config-file by forwarding it via the env\n        # var that FlexKV's config loader actually reads.\n        if get_memory().flexkv_config_file and not os.environ.get(\"FLEXKV_CONFIG_PATH\"):\n            os.environ[\"FLEXKV_CONFIG_PATH\"] = get_memory().flexkv_config_file\n        return _flexkv_factory(ctx)\n\n    return _create_unified_radix_cache(ctx, server_args, params)\n\n\ndef _create_unified_radix_cache(\n    ctx: TreeCacheBuildContext,\n    server_args: ServerArgs,\n    params: CacheInitParams,\n) -> BasePrefixCache:\n    \"\"\"Initialize a UnifiedRadixCache with proper components and optional HiCache.\"\"\"\n    if get_disagg().disaggregation_decode_retraction_backup == \"host_pool\":\n        if ctx.is_hybrid_ssm:\n            raise ValueError(\"Host-pool retraction does not support Mamba models.\")\n        if ctx.is_hybrid_swa and ctx.full_tokens_per_layer == 0:\n            raise ValueError(\"Host-pool retraction does not support pure-SWA models.\")\n\n    from sglang.srt.mem_cache.unified_cache.components import ComponentType\n    from sglang.srt.mem_cache.unified_radix_cache import UnifiedRadixCache\n\n    tree_components = [ComponentType.FULL]\n    if ctx.is_hybrid_swa:\n        tree_components.append(ComponentType.SWA)\n    if ctx.is_hybrid_ssm:\n        tree_components.append(ComponentType.MAMBA)\n\n    if hasattr(params.req_to_token_pool, \"req_to_c128_sidecar\"):\n        from sglang.srt.hardware_backend.npu.dsv4.c128_sidecar_component import (\n            C128SidecarComponent,\n        )\n\n        tree_components.append(ComponentType.C128)","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/registry.py#L136-L172","documentation":"When disagg decode retraction backup is set to 'host_pool', the unified radix cache factory rejects hybrid SSM (Mamba/Mamba2-style) models: their linear-attention state cannot be backed up to the host pool the way KV pages can. It raises ValueError at cache construction time.","triggerScenarios":"Setting disaggregation_decode_retraction_backup='host_pool' (env/disagg config) and loading a hybrid SSM model (e.g. Qwen3-Next, Falcon-H1, a Mamba hybrid) so ctx.is_hybrid_ssm is True.","commonSituations":"PD-disaggregation deployments tuning retraction behavior with host-pool backup enabled globally, then scheduling a Mamba hybrid model on the same cluster/config.","solutions":["Use a different retraction backup mode (e.g. default) for hybrid SSM models","Per-model config: disable host_pool backup for Mamba hybrids and keep it only for attention models","Upgrade if a later version adds SSM state backup support"],"exampleFix":"# before\nSGLANG_DISAGG_DECODE_RETRACTION_BACKUP=host_pool  # with Qwen3-Next / Mamba hybrid\n# after\n# unset or set to default for hybrid SSM models","handlingStrategy":"validation","validationCode":"if get_disagg().disaggregation_decode_retraction_backup == \"host_pool\" and model_is_hybrid_ssm:\n    # fall back to default retraction\n    set_retraction_backup(\"default\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Per-model gating of disagg retraction settings","Check is_hybrid_ssm before enabling host_pool backup"],"tags":["disaggregation","retraction","mamba","hybrid-ssm","unified-cache","value-error"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}