feature: accelerate line-buffered rolled conv and depthwise on CMSIS-NN and ESP-NN - #38
Merged
Merged
Conversation
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
Line-buffered chains roll their overlap rows across tiles, but every rolled tile fell back to
s8_ref on the accelerated backends (the
tigris_accel_try_s8_refguard). This teaches theCMSIS-NN and ESP-NN Conv/Depthwise adapters to honor the roll offsets, so a rolled chain
accelerates. Second substep of Phase 1.5 (native tile-contract acceleration).
Change
tigris_accel_try_s8_ref(tigris_kernels_s8.c): a rolled tile's conv/depthwise now proceedsto the vendor adapter; a rolled non-conv/depthwise op still routes to s8_ref, and every
2D-width tile still routes to s8_ref (deferred to 1.5c).
adapt_conv2d/adapt_depthwise_conv2din both the CMSIS-NN and ESP-NN adapters: fold theroll into pointer offsets -
Y += out_row_startrows,X += (out_row_start*stride - in_row_start)rows,IH -=that delta - mirroring theoh_g/ihindex math inkern_conv2d_s8. For a spatial op the executor setsin_row_start = 0, so the delta isout_row_start*stride.test_accel_routing.c: a rolled conv/depthwise routes to the adapter; a rollednon-conv/depthwise (max-pool) still routes to reference.
Testing
events; instrumentation confirmed the CMSIS adapter roll block executes with
out_row_start=2/delta=2):max_abs_diff=0(bit-exact) vs the reference dispatcher throughthe executor. The 1.5a plain-height conv/depthwise differentials still pass.
(+1 advisory finding, 0 correctness).
exactly and is validated on-device (SiliconRig) separately, as in 1.5a.
Follow-up
The persistent CI differential (a rolled-chain case in
tigris-benchhost-validation + acore-versions.jsonre-pin) lands after this merges, per the standard bench re-pin flow.