{"record":{"id":"cf49d7e0cd32f15c","repo":"huggingface/transformers","slug":"scale-fmt-ue8m0-requires-torch-float8-e8m0fnu-w","errorCode":null,"errorMessage":"scale_fmt='ue8m0' requires torch.float8_e8m0fnu, which is only available in PyTorch >= 2.7 (found {torch.__version__}). Upgrade torch to use UE8M0 FP8 checkpoints.","messagePattern":"scale_fmt='ue8m0' requires torch\\.float8_e8m0fnu, which is only available in PyTorch >= 2\\.7 \\(found (.+?)\\)\\. Upgrade torch to use UE8M0 FP8 checkpoints\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/transformers/integrations/finegrained_fp8.py","lineNumber":59,"sourceCode":"\n\nlogger = logging.get_logger(__name__)\n\n\n_FP8_DTYPE = torch.float8_e4m3fn\n_FP8_MIN = torch.finfo(_FP8_DTYPE).min\n_FP8_MAX = torch.finfo(_FP8_DTYPE).max\n\n\n@functools.cache\ndef _get_ue8m0_dtype() -> torch.dtype:\n    \"\"\"Return ``torch.float8_e8m0fnu`` or raise a clear error on torch without FP8 support.\n\n    UE8M0 scales are always stored/consumed as this single dtype — the kernels (Triton\n    finegrained + DeepGEMM) read it natively, and supporting the same scales in mixed\n    container dtypes would be a mess — so fail loudly rather than fall back.\"\"\"\n    if not hasattr(torch, \"float8_e8m0fnu\"):\n        raise RuntimeError(\n            \"scale_fmt='ue8m0' requires torch.float8_e8m0fnu, which is only available in \"\n            f\"PyTorch >= 2.7 (found {torch.__version__}). Upgrade torch to use UE8M0 FP8 checkpoints.\"\n        )\n    return torch.float8_e8m0fnu\n\n\ndef _first_attr(obj, *names):\n    for name in names:\n        if hasattr(obj, name):\n            return getattr(obj, name)\n    raise AttributeError(f\"{type(obj).__name__} has none of: {names}\")\n\n\n@dataclass(frozen=True)\nclass FineGrainedFP8:\n    \"\"\"Entry points exposed by the `kernels-community/finegrained-fp8` Triton kernel.\"\"\"\n\n    matmul: Callable","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/integrations/finegrained_fp8.py#L41-L77","documentation":"Error \"scale_fmt='ue8m0' requires torch.float8_e8m0fnu, which is only available in PyTorch >= 2.7 (found {torch.__version__}). Upgrade torch to use UE8M0 FP8 checkpoints.\" thrown in huggingface/transformers.","triggerScenarios":"Raised in finegrained FP8 integration when scale_fmt='ue8m0' is used with PyTorch < 2.7 lacking float8_e8m0fnu.","commonSituations":"Loading a UE8M0 FP8 checkpoint on an older torch version without the e8m0 dtype.","solutions":["Upgrade PyTorch to >= 2.7 to get torch.float8_e8m0fnu.","Use a checkpoint with scale_fmt='float' instead of 'ue8m0'."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}