{"record":{"id":"b1f3799626e3d660","repo":"huggingface/transformers","slug":"type-obj-name-has-none-of-names","errorCode":null,"errorMessage":"{type(obj).__name__} has none of: {names}","messagePattern":"(.+?) has none of: (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"src/transformers/integrations/finegrained_fp8.py","lineNumber":70,"sourceCode":"def _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\n    batched_matmul: Callable\n    grouped_matmul: Callable\n\n\n# Cache the loaded kernel but not failures: re-checking each call is cheap and intended, since the env\n# can change between attempts. A module global (not `@functools.cache`) avoids Dynamo warning about\n# tracing a cache-wrapped function on every compile.\n_FINEGRAINED_FP8: FineGrainedFP8 | None = None\n\n\n@torch._dynamo.allow_in_graph","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/integrations/finegrained_fp8.py#L52-L88","documentation":"Error \"{type(obj).__name__} has none of: {names}\" thrown in huggingface/transformers.","triggerScenarios":"Raised in finegrained FP8 helpers when an object has none of the expected attribute names.","commonSituations":"Accessing alternate attribute names (e.g. weight_scale vs scale) on a quantized module that defines none of them.","solutions":["Pass an object exposing one of the listed attribute names.","Rename/provide the expected attribute on the object."],"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"}