From 73b3de79eae5dec7459d54888083e5068890799b Mon Sep 17 00:00:00 2001 From: Xinyu Yang Date: Fri, 18 Aug 2023 03:56:04 +0800 Subject: [PATCH] explicitly del state (#784) --- vllm/model_executor/weight_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vllm/model_executor/weight_utils.py b/vllm/model_executor/weight_utils.py index a9d899ad..3127a360 100644 --- a/vllm/model_executor/weight_utils.py +++ b/vllm/model_executor/weight_utils.py @@ -76,6 +76,8 @@ def hf_model_weights_iterator( state = torch.load(bin_file, map_location="cpu") for name, param in state.items(): yield name, param + del state + torch.cuda.empty_cache() def load_tensor_parallel_weights(