FP16 does not decrease much GPU memory #13252
Answered
by
akihironitta
icoz69
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
hi, I just tried mix precision training with precision=16 set in the trainer. I found the training speed does increase by around 30%, but the GPU memory merely decreases. Should it be half of the raw memory? |
Beta Was this translation helpful? Give feedback.
Answered by
akihironitta
Jun 9, 2022
Replies: 1 comment 2 replies
-
Hi @icoz69 AFAIK, the memory usage depends on your model architecture, specifically, the ratio of the model size to the size of activations. This is because, with amp, your model always stays in fp32 while some operations in your model are done in fp16. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
akihironitta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @icoz69 AFAIK, the memory usage depends on your model architecture, specifically, the ratio of the model size to the size of activations. This is because, with amp, your model always stays in fp32 while some operations in your model are done in fp16.