{"record":{"id":"61d011d790eb019d","repo":"sgl-project/sglang","slug":"lingbotworld-requires-cross-attn-norm-true","errorCode":null,"errorMessage":"LingBotWorld requires cross_attn_norm=True","messagePattern":"LingBotWorld requires cross_attn_norm=True","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/models/dits/lingbot_world.py","lineNumber":422,"sourceCode":"        self.attn1 = USPAttention(\n            num_heads=self.local_num_heads,\n            head_size=self.dim_head,\n            causal=False,\n            supported_attention_backends=supported_attention_backends,\n            prefix=add_prefix(\"attn1\", prefix),\n            quant_config=quant_config,\n            is_cross_attention=False,\n        )\n        if qk_norm == \"rms_norm\":\n            self.norm_q = RMSNorm(self.dim_head, eps=eps)\n            self.norm_k = RMSNorm(self.dim_head, eps=eps)\n        elif qk_norm == \"rms_norm_across_heads\":\n            self.norm_q = RMSNorm(dim, eps=eps)\n            self.norm_k = RMSNorm(dim, eps=eps)\n        else:\n            raise ValueError(f\"Unsupported qk_norm: {qk_norm}\")\n        if not cross_attn_norm:\n            raise ValueError(\"LingBotWorld requires cross_attn_norm=True\")\n        self.self_attn_residual_norm = ScaleResidualLayerNormScaleShift(\n            dim,\n            eps=eps,\n            elementwise_affine=True,\n            dtype=torch.float32,\n        )\n\n        cross_attn_backends = {\n            b for b in supported_attention_backends if not b.is_sparse\n        }\n        if added_kv_proj_dim is not None:\n            self.attn2 = WanI2VCrossAttention(\n                dim,\n                num_heads,\n                qk_norm=qk_norm,\n                eps=eps,\n                prefix=add_prefix(\"attn2\", prefix),\n                supported_attention_backends=cross_attn_backends,","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/dits/lingbot_world.py#L404-L440","documentation":"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.","triggerScenarios":"Passing cross_attn_norm=False (or omitting it if the default is falsy) when instantiating the LingBotWorld attention block.","commonSituations":"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.","solutions":["Set cross_attn_norm=True for LingBotWorld blocks","If you intentionally need no cross-attention norm, subclass and replace the ScaleResidual... plumbing rather than flipping the flag","Check the model's reference config shipped with the checkpoint"],"exampleFix":"// before\nblock = LingBotWorldAttention(..., cross_attn_norm=False)\n\n// after\nblock = LingBotWorldAttention(..., cross_attn_norm=True)","handlingStrategy":"validation","validationCode":"assert cross_attn_norm is True, 'LingBotWorld requires cross_attn_norm=True'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't reuse generic block flags with LingBotWorld","Start from the shipped reference config","Pin config values in a fixture for tests"],"tags":["config-validation","cross-attention","init-time","lingbot"],"backgroundTag":"unsupported-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}