Skip to content

openrknn: byte-exact l0_mlp — complete exNorm DMA routing - #89

Merged
widgetii merged 1 commit into
masterfrom
openrknn/exnorm-scratch-routing
Apr 13, 2026
Merged

widgetii merged 1 commit into
masterfrom
openrknn/exnorm-scratch-routing

Conversation

@widgetii

Copy link
Copy Markdown
Owner

Summary

Achieve byte-exact DMA address match with vendor oracle for SmolVLM l0_mlp: 0 non-DMA diffs, 0 DMA-class diffs across 613 unique regcmd sections. This is the first FP16 transformer model to reach byte-exact parity with the vendor runtime.

Changes (on top of PR #88)

  • Second+ post-em0d CONV SRC/EW: use scratch tensor + CNA-derived tile offset (em0d_block_idx > 1)
  • First post-em0d CONV: keep using data tensor (em0d_block_idx == 1)
  • Post-CONV REFORMAT SRC: use dst_tensor_off (CONV output) when preceding task was em=0x1d (unified_act mode only)

DMA diff progression

PR Diffs Key fix
Baseline 72 —
#86 52 pc2/pc3 LUT blob swap
#87 48 Unified activation BO
#88 3 exNorm scratch routing
This 0 CONV tile offset + post-CONV SRC

Results

  • Phase 2.5: 6 clean, 0 gating, 1 allowlisted (was 5+0+2)
  • smolvlm_l0_mlp: BYTE-EXACT with vendor oracle
  • smolvlm_l0_attn_fused: still on allowlist (needs same fixes applied)
  • CI: 9/9 pass, 5/5 CNN byte-exact preserved

Test plan

  • CI: 9/9 pass (Phase 1, 2, 2.5, 3)
  • Phase 2.5: smolvlm_l0_mlp BYTE-EXACT
  • 5/5 CNN models byte-exact (no regression)
  • Per-shard cosine still near-zero despite byte-exact DMA — data-level investigation needed

🤖 Generated with Claude Code

Achieve byte-exact DMA address match with vendor oracle for SmolVLM
l0_mlp: 0 non-DMA diffs, 0 DMA-class diffs across 613 regcmd sections.

Key fixes:
- exNorm trailing REFORMAT SRC/DST: use scratch tensor (input[3])
  for intermediate tasks, real output for final task
- exNorm trailing REFORMAT BS/BN: remove gamma/beta for intermediate
  tasks, keep for final (detected via next-task op_idx lookahead)
- Post-em0d CONV SRC/EW (block_idx>1): use scratch + CNA-derived
  tile offset; first CONV (block_idx=1) still reads from data tensor
- Post-CONV REFORMAT SRC: use dst_tensor_off (CONV output) when
  preceding task was em=0x1d of the same op (unified_act mode only)

DMA diff history: 72 → 52 → 48 → 3 → 1 → 0

CI: 9/9 pass, 5/5 CNN byte-exact pending verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@widgetii
widgetii merged commit ca4162f into master Apr 13, 2026
7 checks passed
@widgetii
widgetii deleted the openrknn/exnorm-scratch-routing branch April 13, 2026 05:52
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.

1 participant