{"record":{"id":"d98f35bfcd38e668","repo":"google-research/timesfm","slug":"layer-norm-config-feedforward-norm-not-supporte-d98f35","errorCode":null,"errorMessage":"Layer norm: {config.feedforward_norm} not supported.","messagePattern":"Layer norm: (.+?) not supported\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/timesfm/torch/transformer.py","lineNumber":333,"sourceCode":"      self.pre_attn_ln = RMSNorm(num_features=config.model_dims)\n      self.post_attn_ln = RMSNorm(num_features=config.model_dims)\n    else:\n      raise ValueError(f\"Layer norm: {config.attention_norm} not supported.\")\n\n    self.attn = MultiHeadAttention(\n      num_heads=config.num_heads,\n      in_features=config.model_dims,\n      use_per_dim_scale=True,\n      use_rotary_position_embeddings=config.use_rotary_position_embeddings,\n      qk_norm=config.qk_norm,\n      fuse_qkv=config.fuse_qkv,\n    )\n\n    if config.feedforward_norm == \"rms\":\n      self.pre_ff_ln = RMSNorm(num_features=config.model_dims)\n      self.post_ff_ln = RMSNorm(num_features=config.model_dims)\n    else:\n      raise ValueError(f\"Layer norm: {config.feedforward_norm} not supported.\")\n\n    self.ff0 = nn.Linear(\n      in_features=config.model_dims,\n      out_features=config.hidden_dims,\n      bias=config.use_bias,\n    )\n    self.ff1 = nn.Linear(\n      in_features=config.hidden_dims,\n      out_features=config.model_dims,\n      bias=config.use_bias,\n    )\n    if config.ff_activation == \"relu\":\n      self.activation = nn.ReLU()\n    elif config.ff_activation == \"swish\":\n      self.activation = nn.SiLU()\n    elif config.ff_activation == \"none\":\n      self.activation = nn.Identity()\n    else:","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/google-research/timesfm/blob/331c6d33cb1ac2611de3056d0ac7164aab6301eb/src/timesfm/torch/transformer.py#L315-L351","documentation":"The feedforward sublayer normalization in the Torch transformer only accepts \"rms\". Any other config.feedforward_norm value causes __init__ to raise this ValueError because only RMSNorm pre/post FF layers are implemented.","triggerScenarios":"Building the Torch transformer block with config.feedforward_norm not equal to \"rms\" (e.g. \"layer\", \"layernorm\", None, or a typo like \"RMS\").","commonSituations":"Same as attention_norm errors: configs copied from other architectures, manual config edits, case-sensitive typos like \"RMS\" instead of \"rms\".","solutions":["Set config.feedforward_norm = \"rms\" in the config.","Check spelling/casing in a hand-edited config file (comparison is case-sensitive).","Add an nn.LayerNorm branch in src/timesfm/torch/transformer.py __init__ if another norm is genuinely needed."],"exampleFix":"// before\nconfig.feedforward_norm = \"layernorm\"\n// after\nconfig.feedforward_norm = \"rms\"","handlingStrategy":"validation","validationCode":"if config.feedforward_norm != \"rms\":\n    raise ValueError(f\"feedforward_norm must be 'rms', got {config.feedforward_norm!r}\")","typeGuard":"def has_valid_ff_norm(config) -> bool:\n    return getattr(config, \"feedforward_norm\", None) == \"rms\"","tryCatchPattern":"try:\n    model = TimesFmTorch(config)\nexcept ValueError as e:\n    if \"feedforward_norm\" in str(e):\n        config.feedforward_norm = \"rms\"\n        model = TimesFmTorch(config)\n    else:\n        raise","preventionTips":["Pin config values to the library's supported set","Add a config sanity-check helper in your project","Beware of copying norms from non-TimesFM configs"],"tags":["python","configuration","valueerror"],"backgroundTag":"unsupported-config-value","analyzedSha":"331c6d33cb1ac2611de3056d0ac7164aab6301eb","analyzedAt":"2026-08-29T01:04:23.138Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}