Port of quantize() in the reference. bits in {2,4,5,8}; signed is
only meaningful (and only ever true) for bits===8 (q8_0/int8) — every
sub-8-bit key type in QUANT_PARAMS is unsigned. Groups run along the
LAST axis (head_dim), BLOCK_SIZE=32 elements per group.
Port of quantize() in the reference.
bitsin {2,4,5,8};signedis only meaningful (and only ever true) for bits===8 (q8_0/int8) — every sub-8-bit key type in QUANT_PARAMS is unsigned. Groups run along the LAST axis (head_dim), BLOCK_SIZE=32 elements per group.