Skip to content

Commit

Permalink
Free CPU pinned memory on environment cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
janimo committed Nov 20, 2024
1 parent 343041c commit 9d6dd78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vllm/distributed/parallel_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,12 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
gc.collect()
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"
) #noqa: E501


def in_the_same_node_as(pg: ProcessGroup, source_rank: int = 0) -> List[bool]:
Expand Down

0 comments on commit 9d6dd78

Please sign in to comment.