Skip to content

Add NEON optimizations for SynetQuantizedMergedConvolution Cdc/Cd/Dc - #855

Merged
ermig1979 merged 2 commits into
devfrom
cursor/neon-synet-quantized-merged-conv-9c60
Aug 13, 2026
Merged

Add NEON optimizations for SynetQuantizedMergedConvolution Cdc/Cd/Dc#855
ermig1979 merged 2 commits into
devfrom
cursor/neon-synet-quantized-merged-conv-9c60

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Port SynetQuantizedMergedConvolutionCdc, SynetQuantizedMergedConvolutionCd, and SynetQuantizedMergedConvolutionDc from the SSE4.1 kernels to ARM/ARM64 NEON.
  • New sources: SimdNeonSynetQuantizedMergedConvolution.cpp, Input.cpp, Depthwise.cpp, and Output.cpp (input 1x1 GEMM, packed depthwise 3x3/any, output 1x1 GEMM, residual add).
  • Wire Neon::SynetQuantizedMergedConvolutionInit into SimdSynetQuantizedMergedConvolutionInit, add NEON QuntizedTerm8i helpers, extend AutoTest, update VS2022 Neon project files, and document the change under release 7.2.165.
  • Fix ARM64 quantized rounding: QuntizedTerm8i and residual QuantizedAdd now use vcvtnq_s32_f32 (ties-to-even), matching Base std::nearbyint and SSE _mm_cvtps_epi32. The previous NEON Round() path (half away from zero) caused off-by-1 mismatches such as CDC 1x32x56x56-192x1x1-5x2-56x1x1.

Validation

  • AArch64 cross-compile of the four NEON sources succeeded (aarch64-linux-gnu-g++ -march=armv8-a+crc), including after the rounding change.
  • Native x86 Release build succeeded; ./Test "-r=.." -fi=SynetQuantizedMergedConvolution -tt=1 -ts=1 finished successfully (NEON is not selected on that host).

Test plan

  • Cross-compile Neon sources for aarch64 and confirm the new files build.
  • Native x86 Release build + SynetQuantizedMergedConvolution AutoTest.
  • On ARM/ARM64 hardware, rebuild and run ./Test "-r=.." -fi=SynetQuantizedMergedConvolution -tt=1 -ts=1 and confirm Neon vs Base (exact compare). The previously failing case is [3:1x32x56x56-192x1x1-5x2-56x1x1].
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 13, 2026 08:32
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
ermig1979 marked this pull request as ready for review August 13, 2026 08:57
@ermig1979
ermig1979 merged commit 1696e88 into dev Aug 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants