add gtest for conv gpu SAME_UPPER autopad - #35
Conversation
|
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 |
e432fd9 to
d39a038
Compare
|
rebased the pr; pls review, thanks |
|
/runci |
|
/runci: GPU Unit Tests ❌ failed — view run |
|
/runci |
|
/runci: GPU Unit Tests ❌ failed — view run |
d39a038 to
005e940
Compare
|
/runci |
|
/runci: GPU Unit Tests ❌ failed — view run |
|
/runtest |
1 similar comment
|
/runtest |
|
/runtest h100-47gb |
|
/runtest (h100-47gb): GPU Unit Tests ❌ failed — view run |
005e940 to
ee85673
Compare
|
/runtest h100-47gb |
|
/runtest: triggered — view run |
|
/runtest (h100-47gb): GPU Unit Tests ✅ passed — view run |
|
/runbenchmark h100-47gb |
|
/runbenchmark: triggered — view run |
Benchmark results (h100-47gb)Comparing against |
|
/runbenchmark (h100-47gb): Benchmark ✅ completed — results updated above. view run |
sanjibansg
left a comment
There was a problem hiding this comment.
LGTM! Thanks for this implementation.
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.