sgl-project/sglang · critical · ValueError

LingBotWorld requires cross_attn_norm=True

Error message

LingBotWorld requires cross_attn_norm=True

What it means

LingBotWorld's residual scaling design (ScaleResidualLayerNormScaleShift applied around self-attention) hard-depends on cross_attn_norm=True. Constructing the block with cross_attn_norm disabled leaves required norm modules unbuildable, so init fails fast.

Source

Thrown at python/sglang/multimodal_gen/runtime/models/dits/lingbot_world.py:422

        self.attn1 = USPAttention(
            num_heads=self.local_num_heads,
            head_size=self.dim_head,
            causal=False,
            supported_attention_backends=supported_attention_backends,
            prefix=add_prefix("attn1", prefix),
            quant_config=quant_config,
            is_cross_attention=False,
        )
        if qk_norm == "rms_norm":
            self.norm_q = RMSNorm(self.dim_head, eps=eps)
            self.norm_k = RMSNorm(self.dim_head, eps=eps)
        elif qk_norm == "rms_norm_across_heads":
            self.norm_q = RMSNorm(dim, eps=eps)
            self.norm_k = RMSNorm(dim, eps=eps)
        else:
            raise ValueError(f"Unsupported qk_norm: {qk_norm}")
        if not cross_attn_norm:
            raise ValueError("LingBotWorld requires cross_attn_norm=True")
        self.self_attn_residual_norm = ScaleResidualLayerNormScaleShift(
            dim,
            eps=eps,
            elementwise_affine=True,
            dtype=torch.float32,
        )

        cross_attn_backends = {
            b for b in supported_attention_backends if not b.is_sparse
        }
        if added_kv_proj_dim is not None:
            self.attn2 = WanI2VCrossAttention(
                dim,
                num_heads,
                qk_norm=qk_norm,
                eps=eps,
                prefix=add_prefix("attn2", prefix),
                supported_attention_backends=cross_attn_backends,

View on GitHub (pinned to 0132848349)

Solutions

  1. Set cross_attn_norm=True for LingBotWorld blocks
  2. If you intentionally need no cross-attention norm, subclass and replace the ScaleResidual... plumbing rather than flipping the flag
  3. Check the model's reference config shipped with the checkpoint

Example fix

// before
block = LingBotWorldAttention(..., cross_attn_norm=False)

// after
block = LingBotWorldAttention(..., cross_attn_norm=True)
Defensive patterns

Strategy: validation

Validate before calling

assert cross_attn_norm is True, 'LingBotWorld requires cross_attn_norm=True'

Prevention

When it happens

Trigger: Passing cross_attn_norm=False (or omitting it if the default is falsy) when instantiating the LingBotWorld attention block.

Common situations: Reusing a generic Wan-style block constructor with flags copied from a non-LingBot model; toggling flags during architecture experiments; config defaults from a different family.

Related errors


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