{"record":{"id":"d1e6db13b14eecf3","repo":"sgl-project/sglang","slug":"chunk-plucker-must-have-shape-48-t-h-w-or-b-48","errorCode":null,"errorMessage":"chunk_plucker must have shape (48,T,H,W) or (B,48,T,H,W), got {tuple(chunk_plucker.shape)}","messagePattern":"chunk_plucker must have shape \\(48,T,H,W\\) or \\(B,48,T,H,W\\), 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":2129,"sourceCode":"                chunk_plucker = compute_chunk_plucker(\n                    camera_conditions=original_camera_conditions,\n                    HW=(T_lat, sp_h, sp_w),\n                    vae_temporal_stride=vae_temporal_stride,\n                    patch_size=(1, 1, 1),\n                )\n\n        if chunk_plucker is not None:\n            chunk_plucker = (\n                chunk_plucker\n                if isinstance(chunk_plucker, torch.Tensor)\n                else torch.as_tensor(chunk_plucker)\n            ).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)","sourceCodeStart":2111,"sourceCodeEnd":2147,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/base.py#L2111-L2147","documentation":"chunk_plucker (precomputed plücker ray embeddings) must be a 4-D (48,T,H,W) or 5-D (B,48,T,H,W) tensor. After unsqueezing 4-D input, any rank other than 5 raises this error.","triggerScenarios":"Passing an unbatched 3-D ray map, a per-pixel 6-D layout, or extra leading dims to diffusers_kwargs['chunk_plucker'].","commonSituations":"Exporting plücker coordinates from diffusers in an older layout, or stacking tensors along the wrong axis so the channel dim is not first.","solutions":["Reshape to (48,T,H,W); add a leading batch dim only if you need per-request rays: (B,48,T,H,W).","Verify the channel dim is 48 (two 24-chunk plücker groups) and it is dim 0.","If you only have cameras, pass camera_conditions/camera_to_world and let the stage compute plücker."],"exampleFix":"# before\nplucker = plucker.permute(1,0,2,3)  # (T,48,H,W)\n# after\nplucker = plucker.permute(1,0,2,3).unsqueeze(0)  # (1,48,T,H,W)","handlingStrategy":"validation","validationCode":"assert chunk_plucker.dim() in (4, 5), tuple(chunk_plucker.shape)\nif chunk_plucker.dim() == 4:\n    chunk_plucker = chunk_plucker.unsqueeze(0)","typeGuard":"def is_valid_chunk_plucker(t) -> bool:\n    return isinstance(t, torch.Tensor) and t.dim() in (4,5) and (t.shape[-4] == 48)","tryCatchPattern":null,"preventionTips":["Validate exported plücker tensors once at export time, not per request."],"tags":["sglang","sana-wm","chunk-plucker","tensor-rank","shape-validation"],"backgroundTag":"tensor-shape-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}