{"record":{"id":"3f5d60d90dbf932a","repo":"sgl-project/sglang","slug":"unsupported-io-backend-io-backend-3f5d60","errorCode":null,"errorMessage":"Unsupported IO backend: {io_backend}","messagePattern":"Unsupported IO backend: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/pool_host/mla.py","lineNumber":339,"sourceCode":"            if self.layout == \"page_first_kv_split\":\n                # Ascend-specific: transfer KV data for all layers when layer_id == 0\n                if device_layer_id == 0:\n                    transfer_kv_dim_exchange(\n                        device_indices=device_indices,\n                        host_indices=host_indices,\n                        device_k=device_pool.k_buffer,\n                        host_k=self.k_buffer,\n                        device_v=device_pool.v_buffer,\n                        host_v=self.v_buffer,\n                        device_index_k=device_pool.index_k_buffer,\n                        host_index_k=self.index_k_buffer,\n                        page_size=self.page_size,\n                        direction=TransferDirection.H2D,\n                    )\n            else:\n                raise ValueError(f\"Unsupported layout: {self.layout}\")\n        else:\n            raise ValueError(f\"Unsupported IO backend: {io_backend}\")\n\n    def _backup_from_device_per_layer(\n        self,\n        device_pool,\n        host_indices,\n        device_indices,\n        layer_id,\n        io_backend,\n        *,\n        is_draft: bool = False,\n    ):\n        # Indices arrive already translated by backup_from_device_all_layer.\n        # MTP draft layers do not participate in CP layer sharding.\n        host_layer_id = layer_id if is_draft else self._host_layer_index(layer_id)\n        device_layer_id = 0 if is_draft else layer_id\n\n        if io_backend == \"kernel\":\n            if self.layout == \"layer_first\":","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/pool_host/mla.py#L321-L357","documentation":"load_to_device_per_layer received an io_backend value outside the supported set {'triton'/'kernel', 'direct', 'kernel_ascend'} for the MLA host pool, so no host-to-device transfer path can be selected.","triggerScenarios":"Calling load_to_device_per_layer(..., io_backend=X) with X not one of the implemented branches (typo, None, or a backend added elsewhere but not here).","commonSituations":"HiCache io_backend server arg typo or version skew between where the arg is validated and where it is consumed; experimental backends not wired into the MLA pool.","solutions":["Set io_backend to one of 'triton', 'direct', or 'kernel_ascend'","Trace where io_backend is passed from (server args / HiCache config) and fix the propagated value","Add an early validation of io_backend at startup"],"exampleFix":"// before\nio_backend = \"cuda\"  # unsupported\n\n// after\nio_backend = \"direct\"","handlingStrategy":"validation","validationCode":"MLA_IO_BACKENDS = {\"triton\", \"direct\", \"kernel_ascend\"}\nif io_backend not in MLA_IO_BACKENDS:\n    raise ConfigError(f\"io_backend must be one of {MLA_IO_BACKENDS}, got {io_backend!r}\")","typeGuard":"from typing import Literal\nIoBackend = Literal[\"triton\", \"direct\", \"kernel_ascend\"]","tryCatchPattern":"try:\n    pool.load_to_device_per_layer(..., io_backend=io_backend)\nexcept ValueError as e:\n    if \"Unsupported IO backend\" in str(e):\n        io_backend = \"direct\"\n        pool.load_to_device_per_layer(..., io_backend=io_backend)\n    else:\n        raise","preventionTips":["Type-annotate io_backend with Literal to catch typos statically","Reject unknown backend names at server-arg parsing time"],"tags":["sglang","mla","hicache","io-backend"],"backgroundTag":"unsupported-io-backend","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}