add gtest for conv gpu SAME_UPPER autopad#35
Open
harz05 wants to merge 1 commit into
Open
Conversation
Author
|
While working on this PR, I noticed SAME_UPPER and SAME_LOWER only differ when the total padding is odd and for even padding they resolve to the same pads. ROOT's SameUpper model (input 5, k3, s1) is an even case, so it's effectively identical to SameLower. The odd case would something be like having a 3x3 stride-2 conv on an even-sized input(this gives odd padding) and the TF/Keras "SAME" maps to SAME_UPPER. So it kinda seemed worth covering to me. Does this odd-split path actually come up in the models SOFIE targets or is the even case all we really need here? Any thoughts or guidance would be helpful. @sanjibansg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33.
Adds a GPU test for the SAME_UPPER autopad branch, which the alpaka tests didn't cover (only SAME_LOWER was tested).
SAME_UPPER and SAME_LOWER only differ when the total padding is odd, so the test uses x[1,1,4,4], kernel 3, stride 2 (total pad 1): SAME_UPPER puts the extra pad at the end (begin 0), SAME_LOWER at the start (begin 1). The output differs from what SAME_LOWER gives, and the generated im2col confirms the begin pad (- 0 vs - 1), so the test actually exercises the upper split rather than just the code path.
Tested on Colab T4: ConvWithAutopadSameUpper passes and all existing Conv tests still pass.