Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions vllm/entrypoints/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,9 @@ def _run_engine(self, use_tqdm: bool) -> List[RequestOutput]:
# its previous requests.
outputs = sorted(outputs, key=lambda x: int(x.request_id))
return outputs

def __del__(self):
del self.llm_engine.driver_worker.model_runner
del self.llm_engine.driver_worker
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will also have to handle the case where there are multiple gpus.

In this case llm_engine will also have a workers list

import gc
gc.collect()