Image Matrix Processing Without Channel Filling Overhead
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing matrix operation methods for image data in neural networks are computationally intensive and inefficient, particularly for small matrices, due to the additional time and resource consumption caused by data rearrangement and channel filling.
Innovation Solution
A method that involves reading matrix data, calculating column data with a single instruction, multiplexing and rearranging the intermediate result into cached rows, and performing further calculations to obtain an image processing result without channel filling, optimizing the operation efficiency for small matrices.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If data rearrangement is performed on source matrix data (e.g., NC4HW4 format), then the matrix operation can be optimized for large matrices, but additional time is consumed due to large-scale data adjustment and channel filling is required
Solution Approach 1:
The patent segments the matrix operation into distinct phases: data reading, column calculation, intermediate result generation, and final result computation. By dividing the operation into manageable segments, the patent avoids the need for complete data rearrangement while maintaining operational efficiency.
Solution Approach 2:
The patent performs preliminary column calculations on the source matrix data before final processing. By calculating column data in advance and storing intermediate results, the patent eliminates the need for time-consuming data rearrangement and channel filling operations that would otherwise be required.
2Adaptability or versatility
If channel filling is performed for matrices with channels not divisible by 4, then the matrix operation can proceed, but additional resource consumption and time are required
Solution Approach 1:
The patent changes the computational approach by calculating column data independently rather than requiring channel alignment. This parameter change in the calculation method allows the system to handle any channel number without padding or filling operations, thereby eliminating the associated resource consumption.
3Ease of manufacture
If conventional matrix operation methods are used, then the process is simple to implement, but the operation efficiency is low due to computational intensity and redundant calculations
Solution Approach 1:
The patent performs preliminary column calculations and stores intermediate results before the final matrix operation. This preliminary action eliminates redundant calculations during the main operation, significantly improving efficiency while maintaining implementation simplicity through a clear two-stage process.
Solution Approach 2:
The patent creates intermediate result copies from the source matrix data through column calculations. These copied intermediate results are then used in the final operation, avoiding repeated access to the original data and reducing computational overhead.
Data Source
AI summary
The disclosure relates to method and apparatus for operating image data. The method includes: reading matrix data from the image data based on a matrix size, M rows and N columns, of an image operator (220); calculating column data in the matrix data with a single calculation instruction corresponding to the image operator, to obtain an intermediate calculation result (240); multiplexing and rearranging the intermediate calculation result into N rows of cached data (260); calculating matrix elements of a target column in the N rows of cached data with the single calculation instruction, to obtain a calculation result of the matrix data under the single calculation instruction (280); and outputting the calculation result as an image processing result of the matrix data by the image operator (300).


