Fix dilation>1 in Conv operator (GPU & CPU)#34
Open
harz05 wants to merge 3 commits into
Open
Conversation
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.
Implements #32 .
Conv generated wrong code for dilation > 1 because dilation was counted twice: fAttrKernelShape is expanded to the dilated size in Initialize and then used again with fAttrDilations. Same is already covered and fix as=> root-project/root#22473 / root-project/root#22474.
CPU path: ports the root-project/root#22474 one-liner, resetting fAttrDilations to 1 after the weight reorder so the dense im2col does not re-apply dilation.
GPU path (alpaka): applies the analogous fix in the generated kernels:
Generated im2col for a 3x3 dilation-2 conv, before -> after:
decode k_rem / 3uis changed tok_rem / 5ugather oh*1u + kh*2uis changed tooh*1u + khzero (none)is changed toalpaka::memset(queue, deviceBuf_x_f, 0)The changes are no-ops at dilation 1, so existing Conv tests are unaffected.
Tested on Colab T4: ConvWithDilation passes and all existing Conv tests still pass. Reverting only the codegen fix makes ConvWithDilation fail, confirming the fix.