Neural Network Quantization Calibration for Edge Memory Limits

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Edge devices such as mobile phones and wearable devices have limited computing power and memory, making it challenging to run deep neural networks efficiently without compromising accuracy or increasing resource consumption.

Innovation Solution

An automatic quantization system that converts 32-bit floating point neural network models into 8-bit quantized models, reducing precision and thereby consuming less memory and energy, while maintaining output quality with minimal loss of accuracy, by using an automatic quantization library to parse and analyze the computational graph and calibrate the model.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If 32-bit floating point precision is used in neural network models, then accuracy is maintained, but memory consumption and computational resources increase

Engineering Contradiction:
Improvemodel accuracyVSAvoidmemory consumption
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent applies parameter changes by systematically varying the precision level of neural network parameters from 32-bit floating point to lower precision formats (16-bit, 8-bit, or lower). This allows the model to maintain acceptable accuracy while significantly reducing memory consumption and computational requirements, making deep learning models feasible for deployment on edge devices with limited resources.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent implements partial quantization where different portions of the neural network are quantized to different precision levels based on their importance and sensitivity to precision changes. Critical layers maintain higher precision while less sensitive layers use lower precision, achieving a balance between accuracy preservation and resource reduction.

Inventive Principle:
Principle #16Partial or excessive action

2Measurement precision

If 32-bit floating point precision is used in neural network models, then output quality is maintained, but processing power requirements increase

Engineering Contradiction:
Improveoutput qualityVSAvoidcomputational resources
Core Design Contradiction:
Measurement precisionVSPower

Solution Approach 1:

The patent changes the numerical representation parameters of neural network weights and activations from 32-bit floating point to lower precision formats. This reduction in parameter precision directly decreases the computational complexity of matrix operations, reducing processing power requirements and energy consumption while maintaining output quality within acceptable thresholds.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces dynamic precision adjustment mechanisms that adapt the precision level based on the specific computational context, input data characteristics, and layer importance. This allows the system to use higher precision when needed for accuracy-critical operations and lower precision for routine computations, optimizing the trade-off between output quality and processing power dynamically.

Inventive Principle:
Principle #15Dynamics

3Volume of moving object

If model size is reduced through quantization, then deployment on edge devices is enabled, but accuracy may be compromised

Engineering Contradiction:
Improvemodel sizeVSAvoidaccuracy
Core Design Contradiction:
Volume of moving objectVSMeasurement precision

Solution Approach 1:

The patent systematically changes the precision parameters of model parameters during quantization, reducing model size from gigabytes to megabytes or kilobytes. This enables deployment on edge devices with limited storage and memory while incorporating calibration and fine-tuning processes to minimize accuracy degradation, achieving acceptable performance levels on resource-constrained platforms.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent performs preliminary quantization analysis and calibration on a validation dataset before final model deployment. This preliminary action identifies which parameters are most sensitive to quantization and applies appropriate precision levels accordingly, preserving accuracy for critical parameters while maximizing compression for less sensitive ones, thereby minimizing overall accuracy loss.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20240053959A1Automatic quantization of a floating point model
Publication Date: 2024.02.15 SNAP INC
  • US20240053959A1 patent drawing
  • US20240053959A1 patent drawing
  • US20240053959A1 patent drawing

AI summary

Aspects of the present disclosure involve a system comprising a computer-readable storage medium storing a program and method for automatic quantization of a floating point model. The program and method provide for providing a floating point model to an automatic quantization library, the floating point model being configured to represent a neural network, and the automatic quantization library being configured to generate a first quantized model based on the floating point model; providing a function to the automatic quantization library, the function being configured to run a forward pass on a given dataset for the floating point model; causing the automatic quantization library to generate the first quantized model based on the floating point model; causing the automatic quantization library to calibrate the first quantized model by running the first quantized model on the function; and converting the calibrated first quantized model to a second quantized model.