maskbit icon indicating copy to clipboard operation
maskbit copied to clipboard

16bit mixed precision & bf16

Open Psarpei opened this issue 1 year ago • 2 comments

What is your experience with lower precisions like mixed fp16 or bf16 ? Does this affect the perfomance drastically?

Psarpei avatar Jan 05 '25 14:01 Psarpei

I didn't experiment with fp16/bf16 a lot in the final stages of this project, so I can't really say.

Instead we use is TF32, which is 19bit I think. You can read more on this here: https://blogs.nvidia.com/blog/tensorfloat-32-precision-format/

It is enabled in our codecase as follows:

# Enable TF32 on Ampere GPUs
if config.training.enable_tf32:
    torch.backends.cuda.matmul.allow_tf32 = True
    torch.backends.cudnn.benchmark = True
    torch.backends.cudnn.deterministic = False

markweberdev avatar Jan 05 '25 21:01 markweberdev

okay thanks!

Psarpei avatar Jan 05 '25 22:01 Psarpei