Handle Conv2d layer with implicit output padding in NHWC
authorGeorgios Pinitas <georgios.pinitas@arm.com>
Mon, 15 Feb 2021 20:42:39 +0000 (20:42 +0000)
committerGiorgio Arena <giorgio.arena@arm.com>
Tue, 16 Feb 2021 11:59:52 +0000 (11:59 +0000)
commit274733dbd323321a9c09668e4f60396bef150e39
tree46395a6fe0d99aecbb2b17d99802b4f134637252
parentcab1ab92813a346779bacd728ef8d7d4159abac6
Handle Conv2d layer with implicit output padding in NHWC

Corner cases exist when output top/bottom padding is non-zero for
Convolution Layer. This can cause invalid output from the
NEGEMMConvolutionLayer as assembly kernel integration does not
efficiently handles such cases.

As a workaround we always allocate a memory-managed auxiliary tensor
which we use as an output for GEMM when padding exists and then we copy
to the padded output. If no padding exists we import the output tensor
memory to the temporary buffer and perform calculation as we did before.

Resolves: COMPMID-4114

Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: If82d0e115b8369b91d775895d5315b044306cc74
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5083
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h
src/runtime/NEON/functions/NEGEMMAssemblyDispatch.h
src/runtime/NEON/functions/NEGEMMConvolutionLayer.cpp