pyro-ppl/pyro

[FR] Support Automatic Mixed Precision training

Open

#3,316 opened on 2024年1月31日

GitHub で見る
 (7 comments) (0 reactions) (0 assignees)Python (981 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (8,211 stars)
PR merge metrics
 (平均マージ 10d 19h) (30d で 1 merged PR)

説明

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.

コントリビューターガイド