[Rebase] Rebase to vLLM 0.29.0 (#7230)
Signed-off-by: tzhouam <tzhouam@connect.ust.hk> Signed-off-by: Zhou Taichang <tzhouam@connect.ust.hk> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
333f14e97e
commit
aff7d64948
120 files changed
+2958
-1690
No files matched your search
@@ -1,5 +1,5 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
"""Sampling-state guards shared by the GPU and NPU AR model runners."""
|
||||
|
||||
import torch
|
||||
@@ -48,7 +48,7 @@ def sanitize_min_tokens_stop_ids(logitsprocs: LogitsProcessors, logits_vocab: in
|
||||
if not min_toks:
|
||||
continue
|
||||
needs_rebuild = False
|
||||
for _, _, stop_tok_ids in min_toks.values():
|
||||
for _, _, stop_tok_ids, _ in min_toks.values():
|
||||
oob = [tok for tok in stop_tok_ids if tok >= logits_vocab]
|
||||
if not oob:
|
||||
continue
|
||||
@@ -63,10 +63,19 @@ def sanitize_min_tokens_stop_ids(logitsprocs: LogitsProcessors, logits_vocab: in
|
||||
if needs_rebuild:
|
||||
reqs: list[int] = []
|
||||
tok_ids: list[int] = []
|
||||
for index, (_, _, stop_tok_ids) in min_toks.items():
|
||||
restore_reqs: list[int] = []
|
||||
restore_tok_ids: list[int] = []
|
||||
for index, (_, _, stop_tok_ids, uses_structured_output) in min_toks.items():
|
||||
reqs.extend([index] * len(stop_tok_ids))
|
||||
tok_ids.extend(stop_tok_ids)
|
||||
if uses_structured_output:
|
||||
restore_reqs.extend([index] * len(stop_tok_ids))
|
||||
restore_tok_ids.extend(stop_tok_ids)
|
||||
proc.logits_slice = (
|
||||
proc._device_tensor(reqs, torch.int32),
|
||||
proc._device_tensor(tok_ids, torch.int32),
|
||||
)
|
||||
proc.restore_logits_slice = (
|
||||
proc._device_tensor(restore_reqs, torch.int32),
|
||||
proc._device_tensor(restore_tok_ids, torch.int32),
|
||||
)
|
||||
Reference in new issue
Block a user