Skip to content

et-backend: Q4_0 matrix-engine GEMM rewrite for prefill#11

Closed
RehanQasim-dev wants to merge 1 commit into
etfrom
feat/q4_0-tensor-gemm-decode-prefill
Closed

et-backend: Q4_0 matrix-engine GEMM rewrite for prefill#11
RehanQasim-dev wants to merge 1 commit into
etfrom
feat/q4_0-tensor-gemm-decode-prefill

Conversation

@RehanQasim-dev

@RehanQasim-dev RehanQasim-dev commented Jul 14, 2026

Copy link
Copy Markdown

Summary

  • Rewrites the Q4_0 matrix-engine mul_mat kernel with static-reuse dequant across N-tiles, K-splitting and a materialized register-resident path for deep reuse, plus software-pipelined activation prefetch and hart-sync fixes.
  • Adds flush_to_l2_multi to work around the 16-line cap of a single FlushVA.

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

Prefill improved roughly 3x. Decode is the same as et since decode (N=1) always routes to the vecdot kernel, not the matrix-engine path this PR touches.

Prefill t/s

N et optimized speedup
100 175.7 533.9 3.04x
220 221.6 794.2 3.58x
512 231.1 743.8 3.22x
700 220.4 694.2 3.15x
900 216.0 693.5 3.21x

Testing

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

Static-reuse dequant across N-tiles with K-splitting and a materialized
register-resident path for deep reuse, plus software-pipelined activation
prefetch and hart-sync fixes. Adds flush_to_l2_multi to work around the
16-line cap of a single FlushVA.
@github-actions github-actions Bot added the ggml label Jul 14, 2026
@RehanQasim-dev

Copy link
Copy Markdown
Author

Superseded by the upstream PR against ggml-org/llama.cpp.

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.

1 participant