Skip to content

Commit 206be30

Browse files
author
jiangweixiang
committed
Fix out-of-bounds access to token_id due to uninitialized logprobs_tensor
Signed-off-by: jiangweixiang <[email protected]>
1 parent a30261f commit 206be30

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vllm_ascend/worker/model_runner_v1.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4226,8 +4226,9 @@ def _get_prompt_logprobs_dict(
42264226
else:
42274227
# This is the last chunk of prompt tokens to return.
42284228
num_logits = num_remaining_tokens
4229-
completed_prefill_reqs.append(req_id)
4230-
prompt_logprobs_dict[req_id] = logprobs_tensors
4229+
if num_logits > 0:
4230+
completed_prefill_reqs.append(req_id)
4231+
prompt_logprobs_dict[req_id] = logprobs_tensors
42314232

42324233
if num_logits <= 0:
42334234
# This can happen for the final chunk if we prefilled exactly

0 commit comments

Comments
 (0)