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
add1adfe
Unverified
Commit
add1adfe
authored
Aug 22, 2025
by
Nick Hill
Committed by
GitHub
Aug 23, 2025
Browse files
[BugFix] Fix `MinPLogitsProcessor.update_states()` (#23401)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
c80c53a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
vllm/v1/sample/logits_processor/builtin.py
vllm/v1/sample/logits_processor/builtin.py
+21
-13
No files found.
vllm/v1/sample/logits_processor/builtin.py
View file @
add1adfe
...
@@ -53,29 +53,37 @@ class MinPLogitsProcessor(LogitsProcessor):
...
@@ -53,29 +53,37 @@ class MinPLogitsProcessor(LogitsProcessor):
# Process added requests.
# Process added requests.
for
index
,
params
,
_
,
_
in
batch_update
.
added
:
for
index
,
params
,
_
,
_
in
batch_update
.
added
:
min_p
=
params
.
min_p
min_p
=
params
.
min_p
if
self
.
min_p_cpu
[
index
]
!=
min_p
:
min_p_before
=
self
.
min_p_cpu
[
index
]
if
min_p_before
!=
min_p
:
needs_update
=
True
needs_update
=
True
self
.
min_p_cpu
[
index
]
=
min_p
self
.
min_p_cpu
[
index
]
=
min_p
if
min_p
:
if
min_p
and
not
min_p_before
:
self
.
min_p_count
+=
1
self
.
min_p_count
+=
1
elif
not
min_p
and
min_p_before
:
self
.
min_p_count
-=
1
if
self
.
min_p_count
:
if
self
.
min_p_count
:
# Process removed requests.
# Process removed requests.
needs_update
|=
bool
(
batch_update
.
removed
)
if
batch_update
.
removed
:
for
index
in
batch_update
.
removed
:
needs_update
=
True
if
self
.
min_p_cpu
[
index
]:
for
index
in
batch_update
.
removed
:
self
.
min_p_count
-=
1
if
self
.
min_p_cpu
[
index
]:
self
.
min_p_cpu
[
index
]
=
0
self
.
min_p_count
-=
1
# Process moved requests, unidirectional (a->b) and swap (a<->b)
# Process moved requests, unidirectional (a->b) and swap (a<->b)
.
for
adx
,
bdx
,
direct
in
batch_update
.
moved
:
for
adx
,
bdx
,
direct
in
batch_update
.
moved
:
change
=
(
min_p_a
:
=
min_p_a
,
min_p_b
=
self
.
min_p_cpu
[
adx
],
self
.
min_p_cpu
[
bdx
]
self
.
min_p_cpu
[
adx
])
!=
(
min_p_b
:
=
if
min_p_a
!=
min_p_b
:
self
.
min_p_cpu
[
bdx
])
needs_update
=
True
needs_update
|=
change
if
change
:
self
.
min_p_cpu
[
bdx
]
=
min_p_a
self
.
min_p_cpu
[
bdx
]
=
min_p_a
if
direct
==
MoveDirectionality
.
SWAP
:
if
direct
==
MoveDirectionality
.
SWAP
:
self
.
min_p_cpu
[
adx
]
=
min_p_b
self
.
min_p_cpu
[
adx
]
=
min_p_b
if
direct
==
MoveDirectionality
.
UNIDIRECTIONAL
:
if
min_p_a
:
self
.
min_p_cpu
[
adx
]
=
0
if
min_p_b
:
self
.
min_p_count
-=
1
# Update tensors if needed.
# Update tensors if needed.
size
=
batch_update
.
batch_size
size
=
batch_update
.
batch_size
...
...
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