Neural Network Tensor Precision Adaptation via Histogram Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
At lower precision floating-point formats, such as FP8, it is challenging to represent values of different network tensors spanning various ranges without some values falling outside the representable range, leading to numerical underflow and overflow issues and increased quantization error in neural network training and deployment.
Innovation Solution
A method is described to determine a format for representing network tensors based on their statistics, involving computing a histogram of tensor elements, selecting a target numerical format with lower precision, and evaluating a metric to assess the accuracy of representation, allowing for conversion to an optimal format that matches the tensor data range.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If lower-precision floating-point formats (e.g., FP8) are used to reduce memory usage and computational cost, then productivity and energy efficiency are improved, but manufacturing precision and reliability deteriorate due to numerical underflow and overflow
Solution Approach 1:
The patent implements dynamic precision adjustment where the system automatically selects between different precision levels (FP32, FP16, FP8, or custom formats) based on the specific computational context, data characteristics, and accuracy requirements. This allows the system to use lower precision when acceptable and higher precision when necessary, resolving the contradiction between speed and precision
Solution Approach 2:
The patent changes the numerical representation parameters by introducing custom floating-point formats with configurable exponent and mantissa bit allocations, and by dynamically adjusting precision levels based on data statistics and computational requirements. This enables optimization of both speed and precision rather than being constrained to fixed precision formats
2Quantity of substance
If lower-precision formats are used to reduce memory usage, then loss of substance is reduced, but manufacturing precision deteriorates due to increased quantization error
Solution Approach 1:
The patent applies different precision levels to different parts of the neural network based on their specific requirements. Critical layers and parameters maintain higher precision while less sensitive components use lower precision, optimizing the balance between memory efficiency and overall model accuracy
Solution Approach 2:
The system dynamically adjusts precision requirements for different tensors and computations based on their statistical properties and importance to the final output, rather than applying a uniform precision level across the entire network
3Adaptability or versatility
If standard floating-point formats are used to ensure broad representable range, then adaptability is improved, but productivity deteriorates due to higher computational cost
Solution Approach 1:
The system dynamically adapts the floating-point format parameters (exponent bits, mantissa bits, bias values) based on the actual data distribution and computational requirements, rather than using fixed standard formats. This allows optimization for specific workloads while maintaining adaptability to different scenarios
Solution Approach 2:
The patent introduces configurable floating-point format parameters that can be adjusted to match the specific range and precision requirements of different neural network components, replacing rigid standard formats with flexible custom formats
Data Source
AI summary
A computer-implemented method comprising: processing data in a neural network to compute a network tensor comprising a plurality of tensor elements represented in an initial numerical format; computing a histogram of tensor elements; selecting a target numerical format, the target numerical format having a lower precision than the initial numerical format; evaluating a metric based on the histogram of tensor elements and the target numerical format, the metric indicating a degree of accuracy of a representation of the network tensor in the target numerical format; and based on the evaluated metric, converting the plurality of tensor elements from the initial numerical format to the target numerical format.


