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
f352b793
Unverified
Commit
f352b793
authored
Aug 08, 2025
by
Lianmin Zheng
Committed by
GitHub
Aug 08, 2025
Browse files
Minor Optimizations in Schedule Batch (#8724)
Co-authored-by:
Suruchi Shah
<
surshah@linkedin.com
>
parent
6642e3a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
python/sglang/srt/managers/schedule_batch.py
python/sglang/srt/managers/schedule_batch.py
+4
-3
No files found.
python/sglang/srt/managers/schedule_batch.py
View file @
f352b793
...
@@ -37,6 +37,7 @@ import logging
...
@@ -37,6 +37,7 @@ import logging
import
threading
import
threading
from
enum
import
Enum
,
auto
from
enum
import
Enum
,
auto
from
http
import
HTTPStatus
from
http
import
HTTPStatus
from
itertools
import
chain
from
typing
import
TYPE_CHECKING
,
Any
,
List
,
Optional
,
Set
,
Tuple
,
Union
from
typing
import
TYPE_CHECKING
,
Any
,
List
,
Optional
,
Set
,
Tuple
,
Union
import
numpy
as
np
import
numpy
as
np
...
@@ -1145,9 +1146,9 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
...
@@ -1145,9 +1146,9 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
req_pool_indices_tensor
=
torch
.
tensor
(
req_pool_indices
,
dtype
=
torch
.
int64
).
to
(
req_pool_indices_tensor
=
torch
.
tensor
(
req_pool_indices
,
dtype
=
torch
.
int64
).
to
(
self
.
device
,
non_blocking
=
True
self
.
device
,
non_blocking
=
True
)
)
input_ids_tensor
=
torch
.
tensor
(
sum
(
input_ids
,
[]),
dtype
=
torch
.
int64
).
to
(
input_ids_tensor
=
torch
.
tensor
(
self
.
device
,
non_blocking
=
True
list
(
chain
.
from_iterable
(
input_ids
)),
dtype
=
torch
.
int64
)
)
.
to
(
self
.
device
,
non_blocking
=
True
)
seq_lens_tensor
=
torch
.
tensor
(
seq_lens
,
dtype
=
torch
.
int64
).
to
(
seq_lens_tensor
=
torch
.
tensor
(
seq_lens
,
dtype
=
torch
.
int64
).
to
(
self
.
device
,
non_blocking
=
True
self
.
device
,
non_blocking
=
True
)
)
...
...
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