Commit Graph
1 Commits
Author SHA1 Message Date
Niko1221 2fe91fddd7 quant layer: AVX-512 VL+VNNI build of the AVX2-contract dots (Q4_0/1, Q5_0/1, Q8_0, IQ4_NL, MXFP4), quant_bench, check_no_ggml.sh
dot_avx512.cpp compiles the same ported ggml dots as dot_avx2.cpp with -mavx512vl -mavx512vnni so the helper's VPDPBUSD branch (ggml's own, for
__AVX512VNNI__ && __AVX512VL__) replaces maddubs + madd.  Integer sums are exact either way and the float order is the AVX2 one, so the bits are the
AVX2 tier's: quant_parity runs these kernels against ggml's AVX2 dots (19097 comparisons, 0 differences, p2006).  Isa::Avx512 now means AVX-512
F/DQ/BW/VL + VNNI (isa_ok / best_isa).  One thread, Zen 4 (p2006), GB/s of weights, DRAM set / L2 set, avx2 -> avx512 build:
q4_0 15.98/16.27 -> 16.73/17.03, q4_1 16.20/16.55 -> 17.02/17.44, q5_0 15.36/15.69 -> 16.87/17.26, q5_1 15.49/15.84 -> 16.63/17.03,
q8_0 37.42/39.55 -> 38.07/40.41, iq4_nl 14.93/15.30 -> 15.19/15.58, mxfp4 11.39/11.88 -> 11.65/12.11 (+2% to +10%).

Tried and dropped (not in the tree): a two-block 512-bit decode (nibbles of two blocks, the 5th bit from a mask register, one VPDPBUSD) with the float chain in ggml's
order: 14.94 vs 15.35 (Q5_0), 12.6 vs 15.9 (Q4_0), no gain; and 4-rows-at-a-time kernels (bit-exact, R chains in flight): L2-resident +15-20%, DRAM-streamed
-30% (four streams per core), so a loss where the pool lives.

tests/quant/quant_bench.cpp: one-thread GB/s of every kernel (no ggml), interleaved rounds, medians.
tests/quant/check_no_ggml.sh: nm -u over the pool's objects (strata_kernels_cpu, strata_quant, mtp.cpp, ds4_gg_cpu.cpp): none may reference ggml
(own build: 29 objects, clean; ggml build: ggml_cpu_init, ggml_get_type_traits_cpu, ggml_row_size, ggml_cpu_has_* found, as it must).
2026-11-09 05:04:42 +01:00