sgl-project/sglang · critical · RuntimeError
[Elastic EP] WORLD MLP sync dp_size exceeds WORLD size: rank
Error message
[Elastic EP] WORLD MLP sync dp_size exceeds WORLD size: rank={torch.distributed.get_rank(group)} live_dp_size={live_dp_size} world_size={world_size} effective_ep_size={effective_ep_size} What it means
Elastic EP guard: the live attention DP size exceeds the WORLD (process group) size, which is topologically impossible and means the elastic state over-counts replicas relative to actual ranks.
Source
Thrown at python/sglang/srt/managers/scheduler_components/dp_attn.py:77
from sglang.srt.elastic_ep.elastic_ep import ElasticEPStateManager
from sglang.srt.layers.dp_attention import get_attention_dp_size
live_dp_size = get_attention_dp_size()
effective_ep_size = ElasticEPStateManager.get_effective_ep_size()
world_size = torch.distributed.get_world_size(group)
if live_dp_size != effective_ep_size:
raise RuntimeError(
"[Elastic EP] WORLD MLP sync dp_size is out of sync: "
f"rank={torch.distributed.get_rank(group)} "
f"live_dp_size={live_dp_size} effective_ep_size={effective_ep_size} "
f"world_size={world_size} server_args_dp_size={dp_size} "
f"local_num_tokens={local_num_tokens} "
f"local_forward_mode={local_forward_mode}"
)
if live_dp_size > world_size:
raise RuntimeError(
"[Elastic EP] WORLD MLP sync dp_size exceeds WORLD size: "
f"rank={torch.distributed.get_rank(group)} "
f"live_dp_size={live_dp_size} world_size={world_size} "
f"effective_ep_size={effective_ep_size}"
)
return live_dp_size
@dataclass
class MLPSyncBatchInfo:
dp_size: int
tp_size: int
cp_size: int
num_tokens: int
num_tokens_for_logprob: int
can_run_decode_cuda_graph: boolView on GitHub (pinned to 0132848349)
Solutions
- Verify dp_size * tp/ep configuration divides the actual world size (GPU count) exactly
- Recheck elastic EP resize parameters and that no rank applied a stale dp_size
- Relaunch with a consistent topology
Example fix
# before --dp-size 8 --tp 8 # 8 dp ranks needed but world has 8 total # after --dp-size 4 --tp 8 # or add GPUs so dp_size <= world_size
Defensive patterns
Strategy: validation
Validate before calling
world = torch.distributed.get_world_size()
assert dp_size <= world, f'dp_size {dp_size} exceeds world {world}' Prevention
- Validate dp_size * tp_size divides total GPU count at launch
- Use a topology-check script before starting multi-node jobs
When it happens
Trigger: get_attention_dp_size() > torch.distributed.get_world_size(group) during prepare_mlp_sync_batch_raw, e.g. after a buggy resize that set dp_size beyond the launched world, or launching with dp_size larger than the number of GPUs/ranks.
Common situations: Misconfigured --dp-size vs --tensor-parallel-size/--expert-parallel-size world size; elastic resize arithmetic bugs; env var overrides applied on only some ranks.
Related errors
- [Elastic EP] WORLD MLP sync dp_size is out of sync: rank={to
- world_size must be positive and divide global_heads
- Group {group_name} is destroyed.
- world_size ({world_size}) is less than tensor_parallel_degre
- {type(self).__name__} does not implement ring KV-chunk atten
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/ebb00cc29f46a555.
Report an issue: GitHub.