easydel.layers.quantization._8bit_quantizer

easydel.layers.quantization._8bit_quantizer#

easydel.layers.quantization._8bit_quantizer.dequantize_row_q8_0(quants, scales)[source]#

Dequantize 8-bit integers back to float32 values using blockwise scaling.

Parameters
  • quants – int8 array of shape (k,) containing quantized values

  • scales – float16 array of shape (nb,) containing scaling factors

Returns

float32 array of shape (k,) containing dequantized values

easydel.layers.quantization._8bit_quantizer.quantize_row_q8_0(x: Array)[source]#

Quantize a row of float32 values to 8-bit integers with blockwise scaling. :param x: input array

Returns

tuple of (scales, quantized_values) - scales: float16 array of shape (nb,) - quantized_values: int8 array of shape (k,)