mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-06 00:08:52 +00:00
New files (replacements, same interfaces):
engine/src/quant/x86/dot_avx2_clean.cpp table + six _opt kernels + three x4 kernels, bit-identical to the plain kernels of the TU
engine/src/quant/x86/act_avx512_clean.cpp AVX-512 Q8_0 / Q8_1 / Q8_K quantisers, byte-identical to the Avx2 contract
engine/src/kernels/cpu/kq_dots_avx2.{hpp,cpp} Q4_K / Q5_1 / Q8_0 multi-token dots, bit-identical per token to the single-token Avx2 dots
Float orders were found by black-box probing of the current kernels (tests/clean_p2/probe_*.cpp, model_*.cpp), then
confirmed on random rows. Tests: dot_avx2_verify, act_avx512_verify (needs AVX-512), kq_dots_avx2_test, plus the probes,
a manual build script for the quant layer and Windows (MSVC) drivers.
17 lines
742 B
C++
17 lines
742 B
C++
// probe_lanes: which elements of one block share an accumulator lane in a dot kernel (Q8 activation, one block); see probe_core.hpp.
|
|
// usage: probe_lanes <q8_0|q4_K|q5_K|q6_K|iq4_xs|iq3_xxs> [trials]
|
|
#include "probe_core.hpp"
|
|
|
|
int main(int argc, char** argv) {
|
|
const std::string name = argc > 1 ? argv[1] : "q8_0";
|
|
const int trials = argc > 2 ? atoi(argv[2]) : 40;
|
|
ProbeType* t = find_probe_type(name);
|
|
if (!t) { printf("unknown type\n"); return 1; }
|
|
const DotKernel* k = dot_kernel(t->type, Arith::Avx2, Isa::Avx2);
|
|
printf("kernel %s, block %d elements\n", k->name, t->elems);
|
|
std::mt19937_64 rng(5);
|
|
LanePartition lp = lane_partition(*t, k, rng, trials);
|
|
print_partition(lp, t->elems);
|
|
return 0;
|
|
}
|