{"record":{"id":"005837736d141527","repo":"unslothai/unsloth","slug":"activation-rotation-names-len-missing-fqn-s-th","errorCode":null,"errorMessage":"activation rotation names {len(missing)} fqn(s) this model does not have (e.g. {missing[0]!r}); the checkpoint and this build disagree about the model","messagePattern":"activation rotation names (.+?) fqn\\(s\\) this model does not have \\(e\\.g\\. (.+?)\\); the checkpoint and this build disagree about the model","errorType":"exception","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"studio/backend/core/inference/diffusion_convrot.py","lineNumber":353,"sourceCode":"\n    Call AFTER ``load_state_dict`` and BEFORE ``apply_small_m_padding``: after, because the meta\n    retry path rebuilds the module from the config and would discard an earlier swap; before,\n    because padding reparents the Linears under a wrapper while the recorded fqns name the\n    unwrapped tree.\"\"\"\n    if not declares_rotation(metadata):\n        return ()\n    problem = rotation_metadata_error(metadata)\n    if problem:\n        raise ValueError(problem)\n\n    from torch import nn\n\n    group_size = int(metadata[ROTATION_GROUP_KEY])\n    fqns = list(metadata[ROTATION_FQNS_KEY])\n    modules = dict(transformer.named_modules())\n    missing = [fqn for fqn in fqns if fqn not in modules]\n    if missing:\n        raise ValueError(\n            f\"activation rotation names {len(missing)} fqn(s) this model does not have \"\n            f\"(e.g. {missing[0]!r}); the checkpoint and this build disagree about the model\"\n        )\n    for fqn in fqns:\n        module = modules[fqn]\n        if not isinstance(module, nn.Linear):\n            raise ValueError(f\"activation rotation target {fqn!r} is not an nn.Linear\")\n        if is_rotated_linear(module):\n            raise ValueError(f\"activation rotation target {fqn!r} is already rotated\")\n        if module.in_features % group_size:\n            raise ValueError(\n                f\"activation rotation target {fqn!r} has in_features {module.in_features}, \"\n                f\"which the recorded group {group_size} does not divide\"\n            )\n    # Every target is validated before ANY is swapped. A partial install is the one outcome worse\n    # than either end state: the rotated half still renders, just wrongly, so there is nothing to\n    # notice and nothing to fall back from.\n    for fqn in fqns:","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/diffusion_convrot.py#L335-L371","documentation":"The checkpoint's rotation metadata lists fqns that do not exist in the loaded model's module tree. The checkpoint and this build disagree about the architecture (renamed, added, or removed layers), so the recorded rotation set cannot be installed.","triggerScenarios":"Loading a rotated checkpoint onto a model whose named_modules() lacks one or more recorded fqns — e.g. an architecture revision that renamed projections, or loading the rotation metadata against a different base model.","commonSituations":"Base model weights updated to a new architecture revision while the rotation metadata stayed from the old one; loading a checkpoint fine-tuned from a variant with different layer naming; version skew between the build that rotated and the build that loads.","solutions":["Re-match base model and checkpoint: both must come from the same architecture revision","Re-run the offline rotation on the current model to regenerate matching metadata","Fall back to the dense (unrotated) checkpoint — the prequant loader already converts this raise into a refused checkpoint plus dense fallback","Verify with set(metadata[ROTATION_FQNS_KEY]) <= set(dict(transformer.named_modules())) before loading"],"exampleFix":"# before\napply_activation_rotation(transformer, metadata)  # metadata names 'layers.31.mlp.up'\n\n# after\nlive = set(dict(transformer.named_modules()))\nrecorded = set(metadata[ROTATION_FQNS_KEY])\nassert recorded <= live, f\"checkpoint/model mismatch: {sorted(recorded - live)}\"\napply_activation_rotation(transformer, metadata)","handlingStrategy":"validation","validationCode":"def rotation_fqns_present(transformer, metadata) -> bool:\n    live = set(dict(transformer.named_modules()))\n    return set(metadata[ROTATION_FQNS_KEY]) <= live","typeGuard":null,"tryCatchPattern":"try:\n    apply_activation_rotation(transformer, metadata)\nexcept ValueError as e:\n    if \"does not have\" in str(e):\n        return load_dense_fallback(metadata)  # checkpoint/model mismatch: refuse + dense\n    raise","preventionTips":["Pin base-model revision when producing rotated checkpoints; record it in metadata","Validate fqns against named_modules() before load in the prequant loader","Never ignore a missing fqn — a partially rotated model renders wrong with no visible failure"],"tags":["convrot","checkpoint-mismatch","fqn","quantization"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}