runtime_context: record the publishing process role (#31813)

This commit is contained in:
Cheng Wan
2026-07-22 01:17:42 -07:00
committed by GitHub
parent e1479cc966
commit 1d0a6ee178
8 changed files with 183 additions and 39 deletions
@@ -815,6 +815,12 @@ def run_data_parallel_controller_process(
kill_itself_when_parent_died()
parent_process = psutil.Process().parent()
# Publish the resolved config at DP-controller process entry: this process
# reads config namespaces (e.g. get_exec().moe.*) in its own address space
# before spawning schedulers.
from sglang.srt.runtime_context import publish
publish(server_args, role="scheduler")
configure_logger(server_args)
if server_args.enable_trace:
process_tracing_init(
+7
View File
@@ -4627,6 +4627,13 @@ def run_scheduler_process(
display_dp_rank=display_dp_rank,
display_moe_ep_rank=display_moe_ep_rank,
)
# Publish the resolved config at scheduler process entry so the config
# namespaces (get_serving()/get_device()/get_exec()/...) are available to
# Scheduler.__init__ and its init_* helpers, which read them before the
# model worker's own publish. ModelRunner re-publishes idempotently.
from sglang.srt.runtime_context import publish
publish(server_args, role="scheduler")
parent_process = psutil.Process().parent()
# Set up tracing