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
b716ab93
Unverified
Commit
b716ab93
authored
Sep 19, 2025
by
Lucia Fang
Committed by
GitHub
Sep 19, 2025
Browse files
[bugfix] fix structured outputs key missing issue from #24929 (#25195)
Signed-off-by:
Lu Fang
<
fanglu@fb.com
>
parent
138f0d1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
vllm/v1/core/sched/scheduler.py
vllm/v1/core/sched/scheduler.py
+3
-1
vllm/v1/structured_output/utils.py
vllm/v1/structured_output/utils.py
+6
-5
No files found.
vllm/v1/core/sched/scheduler.py
View file @
b716ab93
...
...
@@ -578,8 +578,10 @@ class Scheduler(SchedulerInterface):
scheduled_spec_decode_tokens
,
req_to_new_blocks
,
)
scheduled_requests
=
(
scheduled_new_reqs
+
scheduled_running_reqs
+
scheduled_resumed_reqs
)
structured_output_request_ids
,
grammar_bitmask
=
(
self
.
get_grammar_bitmask
(
s
elf
.
running
,
self
.
get_grammar_bitmask
(
s
cheduled_requests
,
scheduled_spec_decode_tokens
))
scheduler_output
=
SchedulerOutput
(
scheduled_new_reqs
=
new_reqs_data
,
...
...
vllm/v1/structured_output/utils.py
View file @
b716ab93
...
...
@@ -90,13 +90,14 @@ def apply_grammar_bitmask(
seq
=
sorted
(
scheduler_output
.
structured_output_request_ids
.
items
(),
key
=
lambda
x
:
x
[
1
])
for
req_id
,
_
in
seq
:
logit_index
=
struct_out_req_batch_indices
[
req_id
]
num_spec_tokens
=
len
(
scheduler_output
.
scheduled_spec_decode_tokens
.
get
(
req_id
,
[]))
for
i
in
range
(
1
+
num_spec_tokens
):
sorted_bitmask
[
logit_index
+
i
]
=
\
grammar_bitmask
[
cumulative_index
+
i
]
out_indices
.
append
(
logit_index
+
i
)
if
req_id
in
struct_out_req_batch_indices
:
logit_index
=
struct_out_req_batch_indices
[
req_id
]
for
i
in
range
(
1
+
num_spec_tokens
):
sorted_bitmask
[
logit_index
+
i
]
=
\
grammar_bitmask
[
cumulative_index
+
i
]
out_indices
.
append
(
logit_index
+
i
)
cumulative_index
+=
1
+
num_spec_tokens
grammar_bitmask
=
sorted_bitmask
...
...
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