LLM Laboratory

Date: 05.01.2026

PyTorch dtype compatibility — quick cheat sheet

The table below shows, dtype in API that we can use in torch_dtype=... for PyTorch versions

Floating-point dtype

PyTorch version Supported dtype
≥ 1.1 torch.float16 (torch.half)
torch.float32 (torch.float)
torch.float64 (torch.double)
≥ 1.6 torch.float16 (torch.half)
torch.float32 (torch.float)
torch.float64 (torch.double)
torch.bfloat16
≥ 2.2 torch.float16 (torch.half)
torch.float32 (torch.float)
torch.float64 (torch.double)
torch.bfloat16
torch.float8_e4m3fn
torch.float8_e5m2
≥ 2.9 torch.float16 (torch.half)
torch.float32 (torch.float)
torch.float64 (torch.double)
torch.bfloat16
torch.float8_e4m3fn
torch.float8_e5m2
torch.float8_e4m3fnuz
torch.float8_e5m2fnuz
torch.float8_e8m0fnu
torch.float4_e2m1fn_x2