Skip to content

Commit

Permalink
Make empty intermediate tensors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaksymczuk committed Sep 23, 2024
1 parent 1c1063c commit 50faef5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vllm/worker/habana_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,13 +1340,6 @@ def warmup_scenario(self,
profiler.start()
for _ in range(times):
inputs = self.prepare_model_input(seqs)
intermediate_tensors = None
if not get_pp_group().is_first_rank:
print("\n\n\n SELF MODEL = ", self.model)
# intermediate_tensors = self.model.make_empty_intermediate_tensors(
# batch_size=batch_size,
# dtype=self.model_config.dtype,
# device=self.device)
self.execute_model(inputs, kv_caches, warmup_mode=True)
torch.hpu.synchronize()
if profiler:
Expand Down Expand Up @@ -1819,6 +1812,13 @@ def execute_model(
seq_len = self._seq_len(attn_metadata)
use_graphs = self._use_graphs(batch_size, seq_len, is_prompt)
self._check_config(batch_size, seq_len, is_prompt, warmup_mode)

if not get_pp_group().is_first_rank:
intermediate_tensors = self.model.make_empty_intermediate_tensors(
batch_size=batch_size,
dtype=self.model_config.dtype,
device=self.device)

execute_model_kwargs = {
"input_ids": input_tokens,
"positions": input_positions,
Expand Down

0 comments on commit 50faef5

Please sign in to comment.