{"record":{"id":"7ce8066fb9ef5a73","repo":"unslothai/unsloth","slug":"unsupported-activation-rotation-kind-r-this-bui","errorCode":null,"errorMessage":"unsupported activation rotation {kind!r} (this build implements {CONVROT_KIND!r})","messagePattern":"unsupported activation rotation (.+?) \\(this build implements (.+?)\\)","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"studio/backend/core/inference/diffusion_convrot.py","lineNumber":344,"sourceCode":"    logger: Any = None,\n) -> tuple[str, ...]:\n    \"\"\"ONLINE half: install the input rotation on exactly the fqns ``metadata`` records.\n\n    Returns the fqns rotated, or ``()`` when ``metadata`` declares no rotation -- the plain\n    artifacts, which have to be left exactly as they are. RAISES on any other outcome: an\n    unusable contract, an fqn this model does not have, a target that is not a Linear, an\n    ``in_features`` the recorded group does not divide, or a Linear already rotated. The prequant\n    loader turns a raise into a refused checkpoint and a dense fallback.\n\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\")","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/diffusion_convrot.py#L326-L362","documentation":"At load time, apply_activation_rotation read a rotation 'kind' from checkpoint metadata that this build does not implement (only CONVROT_KIND is supported). The checkpoint was produced by a builder using a different rotation scheme, so this build refuses rather than applying a rotation it cannot undo or verify.","triggerScenarios":"Loading a checkpoint whose metadata records rotation kind != CONVROT_KIND (e.g. a future/other scheme like a learned rotation); the prequant loader's rotation_metadata_error surfaces it and apply_activation_rotation re-raises. The prequant loader turns the raise into a refused checkpoint and dense fallback.","commonSituations":"Checkpoint built by a newer or differently-configured build of the studio; hand-edited safetensors metadata; mixing checkpoints across versions after a rotation-scheme change.","solutions":["Rebuild/re-export the checkpoint with this build so the metadata records the implemented CONVROT_KIND","Or strip the rotation metadata and use a dense (unrotated) checkpoint","Keep builder and loader on the same code version when producing rotated checkpoints","Catch the refusal and fall back to the dense model path rather than retrying the load"],"exampleFix":"# before\n# checkpoint metadata: {\"rotation_kind\": \"learned_r\"}\napply_activation_rotation(transformer, metadata)\n\n# after\n# rebuild with the shipped builder so metadata records:\n# {\"rotation_kind\": \"convrot\", \"rotation_group\": 64, \"rotation_fqns\": [...]}\napply_activation_rotation(transformer, metadata)","handlingStrategy":"fallback","validationCode":"from studio.backend.core.inference.diffusion_convrot import CONVROT_KIND, declares_rotation, rotation_metadata_error\n\ndef rotation_supported(metadata) -> bool:\n    if not declares_rotation(metadata):\n        return True\n    return metadata.get(ROTATION_KIND_KEY) == CONVROT_KIND and not rotation_metadata_error(metadata)","typeGuard":null,"tryCatchPattern":"try:\n    apply_activation_rotation(transformer, metadata)\nexcept ValueError as e:\n    logger.warning(\"refusing rotated checkpoint (%s); falling back to dense\", e)\n    transformer = load_dense_checkpoint()  # the prequant loader's documented fallback","preventionTips":["Build and load rotated checkpoints with the same build version","Treat an unknown rotation kind as a hard refusal — never apply a scheme this build cannot undo","Keep a dense export alongside rotated ones for cross-version loads"],"tags":["convrot","checkpoint-mismatch","version-skew","quantization"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}