Configuring a programmable integrated circuit device to perform matrix multiplication
First Claim
1. A method of configuring a programmable integrated circuit device to perform multiplication of a first multiplicand matrix by a second multiplicand matrix to form a resultant matrix, wherein said first multiplicand matrix has a first number of rows and a second number of columns, said second multiplicand matrix has said second number of rows and a third number of columns, and said resultant matrix has a number of elements equal to a product of said first and third numbers, said method comprising:
- configuring logic of said programmable integrated circuit device as a fourth number of multipliers, wherein said fourth number is one-Nth of said second number;
configuring logic of said programmable integrated circuit device to break down each respective row of said first multiplicand matrix into N row-blocks and to break down each respective column of said second multiplicand matrix into N column-blocks, and to use said fourth number of multipliers to form a respective dot-product of each of said row-blocks with a respective one of said column-blocks to form N partial dot products of each respective row of said first multiplicand matrix and a corresponding respective column of said second multiplicand matrix, wherein;
each said row-block comprises more than one element of said respective row and fewer than all elements of said respective row, and each said column-block comprises more than one element of said respective column and fewer than all elements of said respective column, andall respective ones of said partial dot products involving each respective one of said row-blocks and all of said column-blocks being formed before forming any partial dot product involving any other one of said row-blocks;
configuring logic of said programmable integrated circuit device to save each of said N partial dot products until all of said N partial dot products have been computed; and
configuring logic of said programmable integrated circuit device to add said N partial dot products to provide an element of said resultant matrix corresponding to said respective row of said first multiplicand matrix and said corresponding respective column of said second multiplicand matrix.
1 Assignment
0 Petitions
Accused Products
Abstract
In a matrix multiplication in which each element of the resultant matrix is the dot product of a row of a first matrix and a column of a second matrix, each row and column can be broken into manageable blocks, with each block loaded in turn to compute a smaller dot product, and then the results can be added together to obtain the desired row-column dot product. The earliest results for each dot product are saved for a number of clock cycles equal to the number of portions into which each row or column is divided. The results are then added to provide an element of the resultant matrix. To avoid repeated loading and unloading of the same data, all multiplications involving a particular row-block can be performed upon loading that row-block, with the results cached until other multiplications for the resultant elements that use the cached results are complete.
-
Citations
25 Claims
-
1. A method of configuring a programmable integrated circuit device to perform multiplication of a first multiplicand matrix by a second multiplicand matrix to form a resultant matrix, wherein said first multiplicand matrix has a first number of rows and a second number of columns, said second multiplicand matrix has said second number of rows and a third number of columns, and said resultant matrix has a number of elements equal to a product of said first and third numbers, said method comprising:
-
configuring logic of said programmable integrated circuit device as a fourth number of multipliers, wherein said fourth number is one-Nth of said second number; configuring logic of said programmable integrated circuit device to break down each respective row of said first multiplicand matrix into N row-blocks and to break down each respective column of said second multiplicand matrix into N column-blocks, and to use said fourth number of multipliers to form a respective dot-product of each of said row-blocks with a respective one of said column-blocks to form N partial dot products of each respective row of said first multiplicand matrix and a corresponding respective column of said second multiplicand matrix, wherein; each said row-block comprises more than one element of said respective row and fewer than all elements of said respective row, and each said column-block comprises more than one element of said respective column and fewer than all elements of said respective column, and all respective ones of said partial dot products involving each respective one of said row-blocks and all of said column-blocks being formed before forming any partial dot product involving any other one of said row-blocks; configuring logic of said programmable integrated circuit device to save each of said N partial dot products until all of said N partial dot products have been computed; and configuring logic of said programmable integrated circuit device to add said N partial dot products to provide an element of said resultant matrix corresponding to said respective row of said first multiplicand matrix and said corresponding respective column of said second multiplicand matrix. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A programmable integrated circuit device configured to perform multiplication of a first multiplicand matrix by a second multiplicand matrix to form a resultant matrix, wherein said first multiplicand matrix has a first number of rows and a second number of columns, said second multiplicand matrix has said second number of rows and a third number of columns, and said resultant matrix has a number of elements equal to a product of said first and third numbers, said programmable integrated circuit device comprising:
-
logic configured as a fourth number of multipliers, wherein said fourth number is one-Nth of said second number; logic configured to break down each respective row of said first multiplicand matrix into N row-blocks and to break down each respective column of said second multiplicand matrix into N column-blocks, and to use said fourth number of multipliers to form a respective dot-product of each of said row-blocks with a respective one of said column-blocks to form N partial dot products of each respective row of said first multiplicand matrix and a corresponding respective column of said second multiplicand matrix, wherein; each said row-block comprises more than one element of said respective row and fewer than all elements of said respective row, and each said column-block comprises more than one element of said respective column and fewer than all elements of said respective column, and said logic configured to use said fourth number of multipliers is configured to form all respective ones of said partial dot products involving each respective one of said row-blocks and all of said column-blocks, before forming any partial dot product involving any other one of said row-blocks; logic configured to save each of said N partial dot products until all of said N partial dot products have been computed; and logic configured to add said N partial dot products to provide an element of said resultant matrix corresponding to said respective row of said first multiplicand matrix and said corresponding respective column of said second multiplicand matrix. - View Dependent Claims (8, 9, 10, 11, 12, 13)
-
-
14. A non-transitory machine-readable data storage medium encoded with machine-executable instructions for configuring a programmable integrated circuit device to execute a method of configuring a programmable integrated circuit device to perform multiplication of a first multiplicand matrix by a second multiplicand matrix to form a resultant matrix, wherein said first multiplicand matrix has a first number of rows and a second number of columns, said second multiplicand matrix has said second number of rows and a third number of columns, and said resultant matrix has a number of elements equal to a product of said first and third numbers, said instructions comprising:
-
instructions to configure logic of said programmable integrated circuit device as a fourth number of multipliers, wherein said fourth number is one-Nth of said second number; instructions to configure logic of said programmable integrated circuit device to break down each respective row of said first multiplicand matrix into N row-blocks and to break down each respective column of said second multiplicand matrix into N column-blocks, and to use said fourth number of multipliers to form a respective dot-product of each of said row-blocks with a respective one of said column-blocks to form N partial dot products of each respective row of said first multiplicand matrix and a corresponding respective column of said second multiplicand matrix, wherein; each said row-block comprises more than one element of said respective row and fewer than all elements of said respective row, and each said column-block comprises more than one element of said respective column and fewer than all elements of said respective column, and said instructions to configure said logic of said programmable integrated circuit device to use said fourth number of multipliers comprise instructions to configure said logic of said programmable integrated circuit device to form all respective ones of said partial dot products involving each respective one of said row-blocks and all of said column-blocks, before forming any partial dot product involving any other one of said row-blocks; instructions to configure logic of said programmable integrated circuit device to save each of said N partial dot products until all of said N partial dot products have been computed; and instructions to configure logic of said programmable integrated circuit device to add said N partial dot products to provide an element of said resultant matrix corresponding to said respective row of said first multiplicand matrix and said corresponding respective column of said second multiplicand matrix. - View Dependent Claims (15, 16, 17, 18, 19)
-
-
20. Circuitry for performing multiplication of a first multiplicand matrix by a second multiplicand matrix to form a resultant matrix, wherein said first multiplicand matrix has a first number of rows and a second number of columns, said second multiplicand matrix has said second number of rows and a third number of columns, and said resultant matrix has a number of elements equal to a product of said first and third numbers, said circuitry comprising:
-
a fourth number of multipliers, wherein said fourth number is one-Nth of said second number; logic configured to break down each respective row of said first multiplicand matrix into N row-blocks and to break down each respective column of said second multiplicand matrix into N column-blocks, and to use said fourth number of multipliers to form a respective dot-product of each of said row-blocks with a respective one of said column-blocks to form N partial dot products of each respective row of said first multiplicand matrix and a corresponding respective column of said second multiplicand matrix, wherein; each said row-block comprises more than one element of said respective row and fewer than all elements of said respective row, and each said column-block comprises more than one element of said respective column and fewer than all elements of said respective column, and said logic configured to use said fourth number of multipliers is configured to form all respective ones of said partial dot products involving each respective one of said row-blocks and all of said column-blocks, before forming any partial dot product involving any other one of said row-blocks; memory for saving each of said N partial dot products until all of said N partial dot products have been computed; and circuitry for adding said N partial dot products to provide an element of said resultant matrix corresponding to said respective row of said first multiplicand matrix and said corresponding respective column of said second multiplicand matrix. - View Dependent Claims (21, 22, 23, 24, 25)
-
Specification