Neural Network Quantization Calibration for Stable INT8 Inference

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for neural network inference using reduced precision data formats face challenges such as numerical overflow, underflow, and require additional processing overhead due to dynamic quantization and fine-tuning during training.

Innovation Solution

A computer-implemented process that automates the conversion from higher precision data formats to lower precision formats by generating candidate conversions, measuring divergence using a histogram, and identifying the most accurate representation for each layer of a neural network, allowing for static conversion without re-training or applying constraints.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If reduced precision data formats (float16, INT8) are used for neural network inference, then memory storage and computation resources are significantly reduced, but numerical overflow and underflow issues occur

Engineering Contradiction:
Improvememory and processing resourcesVSAvoidnumerical stability
Core Design Contradiction:
Quantity of substanceVSReliability

Solution Approach 1:

The patent changes the precision parameter of data from FP32 to reduced precision formats (float16, INT8) to reduce memory and computation resources. This parameter change enables efficient inference with lower resource consumption while the system manages numerical stability through careful quantization strategies.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent performs preliminary quantization analysis and calibration before deployment to determine optimal quantization parameters and thresholds. This preliminary action prevents numerical overflow and underflow by establishing safe operating ranges for reduced precision formats before actual inference begins.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If dynamic quantization is applied during training to convert to lower precision formats, then inference efficiency is improved, but additional processing overhead and fine-tuning requirements are introduced

Engineering Contradiction:
Improveinference efficiencyVSAvoidprocessing overhead
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent performs quantization calibration and parameter determination during a preliminary training phase using calibration datasets. This preliminary action captures the relationship between high-precision training weights and low-precision inference weights, storing this mapping information for direct use during inference without requiring dynamic quantization or additional fine-tuning.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a static quantization mapping table that copies the quantization relationships learned during calibration directly to the inference model. This copying approach eliminates the need for dynamic quantization computation during inference, reducing processing overhead while maintaining inference efficiency.

Inventive Principle:
Principle #26Copying

3Reliability

If constraints are applied during training to prevent overflow in reduced precision formats, then numerical stability is improved, but model accuracy and flexibility are reduced

Engineering Contradiction:
Improvenumerical stabilityVSAvoidmodel performance
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent changes the data precision parameter from FP32 to reduced precision formats (float16, INT8) to enable efficient inference. By using post-training quantization with calibration datasets, the system achieves numerical stability without applying constraints during training, thereby maintaining model flexibility and performance.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces calibration datasets as an intermediary between training and inference. These datasets capture the statistical properties of actual inference inputs, allowing the system to determine optimal quantization parameters that ensure numerical stability without constraining the training process or reducing model adaptability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20210256348A1Automated methods for conversions to a lower precision data format
Publication Date: 2021.08.19 NVIDIA CORP
  • US20210256348A1 patent drawing
  • US20210256348A1 patent drawing
  • US20210256348A1 patent drawing

AI summary

Aspects of the present invention are directed to computer-implemented techniques for performing data compression and conversion between data formats of varying degrees of precision, and more particularly for improving the inferencing (application) of artificial neural networks using a reduced precision (e.g., INT8) data format. Embodiments of the present invention generate candidate conversions of data output, then employ a relative measure of quality to identify the candidate conversion with the greatest accuracy (i.e., least divergence from the original higher precision values). The representation can be then be used during inference to perform computations on the resulting output data.