sgl-project/sglang · error · ValueError

Unsupported SANA-WM cam_update_rule: {self.cam_update_rule}

Error message

Unsupported SANA-WM cam_update_rule: {self.cam_update_rule}

What it means

The camera-branch GDN update rule (cam_update_rule) must be 'torch_chunk' or 'torch_recurrent'. This is validated separately from update_rule at block construction.

Source

Thrown at python/sglang/multimodal_gen/runtime/models/dits/sana_wm_components.py:1891

        out_dim = heads * head_dim
        assert (
            out_dim == in_dim
        ), f"in_dim ({in_dim}) must equal heads*head_dim ({out_dim})"
        self.in_dim = in_dim
        self.out_dim = out_dim
        self.heads = heads
        self.dim = head_dim
        self.eps = eps
        self.softmax_main = softmax_main
        self.update_rule = update_rule
        self.cam_update_rule = cam_update_rule
        self.chunk_gdn_chunk_size = chunk_gdn_chunk_size
        self.use_chunked_softmax_attention = use_chunked_softmax_attention
        self.gdn_backend = gdn_backend
        if self.update_rule not in ("torch_chunk", "torch_recurrent"):
            raise ValueError(f"Unsupported SANA-WM update_rule: {self.update_rule}")
        if self.cam_update_rule not in ("torch_chunk", "torch_recurrent"):
            raise ValueError(
                f"Unsupported SANA-WM cam_update_rule: {self.cam_update_rule}"
            )
        if self.gdn_backend not in ("auto", "torch", "triton"):
            raise ValueError(
                "Unsupported SANA-WM gdn_backend: "
                f"{self.gdn_backend}. Expected one of auto, torch, triton."
            )

        # Fused QKV + output proj (proj shared with cam branch).
        self.qkv = nn.Linear(in_dim, 3 * out_dim, bias=False)
        self.proj = nn.Linear(out_dim, out_dim, bias=True)

        if qk_norm:
            self.q_norm = _RMSNorm(in_dim, eps=1e-5)
            self.k_norm = _RMSNorm(in_dim, eps=1e-5)
            self.q_norm_cam = _RMSNorm(in_dim, eps=1e-5)
            self.k_norm_cam = _RMSNorm(in_dim, eps=1e-5)
        else:

View on GitHub (pinned to 0132848349)

Solutions

  1. Set cam_update_rule to 'torch_chunk' or 'torch_recurrent'
  2. To disable the camera branch, omit camera_conditions at forward time rather than hacking cam_update_rule
  3. Validate config enums before model construction

Example fix

# before
GDNBlock(dim, cam_update_rule="recurrent")
# after
GDNBlock(dim, cam_update_rule="torch_recurrent")
Defensive patterns

Strategy: validation

Validate before calling

assert cam_update_rule in ("torch_chunk", "torch_recurrent"), cam_update_rule

Type guard

def valid_cam_update_rule(r: str) -> bool: return r in ("torch_chunk", "torch_recurrent")

Prevention

When it happens

Trigger: Building the SANA-WM GDN block with cam_update_rule set to anything other than the two supported values (e.g. 'none', 'triton', 'recurrent').

Common situations: Config written for the main update_rule copied to cam_update_rule with a shortened name; disabling camera branch by setting cam_update_rule='none' (not supported).

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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