Skip to content

Commit 295346f

Browse files
committed
fix dummy prefill batch for eager
Signed-off-by: Wuxun Zhang <[email protected]>
1 parent 53a4529 commit 295346f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

vllm_gaudi/v1/worker/hpu_model_runner.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ class BatchContents:
133133
def get_num_tokens(self):
134134
return [len(t) for t in self.token_ids]
135135

136+
def clone(self):
137+
return BatchContents(
138+
req_ids=self.req_ids.copy(),
139+
token_ids=[t.copy() for t in self.token_ids],
140+
context_lens=self.context_lens.copy(),
141+
blocks=[b.copy() for b in self.blocks],
142+
logits_positions=[lp.copy() for lp in self.logits_positions])
143+
136144

137145
# TODO(kzawora): remove this
138146
@dataclass
@@ -1600,7 +1608,7 @@ def _create_dummy_prefill_batch_contents(
16001608
)
16011609

16021610
outputs = [
1603-
self._form_prefill_batch(new_batch_contents)
1611+
self._form_prefill_batch(new_batch_contents.clone())
16041612
for _ in range(num_prefills)
16051613
]
16061614
return outputs

0 commit comments

Comments
 (0)