Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
424591d5
Unverified
Commit
424591d5
authored
Sep 30, 2025
by
Ke Bao
Committed by
GitHub
Sep 30, 2025
Browse files
Fix spec filter batch when target extend (#10991)
parent
d1676cd4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
python/sglang/srt/managers/schedule_batch.py
python/sglang/srt/managers/schedule_batch.py
+8
-1
python/sglang/srt/speculative/ngram_utils.py
python/sglang/srt/speculative/ngram_utils.py
+1
-1
No files found.
python/sglang/srt/managers/schedule_batch.py
View file @
424591d5
...
@@ -1736,7 +1736,14 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
...
@@ -1736,7 +1736,14 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
self
.
sampling_info
.
filter_batch
(
keep_indices
,
keep_indices_device
)
self
.
sampling_info
.
filter_batch
(
keep_indices
,
keep_indices_device
)
if
self
.
spec_info
:
if
self
.
spec_info
:
self
.
spec_info
.
filter_batch
(
keep_indices_device
)
if
chunked_req_to_exclude
is
not
None
and
len
(
chunked_req_to_exclude
)
>
0
:
has_been_filtered
=
False
else
:
has_been_filtered
=
True
self
.
spec_info
.
filter_batch
(
new_indices
=
keep_indices_device
,
has_been_filtered
=
has_been_filtered
,
)
def
merge_batch
(
self
,
other
:
"ScheduleBatch"
):
def
merge_batch
(
self
,
other
:
"ScheduleBatch"
):
# Penalizer orchestrator must be merged before Batch.reqs is merged. This is because
# Penalizer orchestrator must be merged before Batch.reqs is merged. This is because
...
...
python/sglang/srt/speculative/ngram_utils.py
View file @
424591d5
...
@@ -405,7 +405,7 @@ class NgramVerifyInput:
...
@@ -405,7 +405,7 @@ class NgramVerifyInput:
return
logits_output
,
self
.
verified_id
,
self
.
accept_length
.
sum
().
item
()
return
logits_output
,
self
.
verified_id
,
self
.
accept_length
.
sum
().
item
()
def
filter_batch
(
self
,
new_indices
:
torch
.
Tensor
):
def
filter_batch
(
self
,
new_indices
:
torch
.
Tensor
,
has_been_filtered
:
bool
=
True
):
pass
pass
def
merge_batch
(
self
,
spec_info
:
NgramVerifyInput
):
def
merge_batch
(
self
,
spec_info
:
NgramVerifyInput
):
...
...
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