Neural Network Calculation Device Pre-scaling Weight Matrix

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing neural network (NN) calculation methods face inefficiencies in performing numerical conversions between floating-point and integer operations, which affects computing performance and accuracy in NN operations.

Innovation Solution

A neural network calculation device and method that involves pre-scaling the weight matrix of a trained neural network model to generate a scaled weight matrix, allowing for efficient floating-point-to-integer or integer-to-floating-point conversions within the matrix operation circuit, thereby eliminating the need for scaling during each numerical conversion process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If floating-point operations are used in neural network computations, then calculation accuracy is improved, but computing performance deteriorates

Engineering Contradiction:
Improvecalculation accuracyVSAvoidcomputing performance
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent applies parameter changes by converting between floating-point and integer representations dynamically. The system maintains floating-point precision for accurate calculations during matrix operations, then converts to integer format for faster subsequent computations. This parameter transformation allows the system to leverage the high accuracy of floating-point arithmetic when needed while achieving the speed benefits of integer operations, thereby resolving the contradiction between accuracy and computing performance.

Inventive Principle:
Principle #35Parameter changes

2Productivity

If integer operations are used in neural network computations, then computing performance is improved, but calculation accuracy deteriorates

Engineering Contradiction:
Improvecomputing performanceVSAvoidcalculation accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent implements preliminary action by performing floating-point matrix operations and conversions in advance before integer operations are executed. The system pre-computes scaled weight matrices and performs necessary numerical conversions beforehand, so that when integer operations are performed, the data is already in the appropriate format. This preliminary preparation allows the system to achieve high computing performance through integer operations while maintaining the accuracy benefits of floating-point arithmetic through the pre-computed scaled representations.

Inventive Principle:
Principle #10Preliminary action

3Adaptability or versatility

If numerical conversion is performed during each operation, then flexibility is maintained, but computational time increases

Engineering Contradiction:
ImproveflexibilityVSAvoidcomputational time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by performing numerical conversions and scaling operations in advance during model training or initialization, rather than during each forward propagation step. The system pre-scales weight matrices and performs floating-point-to-integer conversions beforehand, storing the converted values for use during inference. This approach maintains the flexibility to switch between floating-point and integer operations while significantly reducing computational time by eliminating repeated conversions during actual neural network computations.

Inventive Principle:
Principle #10Preliminary action

4Measurement precision

If scaling is performed during each numerical conversion, then conversion accuracy is improved, but device complexity increases

Engineering Contradiction:
Improveconversion accuracyVSAvoiddevice complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent implements preliminary action by performing scaling operations during model training or initialization rather than during each numerical conversion. The system pre-computes scaled weight matrices and stores them, eliminating the need for repeated scaling during inference. This approach maintains conversion accuracy by using pre-scaled representations while significantly reducing device complexity by removing the need for dynamic scaling circuitry during forward propagation, thereby resolving the contradiction between conversion accuracy and device complexity.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20240256632A1Neural network calculation device and numerical conversion method in neural network calculation
Publication Date: 2024.08.01 NEUCHIPS CORP
  • US20240256632A1 patent drawing
  • US20240256632A1 patent drawing
  • US20240256632A1 patent drawing

AI summary

A neural network (NN) calculation device and a numerical conversion method in NN calculation. The NN calculation device includes a memory and a matrix operation circuit. The memory provides a scaled weight matrix. The scaled weight matrix is a scaled result generated by performing pre-scaling on an original weight matrix of a trained NN model. The matrix operation circuit is coupled to the memory. The matrix operation circuit performs a floating-point matrix operation on an activation matrix and the scaled weight matrix to obtain a first operation result matrix, and performs a floating-point-to-integer conversion to convert the first operation result matrix into a second operation result matrix. Alternatively, the matrix operation circuit performs integer-to-floating-point conversion to convert a first activation matrix into a second activation matrix, and performs a floating-point matrix operation on the second activation matrix and a scaled weight matrix to obtain an operation result matrix.