microsoft/VibeVoice · error · ValueError

Unsupported norm type: {layernorm}

Error message

Unsupported norm type: {layernorm}

What it means

When building the tokenizer encoder stack (modular_vibevoice_tokenizer.py:740), the normalization class is chosen from the config's layernorm field: 'LN' -> ConvLayerNorm, 'RMSNorm' -> ConvRMSNorm; any other string raises ValueError. This guards the norm-type dispatch before any layers are constructed.

Source

Thrown at vibevoice/modular/modular_vibevoice_tokenizer.py:740

        norm = getattr(config, "norm", "none")
        norm_params = getattr(config, "norm_params", {})
        pad_mode = getattr(config, "pad_mode", "reflect")
        bias = getattr(config, "bias", True)
        layernorm = getattr(config, "layernorm", "LN")
        layernorm_eps = getattr(config, "layernorm_eps", 1e-6)
        layernorm_elementwise_affine = getattr(config, "layernorm_elementwise_affine", True)
        drop_path_rate = getattr(config, "drop_path_rate", 0.0)
        mixer_layer = getattr(config, "mixer_layer", "conv")
        layer_scale_init_value = getattr(config, "layer_scale_init_value", 0)
        disable_last_norm = getattr(config, "disable_last_norm", False)
        
        # determine the norm type based on layernorm
        if layernorm == 'LN':
            norm_type = ConvLayerNorm
        elif layernorm == 'RMSNorm':
            norm_type = partial(ConvRMSNorm, elementwise_affine=layernorm_elementwise_affine)
        else:
            raise ValueError(f"Unsupported norm type: {layernorm}")
        
        # stem and intermediate downsampling conv layers
        stem = nn.Sequential(
                SConv1d(self.channels, self.n_filters, kernel_size, norm=norm, norm_kwargs=norm_params, causal=self.causal, pad_mode=pad_mode, bias=bias),
            )
        
        self.downsample_layers = nn.ModuleList()
        self.downsample_layers.append(stem)
        for i in range(len(self.ratios)):
            in_ch = self.n_filters * (2 ** i)
            out_ch = self.n_filters * (2 ** (i + 1))
            downsample_layer = nn.Sequential(
                SConv1d(in_ch, out_ch, kernel_size=self.ratios[i] * 2, stride=self.ratios[i], causal=self.causal, pad_mode=pad_mode, norm=norm, bias=bias)
            )
            self.downsample_layers.append(downsample_layer)

        # configure the transformer blocks
        layer_type = partial(

View on GitHub (pinned to 94da20d98b)

Solutions

  1. Set layernorm to 'LN' or 'RMSNorm' (exact casing) in the tokenizer config.
  2. Normalize incoming values: map 'ln'->'LN', 'rmsnorm'->'RMSNorm' before construction.
  3. Prefer loading the config shipped with the checkpoint rather than editing it.
  4. Validate at config-load time: assert layernorm in {'LN','RMSNorm'} with a helpful message.

Example fix

# before
cfg["layernorm"] = "ln"  # -> ValueError: Unsupported norm type: ln

# after
cfg["layernorm"] = "LN"  # exact supported value
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_NORMS = {"LN", "RMSNorm"}
ln = getattr(config, "layernorm", "LN")
assert ln in SUPPORTED_NORMS, f"layernorm must be one of {SUPPORTED_NORMS}, got {ln!r}"

Type guard

def is_supported_layernorm(v: object) -> bool:
    return v in ("LN", "RMSNorm")

Prevention

When it happens

Trigger: Loading/creating a tokenizer config with layernorm set to anything besides exactly 'LN' or 'RMSNorm' — e.g. 'ln', 'layernorm', 'rms', or an empty string.

Common situations: Hand-written or converted config JSON using lowercase names; configs from a fork that renamed the field values; casing drift when merging configs programmatically.

Related errors


AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15). Data as JSON: /api/errors/c277e05b6f6ffdfb. Report an issue: GitHub.