Repository navigation
openrknn: route exNorm trailing REFORMATs through scratch tensor - #88
Merged
Merged
Conversation
The vendor's oracle shows that exNorm trailing REFORMAT tasks (after the em=0x0d + CONV pass) read from and write to the scratch tensor (input[3]), not the data tensor (input[0]) or output tensor (output[0]). Analysis of all 48 DMA diffs confirmed a constant vendor_base of 0x480000 (scratch) for both SRC and DST, with identical raw vals. The final trailing REFORMAT is special: it writes to the real output tensor (dst_tensor_off) and applies BS/BN (gamma/beta). Changes: - SRC (0x5018): use rdma_tensor_off (scratch) for exNorm trailing REFORMATs when em0d_block_idx > 0 - DST (0x4020): use rdma_tensor_off (scratch) for intermediate exNorm REFORMATs; final one uses dst_tensor_off (real output) - BS/BN (0x5020/0x502c): remove exNorm from intermediate REFORMATs, keep for final REFORMAT and BatchNormalization - Detect final REFORMAT via next-task op_idx lookahead Reduces l0_mlp DMA-class diffs from 48 to 3 (72 → 3 total, 96%). Remaining 3: CONV SRC/EW tile offset + post-exNorm op SRC. CI: 9/9 pass, 5/5 CNN byte-exact, 0 gating. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
widgetii
force-pushed
the
openrknn/exnorm-scratch-routing
branch
from
April 13, 2026 05:30
c0c50cc to
48e59eb
Compare
3 of 4 tasks
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
Results
DMA-class diffs on l0_mlp: 72 → 3 (96% reduction)
Remaining 3 diffs: the post-em0d CONV reads from scratch+tile_offset where the tile offset is vendor-computed (not in template val), and the next op's SRC uses a different tensor base than openrknn resolves.
Test plan
🤖 Generated with Claude Code