Skip to content

Commit 505f860

Browse files
author
wangzaijun
committed
fix lock range
1 parent 7b7f85e commit 505f860

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightllm/server/multi_level_kv_cache/manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,18 @@ def _handle_group_req_cpu_cache_match(self, group_req_indexes: GroupReqIndexes,
7676
if req.is_aborted:
7777
continue
7878

79-
self.cpu_cache_client.lock.acquire_sleep1ms()
8079
req: Req = req
8180
finded_page_indexes = []
8281
for token_chuncked_hash_value in req.token_hash_list.get_all():
82+
self.cpu_cache_client.lock.acquire_sleep1ms()
8383
page_index, ready = self.cpu_cache_client.query_one_page(token_chuncked_hash_value)
84+
self.cpu_cache_client.lock.release()
85+
8486
if page_index is not None:
8587
assert ready
8688
finded_page_indexes.append(page_index)
8789
else:
8890
break
89-
self.cpu_cache_client.lock.release()
9091

9192
# 等待所有的 cpu cache 页面ready
9293
while not self.cpu_cache_client.check_allpages_ready(finded_page_indexes):

0 commit comments

Comments
 (0)