Add NEON optimizations for SynetQuantizedMergedConvolution Cdc/Cd/Dc - #855
Merged
Conversation
Port the SSE41 quantized merged convolution kernels (input GEMM, packed depthwise 3x3/any, output GEMM, and residual add) to ARM/ARM64 NEON, wire them into SimdSynetQuantizedMergedConvolutionInit, and extend the auto-test. Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
Use ARM64 vcvtn (ties-to-even) instead of Round (half away from zero) so Neon QuntizedTerm8i and residual QuantizedAdd match Base nearbyint and SSE _mm_cvtps_epi32. This addresses off-by-1 errors such as SynetQuantizedMergedConvolution CDC 5x2. Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
ermig1979
marked this pull request as ready for review
August 13, 2026 08:57
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.
Summary
SynetQuantizedMergedConvolutionCdc,SynetQuantizedMergedConvolutionCd, andSynetQuantizedMergedConvolutionDcfrom the SSE4.1 kernels to ARM/ARM64 NEON.SimdNeonSynetQuantizedMergedConvolution.cpp,Input.cpp,Depthwise.cpp, andOutput.cpp(input 1x1 GEMM, packed depthwise 3x3/any, output 1x1 GEMM, residual add).Neon::SynetQuantizedMergedConvolutionInitintoSimdSynetQuantizedMergedConvolutionInit, add NEONQuntizedTerm8ihelpers, extend AutoTest, update VS2022 Neon project files, and document the change under release 7.2.165.QuntizedTerm8iand residualQuantizedAddnow usevcvtnq_s32_f32(ties-to-even), matching Basestd::nearbyintand SSE_mm_cvtps_epi32. The previous NEONRound()path (half away from zero) caused off-by-1 mismatches such as CDC1x32x56x56-192x1x1-5x2-56x1x1.Validation
aarch64-linux-gnu-g++ -march=armv8-a+crc), including after the rounding change../Test "-r=.." -fi=SynetQuantizedMergedConvolution -tt=1 -ts=1finished successfully (NEON is not selected on that host).Test plan
./Test "-r=.." -fi=SynetQuantizedMergedConvolution -tt=1 -ts=1and confirm Neon vs Base (exact compare). The previously failing case is[3:1x32x56x56-192x1x1-5x2-56x1x1].