Skip to content

load and train with bf16,saved torch_dtype is float32 #30305

@gyangfan

Description

@gyangfan

System Info

  • transformers version: 4.39.3
  • Platform: Linux-3.10.0-1160.102.1.el7.x86_64-x86_64-with-glibc2.17
  • Python version: 3.9.1
  • Huggingface_hub version: 0.22.2
  • Safetensors version: 0.4.2
  • Accelerate version: 0.29.2
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.2.2+cu121 (True)

load a bf16 model then train with --bf16 and log show [Using auto half precision backend], the final saved model parameter torch_dtype in config.json is float32
1、why saved float32?
2、how do i load the trained model?if load with float32,Can I get a better output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions