Dynamic Quantization for Edge Neural Networks

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Neural networks deployed on edge devices face accuracy loss due to quantization, as existing methods like post training quantization and quantization aware training have limitations in handling dynamic data formats and constraints, leading to suboptimal inference performance.

Innovation Solution

Implementing dynamic quantization for neural networks by calculating statistics on output layers and dynamically adjusting data formats and weight kernels based on current image statistics, allowing for real-time adaptation and parallel processing in heterogeneous architectures.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If post training quantization is used to minimize effort in porting neural networks to edge devices, then ease of operation is improved, but manufacturing precision deteriorates due to locked data formats and precision loss

Engineering Contradiction:
Improveeffort required in porting neural networkVSAvoidinference accuracy
Core Design Contradiction:
Ease of operationVSManufacturing precision

Solution Approach 1:

The patent implements dynamic quantization where data formats are not locked but continuously adjusted based on input statistics. The system calculates statistics like min, max, and variance for each layer during inference and dynamically determines optimal data formats, allowing the quantization parameters to adapt to different input distributions while maintaining ease of deployment on edge devices.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes quantization parameters (data formats, precision levels) based on calculated statistics from representative datasets. By computing layer-wise statistics and using them to determine optimal fixed-point representations, the system achieves better accuracy while maintaining the simplicity of post-training quantization deployment.

Inventive Principle:
Principle #35Parameter changes

2Manufacturing precision

If quantization aware training is used to model quantization loss and improve accuracy, then manufacturing precision is improved, but device complexity increases due to additional training requirements and unmodeled constraints

Engineering Contradiction:
Improveinference accuracyVSAvoidtraining complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent performs preliminary calculation of statistics (min, max, variance, histogram) on representative datasets before finalizing the quantization scheme. This preliminary action allows the system to determine optimal data formats in advance without requiring complex quantization-aware training, reducing training complexity while maintaining accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses calculated statistics from representative datasets as feedback to determine optimal data formats for each layer. This feedback mechanism allows the system to iteratively refine quantization parameters based on actual performance metrics, achieving accuracy improvement without the complexity of quantization-aware training.

Inventive Principle:
Principle #23Feedback

3Use of energy by moving object

If fixed point container format is used to save bandwidth and computation cost, then use of energy is improved, but manufacturing precision deteriorates due to trade-off between range and precision

Engineering Contradiction:
Improvecomputation costVSAvoidprecision
Core Design Contradiction:
Use of energy by moving objectVSManufacturing precision

Solution Approach 1:

The patent applies different data formats and precision levels to different layers based on their specific requirements. By calculating statistics for each layer individually and determining optimal fixed-point representations locally, the system achieves energy efficiency while minimizing precision loss in critical layers.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system dynamically adjusts precision and range parameters of fixed-point representations based on layer-wise statistics. By changing these parameters optimally for each layer rather than using a uniform format, the system achieves the right balance between energy efficiency and precision.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11568251B1Dynamic quantization for models run on edge devices
Publication Date: 2023.01.31 AMBARELLA INT LP
  • US11568251B1 patent drawing
  • US11568251B1 patent drawing
  • US11568251B1 patent drawing

AI summary

A method of generating a quantized neural network comprises (i) receiving a pre-trained neural network model and (ii) modifying the pre-trained neural network model to calculate one or more statistics on an output of one or more layers of the pre-trained neural network model based on a current image and set up an output data format for one or more following layers of the pre-trained neural network model for one or more of the current image and a subsequent image dynamically based on the one or more statistics.