Hardware-Aware Cost Model for Dynamic DNN Quantization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Deep neural networks face challenges in industrial deployment due to high computational complexity during inference, particularly with strict accuracy requirements for low precision models, where some operators need higher precision than 8-bit, leading to performance sacrifices in fallback mechanisms.

Innovation Solution

A hardware-aware cost model is introduced to optimize low precision inference by estimating computation and memory/cache costs based on hardware specifications, providing dynamic quantization knobs for converting conventional precision models to low precision models through performance simulation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If low precision (8-bit) inference is used, then computational speed and efficiency are improved, but accuracy deteriorates requiring fallback to higher precision

Engineering Contradiction:
Improveinference speedVSAvoidmodel accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent dynamically changes the precision parameter (data type) of neural network operators based on a cost model evaluation. Instead of using a fixed precision for all operators, the system selects between INT8, FP16, and FP32 precisions for each operator individually, optimizing the balance between speed and accuracy for each specific operation in the network.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces dynamic precision selection where the precision of each operator is determined at runtime based on hardware specifications and performance requirements. The cost model dynamically evaluates whether to use low precision (INT8) for speed or higher precision (FP16/FP32) for accuracy, making the system adaptable rather than static.

Inventive Principle:
Principle #15Dynamics

2Measurement precision

If higher precision operators are used to maintain accuracy, then model accuracy is preserved, but computational complexity and processing time increase

Engineering Contradiction:
Improvemodel accuracyVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent applies different precision levels to different parts (operators) of the neural network based on their specific requirements. Critical operators that heavily impact accuracy are executed in higher precision (FP16 or FP32), while less sensitive operators use lower precision (INT8), creating a heterogeneous precision architecture optimized for each local region of the network.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system changes the precision parameter of individual operators based on their contribution to overall accuracy and their computational cost. The cost model identifies which operators benefit most from higher precision and allocates computational resources accordingly, reducing overall complexity while preserving necessary accuracy.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If fallback mechanisms are implemented to handle precision requirements, then accuracy requirements are met, but performance is sacrificed

Engineering Contradiction:
Improveaccuracy requirement satisfactionVSAvoidinference performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent performs preliminary analysis using a cost model to determine the optimal precision for each operator before actual inference execution. This advance planning eliminates the need for runtime fallback mechanisms, as the precision strategy is pre-determined based on hardware characteristics and accuracy requirements, ensuring both reliability and performance.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The cost model provides feedback about the expected accuracy and performance impact of different precision choices. This feedback mechanism allows the system to make informed decisions about precision allocation, avoiding both unnecessary high-precision computations and accuracy-critical low-precision operations.

Inventive Principle:
Principle #23Feedback

4Productivity

If conventional precision models are converted to low precision models, then inference efficiency is improved, but quantization accuracy challenges arise

Engineering Contradiction:
Improveinference efficiencyVSAvoidquantization accuracy
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The patent applies different quantization parameters (precision levels) to different operators based on their sensitivity to quantization errors. Instead of uniform quantization across the entire network, the system selectively quantizes operators that are less sensitive to precision changes while maintaining higher precision for operators where quantization would significantly degrade accuracy.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20240289612A1Method and apparatus for optimizing inference of deep neural networks
Publication Date: 2024.08.29 INTEL CORP
  • US20240289612A1 patent drawing
  • US20240289612A1 patent drawing
  • US20240289612A1 patent drawing

AI summary

The application provides a hardware-aware cost model for optimizing inference of a deep neural network (DNN) comprising: a computation cost estimator configured to compute estimated computation cost based on input tensor, weight tensor and output tensor from the DNN; and a memory/cache cost estimator configured to perform memory/cache cost estimation strategy based on hardware specifications, wherein the hardware-aware cost model is used to perform performance simulation on target hardware to provide dynamic quantization knobs to quantization as required for converting a conventional precision inference model to an optimized inference model based on the result of the performance simulation.