sgl-project/sglang · error · ValueError

SANA-WM plucker_embedder is not initialized.

Error message

SANA-WM plucker_embedder is not initialized.

What it means

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.

Source

Thrown at python/sglang/multimodal_gen/runtime/models/dits/sana_wm.py:579

        raymats = process_camera_conditions_ucpe(
            camera_conditions,
            HW=HW,
            patch_size=self.patch_size,
        )
        raymats_flat = raymats.reshape(camera_conditions.shape[0], -1, 4, 4)
        prope_fns = _build_ucpe_apply_fns(head_dim, raymats_flat, freqs)
        self._ucpe_apply_fns_cache = (key, camera_conditions, prope_fns)
        return prope_fns

    def _get_plucker_emb(
        self,
        chunk_plucker: torch.Tensor,
        *,
        latent_token_count: int,
    ) -> torch.Tensor:
        if self.plucker_embedder is None:
            raise ValueError("SANA-WM plucker_embedder is not initialized.")

        weight = self.plucker_embedder.proj.weight
        bias = self.plucker_embedder.proj.bias
        key = (
            "plucker_emb",
            latent_token_count,
            self.patch_size,
            _tensor_cache_key(chunk_plucker),
            _tensor_cache_key(weight),
            None if bias is None else _tensor_cache_key(bias),
        )
        if not torch.is_grad_enabled():
            cached = self._plucker_emb_cache
            if cached is not None and cached[0] == key:
                return cached[2]

        plucker_emb = self.plucker_embedder(chunk_plucker.to(weight.dtype))
        if plucker_emb.shape[1] != latent_token_count:

View on GitHub (pinned to 0132848349)

Solutions

  1. Build the model with plucker/camera conditioning enabled so plucker_embedder is constructed
  2. If camera conditioning is not needed, avoid passing chunk_plucker / camera inputs that trigger _get_plucker_emb
  3. Verify checkpoint weights include plucker_embedder.proj

Example fix

# before: built with enable_plucker=False
cfg.enable_plucker = False
model = SanaWM(cfg)
out = model.forward_long(..., chunk_plucker=plk)
# after
cfg.enable_plucker = True
model = SanaWM(cfg)
out = model.forward_long(..., chunk_plucker=plk)
Defensive patterns

Strategy: validation

Validate before calling

if chunk_plucker is not None:
    assert model.plucker_embedder is not None, "build model with plucker conditioning enabled"

Type guard

def has_plucker_embedder(model) -> bool:
    return getattr(model, "plucker_embedder", None) is not None

Prevention

When it happens

Trigger: Instantiating SANA-WM without camera conditioning enabled (plucker_embedder left None) but then calling a path that requests plucker embeddings from chunk_plucker.

Common situations: Loading a camera-conditioning-free checkpoint then feeding camera latents/plucker chunks; config flag mismatch (camera branch disabled in init but enabled at runtime).

Related errors


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