Skip to content

Commit c94564d

Browse files
committed
update
Signed-off-by: shen-shanshan <[email protected]>
1 parent 1f0392a commit c94564d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vllm_ascend/worker/worker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Adapted from vllm-project/vllm/vllm/worker/worker.py
1818
#
1919

20+
import gc
2021
import os
2122
from typing import Dict, List, Optional, Set, Tuple, Type, Union
2223

@@ -304,7 +305,9 @@ def determine_num_available_blocks(self) -> Tuple[int, int]:
304305
cache_block_size)
305306
num_npu_blocks = max(num_npu_blocks, 0)
306307
num_cpu_blocks = max(num_cpu_blocks, 0)
307-
308+
gc.collect()
309+
# TODO: don`t need impl this func after empty_cache in
310+
# Worker.determine_num_available_blocks() unified`
308311
NPUPlatform.empty_cache()
309312
return num_npu_blocks, num_cpu_blocks
310313

0 commit comments

Comments
 (0)