What Is INT8 Quantization? Choosing Scales, Calibration, PTQ, and QAT
Learn how INT8 scales and zero points map real values to integers, compare static and dynamic quantization and PTQ versus QAT, and follow the current TensorRT 11.x Q/DQ workflow to validate quality and performance.
INT8 quantization approximates floating-point values with 8-bit integers and scales for inference. It can reduce model size or memory traffic, but rounding and clipping can change accuracy, and faster execution is not guaranteed. Start with a floating-point baseline, check the quantization method and representative data for your runtime, then measure both quality and latency.
This article focuses on explicit quantization in NVIDIA TensorRT 11.x and dynamic versus static INT8 quantization in ONNX Runtime. The TensorRT docs refer to the latest 11.5.0 release as checked on November 19, 2026. Options from different runtimes are not assumed to be interchangeable.
INT8 values approximate real numbers with a scale
Quantization rounds a floating-point value x into an integer range and clips values outside that range to its boundary:
Quantize: q = clip(round(x / scale) + zero_point, q_min, q_max)
Approximate recovery: x_hat = scale × (q - zero_point)
The scale is a positive real interval represented by one integer step. The zero point is the integer that represents real zero. ONNX Runtime supports symmetric and asymmetric linear quantization that may use a zero point. TensorRT’s current standard quantization scheme is symmetric, with zero point 0 for INT8.
TensorRT’s INT8 formula uses the signed range -128 to 127 and round-to-nearest-even. As an illustrative calculation, assume scale=0.1 and zero_point=0. The real value 1.2 becomes integer 12 and recovers approximately as 1.2. The value 13.0 maps to 130, above INT8’s maximum of 127, so it is clipped and recovers as 12.7. This explains the math; it is not a measured result for a model.
Static and dynamic quantization
In ONNX Runtime, the main difference is when activation scales and zero points are calculated.
| Method | Parameter calculation | Benefit and cost | Consider first when |
|---|---|---|---|
| Static | Calculated before inference from calibration data and fixed in the model | Avoids calculating parameters for every inference, but unrepresentative calibration inputs can increase error. | Inputs have a fairly stable distribution and you want less runtime calculation. |
| Dynamic | Calculated from activations during each inference | Can adapt to changing inputs and may help preserve quality, but adds runtime calculation. | Activation distributions vary and the extra work is acceptable. |
ONNX Runtime suggests dynamic quantization as a general starting point for RNN and transformer models, and static quantization for CNNs. This is not a rule for every model. Convert the same model with both methods and compare quality and execution time on the target device. ONNX Runtime offers MinMax, Entropy, and Percentile calibration methods for static quantization; no single method is always best.
Choosing PTQ or QAT
**Post-Training Quantization (PTQ)** converts a trained model without retraining. It is quick to try, but unrepresentative calibration data or sensitive layers can put quality below your target.
**Quantization-Aware Training (QAT)** retrains while simulating quantization and dequantization effects. It may recover accuracy, but takes more time and requires labeled training data. It is not a guarantee.
If quality falls short, first locate where the difference appears. ONNX Runtime documents comparing weights and activations in the original and quantized graphs. You can isolate the cause by retaining an affected operation at higher precision, changing the static calibration method, or moving from PTQ to QAT.
Prepare a Q/DQ model for TensorRT 11.x
TensorRT 11.x removed the older IInt8Calibrator family and setInt8Calibrator(). Do not attach a legacy calibrator while building a TensorRT 11.x engine. Quantization is performed before engine building: use NVIDIA Model Optimizer for PTQ or QAT to produce an ONNX graph with Quantize/Dequantize (Q/DQ) nodes and scales, or add Q/DQ directly where supported. TensorRT 11.x networks are strongly typed, and Q/DQ nodes specify where conversion occurs.
Support varies by operation and GPU. A successful build does not prove that every layer runs in INT8. Check TensorRT’s operator documentation, the target GPU support matrix, and parser logs. Some calculations may need higher precision. TensorRT cites LayerNorm output as an example that should not be INT8 and describes retaining sensitive calculations in mixed precision.
Apply and verify INT8 on a model
**Create a baseline.** Record FP32 outputs and task-specific quality metrics for a fixed model version, representative inputs, and evaluation data. Keep the final evaluation set separate from calibration inputs to reduce evaluation bias.
**Check runtime and operator support.** Verify the deployment GPU, CUDA, TensorRT or ONNX Runtime version, execution provider, and INT8 path for each operation. With TensorRT 11.x, prepare a Q/DQ model instead of following a legacy calibrator example.
**Preprocess before quantizing.** ONNX Runtime recommends performing shape inference and graph optimization as preprocessing. Separating this step makes it easier to match layers before and after quantization.
**Prepare a PTQ candidate.** Use representative inputs for calibration and choose static or dynamic quantization and a calibration method. For TensorRT 11.x, place quantization information in the model with Model Optimizer or manual Q/DQ. Try QAT if PTQ misses the quality target.
**Find accuracy and numerical problems.** Compare the baseline and INT8 outputs on the same inputs, task metrics, and failure cases. If clipping, large layer differences, Inf, or NaN appear, compare intermediate activations to find the affected layer. Adjust the scale or calibration data, or keep sensitive operations at higher precision.
**Measure performance on the target environment.** Only after the model meets quality requirements, compare latency, throughput, and memory with the same GPU, batch, input shape, and execution conditions. Confirm that an INT8 execution path was actually selected.
INT8 quantization is more than changing a data type. Scale, zero point, when parameters are calculated, Q/DQ placement, representative input distribution, and hardware support all affect the result. First find a configuration that meets quality requirements; then decide whether to deploy it based on measured costs and benefits.
References
[NVIDIA TensorRT: Working with Quantized Types](https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/work-with-quantized-types.html) — TensorRT symmetric quantization and supported types.
[NVIDIA TensorRT: Quantization Schemes](https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/quantized-types-schemes.html) — INT8 range, scale equation, and rounding.
[NVIDIA TensorRT: Quantization Workflows](https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/quantized-types-workflows.html) — PTQ/QAT, Q/DQ, scale granularity, and calibration workflows.
[NVIDIA TensorRT: C++ Migration Patterns for TensorRT 11.x](https://docs.nvidia.com/deeplearning/tensorrt/latest/api/migration/tensorrt-10x-to-11x-c-api-patterns.html) — Removal of the legacy INT8 calibrator and explicit Q/DQ in TensorRT 11.x.
[NVIDIA TensorRT: Optimizing TensorRT Performance](https://docs.nvidia.com/deeplearning/tensorrt/latest/performance/optimization.html) — Preparing quantized models for TensorRT 11.x and diagnosing accuracy.
[ONNX Runtime: Quantize ONNX Models](https://onnxruntime.ai/docs/performance/model-optimizations/quantization.html) — Linear quantization, static/dynamic methods, calibration, and debugging.