Repository navigation
fix: Correct padding for NCHW quantized AVG pooling - #1319
Open
vera-rubin wants to merge 1 commit into
Open
vera-rubin wants to merge 1 commit into
vera-rubin wants to merge 1 commit into
Conversation
With included padding, a 2x2 QASYMM8 input filled with its zero point of 128 produces corner values of 32 instead of 128. The NCHW kernels sum stored codes but use raw zero for padding. Use the input zero point for included AVG padding in the 2x2, 3x3 and general kernels. Keep samples beyond explicit padding out of partial CEIL windows, since the averaging divisor excludes those samples. Add coverage for signed and unsigned quantization, equal and differing output quantization, both padding modes, and partial vector windows. Signed-off-by: Nathan Chandrasekar <322284620+vera-rubin@users.noreply.github.com>
This branch has not been deployed
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.
NCHW quantized AVG pooling uses raw code zero for included padding. With a 2×2 QASYMM8 input filled with code 128, scale 0.25 and zero point 128, a 2×2 pool with stride 1 and padding 1 produces corners of 32 and edges of 64. The documented zero padding should leave every output at 128.
We use the input zero point for included padding in the 2×2, 3×3 and general kernels, while omitting samples beyond explicit padding in partial CEIL windows.
We tested the reproducer, 72 regression cases covering signed and unsigned quantization, and the existing pooling suite.
— ChipLab