pyro-ppl/pyro

[FR] Support Automatic Mixed Precision training

Open

#3316 aperta il 31 gen 2024

Vedi su GitHub
 (7 commenti) (0 reazioni) (0 assegnatari)Python (981 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (8211 star)
Metriche merge PR
 (Merge medio 10g 19h) (1 PR mergiata in 30 g)

Descrizione

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.

Guida contributor