Feature/data loader api#785
Merged
Merged
Conversation
Always-on accumulating profiler (quant-NEON / fp32-scalar / generic) on the DefaultCpuOps.matmul dispatch, read via KernelProfile.report(). Clock read per call is negligible next to a matmul. Used to localize native board decode cost: showed 100% of matmul time is the quant-NEON path (fp32-scalar/generic never hit). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…matmul on A55 Two changes to skainet_q4k_matmul, both validated against the Panama reference (aggregate RMS gate, AGG_REL_TOL=0.03) and on-board generation: 1. Loop order block-OUTER / output-row-INNER. The weight is packed block-major (blockIdx*outputDim + o)*144, so for a fixed block consecutive `o` are exactly 144 bytes apart — weight bytes are now read strictly sequentially (prefetch/cache-line friendly). The previous o-outer order strided outputDim*144 (~295 KB on the down-proj) per step, making every weight read a cold miss on the in-order A55 with small caches. out_base[o] accumulates across blocks (stays hot in cache); accumulation order is unchanged so the result is numerically identical. 2. ggml-style Q8 activation quantization + integer vdotq_s32 dot path (asimddp), input row quantized once per 256-block and reused across all output rows; scalar integer fallback when dotprod is absent. On the SL2619 (Cortex-A55, TinyLlama Q4_K_M, 8-tok decode), Q4_K matmul dropped 41730 ms -> 20133 ms (2.07x); end-to-end decode 0.123 -> 0.184 tok/s (1.50x, matmul being ~64% of decode). The loop reorder is the dominant lever — the Q8 dot alone showed no gain because the kernel was memory-stall-bound, not compute-bound. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
No description provided.