sgl-project/sglang · error · ValueError

experimental_sgl_marlin EP requires trivial expert placement

Error message

experimental_sgl_marlin EP requires trivial expert placement without redundancy, EPLB, or elastic EP

What it means

Startup validation: with expert parallelism (ep_size > 1), the experimental SGLang Marlin runner requires trivial expert placement (--init-expert-location trivial), zero redundant experts, no EPLB, and no elastic-EP features, because its kernels assume a static, identity expert layout across ranks.

Source

Thrown at python/sglang/srt/lora/marlin_lora_temp/policy.py:51

        raise ValueError(
            "experimental_sgl_marlin LoRA requires --lora-use-virtual-experts"
        )
    if cfg.lora_backend != "triton":
        # The temporary dense/sink kernels consume Triton SGEMM batch metadata
        # directly; other global backends are not adapted in this tree.
        raise ValueError("experimental_sgl_marlin LoRA requires --lora-backend triton")
    if resolved_args.ep_size <= 1:
        return

    if (
        cfg.init_expert_location != "trivial"
        or cfg.ep_num_redundant_experts != 0
        or cfg.enable_eplb
        or cfg.elastic_ep_backend is not None
        or cfg.enable_elastic_expert_backup
        or cfg.elastic_ep_rejoin
    ):
        raise ValueError(
            "experimental_sgl_marlin EP requires trivial expert placement "
            "without redundancy, EPLB, or elastic EP"
        )


def validate_experimental_sgl_marlin_contract(
    runner_config: Any,
    *,
    moe_ep_size: int,
    device_capability: tuple[int, int],
) -> None:
    """Fail before capture when the specialized pipeline would change semantics."""

    errors: list[str] = []

    if runner_config.activation != "silu":
        errors.append(f"activation must be 'silu', got {runner_config.activation!r}")
    if not runner_config.is_gated:

View on GitHub (pinned to 0132848349)

Solutions

  1. Set --init-expert-location trivial and --ep-num-redundant-experts 0
  2. Disable EPLB (--disable-eplb / omit enable flags) and all elastic-EP options
  3. Fall back to the standard MoE runner if EPLB/elastic EP is a hard requirement

Example fix

# before
--ep-size 8 --enable-eplb --ep-num-redundant-experts 32
# after
--ep-size 8 --init-expert-location trivial --ep-num-redundant-experts 0
Defensive patterns

Strategy: validation

Validate before calling

if server_args.ep_size > 1:
    ok = (server_args.init_expert_location == 'trivial'
          and server_args.ep_num_redundant_experts == 0
          and not server_args.enable_eplb
          and server_args.elastic_ep_backend is None)
    assert ok, 'experimental_sgl_marlin EP needs trivial placement, no redundancy/EPLB/elastic EP'

Prevention

When it happens

Trigger: Launching with ep_size > 1 on the experimental runner while any of: init_expert_location != 'trivial', ep_num_redundant_experts != 0, enable_eplb, elastic_ep_backend set, enable_elastic_expert_backup, or elastic_ep_rejoin is active.

Common situations: Reusing a production EP launch script that enables EPLB or redundant experts when trying the experimental Marlin LoRA path on the same cluster config.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/5b6e44042c579a93. Report an issue: GitHub.