mirror of
https://github.com/opencv/opencv.git
synced 2026-12-02 21:22:43 -06:00
Changes AVX2 fastGemm uses a 6 × 16 micro-kernel instead of 12 × 8: 8 memory reads per 12 multiply-adds instead of 13, the same shape MLAS uses. On AVX2, a row-major A is read straight from its rows instead of being packed first. B packing copies a whole row at once when it is contiguous (row-major B), on all platforms. Attention layer: when there are fewer (batch, head, Q/K/V) projections than threads, each one's rows are split too, so models with few heads use all threads. The flash-attention softmax from fastGemm optimizations and add flashattention without MLAS #30423 is also built for AVX2.