[Worker][V1] Support sleep mode for v1 (#1084)

### What this PR does / why we need it?
 Support sleep mode for v1

Signed-off-by: wangli <wangli858794774@gmail.com>
This commit is contained in:
Li Wang
2025-06-06 21:54:02 +08:00
committed by GitHub
parent 0395ab30be
commit a2552e10e4
5 changed files with 65 additions and 60 deletions

View File

@@ -15,6 +15,7 @@
# This file is a part of the vllm-ascend project.
#
import gc
import logging
import os
from typing import TYPE_CHECKING, Optional, Tuple
@@ -118,6 +119,12 @@ class NPUPlatform(Platform):
def mem_get_info(cls) -> Tuple[int, int]:
return torch.npu.mem_get_info()
@classmethod
def clear_npu_memory(cls):
gc.collect()
torch.npu.empty_cache()
torch.npu.reset_peak_memory_stats()
@classmethod
def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
# initialize ascend config from vllm additional_config