mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
pool_quant.hpp (include/strata/kernels/cpu/) is the one place that knows both worlds: Tr (a weight type's dot, its activation format, an activation type's quantizer), traits(), row_size_of(), blck_size_of(), flavour_avx2() / flavour_f16c() / flavour_avx512(), to_float(), fp16_bits(). With STRATA_OWN_CPU_QUANT they are the quant layer's (each kernel passes its self-check once before it is handed out; the contract is default_arith(): Avx2 on any CPU with AVX2+FMA+F16C, i.e. what the shipped ggml-cpu gives, AVX-512 CPUs included); without it they are ggml-cpu's type traits, exactly as before. - src/kernels/cpu/native_expert.cpp: the traits calls, ggml_row_size / ggml_blck_size, ggml_cpu_has_*, ggml_cpu_init and the six first-use checks of the own rows now go through pool_quant.hpp (the checks compare with the layer's dot instead of ggml's). Hot loops call Tr::dot (a function pointer). - src/dsv41/ds4_gg_cpu.cpp (the DeepSeek lane, also compiled into the Metal host): the same, plus to_float for the embedding rows. Types 10-14, 19, 20, 23 and every activation quantizer there come from the layer on x86. - strata/quant/fp16.hpp: the scalar fp16 conversions, public (internal.hpp used to hold them). - CMake: option STRATA_OWN_CPU_QUANT; strata_kernels_cpu links strata_quant and defines it PUBLIC. ggml-cpu / ggml-base stay linked for the tests that use them as the oracle; with the option on, the pool calls no ggml-cpu function, so a static link pulls none of its objects (nm check in the gates). - iq_avx1_parity calls ggml_cpu_init itself now (native_fmt used to do it for the oracle's fp16 table). - native_fmt's two error strings name the library: "native experts: <ggml-cpu | the quant layer> has no dot product for type N" (unchanged text in the ggml build). cpu-check-native preset, p2006 (AVX-512 host), own mode: 101 tests, 0 failures (6 skipped by design); boston (AVX2): 101 tests, 0 failures in both the own and the ggml build.