bitorch_engine.utils.quant_operators

Functions

bit_set

Sets a specific bit in an integer variable to a given value.

get_binary_col

Binarizes an array column-wise, transforming each element into a binary representation.

get_binary_row

Binarizes an input NDArray (nd_row) into a binary representation (binary_row) based on the specified number of bits per binary word (bits_per_binary_word).

gptq_style_unpacking

Reconstructs the fp16 weight tensor from the input quantized weight parameter in GPTQ style.

gptq_style_zeros_packing

Packs the zeros tensor in GPTQ style for efficient storage and computation.

nv_tensor_quant

Quantizes the given tensor using specified quantization parameters.

q4_quantization

Quantizes an input tensor to 4-bit integers using uniform quantization.

q8_quantization

Quantizes an input tensor to 8-bit integers using uniform quantization.