Add GTests for Conv GPU bias, 1D and 3D paths#31
Open
harz05 wants to merge 1 commit into
Open
Conversation
e68a8ca to
57e467b
Compare
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.
Adds GTests exercising three Conv GPU paths that no existing alpaka model covered. All current Conv alpaka models are 2D, group 1, no bias, so these branches in the generated kernels were never run.
BiasBroadcastKernelplus the GEMM beta=1 accumulate. Two output channels with distinct biases (10, 100) so a wrong-channel broadcast is visible.fDim==1branches in the weight-vec and im2col kernels.fDim>2depth branches and the depth handling in im2col.Each model lists W and bias as initializers with an iota input. Reference outputs are verified against PyTorch (
F.conv1d/F.conv2d/F.conv3d). Tested on Google Colab (NVIDIA T4, CUDA 12.x): all Conv-dim tests pass with no regressions.Steps to reproduce on Colab
Test models
ConvWithBias : input x[1,1,5,5] = iota, weight W[2,1,3,3] all ones, bias [10, 100], kernel [3,3], pads [1,1,1,1], output y[1,2,5,5]. The two distinct biases make a wrong-channel broadcast visible.
Conv1d : input x[1,2,7] = iota, weight W[3,2,3] = iota, bias [1, 2, 3], kernel [3], pads [1,1], output y[1,3,7].
Conv3d : input x[1,1,3,4,4] = iota, weight W[2,1,2,3,3] = iota, bias [5, 50], kernel [2,3,3], pads [0,1,1,0,1,1] (no depth pad, h/w padded by 1), output y[1,2,2,4,4].
W and bias are ONNX initializers (baked into the .dat), so infer() takes only x. Iota weights give each output and input channel a distinct slice so a wrong index is visible. References computed with PyTorch (cross-correlation, no kernel flip) reading W and bias straight from the committed .onnx.