Skip to main content

dequant_q3_k

Function dequant_q3_k 

Source
pub fn dequant_q3_k(src: &[u8]) -> Result<Vec<f32>, QuantError>
Expand description

Dequantize a Q3_K buffer into f32. Formula verified against real ggml-quants.c::dequantize_row_q3_K: 16 sub-blocks of 16 elements, value = d_all*(scale-32)*(raw3bit-bias), raw3bit = 2 bits from qs plus 1 high bit from hmask (bit m, m sweeping all 8 bit positions across the whole block – hmask is indexed the same way regardless of which half of qs is active, only the bit tested changes), bias = 4 when the high bit is clear, 0 when set.