MCPcopy Create free account
hub / github.com/Niko1221/Strata / native_quant_h

Function native_quant_h

engine/src/kernels/cpu/native_expert.cpp:527–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525}
526
527void native_quant_h(const NativeFmt& f, const float* h, void* dst) {
528 if (f.had_d) {
529 thread_local std::vector<float> tmp;
530 tmp.assign(h, h + f.n_ff);
531 hadamard_rotate(tmp.data(), (int) f.n_ff, f.had_block, f.d_signs);
532 h = tmp.data();
533 }
534 if (act_dump().on) act_dump_record(f.layer, 1, h, f.n_ff);
535 if (q8k_avx2(f.d_act)) { q8k_quant_avx2(h, dst, f.n_ff); return; }
536 if (q8k_avx1(f.d_act)) { q8k_quant_avx1(h, dst, f.n_ff); return; }
537 traits(f.d_act).from_float(h, dst, f.n_ff);
538}
539
540int native_gu_mt_min(int gu_type) {
541 // #152: from how many tokens the multi-token kernels run (ggml's vec_dot below that). The default 2 is the

Callers

nothing calls this directly

Calls 10

hadamard_rotateFunction · 0.85
act_dump_recordFunction · 0.85
q8k_avx2Function · 0.85
q8k_avx1Function · 0.85
assignMethod · 0.80
from_floatMethod · 0.80
q8k_quant_avx2Function · 0.70
q8k_quant_avx1Function · 0.70
traitsClass · 0.50
dataMethod · 0.45

Tested by

no test coverage detected