{"record":{"id":"dc8bf7ff889f1a36","repo":"sgl-project/sglang","slug":"unsupported-v4-paged-host-layout-backend-self-la","errorCode":null,"errorMessage":"Unsupported V4 paged host layout/backend: {self.layout}/{io_backend}","messagePattern":"Unsupported V4 paged host layout/backend: (.+?)/(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/memory_pool_host.py","lineNumber":432,"sourceCode":"                )\n        elif io_backend == \"direct\" and self.layout == \"layer_first\":\n            transfer_kv_direct(\n                src_layers=self.device_buffers,\n                dst_layers=self.data_refs,\n                src_indices=device_rows,\n                dst_indices=host_rows,\n                page_size=1,\n            )\n        elif io_backend == \"direct\" and self.layout == \"page_first_direct\":\n            transfer_kv_all_layer_direct_lf_pf(\n                src_ptrs=self.device_buffers,\n                dst_ptrs=[self.kv_buffer],\n                src_indices=device_rows,\n                dst_indices=host_rows,\n                page_size=1,\n            )\n        else:\n            raise ValueError(\n                f\"Unsupported V4 paged host layout/backend: {self.layout}/{io_backend}\"\n            )\n\n    def load_to_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        if not self._has_transfer_indices(host_indices, device_indices):\n            return\n        if (\n            host_indices.numel() % self.slot_page_size != 0\n            or device_indices.numel() % self.slot_page_size != 0","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/memory_pool_host.py#L414-L450","documentation":"backup_from_device_all_layer copies all layers of KV data from device to host and dispatches on (self.layout, io_backend). An unsupported combination falls through to a ValueError naming both values.","triggerScenarios":"Calling backup_from_device_all_layer(...) when the pool's layout and the io_backend argument (e.g. 'syscall' vs 'kdma'/'batch_copy' variants) form a pair with no implemented copy path.","commonSituations":"Selecting a KDMA or experimental DMA io_backend with a layout that only supports syscall copies; mixing a pool constructed with one layout with transfer code paths expecting another; version mismatch where a backend branch was removed or renamed.","solutions":["Check the implemented (layout, io_backend) branches in memory_pool_host.py and pass a supported io_backend (usually the default syscall path)","Use a layout that has a copy path for your chosen backend (e.g. page_first_direct)","Upgrade/downgrade SGLang so pool code and the caller's io_backend selection agree"],"exampleFix":"# before\npool.backup_from_device_all_layer(dev_rows, host_rows, io_backend=\"kdma\")\n\n# after\npool.backup_from_device_all_layer(dev_rows, host_rows, io_backend=\"syscall\")","handlingStrategy":"validation","validationCode":"SUPPORTED_PAIRS = {(\"page_first_direct\", \"syscall\"), (\"layer_first\", \"syscall\")}\nassert (pool.layout, io_backend) in SUPPORTED_PAIRS","typeGuard":"null","tryCatchPattern":"try:\n    pool.backup_from_device_all_layer(...)\nexcept ValueError as e:\n    logger.error(\"unsupported transfer pair: %s\", e)\n    raise","preventionTips":["Default to the syscall io_backend unless you verified DMA support for your layout","Keep layout and io_backend config in one place","Pin SGLang versions when using experimental backends"],"tags":["sglang","hicache","io-backend","layout","unsupported"],"backgroundTag":"unsupported-layout-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}