Batch Normalization Fusion and Quantization for Neural Network Inference
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing neural network architectures, particularly convolutional neural networks, face inefficiencies in computation and memory access due to the extensive processing requirements of batch normalization, convolutional, and rectified linear unit layers, which degrade inference performance in real-time applications like autonomous driving.
Innovation Solution
The method involves merging batch normalization and convolutional layer parameters with rectified linear unit functions to perform in-place computations, minimizing memory access and accelerating inference performance by quantizing parameters for 8-bit integer operations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If separate batch normalization and convolutional layer implementations are used, then model accuracy is maintained, but computation efficiency deteriorates and memory access increases
Solution Approach 1:
The patent merges the batch normalization layer and convolutional layer into a single fused operation. The batch normalization parameters (mean, variance, scale, shift) are integrated with the convolutional kernel and bias parameters, allowing both operations to execute simultaneously in one pass through the data. This eliminates the need for separate layer implementations and intermediate memory storage, directly resolving the contradiction by improving computation efficiency while maintaining the functional complexity of both layers.
Solution Approach 2:
The patent performs preliminary computation of batch normalization parameters (mean and variance) during the training phase and stores them for inference. During inference, these pre-computed parameters are used directly in the fused operation without requiring additional computation passes. This preliminary action reduces the computational burden during inference while maintaining accuracy, addressing the efficiency- complexity contradiction.
2Productivity
If results are stored in memory at each layer, then computation accuracy is maintained, but memory access time increases and computation efficiency deteriorates
Solution Approach 1:
By fusing batch normalization and convolutional operations, the patent eliminates intermediate memory storage between these layers. The output of the batch normalization operation is directly fed into the convolutional operation within the same computational pass, removing the need to write intermediate results to memory and read them back. This directly reduces memory access time while maintaining computational accuracy through proper data flow management.
Solution Approach 2:
The fused operation enables continuous computation flow where data flows directly from batch normalization to convolution without interruption or memory storage. This continuous action maintains data in registers or fast buffers throughout the computation chain, eliminating memory access bottlenecks while preserving the mathematical accuracy of each operation through proper floating-point arithmetic management.
3Measurement precision
If 32-bit floating point operations are used, then computation precision is maintained, but processing speed deteriorates compared to integer operations
Solution Approach 1:
The patent quantizes the batch normalization parameters (mean, variance, scale, shift) and convolutional parameters (kernel, bias) to 8-bit integer representations. This parameter change from 32-bit floating point to 8-bit integer enables the use of faster integer arithmetic operations while maintaining sufficient precision for the neural network inference task. The quantization process includes calculating scale and zero-point values to map floating-point ranges to integer ranges, preserving computational accuracy.
Solution Approach 2:
The patent implements a phase transition in the data representation format from floating-point to integer domain. During the fused batch normalization and convolution operation, data is transformed through quantization to integer format for computation, then converted back to floating-point for the output. This phase transition enables exploitation of faster integer arithmetic hardware while maintaining the precision requirements through careful quantization design and dequantization processes.
Data Source
AI summary
Batch normalization (BN) layer fusion and quantization method for model inference in artificial intelligence (AI) network engine are disclosed. A method for a neural network (NN) includes merging batch normalization (BN) layer parameters with NN layer parameters and computing merged BN layer and NN layer functions using the merged BN and NN layer parameters. A rectified linear unit (RELU) function can be merged with the BN and NN layer functions.


