Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
c2ed069b
Unverified
Commit
c2ed069b
authored
Nov 01, 2025
by
Nick Hill
Committed by
GitHub
Nov 01, 2025
Browse files
[BugFix] Fix mixed penalties batch with async scheduling (#27910)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
af6e19f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
vllm/v1/sample/ops/penalties.py
vllm/v1/sample/ops/penalties.py
+8
-0
No files found.
vllm/v1/sample/ops/penalties.py
View file @
c2ed069b
...
@@ -21,6 +21,14 @@ def apply_all_penalties(
...
@@ -21,6 +21,14 @@ def apply_all_penalties(
"""
"""
_
,
vocab_size
=
logits
.
shape
_
,
vocab_size
=
logits
.
shape
output_tokens_t
=
_convert_to_tensors
(
output_token_ids
,
vocab_size
,
logits
.
device
)
output_tokens_t
=
_convert_to_tensors
(
output_token_ids
,
vocab_size
,
logits
.
device
)
# In the async scheduling case, rows that won't have penalties applied may contain
# -1 placeholder token ids. We must replace these with valid token ids so that the
# scatter done in apply_penalties is valid.
# NOTE(nick): The penalties implementation is currently quite inefficient and
# will be reworked anyhow.
output_tokens_t
.
masked_fill_
(
output_tokens_t
==
-
1
,
vocab_size
)
return
apply_penalties
(
return
apply_penalties
(
logits
,
logits
,
prompt_token_ids
,
prompt_token_ids
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment