Skip to content

AutoProcessor import fails with NVIDIA torch 2.7 missing torch.float8_e8m0fnu #46389

@doctorpangloss

Description

@doctorpangloss

System Info

  • transformers: 5.10.1
  • torch: 2.7.0a0+7c8ec84dab.nv25.03
  • Python: 3.12
  • CUDA runner: CUDA 12.8.1.012 / NVIDIA driver 580.126.09

Transformers metadata still lists torch>=2.4 for the torch/testing extras.

Reproduction

In an environment with transformers==5.10.1 and NVIDIA torch 2.7.0a0+7c8ec84dab.nv25.03:

import torch
print(torch.__version__)
print(hasattr(torch, "float8_e8m0fnu"))

from transformers import AutoProcessor

Result:

2.7.0a0+7c8ec84dab.nv25.03
False
AttributeError: module 'torch' has no attribute 'float8_e8m0fnu'

Full import path from the traceback:

from transformers import AutoProcessor
transformers/models/auto/processing_auto.py
transformers/image_processing_utils.py
transformers/processing_utils.py
transformers/modeling_utils.py
transformers/integrations/finegrained_fp8.py: _UE8M0_SF_DTYPE = torch.float8_e8m0fnu

I also checked the public PyTorch CPU torch==2.7.0 wheel and it has this dtype, so the failing case is the NVIDIA torch 2.7 build used by the CUDA runner.

Expected behavior

Importing AutoProcessor should not fail just because this optional finegrained FP8 dtype is missing. Either guard this dtype access/import until the FP8 integration is used, or require a torch version/build that provides torch.float8_e8m0fnu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions