{"record":{"id":"32c2ad259859fe22","repo":"sgl-project/sglang","slug":"mlx-auxiliary-state-radix-cache-does-not-support-e","errorCode":null,"errorMessage":"MLX auxiliary-state radix cache does not support enable_mamba_extra_buffer yet.","messagePattern":"MLX auxiliary-state radix cache does not support enable_mamba_extra_buffer yet\\.","errorType":"error_code","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/hardware_backend/mlx/kv_cache/auxiliary_state.py","lineNumber":334,"sourceCode":"            # auxiliary slot, so return it with the request row. Keyed on\n            # req.mamba_pool_idx (None-safe, nulled by free_mamba_cache), NOT\n            # on req_index_to_auxiliary_state_index_mapping, which may point\n            # at a slot the radix tree owns.\n            self.free_mamba_cache(req)\n        super().free(req)\n\n    def clear(self):\n        super().clear()\n        self.auxiliary_state_pool.clear()\n        self.req_index_to_auxiliary_state_index_mapping.zero_()\n\n\nclass MlxAuxiliaryStateComponent(MambaComponent):\n    \"\"\"Unified radix component for MLX native auxiliary-state snapshots.\"\"\"\n\n    def __init__(self, cache, params):\n        if params.enable_mamba_extra_buffer:\n            raise NotImplementedError(\n                \"MLX auxiliary-state radix cache does not support \"\n                \"enable_mamba_extra_buffer yet.\"\n            )\n        pool = getattr(cache.req_to_token_pool, \"auxiliary_state_pool\", None)\n        if not isinstance(pool, MlxAuxiliaryStatePool):\n            raise TypeError(\n                \"MlxAuxiliaryStateComponent requires MlxAuxiliaryStatePool, \"\n                f\"got {type(pool)}\"\n            )\n        TreeComponent.__init__(self, cache, params)\n        self.enable_mamba_extra_buffer = False\n        self._mamba_pool_host = None\n\n    @staticmethod\n    def _tracked_value(req) -> tuple[object | None, bool]:\n        track_buffer = getattr(req, \"mamba_ping_pong_track_buffer\", None)\n        track_len = getattr(req, \"mamba_last_track_seqlen\", None)\n        if track_buffer is not None and track_len is not None:","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/hardware_backend/mlx/kv_cache/auxiliary_state.py#L316-L352","documentation":"`MlxAuxiliaryStateComponent` is the MLX-native radix-cache component for Mamba-style auxiliary state snapshots. The optional `enable_mamba_extra_buffer` feature (extra buffering of mamba states for scheduling) has not been implemented for the MLX path, so __init__ raises NotImplementedError rather than silently misbehaving.","triggerScenarios":"Constructing the MLX auxiliary-state radix component with server args / params where `enable_mamba_extra_buffer=True` — e.g. enabling the flag in server_args for a hybrid attention+Mamba model running on the MLX backend.","commonSituations":"Copying CPU/GPU-server flags (`--enable-mamba-extra-buffer`) to an Apple-Silicon MLX deployment; a config shared across backends that turns the flag on globally.","solutions":["Disable `enable_mamba_extra_buffer` for MLX runs.","Keep backend-specific server args separated per deployment instead of one shared config.","Track the SGLang MLX backend roadmap and re-enable once implemented."],"exampleFix":"# before\nserver_args = ServerArgs(..., enable_mamba_extra_buffer=True)  # MLX backend\n\n# after\nserver_args = ServerArgs(..., enable_mamba_extra_buffer=False)","handlingStrategy":"validation","validationCode":"if server_args.enable_mamba_extra_buffer and backend == \"mlx\":\n    server_args.enable_mamba_extra_buffer = False  # not supported on MLX","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep per-backend server-arg profiles instead of one shared config.","Check the MLX backend feature matrix before porting CUDA-path flags."],"tags":["mlx","mamba","unsupported-feature","server-args"],"backgroundTag":"unsupported-feature-flag","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}