Skip to content

Commit

Permalink
[Core] Free CPU pinned memory on environment cleanup (#10477)
Browse files Browse the repository at this point in the history
  • Loading branch information
janimo authored Jan 21, 2025
1 parent fa9ee08 commit 9c485d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vllm/distributed/parallel_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,11 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
from vllm.platforms import current_platform
if not current_platform.is_cpu():
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],
Expand Down

0 comments on commit 9c485d9

Please sign in to comment.