{"record":{"id":"215ec030e96076e3","repo":"sgl-project/sglang","slug":"sana-wm-plucker-embedder-is-not-initialized","errorCode":null,"errorMessage":"SANA-WM plucker_embedder is not initialized.","messagePattern":"SANA-WM plucker_embedder is not initialized\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/dits/sana_wm.py","lineNumber":579,"sourceCode":"\n        raymats = process_camera_conditions_ucpe(\n            camera_conditions,\n            HW=HW,\n            patch_size=self.patch_size,\n        )\n        raymats_flat = raymats.reshape(camera_conditions.shape[0], -1, 4, 4)\n        prope_fns = _build_ucpe_apply_fns(head_dim, raymats_flat, freqs)\n        self._ucpe_apply_fns_cache = (key, camera_conditions, prope_fns)\n        return prope_fns\n\n    def _get_plucker_emb(\n        self,\n        chunk_plucker: torch.Tensor,\n        *,\n        latent_token_count: int,\n    ) -> torch.Tensor:\n        if self.plucker_embedder is None:\n            raise ValueError(\"SANA-WM plucker_embedder is not initialized.\")\n\n        weight = self.plucker_embedder.proj.weight\n        bias = self.plucker_embedder.proj.bias\n        key = (\n            \"plucker_emb\",\n            latent_token_count,\n            self.patch_size,\n            _tensor_cache_key(chunk_plucker),\n            _tensor_cache_key(weight),\n            None if bias is None else _tensor_cache_key(bias),\n        )\n        if not torch.is_grad_enabled():\n            cached = self._plucker_emb_cache\n            if cached is not None and cached[0] == key:\n                return cached[2]\n\n        plucker_emb = self.plucker_embedder(chunk_plucker.to(weight.dtype))\n        if plucker_emb.shape[1] != latent_token_count:","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/dits/sana_wm.py#L561-L597","documentation":"SANA-WM's _get_plucker_emb requires the plucker_embedder submodule; if it is None (not constructed at init, e.g. config disabled it or checkpoint lacks weights), the Plücker ray embedding cannot be computed and forward/forward_long fail.","triggerScenarios":"Instantiating SANA-WM without camera conditioning enabled (plucker_embedder left None) but then calling a path that requests plucker embeddings from chunk_plucker.","commonSituations":"Loading a camera-conditioning-free checkpoint then feeding camera latents/plucker chunks; config flag mismatch (camera branch disabled in init but enabled at runtime).","solutions":["Build the model with plucker/camera conditioning enabled so plucker_embedder is constructed","If camera conditioning is not needed, avoid passing chunk_plucker / camera inputs that trigger _get_plucker_emb","Verify checkpoint weights include plucker_embedder.proj"],"exampleFix":"# before: built with enable_plucker=False\ncfg.enable_plucker = False\nmodel = SanaWM(cfg)\nout = model.forward_long(..., chunk_plucker=plk)\n# after\ncfg.enable_plucker = True\nmodel = SanaWM(cfg)\nout = model.forward_long(..., chunk_plucker=plk)","handlingStrategy":"validation","validationCode":"if chunk_plucker is not None:\n    assert model.plucker_embedder is not None, \"build model with plucker conditioning enabled\"","typeGuard":"def has_plucker_embedder(model) -> bool:\n    return getattr(model, \"plucker_embedder\", None) is not None","tryCatchPattern":null,"preventionTips":["Match init-time conditioning flags with runtime inputs","Verify checkpoint contains plucker_embedder weights before serving"],"tags":["sana-wm","plucker-embedder","camera-conditioning","uninitialized-module"],"backgroundTag":"uninitialized-component","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}