Skip to content

Commit d74d988

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 e32014a commit d74d988

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
@@ -4256,8 +4256,9 @@ def _get_prompt_logprobs_dict(
42564256
else:
42574257
# This is the last chunk of prompt tokens to return.
42584258
num_logits = num_remaining_tokens
4259-
completed_prefill_reqs.append(req_id)
4260-
prompt_logprobs_dict[req_id] = logprobs_tensors
4259+
if num_logits > 0:
4260+
completed_prefill_reqs.append(req_id)
4261+
prompt_logprobs_dict[req_id] = logprobs_tensors
42614262

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

0 commit comments

Comments
 (0)