GPU Sparse Matrix Processing Using Non-Zero Distribution Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing matrix processing methods, particularly for sparse matrices, face inefficiencies due to the need for element alignment and the performance of invalid operations involving zero elements during convolution operations, which reduces overall processing efficiency.

Innovation Solution

A method that determines the non-zero elements and their positions in a sparse matrix, creating a distribution matrix to indicate these positions, and combines this information with the non-zero elements to form a compressed matrix, allowing operations like convolution to be performed directly on the compressed matrix, thereby avoiding invalid calculations and improving efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If conventional matrix storage manner is used for sparse matrices, then complete matrix structure is preserved, but invalid operations on zero elements reduce processing efficiency

Engineering Contradiction:
Improvematrix operation efficiencyVSAvoidwasted computation on zero elements
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent extracts only the non-zero elements from the sparse matrix and stores them in a compressed format along with their position information. This extraction eliminates the need to process zero elements during matrix operations, directly resolving the contradiction between preserving complete matrix structure and avoiding wasted computation on zero elements.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent segments the sparse matrix into two components: non-zero elements and their corresponding position information (row and column indices). This segmentation allows the system to process only the meaningful data (non-zero elements) while ignoring the redundant zero elements, thereby improving operation efficiency without losing essential matrix information.

Inventive Principle:
Principle #1Segmentation

2Quantity of substance

If CSR compression is applied to sparse matrices, then storage efficiency is improved, but element alignment requires restoring zero elements before convolution operations

Engineering Contradiction:
Improvestorage space for sparse matrixVSAvoidconvolution operation efficiency
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The patent performs preliminary action by pre-calculating and storing the position information (row offsets and column indices) of all non-zero elements during the compression phase. This preliminary organization of data enables direct access to the correct elements during convolution operations without requiring restoration of zero elements, thus maintaining both storage efficiency and operation efficiency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces position information (row offset array and column index array) as intermediaries that bridge the compressed storage format and the convolution operation. These intermediary structures enable the system to efficiently locate and process only the necessary non-zero elements during convolution, eliminating the need to restore zero elements while maintaining correct element alignment.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Manufacturing precision

If zero elements are restored before convolution operations on CSR matrices, then element alignment is achieved, but invalid operations on zero elements are still performed

Engineering Contradiction:
Improveelement alignment accuracyVSAvoidprocessing speed during convolution
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent applies local quality by making different parts of the data structure serve different functions: the compressed value array stores only non-zero elements, while the separate position arrays (row offsets and column indices) store the structural information. This differentiation allows the convolution operation to process only non-zero elements with high speed while the position information ensures correct alignment, avoiding the need to restore and process zero elements.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent extracts the position information from the compressed matrix representation and uses it to guide the convolution operation. By extracting and utilizing the row and column index information separately, the system can achieve precise element alignment and process only the necessary non-zero elements, eliminating invalid operations on zero elements while maintaining alignment accuracy.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS11734386B2Matrix processing method and apparatus, and logic circuit
Publication Date: 2023.08.22 HUAWEI TECH CO LTD
  • US11734386B2 patent drawing
  • US11734386B2 patent drawing
  • US11734386B2 patent drawing

AI summary

A matrix processing method performed by a graphics processing unit (GPU) includes: determining a plurality of non-zero elements in a to-be-processed matrix at a processor in the GPU; generating a distribution matrix of the to-be-processed matrix at the processor, where the distribution matrix comprises identities for indicating positions of the plurality of non-zero elements in the to-be-processed matrix; obtaining a target matrix from another matrix by using the distribution matrix at a logic circuit in the processor, where the target matrix comprises a plurality of target elements from the another matrix; and performing matrix processing on the plurality of non-zero elements and the target matrix to obtain an operation result at the processor.