llama.cpp
fb8774a7 - hexagon: FlashAttention optimizations and a quick MatMul quant-scales follow-up (#33741)

Commit
14 hours ago
hexagon: FlashAttention optimizations and a quick MatMul quant-scales follow-up (#33741) * docs : document Hexagon worker stack budget, ddr_spad, and vextract Add developer guidelines for avoiding HVX-to-scalar vextract in hot loops and using ddr_spad_base to stay within the 16 KB worker stack budget. Assisted-by: Gemini * hexagon : add strip-chunked FA mask scan and tile cmask skipping Chunk fa_scan_active_blocks over VTCM strips so large Br/n_kv masks no longer bail out to full-square attention, cap FP16 Br/Bc at 256, skip masked 32x32 tiles across HMX QK/O-update and HVX softmax, and outline softmax helpers. Assisted-by: Gemini * hexagon : add 4-row-quad L1D softmax, fused Q8_0 KV, deep HMX, and fused O-norm Process 4 rows per quad with L1D buffers and binary-mask detection in FP16 softmax, fuse Q8_0 KV dequant+interleave, use HMX_LOAD_MPY_DEEP_F16 for QK and O-update, and fuse O-normalization into HVX O-store to drop the HMX O-norm pass. Assisted-by: Gemini * hexagon : remove HVX-to-scalar vextract roundtrips from FA hot loops Keep row maxima, scales, and masks in HVX vectors via rotates, broadcasts, and predicated vector stores across FP16 and W8A8 FlashAttention loops, cutting Q6_R_vextract_VR count from 38 to 7 (0 in compute loops). Assisted-by: Gemini * hexagon: make inspect options additive * hexagon: remove sw-divs in fa code * hexagon: fuse and eliminate separate passes for norm/... * hexagon: further optimize fa tile mask * hexagon: fix F8_E4M3 test failures due to INFs in the quant scales
Parents
Loading