Details
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
Website:
Attestations:
macOS/iOS:
- macOS Apple Silicon (arm64)
- macOS Apple Silicon (arm64, KleidiAI enabled) DISABLED
- macOS Intel (x64)
- iOS XCFramework
Linux:
- Ubuntu x64 (CPU)
- Ubuntu arm64 (CPU)
- Ubuntu 24.04 s390x (CPU)
- Ubuntu 26.04 s390x (CPU)
- Ubuntu 26.04 s390x (zDNN)
- Ubuntu x64 (Vulkan)
- Ubuntu arm64 (Vulkan)
- Ubuntu x64 (CUDA 12) - CUDA 12.8 libraries
- Ubuntu x64 (CUDA 13) - CUDA 13.5 libraries
- Ubuntu arm64 (CUDA 13) - CUDA 13.5 libraries
- Ubuntu x64 (ROCm 10.0)
- Ubuntu x64 (OpenVINO)
- Ubuntu x64 (SYCL FP32)
- Ubuntu x64 (SYCL FP16)
- Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide
Android:
Windows:
- Windows x64 (CPU)
- Windows arm64 (CPU)
- Windows arm64 (OpenCL Adreno)
- Windows x64 (CUDA 12) - CUDA 12.4 DLLs
- Windows x64 (CUDA 13) - CUDA 13.5 DLLs
- Windows arm64 (CUDA 13) - CUDA 13.5 DLLs
- Windows x64 (Vulkan)
- Windows arm64 (Vulkan)
- Windows x64 (OpenVINO)
- Windows x64 (SYCL)
- Windows x64 (ROCm 10.0)
openEuler:
- DISABLED
- openEuler x86 (310p)
- openEuler x86 (910b, ACL Graph)
- openEuler aarch64 (310p)
- openEuler aarch64 (910b, ACL Graph)
UI: