Skip to main content

Module validate

Module validate 

Source
Expand description

Tensor-level (not full-model) quantization error metrics: for each quantized tensor, dequantize and compare against the original f32 weights. No forward pass is needed – this is a pure diff between the original and quantized-then-reconstructed safetensors files.

Structs§

TensorReport
Per-tensor quantization error metrics.

Functions§

compare_tensors
Compares original against reconstructed element-wise, computing TensorReport metrics. Both slices must be the same length (the caller is responsible for shape bookkeeping).
validate_checkpoint
Compares every quantized tensor in quantized_path (as recorded by its embedded quantization_config) against the corresponding tensor in original_path, returning one TensorReport per quantized tensor, in the checkpoint’s tensor order.