-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Test cases used incorrect ParseFromString #1355
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
…String instead of the TextFormat version. Switched those and now the test cases no longer pass.
Thanks @kmatzen, we need to be careful about this. Does this PR exhaust the cases where this mistake was made? Just glancing at ReLU, it looks like the error is in the test, due to cavalier copy and paste. Perhaps having the gradient checker print layer parameters would have kept this from going unnoticed? |
"Does this PR exhaust the cases where this mistake was made?" I don't know. I just greped through the tests directory to find "Perhaps having the gradient checker print layer parameters would have kept this from going unnoticed?" I would just |
Yep, the grep is all I mean. Of course the calls should be checked. This is a case where one error masked another, causing tests to pass without testing anything, which is worse than not having the test in the first place. So now I am wondering, how might we tweak the testing framework to make mistakes of this type harder to make in the future? |
Not sure how we'd automate it but for setting one or two parameters we should probably discourage the use of TextFormat. e.g. instead of:
instead write |
FWIW, that's what I would do. |
I am OK with using text format since it makes testing code easier to read, but also like the explicit setting. Maybe we should set "-Wunused-result" so that if a function returns something and the code is not using it, we'll be able to catch it. |
This bug seems to have two parts: (1) the unit tests are wrong and (2) fixing the unit tests reveals underlying bugs in some of the layers. Some of the this is addressed by #1979: the MVNLayer backward pass was incorrect, and the ParseFromString bug prevented the incorrect backward code from being discovered. |
In addition to what seanbell said, there was also a problem with MVNLayer::Forward with across_channels = true. That was also not being tested (due to the ParseFromString problem). When it was tested, it would produce NaNs. The problem there was that sum_multiplier_ member was the wrong size for the case across_channels = true. If I remember all this correctly. That should also be fixed in 1979. |
Closing as the last instance of this issue is noted and addressed by #1979. |
Some test cases used the binary format ParseFromString rather than the TextFormat version. If you CHECK these calls, the return values indicate failure. When you switch to the correct ParseFromString, the test cases fail. These tests need to be fixed.