[Fix] rust-server: Keep a transfer backend's own bootstrap port on prefill (#46066)
Co-authored-by: metamergebot <metamergebot@users.noreply.github.com> Co-authored-by: shodoco <shodoco@users.noreply.github.com>
This commit is contained in:
co-authored by
metamergebot
shodoco
parent
855c092deb
commit
0d592c475b
@@ -248,8 +248,23 @@ def _alias_bootstrap_port_to_api_port(server_args: ServerArgs) -> None:
|
||||
consumer (KVManager registration, PrefillBootstrapQueue) reads the resolved
|
||||
field and agrees automatically. Decode is untouched: there the field names
|
||||
the PREFILL side's bootstrap port and must stay as the operator set it.
|
||||
A transfer backend that brings its own bootstrap server keeps the port as
|
||||
configured: that server, not the Rust registry, listens there.
|
||||
"""
|
||||
# Lazy: disagg_service pulls in the disaggregation package. Its helper calls
|
||||
# disagg_service.get_kv_class, which a transfer backend registered at
|
||||
# runtime may rebind.
|
||||
from sglang.srt.managers.disagg_service import rust_server_serves_kv_bootstrap
|
||||
|
||||
cfg = resolving_view(server_args)
|
||||
if not rust_server_serves_kv_bootstrap(cfg.disaggregation_transfer_backend):
|
||||
logger.info(
|
||||
"SGLANG_RUST_SERVER: transfer backend %s runs its own KV bootstrap "
|
||||
"server; keeping disaggregation_bootstrap_port %d",
|
||||
cfg.disaggregation_transfer_backend,
|
||||
cfg.disaggregation_bootstrap_port,
|
||||
)
|
||||
return
|
||||
default_port = next(
|
||||
f.default
|
||||
for f in record_fields(type(server_args))
|
||||
|
||||
@@ -51,6 +51,21 @@ def start_disagg_service():
|
||||
return bootstrap_server
|
||||
|
||||
|
||||
def rust_server_serves_kv_bootstrap(transfer_backend: str) -> bool:
|
||||
"""Whether the embedded Rust server's KV bootstrap registry stands in for
|
||||
the transfer backend's bootstrap server: it ports ``CommonKVBootstrapServer``,
|
||||
the HTTP registry the built-in backends run, but not a backend that brings
|
||||
a bootstrap server of its own."""
|
||||
from sglang.srt.disaggregation.common.conn import CommonKVBootstrapServer
|
||||
|
||||
server_class = get_kv_class(
|
||||
TransferBackend(transfer_backend), KVClassType.BOOTSTRAP_SERVER
|
||||
)
|
||||
return server_class is not None and issubclass(
|
||||
server_class, CommonKVBootstrapServer
|
||||
)
|
||||
|
||||
|
||||
def maybe_create_ascend_config_store(transfer_backend: TransferBackend) -> None:
|
||||
"""Also called directly by the rust-server scheduler: there the KV
|
||||
bootstrap registry is served by the embedded rust server's api listener
|
||||
|
||||
Reference in New Issue
Block a user