-
-
Notifications
You must be signed in to change notification settings - Fork 654
set amp_mode and scaler to false in grad_acc=1 test #2243
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
Conversation
I'm quite surprised by the lack of precision here. In these tests, we don't need a very high precision. Anyway we must check amp, so I would prefer we don't disable the test. Why don't compute analytically the results in the case of gradient accumulation as without ? Remove the bias should help to get a concise code with the same coverage. We need to fix this as fast as possible, I'll work on it when I'm available, unless you're done before. |
@sdesrozis I removed the bias part, which does take care of the other failures. Still 1 failure remains on test
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI works now
Description:
In the
_test_create_supervised_trainer
a test for gradient accumulation==1 was added which calculates the result using trainer and compares it with the output of doing simple backprop.While this works fine for most cases, it fails when AMP is turned on because of the precision drop when changing to fp16 and then back to fp32. This causes the test to fail see here
In this PR I have passed
None
asamp_mode
so that it doesn't test gradient_accumulation==1 case with amp.The other alternative I can think of would be to change this test to similar manner as the one of gradient_accumulation != 1 case and have values of input larger so that amp precision doesn't affect too much.
@sdesrozis what do you think?
Check list: