mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
ggml's tiled CPU flash-attention kernel needs the head size (72 in this encoder) to be a multiple of the vector width: 8 floats with AVX2, 16 with AVX-512. With AVX-512, which a build from source gets on a CPU that has it, ggml falls back to a kernel that is several times slower and accumulates in FP16. The release builds are AVX2, where flash attention is the faster one, so auto stays the default there. 1024x1024 picture, Ryzen 7 7700X, 8 threads, F16 mmproj: AVX2 8.3-9.9 s with it, 14.0-15.2 s without; AVX-512 43.5 s with it (26% off the FP32 output), 13.3 s without. --gpu keeps auto, and an explicit --flash-attn still wins. Rebased onto the 0.1.40 strata_vision.cpp (the --min-tokens usage line). Only a source build on an AVX-512 CPU changes; the release builds (AVX2) do not. The Zen4 timing is not run here. (PR #660)