sgl-project/sglang · error · ValueError

Unsupported Mobius layer type

Error message

Unsupported Mobius layer type: {checkpoint_type}

What it means

Intern-S2-Mobius model error: the checkpoint encodes a Mobius layer type that this implementation does not recognize or support.

Solutions

  1. Print checkpoint_type in the factory to see the actual string
  2. Map the new type string to the closest supported layer in your config
  3. Update the model implementation to handle the new layer type

Example fix

# before
if checkpoint_type == "linear_attn": ...
raise ValueError(...)

# after
if checkpoint_type in ("linear_attn", "gated_delta_net"):
    return _InternS2MobiusLinearAttn(...)
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {"full_attn", "linear_attn"}  # per factory branches
assert checkpoint_type in SUPPORTED, f"unsupported layer type {checkpoint_type}"

Type guard

def is_supported_layer(t: str) -> bool:
    return t in {"full_attn", "linear_attn"}

Try / catch

try:
    layer = get_layer(idx, checkpoint_type)
except ValueError as e:
    if "Unsupported Mobius layer type" in str(e):
        raise RuntimeError(f"convert checkpoint: {e}")
    raise

Prevention

When it happens

Trigger: config/checkpoint layer type strings not matching the supported set (e.g., a new 'mamba2' or renamed 'gated_delta' variant), causing no branch of get_layer to return before the fallthrough.

Common situations: Loading checkpoints from a newer/older Intern-S2-Mobius release with renamed layer types, or hand-edited configs.

Related errors


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

Appendix: source

Thrown at python/sglang/srt/models/interns2_mobius.py:747

        def get_layer(idx: int, prefix: str):
            checkpoint_type = config.layer_types[idx]
            if checkpoint_type == "full_attention":
                return InternS2MobiusAttentionDecoderLayer(
                    config=config,
                    layer_id=idx,
                    quant_config=quant_config,
                    prefix=add_prefix("self_attn", prefix),
                    alt_stream=alt_stream,
                )
            if checkpoint_type == "linear_attention":
                return InternS2MobiusLinearDecoderLayer(
                    config=config,
                    layer_id=idx,
                    quant_config=quant_config,
                    prefix=add_prefix("linear_attn", prefix),
                    alt_stream=alt_stream,
                )
            raise ValueError(f"Unsupported Mobius layer type: {checkpoint_type}")

        self.layers, self._start_layer, self._end_layer = make_layers(
            config.num_hidden_layers,
            get_layer,
            pp_rank=0,
            pp_size=1,
            prefix=f"{prefix}.layers",
        )
        self.norm = GemmaRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
        self.layers_to_capture = []

    def get_hidden_dim(self, module_name: str, layer_idx: int):
        if module_name == "gate_up_proj":
            return (
                self.config.hidden_size,
                self.config.shared_expert_intermediate_size * 2,
            )
        if module_name == "down_proj":

View on GitHub (pinned to 0132848349)