Skip to content

et-backend: Q8_0 matrix-engine GEMM kernel for prefill#25

Merged
marty1885 merged 1 commit into
aifoundry-org:etfrom
RehanQasim-dev:upstream-q8_0-tensor-gemm
Jul 24, 2026
Merged

et-backend: Q8_0 matrix-engine GEMM kernel for prefill#25
marty1885 merged 1 commit into
aifoundry-org:etfrom
RehanQasim-dev:upstream-q8_0-tensor-gemm

Conversation

@RehanQasim-dev

Copy link
Copy Markdown

Overview

Adds a Q8_0 matrix-engine mul_mat kernel with static-reuse dequant across N-tiles and K-splitting, plus fused bias support for MUL_MAT+ADD. Routes N >= 47 to the matrix engine and N <= 47 to vecdot.

Prefill improves roughly 6-9x on Llama-3.2-1B. Decode is unchanged since decode (N=1) always routes to the vecdot kernel, not the matrix-engine path this PR touches.

Additional information

Performance (Llama-3.2-1B-Instruct, ET-SoC-1):

Prefill t/s

N master optimized speedup
100 99.3 608.4 6.13x
220 100.5 945.2 9.41x
512 95.3 876.9 9.21x
700 96.1 816.0 8.49x
900 95.4 807.4 8.47x

Verified with llama-cli on ET-SoC-1 hardware (Llama-3.2-1B-Instruct).

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - the optimization strategies and design decisions are my own. AI assisted with understanding the hardware reference manual, some pieces of code implementation and guided debugging. I have thoroughly reviewed the code.

Adds a Q8_0 matrix-engine mul_mat kernel with static-reuse dequant
across N-tiles and K-splitting, plus fused bias support for MUL_MAT+ADD.
Routes N >= 47 to the matrix engine and N <= 47 to vecdot.

Registers the new kernel in the KERNELS list, which it was missing
from, so the runtime kernel lookup was silently failing and leaving
the destination buffer unwritten.

Co-authored-by: Rehan Qasim <rehan.qasim@10xengineers.ai>
@marty1885

Copy link
Copy Markdown

Tested and I can replicate the performance. Decode is still coherent. Looks good!

@marty1885
marty1885 merged commit 234272c into aifoundry-org:et Jul 24, 2026
8 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants