mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-05 04:22:18 +08:00
[Core] Free CPU pinned memory on environment cleanup (#10477)
This commit is contained in:
parent
fa9ee08121
commit
9c485d9e25
@ -1183,6 +1183,11 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
|
|||||||
from vllm.platforms import current_platform
|
from vllm.platforms import current_platform
|
||||||
if not current_platform.is_cpu():
|
if not current_platform.is_cpu():
|
||||||
torch.cuda.empty_cache()
|
torch.cuda.empty_cache()
|
||||||
|
try:
|
||||||
|
torch._C._host_emptyCache()
|
||||||
|
except AttributeError:
|
||||||
|
logger.warning(
|
||||||
|
"torch._C._host_emptyCache() only available in Pytorch >=2.5")
|
||||||
|
|
||||||
|
|
||||||
def in_the_same_node_as(pg: Union[ProcessGroup, StatelessProcessGroup],
|
def in_the_same_node_as(pg: Union[ProcessGroup, StatelessProcessGroup],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user