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
55a6e644
Unverified
Commit
55a6e644
authored
Sep 14, 2025
by
Liangsheng Yin
Committed by
GitHub
Sep 14, 2025
Browse files
[Hack] Add pd-disaggregation decode polling interval (#10411)
parent
6897e06b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
python/sglang/srt/disaggregation/decode.py
python/sglang/srt/disaggregation/decode.py
+15
-6
python/sglang/srt/server_args.py
python/sglang/srt/server_args.py
+9
-0
No files found.
python/sglang/srt/disaggregation/decode.py
View file @
55a6e644
...
@@ -886,9 +886,18 @@ class SchedulerDisaggregationDecodeMixin:
...
@@ -886,9 +886,18 @@ class SchedulerDisaggregationDecodeMixin:
# if there are still retracted requests, we do not allocate new requests
# if there are still retracted requests, we do not allocate new requests
return
return
req_conns
=
self
.
disagg_decode_prealloc_queue
.
pop_preallocated
()
if
not
hasattr
(
self
,
"polling_count"
):
self
.
disagg_decode_transfer_queue
.
extend
(
req_conns
)
self
.
polling_count
=
0
alloc_reqs
=
(
self
.
polling_interval
=
(
self
.
disagg_decode_transfer_queue
.
pop_transferred
()
self
.
server_args
.
disaggregation_decode_polling_interval
)
# the requests which kv has arrived
)
self
.
waiting_queue
.
extend
(
alloc_reqs
)
self
.
polling_count
=
(
self
.
polling_count
+
1
)
%
self
.
polling_interval
if
self
.
polling_count
%
self
.
polling_interval
==
0
:
req_conns
=
self
.
disagg_decode_prealloc_queue
.
pop_preallocated
()
self
.
disagg_decode_transfer_queue
.
extend
(
req_conns
)
alloc_reqs
=
(
self
.
disagg_decode_transfer_queue
.
pop_transferred
()
)
# the requests which kv has arrived
self
.
waiting_queue
.
extend
(
alloc_reqs
)
python/sglang/srt/server_args.py
View file @
55a6e644
...
@@ -394,6 +394,9 @@ class ServerArgs:
...
@@ -394,6 +394,9 @@ class ServerArgs:
disaggregation_ib_device
:
Optional
[
str
]
=
None
disaggregation_ib_device
:
Optional
[
str
]
=
None
num_reserved_decode_tokens
:
int
=
512
# used for decode kv cache offload in PD
num_reserved_decode_tokens
:
int
=
512
# used for decode kv cache offload in PD
# FIXME: hack to reduce ITL when decode bs is small
disaggregation_decode_polling_interval
:
int
=
1
# For model weight update
# For model weight update
custom_weight_loader
:
Optional
[
List
[
str
]]
=
None
custom_weight_loader
:
Optional
[
List
[
str
]]
=
None
weight_loader_disable_mmap
:
bool
=
False
weight_loader_disable_mmap
:
bool
=
False
...
@@ -2245,6 +2248,12 @@ class ServerArgs:
...
@@ -2245,6 +2248,12 @@ class ServerArgs:
default
=
ServerArgs
.
num_reserved_decode_tokens
,
default
=
ServerArgs
.
num_reserved_decode_tokens
,
help
=
"Number of decode tokens that will have memory reserved when adding new request to the running batch."
,
help
=
"Number of decode tokens that will have memory reserved when adding new request to the running batch."
,
)
)
parser
.
add_argument
(
"--disaggregation-decode-polling-interval"
,
type
=
int
,
default
=
ServerArgs
.
disaggregation_decode_polling_interval
,
help
=
"The interval to poll requests in decode server. Can be set to >1 to reduce the overhead of this."
,
)
# Custom weight loader
# Custom weight loader
parser
.
add_argument
(
parser
.
add_argument
(
...
...
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