-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FP16 x gradient clipping #1381
Comments
Hi! thanks for your contribution!, great first issue! |
Should we just fix this when we integrate pytorch mixed precision training #1337 (comment)? |
depends on what will be faster lol |
yeah, let's fix with pytorch mixed precision. We need to remove nvidia apex |
This is still an issue in 0.7.5 and it's quite critical for training certain recurrent models where mixed precision can cause a 10x reduction in training time. Can anyone confirm that this is going to be in the 0.7.6 release? We've been hoping it makes 0.7.3, 0.7.4, 0.7.5... |
Okay, thanks. Just to confirm this won't work with 0.7.5 and PyTorch 1.5? What does PyTorch 1.6 add over 1.5, I thought the latter already has native amp? |
1.6 does not use nvidia apex. it uses its internal version. 1.5 does not have native amp |
Awesome, looking forward to it! |
maybe we shall consider to fix it also for lower versions as we still keep back-compatibility... |
|
@mcarilli mind checking if the issue is still on master? |
@Borda still relevant? |
Verified clipping works with native fp16 |
@teddykoker do we have a test to prevent regressions? |
Don't believe so, I can add one |
it it's quick. |
According to apex docs, we should have a separate case for gradient clipping under fp16. But it seems not to be the case in pytorch-lightning. Is that correct? https://github.com/PyTorchLightning/pytorch-lightning/blob/732eaee4d735dafd1c90728e5583341d75ff72b5/pytorch_lightning/trainer/training_tricks.py#L26
The text was updated successfully, but these errors were encountered: