sgl-project/sglang · critical · ValueError

Unsupported attention type: {config.attention_type}

Error message

Unsupported attention type: {config.attention_type}

What it means

Each Bailing-MoE-linear layer dispatches attention construction on config.attention_type; only specific values (full attention and linear/GDN-style) are handled, and anything else hits the else branch raising ValueError.

Source

Thrown at python/sglang/srt/models/bailing_moe_linear.py:782

                    rope_theta=getattr(config, "rope_theta", 600000),
                    rope_scaling=config.rope_scaling,
                    max_position_embeddings=262144,
                    quant_config=quant_config,
                    layer_id=layer_id,
                    reduce_results=False,
                    prefix=add_prefix("attention", prefix),
                    alt_stream=alt_stream,
                )
            else:
                logger.debug(f"layer {layer_id} use gqa")
                self.attention = BailingMoEAttention(
                    config,
                    quant_config=quant_config,
                    layer_id=self.layer_id,
                    prefix=prefix + ".attention",
                )
        else:
            raise ValueError(f"Unsupported attention type: {config.attention_type}")

        self.expert_num = config.num_experts
        self.hidden_size = config.hidden_size
        is_moe_layer = self._is_layer_sparse(config, self.layer_id)
        is_previous_moe_layer = self._is_layer_sparse(config, self.layer_id - 1)
        is_next_layer_moe_layer = self._is_layer_sparse(config, self.layer_id + 1)
        if self.expert_num == 1:
            self.mlp = BailingMLP(
                hidden_size=self.hidden_size,
                intermediate_size=config.intermediate_size,
                quant_config=quant_config,
                prefix=add_prefix("mlp", prefix),
            )
        else:
            if is_nextn or self.layer_id >= config.first_k_dense_replace:
                # MoE layer
                self.mlp = BailingMoE(
                    config,

View on GitHub (pinned to 0132848349)

Solutions

  1. Check config.json attention_type and set it to a supported value (e.g. "full" or the linear attention type used by this model family)
  2. Upgrade SGLang to a version that supports the new attention_type
Defensive patterns

Strategy: validation

Validate before calling

assert config.attention_type in {"full", "linear"}, f"unsupported {config.attention_type}"

Prevention

When it happens

Trigger: Loading a bailing_moe_linear config with an attention_type value not handled by the if/elif chain (e.g. a new or misspelled type string).

Common situations: New checkpoint revisions introducing an attention_type the installed SGLang version doesn't support; typo in config.json.

Related errors


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