Files
Strata/engine/include/strata/kernels
Niko1221 abb120c5e7 CPU Q2_0 rows: a CPU with AVX but no AVX2 takes Strata's AVX1 rows, and the AVX1 bit-plane row does its float work on 256 bits (#4854)
From PR #4854 (Keoian; its commits 43e390e0e and 7a68664ac), author kept. On a CPU with AVX and no AVX2 (the older-CPU
source build, STRATA_ISA_FLOOR=avx) q2_native_kernels() admitted AVX2 only, so every native pack's Q2_0 expert ran on
ggml-cpu's own vec_dot and never reached the AVX1 rows of q2_avx1.cpp. It now also admits cpu_avx1_ok(); a CPU
without AVX keeps ggml-cpu. On a CPU with AVX2 nothing changes (the first term is true as before). The AVX1 bit-plane
row (STRATA_Q2_BITPLANE=1) computes a pair's float part in one 256-bit register, block 0 in the low lanes and block 1
in the high ones, each lane with the operations of the 128-bit form, so its bytes do not change; h2f_scale converts a
normal fp16 block scale in four integer operations (h2f's normal branch, bit for bit; zero, subnormals, inf and NaN
still take h2f). Author's numbers (i7-3770): a one-token Q2_0 expert 0.975 ms on ggml-cpu, 0.487 ms on the AVX1 rows,
0.297 ms with the bit-plane form; decode on 2x RX 5700 XT 14.97 to 22.38 tok/s. Not measured by us (no AVX-only CPU);
q2_bitplane_parity (AVX1 form against its 128-bit legacy form) with STRATA_Q2_BITPLANE=1 is in the gate table.
2026-11-19 16:19:22 +01:00
..