Skip to content

arm_transpose_conv_s8: wrong output when pad_h % stride_h != 0 #230

Description

@ycx-aizip

Hi,

We noticed an issue with the arm_transpose_conv_s8, producing incorrect output, and writes past the intended output rows, whenever the vertical padding is not an integer multiple of the vertical stride (pad_h % stride_h != 0). The defect seems to be in in the vertical (row) flush scheduling.

Would love to hear your feedback on this issue.

Affected versions: v7.0.0 and current main (ece5a38).
File: Source/ConvolutionFunctions/arm_transpose_conv_s8.c
Component: arm_transpose_conv_s8 (reached via arm_transpose_conv_wrapper_s8), scalar and MVE builds.

Reproduction

Quantized ConvTranspose2d, NHWC, per-tensor s8:

param value
input (HxWxC) 4x4x8
filter (OutCh, kH, kW, InCh) 4, 4, 4, 8
stride 2x2
padding 1x1 -> pad % stride = 1

in_ch = 8 (<= 16), so arm_transpose_conv_wrapper_s8 dispatches to arm_transpose_conv_s8 for exactly this shape. Against a reference computed with PyTorch conv_transpose2d, 152 of 256 output elements differ (59.4%), including saturation sign-flips:

[0] expected  127, got -128
[1] expected -128, got  127
[2] expected   37, got  -70
...
Total: 152/256 elements differ

Setting padding = 2x2 (so pad % stride == 0) with everything else fixed produces a bit-exact match, confirming the trigger is the pad % stride != 0 condition rather than the shape itself.

cmsis_nn_transpose_conv_repro_ycx-aizip.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions