{"record":{"id":"0a4a184d34e9a38f","repo":"sgl-project/sglang","slug":"ascend-pd-transfer-does-not-support-hisparse-desti","errorCode":null,"errorMessage":"Ascend PD transfer does not support HiSparse destination device KV indices","messagePattern":"Ascend PD transfer does not support HiSparse destination device KV indices","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/disaggregation/ascend/conn.py","lineNumber":136,"sourceCode":"                    dst_kv_ptrs[layer_offset + start_layer : layer_offset + end_layer]\n                )\n        layers_current_pp_stage = len(src_kv_ptrs)\n        return src_kv_ptrs, sliced_dst_kv_ptrs, layers_current_pp_stage\n\n    def send_kvcache(\n        self,\n        mooncake_session_id: str,\n        prefill_kv_indices: npt.NDArray[np.int32],\n        dst_kv_ptrs: list[int],\n        dst_kv_indices: npt.NDArray[np.int32],\n        executor: concurrent.futures.ThreadPoolExecutor,\n        dst_layer_ids: Optional[List[int]] = None,\n        dst_device_kv_indices: Optional[npt.NDArray[np.int32]] = None,\n        dst_kv_item_len: Optional[int] = None,\n        dst_attn_tp_size: Optional[int] = None,\n    ):\n        if dst_device_kv_indices is not None:\n            raise NotImplementedError(\n                \"Ascend PD transfer does not support HiSparse \"\n                \"destination device KV indices\"\n            )\n        self._validate_envelope_kv_layout(\n            dst_kv_ptrs, dst_kv_item_len, dst_attn_tp_size\n        )\n        # Group by indices\n        prefill_kv_blocks, dst_kv_blocks = group_concurrent_contiguous(\n            prefill_kv_indices, dst_kv_indices\n        )\n\n        if self.pp_size > 1:\n            if self.is_mla_backend:\n                src_kv_ptrs, sliced_dst_kv_ptrs, layers_current_pp_stage = (\n                    self.get_mla_kv_ptrs_with_pp(self.kv_args.kv_data_ptrs, dst_kv_ptrs)\n                )\n                layers_params = [\n                    (","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/disaggregation/ascend/conn.py#L118-L154","documentation":"The Ascend (NPU) prefill-decode transfer connection's send_kvcache does not implement transferring into pre-assigned destination device KV indices, which is the HiSparse/HiCache path where the decode side dictates exact slot positions. Passing dst_device_kv_indices raises NotImplementedError.","triggerScenarios":"Calling send_kvcache(..., dst_device_kv_indices=<non-None ndarray>) on the Ascend PD connection — i.e. running prefill-decode disaggregation with a hierarchical-cache (HiSparse) destination layout on Ascend hardware.","commonSituations":"Enabling --enable-hierarchical-cache / HiCache with PD disaggregation on Ascend NPU; configurations ported from NVIDIA where the Mooncake/NIXL path supports device indices but the Ascend backend does not yet.","solutions":["Disable the hierarchical cache (HiSparse) on the decode side for Ascend PD runs so dst_device_kv_indices is not required","Wait for or implement Ascend support for destination device KV indices in disaggregation/ascend/conn.py","Fall back to a non-HiCache KV layout that the Ascend transfer engine supports"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if conn.__class__.__name__ == 'AscendKVReceiver' or getattr(conn, 'is_ascend', False):\\n    assert dst_device_kv_indices is None, 'Ascend PD transfer cannot target device KV indices'","typeGuard":"def supports_hisparse_dst(conn) -> bool:\\n    return not getattr(conn, '_ascend_backend', False)","tryCatchPattern":"try:\\n    conn.send_kvcache(..., dst_device_kv_indices=idx)\\nexcept NotImplementedError:\\n    # fall back to non-HiSparse destination layout on Ascend","preventionTips":["Do not enable hierarchical cache with PD disaggregation on Ascend today","Feature-detect backend capability before passing dst_device_kv_indices"],"tags":["ascend","npu","disaggregation","hicache","not-implemented"],"backgroundTag":"unsupported-feature-platform","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}