QuantizationInfo
Models & Types · AiDotNet.Models.Results
Contains information about model quantization applied during or after training. Provides metrics on compression ratio, accuracy impact, and quantization parameters.
For Beginners
After quantizing (compressing) your model, this class tells you how much smaller it got, what technique was used, and other useful information about the compression process.
How It Works
Key Metrics:
Constructors
| Constructor | Summary |
|---|---|
QuantizationInfo() |
Properties
| Property | Summary |
|---|---|
CalibrationMethod CalibrationMethod { get; set; } |
Gets the calibration method used to determine quantization parameters. |
IReadOnlyDictionary<string, LayerQuantizationInfo> LayerInfo { get; set; } |
Gets per-layer quantization information if available. |
IReadOnlyList<string> Warnings { get; set; } |
Gets any warnings or notes generated during quantization. |
QATMethod? QATMethod { get; set; } |
Gets the QAT method used if QAT was enabled. |
QuantizationGranularity Granularity { get; set; } |
Gets the quantization granularity (PerTensor, PerChannel, PerGroup). |
QuantizationInfo None { get; } |
Creates a default QuantizationInfo indicating no quantization was applied. |
QuantizationMode Mode { get; set; } |
Gets the quantization mode used (Int8, Float16, etc.). |
QuantizationStrategy Strategy { get; set; } |
Gets the quantization strategy (algorithm) used (GPTQ, AWQ, etc.). |
bool ActivationsQuantized { get; set; } |
Gets whether activations were also quantized (in addition to weights). |
bool IsQuantized { get; set; } |
Gets whether quantization was applied to this model. |
bool IsSymmetric { get; set; } |
Gets whether symmetric quantization was used. |
bool UsedQAT { get; set; } |
Gets whether Quantization-Aware Training (QAT) was used. |
double CompressionRatio { get; } |
Gets the compression ratio (original size / quantized size). |
double QuantizationTimeMs { get; set; } |
Gets the time taken to perform quantization in milliseconds. |
double QuantizedPercentage { get; } |
Gets the percentage of parameters that were quantized. |
int BitWidth { get; set; } |
Gets the bit width used for quantized weights. |
int CalibrationSamples { get; set; } |
Gets the number of calibration samples used for quantization. |
int GroupSize { get; set; } |
Gets the group size used for per-group quantization. |
int? ActivationBitWidth { get; set; } |
Gets the bit width used for activation quantization (if applicable). |
long OriginalSizeBytes { get; set; } |
Gets the original model size in bytes before quantization. |
long QuantizedParameters { get; set; } |
Gets the number of parameters that were actually quantized. |
long QuantizedSizeBytes { get; set; } |
Gets the quantized model size in bytes after quantization. |
long TotalParameters { get; set; } |
Gets the total number of quantized parameters. |
Methods
| Method | Summary |
|---|---|
string ToString() |
Returns a human-readable summary of the quantization. |