Matrix multiplication in a vector processing system
First Claim
1. A method for efficiently performing matrix multiplication in a vector processing computer system by using partial products that is bit-by-bit compatible with conventional matrix multiplication techniques, wherein two matrices are stored in vector registers within the computer system, comprising the steps of:
- storing values within a first group of vector registers within a vector processor that each comprise multiple copies of a respective individual value of a first matrix to be multiplied;
storing values within a second group of vector registers within a vector processor that each comprise values from a respective row of a second matrix to be multiplied;
dot multiplying each of said first vector registers having values from a single row of said first matrix by each of said second vector registers;
adding the values obtained by said step of multiplying to a third group of vector registers corresponding to a product matrix; and
repeating said steps of multiplying and adding, for said first vector registers having values from every row of said first matrix.
2 Assignments
0 Petitions
Accused Products
Abstract
The present invention is directed to a system and method for multiplication of matrices in a vector processing system. Partial products are obtained by dot multiplication of vector registers containing multiple copies of elements of a first matrix and vector registers containing values from rows of a second matrix. The dot products obtained from this dot multiplication are subsequently added to vector registers which make up a product matrix. In an embodiment of the present invention, each matrix may be divided into submatrices to facilitate the rapid and efficient multiplication of large matrices, which is done in parts by computing partial products of each submatrix. The matrix multiplication performed by the present invention avoids rounding errors as it is bit-by-bit compatible with conventional matrix multiplication methods.
126 Citations
18 Claims
-
1. A method for efficiently performing matrix multiplication in a vector processing computer system by using partial products that is bit-by-bit compatible with conventional matrix multiplication techniques, wherein two matrices are stored in vector registers within the computer system, comprising the steps of:
-
storing values within a first group of vector registers within a vector processor that each comprise multiple copies of a respective individual value of a first matrix to be multiplied;
storing values within a second group of vector registers within a vector processor that each comprise values from a respective row of a second matrix to be multiplied;
dot multiplying each of said first vector registers having values from a single row of said first matrix by each of said second vector registers;
adding the values obtained by said step of multiplying to a third group of vector registers corresponding to a product matrix; and
repeating said steps of multiplying and adding, for said first vector registers having values from every row of said first matrix. - View Dependent Claims (2, 3)
-
-
4. A system for efficiently performing matrix multiplication in a vector processing computer system by using partial products that produces a bit-by-bit compatible result with conventional matrix multiplication techniques, wherein values of two matrices are stored in vector registers within the computer system, comprising the steps of:
-
means for storing values within a first group of vector registers within a vector processor that each comprise multiple copies of each individual value of a first matrix to be multiplied;
means for storing values within a second group of vector registers within a vector processor that each comprise values from each row of a second matrix to be multiplied;
means for dot multiplying each of said first vector registers having values from a single row of said first matrix by each of said second vector registers; and
means for adding the values obtained by said step of multiplying to a third group of vector registers corresponding to a product matrix. - View Dependent Claims (5, 6)
-
-
7. A method for multiplying two matrices that is bit-by-bit compatible with conventional matrix multiplication techniques in a vector processor, comprising the steps of:
-
(i) replicating the value of each element of a first matrix to form corresponding vectors each having a number of elements corresponding to the number of columns in a second matrix, and storing said vectors in a first set of registers;
(ii) storing the value of the elements of each row of said second matrix as corresponding vectors in a second set of registers;
(iii) multiplying a vector in one of said first set of registers with a vector in one of said second set of registers such that the vector in one of the first set of registers multiplied with a vector in one of the second set of registers is selected from a single row within the first matrix, and adding the resulting products as a vector in one of a set of third registers corresponding to the rows of a product matrix equivalent to the row from which the element stored in the vector of the first set of registers is taken; and
(iv) iteratively repeating step (iii) for each vector in said first set of registers. - View Dependent Claims (8, 9)
-
-
10. A method for efficiently calculating the product of a first matrix and a second matrix in a vector processing system that is bit-by-bit compatible with conventional matrix multiplication techniques, wherein said first matrix is stored in a plurality of first vector registers, and wherein said second matrix is stored in a plurality of second vector registers, and wherein each of said first plurality of vector registers corresponds to an individual row of said first matrix, and each of said second plurality of vector registers corresponds to an individual row of said second matrix, comprising the steps of:
-
(1) selecting a vector register corresponding to a row of said first matrix;
(2) storing multiple copies of a single value from the register selected in step 1 in a vector register and wherein the single value selected from the vector register selected in step 1 has a specific index within the vector register selected in step 1;
(3) calculating the dot product of the vector register containing multiple copies of a single value that was stored in step 2 and the vector register containing elements from the row number of the second matrix which corresponds to the index of the element stored within the vector register in step 2;
(4) adding the dot product calculated in step 3 in one of a third group of vector registers that form a third matrix, which is the product of the first two matrices, by adding the dot product value in the register corresponding to the row of the product matrix that is equivalent to the row of the first matrix that corresponds to the vector register selected in step 1;
(5) repeating steps 2 through 4 for each of the elements contained within the register selected in step 1; and
(6) repeating steps 1 through 5 for each of the registers corresponding to each row of the first matrix. - View Dependent Claims (11, 12, 13)
-
-
14. A method for efficiently calculating the product of a first matrix and a second matrix in a vector processing system that is bit-by-bit compatible with conventional matrix multiplication techniques, wherein said first matrix is stored in a plurality of first vector registers, and wherein said second matrix is stored in a plurality of second vector registers, comprising the steps of:
-
(i) dividing each of said first and second matrices into a plurality of submatrices;
(ii) assigning values of each submatrix associated with said first and second matrices to said pluralities of first and second vector registers, respectively, in a manner such that each of said first plurality of vector registers corresponds to an individual row of a submatrix of said first matrix, and each of said second plurality of vector registers corresponds to an individual row of a submatrix of said second matrix;
(iii) selecting a vector register corresponding to a row of a submatrix of said first matrix;
(iv) storing multiple copies of a single value from the register selected in step (iii) in a vector register, and wherein the single value selected from the vector register selected in step (iii) has a specific index within the vector register selected in step (iii);
(v) calculating the dot product of the vector register containing multiple copies of a single value that was stored in step (iv) and the vector register containing elements from the row number of each submatrix of the second matrix which corresponds to the index of the element stored within the vector register in step (iv);
(vi) adding the dot product calculated in step (v) to one of a third group of vector registers that form a third matrix, which is the product of the first two matrices, by adding the dot product value in the register corresponding to the row of the submatrix within the product matrix that is equivalent to the row of the first matrix that corresponds to the vector register selected in step (iii);
(vii) repeating steps (iv-vi) for each of the elements contained within the register selected in step (i); and
(viii) repeating steps (iii-vii) for each of the registers corresponding to each row of each submatrix of the first matrix. - View Dependent Claims (15, 16, 17, 18)
-
Specification