main
py 20 lines 656 Bytes
Raw
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 from vllm.config import VllmConfig
4 from vllm.logger import init_logger
5
6 logger = init_logger(__name__)
7
8
9 def free_before_shutdown(vllm_config: VllmConfig) -> None:
10 from vllm.model_executor.layers.rotary_embedding import _ROPE_DICT
11 from vllm.v1.worker.workspace import reset_workspace_manager
12
13 cache_config = vllm_config.cache_config
14 cache_config.num_gpu_blocks = None
15
16 compilation_config = vllm_config.compilation_config
17 compilation_config.static_forward_context.clear()
18
19 _ROPE_DICT.clear()
20 reset_workspace_manager()