runtime_context: record the publishing process role (#33012)

This commit is contained in:
Cheng Wan
2026-07-31 15:06:22 -07:00
committed by GitHub
parent ab2553284a
commit 4862edc85f
12 changed files with 166 additions and 45 deletions
@@ -48,6 +48,7 @@ from sglang.srt.managers.scheduler import run_scheduler_process
from sglang.srt.observability.cpu_monitor import start_cpu_monitor_thread
from sglang.srt.observability.req_time_stats import DPControllerReqTimeStats
from sglang.srt.observability.trace import process_tracing_init, trace_set_thread_info
from sglang.srt.runtime_context import publish
from sglang.srt.server_args import (
DP_ATTENTION_HANDSHAKE_PORT_DELTA,
PortArgs,
@@ -815,6 +816,8 @@ def run_data_parallel_controller_process(
kill_itself_when_parent_died()
parent_process = psutil.Process().parent()
# This process reads the config namespaces before spawning schedulers.
publish(server_args, role="dp_controller")
configure_logger(server_args)
if server_args.enable_trace:
process_tracing_init(
+4 -1
View File
@@ -250,7 +250,7 @@ from sglang.srt.observability.trace import process_tracing_init, trace_set_threa
from sglang.srt.parser.reasoning_parser import ReasoningParser
from sglang.srt.platforms import current_platform
from sglang.srt.plugins import load_plugins
from sglang.srt.runtime_context import get_context, get_parallel
from sglang.srt.runtime_context import get_context, get_parallel, publish
from sglang.srt.sampling.sampling_batch_info import SamplingBatchInfo
from sglang.srt.sampling.sampling_params import TOP_K_ALL
from sglang.srt.server_args import PortArgs, ServerArgs
@@ -4765,6 +4765,9 @@ def run_scheduler_process(
display_dp_rank=display_dp_rank,
display_moe_ep_rank=display_moe_ep_rank,
)
# Scheduler.__init__ reads the config namespaces before the model
# worker's own publish.
publish(server_args, role="scheduler")
parent_process = psutil.Process().parent()
# Set up tracing