llama.cpp
hexagon: MUL_MAT and MUL_MAT_ID rework : 32x32 tiled weight repack, kernel-params, cached graphs
#24954
Merged

hexagon: MUL_MAT and MUL_MAT_ID rework : 32x32 tiled weight repack, kernel-params, cached graphs #24954

max-krasnyansky
max-krasnyansky hex-mm: new weight layout and fusion updates
e262741e
max-krasnyansky hvx-mm: unroll the new tiled vec_dots to optimize hvx register util
fb09b04f
max-krasnyansky hex-mm: optimize dyn.quant format for q8_0 and q8_1 to reduce overhea…
a4afb7a8
max-krasnyansky hvx-mm: parallel quantizer per block for large rows
a06b224d
max-krasnyansky hvx-mm: simplify and futher optimize dyn.quant and vec_dots
935a886e
max-krasnyansky hvx-mm: keep intermediate per tile accumulators in fp16
18599224
max-krasnyansky hmx-mm: optimize weight dequant by aligning the repacked tiles with t…
56fcca9e
max-krasnyansky hmx-mm: remove qweight scratch and just use vtcm_weight
6bf204ff
max-krasnyansky hmx-mm: remove all unused and obsolete code
e39d260d
max-krasnyansky hmx-mm: the new tiled repack format is here to stay -- rename all x4x…
56353472
max-krasnyansky hmx-mm: improve activation processing with dma prefetch
ffa665a8
max-krasnyansky hex-mm: fix hmx/hvx fallback logic and MUL_MAT_ID allocation (unbreak…
c4c60cca
max-krasnyansky hex-mm: align the weight tiles with dma just like we did in hmx-mm
5b55c747
max-krasnyansky hex-mm: factor out common mm bits into htp/matmul-ops.h
e640c957
max-krasnyansky hex-mm: start moving mm kernel selection to the host
4411fe00
max-krasnyansky hex-mm: move all of the matmul param compute into the host
b2a67891
max-krasnyansky hmx-mm: restore pipelined mode
f65150d5
max-krasnyansky hmx-mm: unroll the dequant functions to optimize register usage
2cbc7195
max-krasnyansky hmx-mm: further improve activation process
887cef15
max-krasnyansky hex-mm: use vtcm_seq_alloc for all vtcm allocations and define more c…
05960a94
max-krasnyansky hex-mm: improve mm optimizer to acount for number of activation threads
7e901392
max-krasnyansky hex-mm: fix matmul-id kernel params selection (unbreaks OLMoE and LFM)
24f44fbc
max-krasnyansky hexagon: remove support for arch < v73 since HMX is now required for …
39cdaf38
max-krasnyansky hex-mm: cleanup naming for consistency
b920cfbc
max-krasnyansky hex-mm: make sure matmul fusion accounts for vtcm allocation
c1fd6401
max-krasnyansky hex-mm: minor cleanup for kernel_params definition
35d4e61f
max-krasnyansky hex-mm: replace hardcoded limits with proper checks for vtcm requirem…
97fcf6ab
max-krasnyansky hex-mm: add support for non-tiled mm as a fallback option and factor …
c2cf841f
max-krasnyansky hex-mm: remove unused functions
121f40d6
max-krasnyansky hex-mm: add shorthand for MM_SELECT in run-tool script
1450d3cf
max-krasnyansky hvx-mm: factor out hvx/hmx microkernels and unify matmul entry and di…
c45e77dd
max-krasnyansky hex-mm: further cleanup matmul fallback path
8369d763
max-krasnyansky hex-mm: refactor matmul entry point and dispatch a bit further
5dc3e65c
max-krasnyansky hexagon: update cmake build to enable hmx for everything
09cdefb0
max-krasnyansky hex-ops: optimize kernel_param updates and include summary in the logs
7f63f94e
max-krasnyansky hex-mm: add support for GGML_HEXAGON_MM_SELECT
891603be
max-krasnyansky hex-mm: add hex-common header
30184849
max-krasnyansky hex-mm: pass correct number of tasks to workpool
03a11a00
max-krasnyansky hex-mm: add proper checks for no-work in dyn.quant tasks
2b6df589
max-krasnyansky hex-mm: convert all quantizers into a macro
95872146
max-krasnyansky hex-mm: fix hvx-flat fallback to pass all MUL_MAT tests
33bde7fe
max-krasnyansky hex-mm: vectorize q8_1 quantizer
a09732c5
max-krasnyansky hex-mm: improve fused ffn mm stride handling
bff2d14a
max-krasnyansky hex-mm: consistent use of n_threads and pipeline in kernel_params
7362cd53
max-krasnyansky hexagon: minor formatting
9a71719b
max-krasnyansky hex-mm: update MUL_MAT_ID kernel_param handling to make sure host/npu…
3cabc20e
max-krasnyansky hvx-mm: go back to accumulating in fp32 in tiled hvx kernels, more ac…
7fae23bb
max-krasnyansky hvx-mm: unroll the loops and remove masking that is not needed for ti…
e187f5ad
max-krasnyansky hmx-mm: optimize activation processing (slit loops, some unrolling, etc)
1fb65001
max-krasnyansky hmx-mm: minor optimization for output processing
7d0c55aa
max-krasnyansky hex-mm: consistent use of uint32_t and size_t in mm kernels
3fd34448
max-krasnyansky hex-mm: remove legacy restrictions for rows to be multiple of 256
7f6be481
max-krasnyansky hexagon: replace sprintf with snprintf
aeaad354
max-krasnyansky hex-mm: relax hardcoded nrows checks and rely on VTCM size requirements
5357dbdc
max-krasnyansky hexagon: minor alignment fix
56487861
max-krasnyansky hexagon: fix trailing spaces
abebb9cf
max-krasnyansky hex-mm: relax padding from 256 to 128 (leftovers)
886dad85
max-krasnyansky hex-mm: remove redundant checks for weight align to 128
ab1b9e1e
max-krasnyansky hmx-mm: MUL_MAT_ID better work distribution between hvx threads and h…
50601fde
max-krasnyansky hex-mm: specialize per-token mmid activation handling
c17fdd9d
max-krasnyansky hex-profile: update python scripts to handle kernel-params section in…
df6414d5
max-krasnyansky hex-mm: move n_prefetch (aka dma_depth) into kernel params and remove…
27c73ccc
max-krasnyansky hex-trace: use easier to parse format, simply and fix post-proc scripts
12db1dad
max-krasnyansky hmx-mm: relax 32 row limit for output processing which helps utilization
2ace3010
max-krasnyansky hmx-mm: use start-chunk idx for tracing info
01562663
max-krasnyansky hmx-mm: parameterize activation dma pipeline
a5da341a
max-krasnyansky hexagon: add support for simple graph caching to avoid recomputing ke…
fcd3f354
max-krasnyansky hex-mm: remove left-over repack functions
4ae13d5f
max-krasnyansky hex-mm: tighten n_prefetch asserts
62031247
max-krasnyansky hex-mm: remove duplicate round/align_up helper
8c434c8d
max-krasnyansky hexagon: cleanup common header used in host/npu
7f2eed5a
max-krasnyansky hexagon: update early wakeup threshold
e951e842
max-krasnyansky hmx-mm: define cost constants and update solver to assume that repack…
1365b241
max-krasnyansky hmx-mm: make precompute_matmul a bit more readable (split into smalle…
95df7d25
max-krasnyansky hex-mm: remove n_threads constraint
9cc6587f
max-krasnyansky hex-mm: minor formatting updates
203f4ef8
max-krasnyansky hex-mm: remove obsolete profiling logs
e35b2b93
github-actions github-actions added documentation
github-actions github-actions added script
github-actions github-actions added testing
github-actions github-actions added python
github-actions github-actions added ggml
github-actions github-actions added Hexagon
max-krasnyansky max-krasnyansky marked this pull request as ready for review 20 days ago
max-krasnyansky max-krasnyansky requested a review from ggerganov ggerganov 20 days ago
max-krasnyansky max-krasnyansky requested a review 20 days ago
max-krasnyansky hex-mm: restore hardcode gate to refuse lm-head to avoid repacking th…
6200365b
lhez
lhez approved these changes on 2026-06-24
max-krasnyansky
CISC
CISC approved these changes on 2026-06-24
max-krasnyansky max-krasnyansky merged 8be759e6 into master 19 days ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone