KR-102962505-B1 - MATRIX INDEX INFORMATION GENERATION METOHD, MATRIX PROCESS METHOD USING MATRIX INDEX INFORMATION
Abstract
A method for generating matrix index information for a target matrix including a sparse matrix and a method for processing a matrix using matrix index information are disclosed. The disclosed method for generating matrix index information includes: a step of checking for the presence or absence of a non-zero element in each row or column of the target matrix; and a step of generating a first bit sequence including information on the presence or absence of the non-zero element for each row or column of the target matrix.
Inventors
- 박기호
- 한치원
Assignees
- 세종대학교산학협력단
Dates
- Publication Date
- 20260508
- Application Date
- 20230215
- Priority Date
- 20221213
Claims (16)
- In a method for generating matrix index information performed in a matrix processing unit, A step of checking for the presence or absence of non-zero elements in each row or column of the target matrix; and The method includes the step of generating a first bit sequence containing information on the presence or absence of the nonzero element for each row or column of the target matrix, and The above first bit sequence is It includes bits corresponding to each row or column of the above target matrix, In the first bit sequence above, the bit value corresponding to the row or column containing the non-zero element and the bit value corresponding to the row or column not containing the non-zero element are different from each other. Method for generating matrix index information.
- delete
- In Article 1, A step of generating a second bit sequence including position information of the non-zero element within the target matrix. A method for generating matrix index information that includes additional
- In Paragraph 3, The above second bit sequence is, It includes bits corresponding to each position of an element within the above target matrix, In the second bit sequence above, the bit value corresponding to the position of the zero element of the target matrix and the bit value corresponding to the position of the non-zero element are different from each other. Method for generating matrix index information.
- delete
- delete
- delete
- delete
- In a matrix processing method performed in a matrix processing device, A step of loading a non-zero element of the first target matrix from memory using matrix index information for the first target matrix; and It includes the step of transferring the above-mentioned loaded data to an arithmetic unit, The above matrix index information For each row or column of the first target matrix, the bit sequence includes information on the presence or absence of the nonzero element, and corresponds to a bit sequence including a bit corresponding to each row or column of the first target matrix. In the above bit sequence, the bit value corresponding to the row or column containing the non-zero element and the bit value corresponding to the row or column not containing the non-zero element are different from each other. The above memory is The elements of the row or column containing the nonzero element in the first target matrix are stored, The step of loading elements from memory as the theorem of the first target matrix above is Loading the elements of the row or column containing the non-zero element in the first target matrix above. Matrix processing method using matrix index information.
- delete
- In Article 9, The step of loading the above-mentioned nonzero element from memory is Using the above matrix index information, among the elements of the second target matrix, only the elements that are the target of multiplication with the non-zero elements of the first target matrix are loaded from the memory. Matrix processing method using matrix index information.
- In Article 9, The above matrix index information It further includes position information of the nonzero element within the first target matrix, The above memory is The zero element of the first target matrix is not stored, and the non-zero element is stored. Matrix processing method using matrix index information.
- delete
- delete
- delete
- delete
Description
Method for generating matrix index information, method for processing matrix using matrix index information {MATRIX INDEX INFORMATION GENERATION METHOD, MATRIX PROCESS METHOD USING MATRIX INDEX INFORMATION} The present invention relates to a method for generating index information of a matrix and a method for processing a matrix using the index information of the matrix, and more specifically, to a method for generating index information for a target matrix including a sparse matrix and a method for processing a matrix using the index information of the matrix. As neural network models evolve, the depth of layers that these models must process is increasing. Due to these factors, the number of parameters, such as weight matrices, in neural network models has grown, leading to high memory overhead emerging as a significant issue. As a solution to this problem, research has been conducted on matrix indexing methods that can efficiently perform operations on sparse matrices by utilizing the fact that pruning techniques, which are performed to solve the overfitting problem of neural network models, turn weight matrices into sparse matrices. Compressed Sparse Row (CSR) is widely used as an indexing method for sparse matrices; however, sparse matrix indexing methods like CSR have disadvantages, such as the need for computations to check index size and location when applied at the weight matrix level, and significant overhead when representing matrices with low sparsity, i.e., matrices with a small number of non-zero elements. Relevant prior art includes Korean published patents No. 2020-0052182, No. 2018-0067426, and No. 2022-0002020. Figure 1 is a diagram illustrating CSR, one of the matrix indexing methods. FIG. 2 is a diagram illustrating a method for generating matrix index information according to an embodiment of the present invention. FIG. 3 is a diagram showing matrix index information according to an embodiment of the present invention. FIG. 4 is a diagram illustrating a method for generating matrix index information according to another embodiment of the present invention. FIG. 5 is a diagram showing matrix index information according to another embodiment of the present invention. FIG. 6 is a diagram illustrating the size of matrix index information according to an embodiment of the present invention. FIG. 7 is a diagram illustrating a matrix processing device using matrix index information according to an embodiment of the present invention. FIG. 8 is a diagram illustrating a matrix processing method using matrix index information according to an embodiment of the present invention. FIG. 9 is a drawing showing memory storage data according to an embodiment of the present invention. FIG. 10 is a drawing showing memory storage data according to another embodiment of the present invention. The present invention is susceptible to various modifications and may have various embodiments, and specific embodiments are illustrated in the drawings and described in detail. However, this is not intended to limit the invention to specific embodiments, and it should be understood that the invention includes all modifications, equivalents, and substitutions that fall within the spirit and scope of the invention. Similar reference numerals have been used for similar components in the description of each drawing. Hereinafter, embodiments according to the present invention will be described in detail with reference to the attached drawings. Figure 1 is a diagram illustrating CSR, one of the matrix indexing methods. According to CSR, indexing is performed on a row-by-row basis of the matrix. As shown in FIG. 1, when a 3x3 target matrix (100) containing 0 other than non-zero elements a, b, c, and d is given, according to CSR, indexing is performed for each of the three rows, and index information for rows and columns is generated. The index information for rows includes cumulative information on the number of non-zero elements for each row, and the index information for columns includes location information of non-zero elements in each row. In the first row (110), there is one thesis element (a), and in the second row (120), there are two thesis elements (b, c). And in the third row (130), there is one thesis element (d). Accordingly, the index information (140) for the row includes index 1 corresponding to the number of thesis elements in the first row (110), index 3 corresponding to the value obtained by adding the number of thesis elements in the second row (120) to the number of thesis elements in the first row (110), and index 4 corresponding to the value obtained by adding the number of thesis elements in the third row (130) to the value obtained by adding the number of thesis elements in the first and second rows (110, 120). And in the first row (110), the non-zero element (a) is located in the first column, and in the second row (120), the non-zero elements (b, c) are located in the second and third columns. Final