hpcaitech/Open-Sora · error · ValueError

context_module {context_module} is not supported

Error message

context_module {context_module} is not supported

What it means

EfficientViTBlock's constructor only supports specific context_module names (the recognized lightweight attention/context variants); an unrecognized string raises this ValueError at model build time. This is a config-vocabulary error in the dc_ae architecture definition.

Source

Thrown at opensora/models/dc_ae/models/nn/ops.py:855

        local_module: str = "MBConv",
        is_video: bool = False,
    ):
        super().__init__()
        if context_module == "LiteMLA":
            self.context_module = ResidualBlock(
                LiteMLA(
                    in_channels=in_channels,
                    out_channels=in_channels,
                    heads_ratio=heads_ratio,
                    dim=dim,
                    norm=(None, norm),
                    scales=scales,
                    is_video=is_video,
                ),
                IdentityLayer(),
            )
        else:
            raise ValueError(f"context_module {context_module} is not supported")
        if local_module == "MBConv":
            self.local_module = ResidualBlock(
                MBConv(
                    in_channels=in_channels,
                    out_channels=in_channels,
                    expand_ratio=expand_ratio,
                    use_bias=(True, True, False),
                    norm=(None, None, norm),
                    act_func=(act_func, act_func, None),
                    is_video=is_video,
                ),
                IdentityLayer(),
            )
        elif local_module == "GLUMBConv":
            self.local_module = ResidualBlock(
                GLUMBConv(
                    in_channels=in_channels,
                    out_channels=in_channels,

View on GitHub (pinned to 7ad6a96a13)

Solutions

  1. Use a supported context_module name as defined in the branches of EfficientViTBlock.__init__
  2. Instantiate from a shipped DCAE config rather than constructing blocks manually
  3. Match the opensora version to the config's origin
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_CONTEXT = {' LightweightCrossAttention', ...}  # mirror EfficientViTBlock branches
assert context_module in SUPPORTED_CONTEXT, context_module

Prevention

When it happens

Trigger: Setting context_module to an unsupported/misspelled value (e.g. 'SelfAttention', 'ViT', 'cross_attn') in an EViTS5_GLU block config; raised when DCAE builds its stages via build_block.

Common situations: Hand-writing architecture configs or porting block definitions from the EfficientViT repo where names differ.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of hpcaitech/Open-Sora@7ad6a96a13 (2026-08-28). Data as JSON: /api/errors/b3e35b3f68a856fe. Report an issue: GitHub.