pyro-ppl/pyro

[FR] Support Automatic Mixed Precision training

Aberta

#3.316 aberto em 31 de jan. de 2024

 (7 comentários) (0 reação) (0 responsável)Python (981 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (8.211 estrelas)
Métricas de merge de PR
 (Mesclagem média 10d 19h) (1 fundiu PR em 30d)

Description

Issue Description

Better support for mixed precision training would be extremely helpful, at least for SVI. I can manually cast data into float16 or bfloat16 but I am unable to leverage PyTorch's automatic mixed precision training. This is because it requires the use of the GradScaler class during the optimization loop to properly scale gradients in a mixed-precision-aware manner. See the documentation for more info: https://pytorch.org/docs/stable/amp.html

It would be nice to have support for using this class within pyro optimizers to allow for amp support.

Guia do colaborador