{"record":{"id":"1cec256197545451","repo":"sgl-project/sglang","slug":"chunk-plucker-shape-mismatch-for-sana-wm-expected","errorCode":null,"errorMessage":"chunk_plucker shape mismatch for SANA-WM: expected {expected_chunk_shape}, got {tuple(chunk_plucker.shape)}.","messagePattern":"chunk_plucker shape mismatch for SANA-WM: expected (.+?), got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/base.py","lineNumber":2141,"sourceCode":"            ).to(device=device, dtype=dtype)\n            if chunk_plucker.dim() == 4:\n                chunk_plucker = chunk_plucker.unsqueeze(0)\n            if chunk_plucker.shape[0] == 1 and batch_size > 1:\n                chunk_plucker = chunk_plucker.expand(batch_size, -1, -1, -1, -1)\n            if chunk_plucker.dim() != 5:\n                raise ValueError(\n                    \"chunk_plucker must have shape (48,T,H,W) or \"\n                    f\"(B,48,T,H,W), got {tuple(chunk_plucker.shape)}\"\n                )\n            if chunk_plucker.shape[0] != batch_size:\n                raise ValueError(\n                    \"chunk_plucker batch dimension must be 1 or match \"\n                    f\"request batch size {batch_size}, got \"\n                    f\"{chunk_plucker.shape[0]}.\"\n                )\n            expected_chunk_shape = (batch_size, 48, T_lat, sp_h, sp_w)\n            if tuple(chunk_plucker.shape) != expected_chunk_shape:\n                raise ValueError(\n                    \"chunk_plucker shape mismatch for SANA-WM: expected \"\n                    f\"{expected_chunk_shape}, got {tuple(chunk_plucker.shape)}.\"\n                )\n\n        if camera_conditions is not None:\n            camera_conditions = camera_conditions.to(device=device, dtype=dtype)\n\n        return camera_conditions, chunk_plucker, source\n\n    def _prepare_timesteps(\n        self,\n        batch: Req,\n        server_args: ServerArgs,\n        device: torch.device,\n    ):\n        \"\"\"Set up scheduler timesteps and populate batch.timesteps, .sigmas.\"\"\"\n        scheduler = get_or_create_request_scheduler(batch, self.scheduler)\n        num_inference_steps = batch.num_inference_steps","sourceCodeStart":2123,"sourceCodeEnd":2159,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/base.py#L2123-L2159","documentation":"chunk_plucker must exactly equal (batch_size, 48, T_lat, sp_h, sp_w) where T_lat is the latent frame count and sp_h/sp_w the spatial latent resolution. Mismatched temporal or spatial extents raise this error.","triggerScenarios":"Passing plücker rays computed at the pixel resolution or original frame rate (H,W,T instead of sp_h,sp_w,T_lat), or with H/W swapped.","commonSituations":"Porting precomputed diffusers ray maps that were not downsampled to the latent grid, or aspect-ratio changes between generation settings and the cached tensor.","solutions":["Recompute chunk_plucker at latent resolution: T = T_lat frames, H = sp_h, W = sp_w spatial dims.","Or pass original-frame camera_conditions so SGLang resamples plücker correctly for the current latent shape.","Check for swapped H/W when exporting from a different convention."],"exampleFix":"# before\nstage.forward(..., diffusers_kwargs={'camera_conditions': pre, 'chunk_plucker': full_res_plucker})\n# after\nstage.forward(..., diffusers_kwargs={'camera_conditions': original_frame_cond})  # derive plücker at latent res","handlingStrategy":"validation","validationCode":"expected = (batch_size, 48, T_lat, sp_h, sp_w)\nassert tuple(chunk_plucker.shape) == expected, (tuple(chunk_plucker.shape), expected)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute expected latent shape from the same config used for generation.","Let SGLang derive plücker from camera_conditions unless you have an exact-match cached tensor."],"tags":["sglang","sana-wm","chunk-plucker","latent-resolution","shape-mismatch"],"backgroundTag":"tensor-shape-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}