Skip to content

Improve SVE2 optimizations of SimdSynetConvert8uTo32f - #897

Merged
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-synet-convert-8u-to-32f-1b7a
Aug 20, 2026
Merged

Improve SVE2 optimizations of SimdSynetConvert8uTo32f#897
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-synet-convert-8u-to-32f-1b7a

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

The SVE2 NHWC channels == 3 path of SimdSynetConvert8uTo32f used gather/scatter, which is slower than the NEON implementation that processes interleaved RGB with sequential vector loads.

This change matches the NEON/AVX512 and SVE2 SynetConvert32fTo8u approach:

  • Build repeating scale/shift vectors [s0,s1,s2,s0,...] with svtbl
  • Convert consecutive uint8 lanes to float32 and store consecutively (svld1ub / svst1)
  • Handle the remainder with SVE predicates instead of scalar fallback

Release notes for 7.2.165 list the improvement.

Correctness was checked by cross-compiling for AArch64 and running under QEMU SVE2 at VL=128 (svcntw=4) and VL=512 (svcntw=16):

  • Standalone Base vs Neon vs Simd::Sve2::SynetConvert8uTo32f: 579 cases per vector length, 0 failures (NHWC c=3 including tails, plus NCHW / other channel counts, including AutoTest-sized tensors)
Open in Web Open in Cursor 

Replace gather/scatter in the NHWC channels==3 path with sequential
loads/stores and repeating scale/shift vectors, matching the NEON and
SVE2 Convert32fTo8u approach.

Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
@ermig1979
ermig1979 marked this pull request as ready for review August 20, 2026 09:37
@ermig1979
ermig1979 merged commit c926351 into dev Aug 20, 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