From 7c39e8a198a7552bc0dba06006543f77ffe3ea30 Mon Sep 17 00:00:00 2001 From: hzh0425 <642256541@qq.com> Date: Tue, 15 Jul 2025 05:57:10 +0800 Subject: [PATCH] Fix Bug 'get_cpu_copy not Implemented' in pd offloading mode (#7982) --- python/sglang/srt/mem_cache/allocator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/sglang/srt/mem_cache/allocator.py b/python/sglang/srt/mem_cache/allocator.py index d086535f4..7dd488e9c 100644 --- a/python/sglang/srt/mem_cache/allocator.py +++ b/python/sglang/srt/mem_cache/allocator.py @@ -526,6 +526,12 @@ class PagedTokenToKVPoolAllocator(BaseTokenToKVPoolAllocator): self.is_not_in_free_group = True self.free_group = [] + def get_cpu_copy(self, indices): + return self._kvcache.get_cpu_copy(indices) + + def load_cpu_copy(self, kv_cache_cpu, indices): + return self._kvcache.load_cpu_copy(kv_cache_cpu, indices) + def alloc_extend_kernel_ascend( prefix_lens,