Skip to content

Commit

Permalink
Workaround for OOM during loading llama-405 (#396)
Browse files Browse the repository at this point in the history
Repeating missing code
  • Loading branch information
afierka-intel authored Oct 18, 2024
1 parent 9276ccc commit 07c98a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vllm/model_executor/models/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py
# Copyright 2023 The vLLM team.
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
# Copyright 2024 Habana Labs, Ltd. an Intel Company
#
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
# and OPT implementations in this library. It has been modified from its
Expand Down Expand Up @@ -420,6 +421,8 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
weight_loader = getattr(param, "weight_loader",
default_weight_loader)
weight_loader(param, loaded_weight)
if is_hpu:
torch.hpu.synchronize()

# If this function is called, it should always initialize KV cache scale
# factors (or else raise an exception). Thus, handled exceptions should
Expand Down

0 comments on commit 07c98a5

Please sign in to comment.