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
68af77e5
Unverified
Commit
68af77e5
authored
Aug 15, 2025
by
JartX
Committed by
GitHub
Aug 15, 2025
Browse files
[FIXBUG] Correctly Apply Grammar Bitmask in Mixed Batches (#22896)
Signed-off-by:
JartX
<
sagformas@epdcenter.es
>
parent
6b04039a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
vllm/v1/worker/gpu_model_runner.py
vllm/v1/worker/gpu_model_runner.py
+4
-3
No files found.
vllm/v1/worker/gpu_model_runner.py
View file @
68af77e5
...
...
@@ -1337,9 +1337,10 @@ class GPUModelRunner(LoRAModelRunnerMixin, KVConnectorModelRunnerMixin):
out_indices
=
[]
# Reorder the bitmask to match the order of the requests in the batch.
sorted_bitmask
=
np
.
zeros_like
(
grammar_bitmask
,
shape
=
(
logits
.
shape
[
0
],
grammar_bitmask
.
shape
[
1
]))
sorted_bitmask
=
np
.
full
(
shape
=
(
logits
.
shape
[
0
],
grammar_bitmask
.
shape
[
1
]),
fill_value
=-
1
,
dtype
=
grammar_bitmask
.
dtype
)
cumulative_index
=
0
seq
=
sorted
(
scheduler_output
.
structured_output_request_ids
.
items
(),
key
=
lambda
x
:
x
[
1
])
...
...
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