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
4f24ab17
Unverified
Commit
4f24ab17
authored
Oct 16, 2025
by
Simo Lin
Committed by
GitHub
Oct 16, 2025
Browse files
[router][grpc] add dissag info to warm up in grpc server (#11727)
parent
64affab4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
python/sglang/srt/entrypoints/grpc_server.py
python/sglang/srt/entrypoints/grpc_server.py
+32
-8
No files found.
python/sglang/srt/entrypoints/grpc_server.py
View file @
4f24ab17
...
@@ -532,9 +532,20 @@ class SGLangSchedulerServicer(sglang_scheduler_pb2_grpc.SglangSchedulerServicer)
...
@@ -532,9 +532,20 @@ class SGLangSchedulerServicer(sglang_scheduler_pb2_grpc.SglangSchedulerServicer)
bootstrap_port
=
None
bootstrap_port
=
None
bootstrap_room
=
None
bootstrap_room
=
None
if
grpc_req
.
HasField
(
"disaggregated_params"
):
if
grpc_req
.
HasField
(
"disaggregated_params"
):
bootstrap_host
=
grpc_req
.
disaggregated_params
.
bootstrap_host
or
None
# Don't use 'or None' as it treats 0 as falsy
bootstrap_port
=
grpc_req
.
disaggregated_params
.
bootstrap_port
or
None
bootstrap_host
=
(
bootstrap_room
=
grpc_req
.
disaggregated_params
.
bootstrap_room
or
None
grpc_req
.
disaggregated_params
.
bootstrap_host
if
grpc_req
.
disaggregated_params
.
bootstrap_host
else
None
)
bootstrap_port
=
(
grpc_req
.
disaggregated_params
.
bootstrap_port
if
grpc_req
.
disaggregated_params
.
bootstrap_port
else
None
)
bootstrap_room
=
(
grpc_req
.
disaggregated_params
.
bootstrap_room
)
# Can be 0, don't use 'or None'
# Create request
# Create request
return
TokenizedGenerateReqInput
(
return
TokenizedGenerateReqInput
(
...
@@ -988,9 +999,9 @@ def _execute_grpc_server_warmup(
...
@@ -988,9 +999,9 @@ def _execute_grpc_server_warmup(
if
is_generation
:
if
is_generation
:
# Create tokenized input for warmup
# Create tokenized input for warmup
warmup_request
=
sglang_scheduler_pb2
.
GenerateRequest
(
warmup_request
_kwargs
=
{
request_id
=
f
"WARMUP_
{
time
.
time
()
}
"
,
"
request_id
"
:
f
"WARMUP_
{
time
.
time
()
}
"
,
tokenized
=
sglang_scheduler_pb2
.
TokenizedInput
(
"
tokenized
"
:
sglang_scheduler_pb2
.
TokenizedInput
(
input_ids
=
[
input_ids
=
[
954
,
954
,
15541
,
15541
,
...
@@ -1002,11 +1013,24 @@ def _execute_grpc_server_warmup(
...
@@ -1002,11 +1013,24 @@ def _execute_grpc_server_warmup(
],
# Simple token sequence
],
# Simple token sequence
original_text
=
"The capital city of France is"
,
original_text
=
"The capital city of France is"
,
),
),
sampling_params
=
sglang_scheduler_pb2
.
SamplingParams
(
"
sampling_params
"
:
sglang_scheduler_pb2
.
SamplingParams
(
temperature
=
0.0
,
temperature
=
0.0
,
max_new_tokens
=
max_new_tokens
,
max_new_tokens
=
max_new_tokens
,
),
),
stream
=
False
,
"stream"
:
False
,
}
# Set disaggregation params if needed
if
server_args
.
disaggregation_mode
!=
DisaggregationMode
.
NULL
:
warmup_request_kwargs
[
"disaggregated_params"
]
=
(
sglang_scheduler_pb2
.
DisaggregatedParams
(
bootstrap_host
=
FAKE_BOOTSTRAP_HOST
,
bootstrap_room
=
0
,
)
)
warmup_request
=
sglang_scheduler_pb2
.
GenerateRequest
(
**
warmup_request_kwargs
)
)
# Send the warmup request
# Send the warmup request
...
...
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