Skip to content

Commit 7ae55fd

Browse files
committed
fix dummy prefill batch for eager
Signed-off-by: Wuxun Zhang <[email protected]>
1 parent 1142665 commit 7ae55fd

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
@@ -127,6 +127,14 @@ class BatchContents:
127127
def get_num_tokens(self):
128128
return [len(t) for t in self.token_ids]
129129

130+
def clone(self):
131+
return BatchContents(
132+
req_ids=self.req_ids.copy(),
133+
token_ids=[t.copy() for t in self.token_ids],
134+
context_lens=self.context_lens.copy(),
135+
blocks=[b.copy() for b in self.blocks],
136+
logits_positions=[lp.copy() for lp in self.logits_positions])
137+
130138

131139
# TODO(kzawora): remove this
132140
@dataclass
@@ -1536,7 +1544,7 @@ def _create_dummy_prefill_batch_contents(
15361544
)
15371545

15381546
outputs = [
1539-
self._form_prefill_batch(new_batch_contents)
1547+
self._form_prefill_batch(new_batch_contents.clone())
15401548
for _ in range(num_prefills)
15411549
]
15421550
return outputs

0 commit comments

Comments
 (0)