Skip to content

Commit

Permalink
bug fix for issue 9688
Browse files Browse the repository at this point in the history
  • Loading branch information
weilong.yu committed Oct 25, 2024
1 parent 9645b9f commit 6a7b7c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions vllm/worker/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,10 @@ def profile_run(self) -> None:
with set_compile_context(batch_size_capture_list):
self.execute_model(model_input, kv_caches, intermediate_tensors)
torch.cuda.synchronize()
# Cleanup
if self.lora_config:
assert self.lora_manager is not None
self.remove_all_loras(()
return

def remove_all_loras(self):
Expand Down
3 changes: 0 additions & 3 deletions vllm/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@ def determine_num_available_blocks(self) -> Tuple[int, int]:
available_kv_cache_memory / (1024**3),
self.cache_config.gpu_memory_utilization)

# Final cleanup
if self.model_runner.lora_manager:
self.model_runner.remove_all_loras()
gc.collect()

return num_gpu_blocks, num_cpu_blocks
Expand Down

0 comments on commit 6a7b7c4

Please sign in to comment.