Skip to content

Commit

Permalink
Fix: Adjust recipe to fit within QueueComputeScal HBM global memory s…
Browse files Browse the repository at this point in the history
…ize limit (#1722)

Co-authored-by: Yaser Afshar <[email protected]>
  • Loading branch information
kalyank007 and yafshar authored Jan 31, 2025
1 parent 19f3337 commit bf23006
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions optimum/habana/transformers/models/mllama/modeling_mllama.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,10 @@ def forward(
next_decoder_cache = None if isinstance(past_key_values, Cache) else ()

for idx, decoder_layer in enumerate(self.layers):
if not self.training and (
not torch.distributed.is_initialized() or torch.distributed.get_world_size() == 1
):
htcore.mark_step()
if output_hidden_states:
all_hidden_states += (hidden_states,)

Expand Down

0 comments on commit bf23006

Please sign in to comment.