From 38bb9dd9e17ba5b821e04d411c92d9ad7b0e0980 Mon Sep 17 00:00:00 2001 From: Mikhail Kuznetsov Date: Tue, 23 Jun 2026 15:29:01 +0000 Subject: [PATCH] slurm sglang-disagg: allow co-located proxy (xP+yD==nnodes) The sglang-disagg launcher hard-required a dedicated proxy node (prefill+decode+1==nnodes), unlike the vllm launcher which leaves topology to the model script. Relax the custom-split validation to also accept a co-located proxy/router on the first prefill node (prefill+decode==nnodes). xP/yD and the exported topology env are unchanged; the proxy is started by the model run.sh, so both layouts are valid. --- src/madengine/deployment/slurm.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/madengine/deployment/slurm.py b/src/madengine/deployment/slurm.py index f5fb2495..2b218215 100644 --- a/src/madengine/deployment/slurm.py +++ b/src/madengine/deployment/slurm.py @@ -876,11 +876,16 @@ def _generate_sglang_disagg_command( f"SGLang Disaggregated requires at least 1 prefill and 1 decode node, " f"got prefill={prefill_nodes}, decode={decode_nodes}" ) - if prefill_nodes + decode_nodes + 1 != nnodes: + # Accept either a dedicated proxy node (1 + xP + yD == nnodes) or a + # co-located proxy/router on the first prefill node (xP + yD == nnodes), + # mirroring the vllm-disagg layout. The proxy is launched by the model + # script (not by this launcher), so both topologies are valid here. + if (prefill_nodes + decode_nodes != nnodes + and prefill_nodes + decode_nodes + 1 != nnodes): raise ValueError( - f"Custom split validation failed: " - f"prefill_nodes ({prefill_nodes}) + decode_nodes ({decode_nodes}) + 1 proxy " - f"must equal nnodes ({nnodes}), but got {prefill_nodes + decode_nodes + 1}" + f"Custom split validation failed: prefill_nodes ({prefill_nodes}) + " + f"decode_nodes ({decode_nodes}) must equal nnodes ({nnodes}) for a " + f"co-located proxy, or nnodes-1 ({nnodes - 1}) for a dedicated proxy node" ) xP = prefill_nodes yD = decode_nodes