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
1a8f5f68
Unverified
Commit
1a8f5f68
authored
May 27, 2025
by
fzyzcjy
Committed by
GitHub
May 26, 2025
Browse files
Super tiny rename environment variable (#6648)
parent
32cd7070
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
python/sglang/srt/disaggregation/mooncake/conn.py
python/sglang/srt/disaggregation/mooncake/conn.py
+11
-8
No files found.
python/sglang/srt/disaggregation/mooncake/conn.py
View file @
1a8f5f68
...
@@ -31,7 +31,12 @@ from sglang.srt.disaggregation.base.conn import (
...
@@ -31,7 +31,12 @@ from sglang.srt.disaggregation.base.conn import (
from
sglang.srt.disaggregation.mooncake.transfer_engine
import
MooncakeTransferEngine
from
sglang.srt.disaggregation.mooncake.transfer_engine
import
MooncakeTransferEngine
from
sglang.srt.disaggregation.utils
import
DisaggregationMode
from
sglang.srt.disaggregation.utils
import
DisaggregationMode
from
sglang.srt.server_args
import
ServerArgs
from
sglang.srt.server_args
import
ServerArgs
from
sglang.srt.utils
import
get_free_port
,
get_ip
,
get_local_ip_by_remote
from
sglang.srt.utils
import
(
get_free_port
,
get_int_env_var
,
get_ip
,
get_local_ip_by_remote
,
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -172,11 +177,9 @@ class MooncakeKVManager(BaseKVManager):
...
@@ -172,11 +177,9 @@ class MooncakeKVManager(BaseKVManager):
# Determine the number of threads to use for kv sender
# Determine the number of threads to use for kv sender
cpu_count
=
os
.
cpu_count
()
cpu_count
=
os
.
cpu_count
()
self
.
executor
=
concurrent
.
futures
.
ThreadPoolExecutor
(
self
.
executor
=
concurrent
.
futures
.
ThreadPoolExecutor
(
int
(
get_int_env_var
(
os
.
getenv
(
"SGLANG_DISAGGREGATION_THREAD_POOL_SIZE"
,
"DISAGGREGATION_THREAD_POOL_SIZE"
,
min
(
max
(
1
,
cpu_count
//
8
),
8
),
min
(
max
(
1
,
cpu_count
//
8
),
8
),
)
)
)
)
)
elif
self
.
disaggregation_mode
==
DisaggregationMode
.
DECODE
:
elif
self
.
disaggregation_mode
==
DisaggregationMode
.
DECODE
:
...
@@ -187,11 +190,11 @@ class MooncakeKVManager(BaseKVManager):
...
@@ -187,11 +190,11 @@ class MooncakeKVManager(BaseKVManager):
self
.
connection_lock
=
threading
.
Lock
()
self
.
connection_lock
=
threading
.
Lock
()
# Heartbeat interval should be at least 2 seconds
# Heartbeat interval should be at least 2 seconds
self
.
heartbeat_interval
=
max
(
self
.
heartbeat_interval
=
max
(
float
(
os
.
getenv
(
"DISAGGREGATION_HEARTBEAT_INTERVAL"
,
5.0
)),
2.0
float
(
os
.
getenv
(
"
SGLANG_
DISAGGREGATION_HEARTBEAT_INTERVAL"
,
5.0
)),
2.0
)
)
# Heartbeat failure should be at least 1
# Heartbeat failure should be at least 1
self
.
max_failures
=
max
(
self
.
max_failures
=
max
(
int
(
os
.
getenv
(
"DISAGGREGATION_HEARTBEAT_MAX_FAILURE"
,
2
)),
1
int
(
os
.
getenv
(
"
SGLANG_
DISAGGREGATION_HEARTBEAT_MAX_FAILURE"
,
2
)),
1
)
)
self
.
start_decode_thread
()
self
.
start_decode_thread
()
self
.
connection_pool
:
Dict
[
str
,
Dict
[
str
,
Union
[
str
,
int
]]]
=
{}
self
.
connection_pool
:
Dict
[
str
,
Dict
[
str
,
Union
[
str
,
int
]]]
=
{}
...
...
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