JP2023115660A - Information processing apparatus, information processing system, addition and subtraction apparatus, multiplication apparatus, information processing method, and information processing program - Google Patents
Information processing apparatus, information processing system, addition and subtraction apparatus, multiplication apparatus, information processing method, and information processing program Download PDFInfo
- Publication number
- JP2023115660A JP2023115660A JP2022018009A JP2022018009A JP2023115660A JP 2023115660 A JP2023115660 A JP 2023115660A JP 2022018009 A JP2022018009 A JP 2022018009A JP 2022018009 A JP2022018009 A JP 2022018009A JP 2023115660 A JP2023115660 A JP 2023115660A
- Authority
- JP
- Japan
- Prior art keywords
- multiplication
- subtraction
- addition
- information processing
- matrix
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000010365 information processing Effects 0.000 title claims abstract description 136
- 238000003672 processing method Methods 0.000 title claims abstract description 23
- 239000011159 matrix material Substances 0.000 claims abstract description 203
- 238000004364 calculation method Methods 0.000 claims abstract description 91
- 238000012545 processing Methods 0.000 claims abstract description 60
- 238000012546 transfer Methods 0.000 claims description 19
- 230000010354 integration Effects 0.000 claims description 13
- 230000006872 improvement Effects 0.000 claims description 11
- 238000007792 addition Methods 0.000 description 187
- 238000004422 calculation algorithm Methods 0.000 description 42
- 238000010586 diagram Methods 0.000 description 21
- 230000005540 biological transmission Effects 0.000 description 20
- 238000004891 communication Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 14
- 238000000034 method Methods 0.000 description 8
- 230000008901 benefit Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000000638 solvent extraction Methods 0.000 description 4
- 230000007423 decrease Effects 0.000 description 3
- 238000005259 measurement Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Landscapes
- Complex Calculations (AREA)
Abstract
Description
本発明は、情報処理装置、情報処理システム、加減算装置、乗算装置、情報処理方法及び情報処理プログラムに関する。 The present invention relates to an information processing device, an information processing system, an addition/subtraction device, a multiplication device, an information processing method, and an information processing program.
特許文献1には、複数のプロセッサエレメント、制御装置、それらを接続する第1通信路、第1通信路とは別の隣接プロセッサエレメントを接続する第2通信路を持つ並列計算機が記載されている。特許文献1の並列計算機は、高価な半導体素子や複雑なネットワークを必要とせずに行列積計算を行う。
特許文献2には、本体部にアクセラレータ部が脱着可能な情報処理装置が記載されている。特許文献2の情報処理装置は、性能情報に応じて、本体側演算器及びアクセラレータ側演算器を駆動するための駆動電圧あるいは駆動周波数を設定する。
特許文献3には、行列計算を行う乗算器及び加算器を含む積和演算回路が記載されている。特許文献3の積和演算回路において、乗算器は、行列Aの行を分割した部分行ベクトルと行列Bの列を分割した部分列ベクトルとの乗算を並列に実行し、加算器は、乗算結果を加算する。
特許文献4には、通信チャンネルを介して受信したデータ信号を処理する方法に、通信チャンネルの特徴を表現する複数の成分を備えた行列を反転させ、反転された行列を用いて処理することが記載されている。
例えば、情報処理装置におけるデータ信号の処理に用いられる大規模行列を高速に計算することが所望されている。 For example, there is a demand for high-speed calculation of large-scale matrices used for processing data signals in information processing apparatuses.
本開示の目的は、上述した課題に鑑み、大規模行列を高速に計算することができる情報処理装置、情報処理システム、加減算装置、乗算装置、情報処理方法及び情報処理プログラムを提供することにある。 An object of the present disclosure is to provide an information processing device, an information processing system, an addition/subtraction device, a multiplication device, an information processing method, and an information processing program capable of calculating a large-scale matrix at high speed in view of the above-described problems. .
一実施の形態に係る情報処理装置は、加減算を行う1または複数の加減算装置の加減算演算性能、及び、乗算を行う1または複数の乗算装置の乗算演算性能を取得する取得部と、部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、を備える。 An information processing apparatus according to an embodiment includes an acquisition unit that acquires addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction and multiplication operation performance of one or more multiplication units that perform multiplication; A calculation unit that calculates a matrix size that makes the processing time for one multiplication equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times as a critical matrix size, and a calculation target using the calculated critical matrix size. a selection unit that selects the number of divisions in a given matrix.
一実施の形態に係る情報処理システムは、加減算を行う1または複数の加減算装置と、乗算を行う1または複数の乗算装置と、前記加減算装置及び前記乗算装置に接続された情報処理装置と、を備え、前記情報処理装置は、前記加減算装置の加減算演算性能、及び、前記乗算装置の乗算演算性能を取得する取得部と、部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、を有する。 An information processing system according to an embodiment includes one or more adder/subtractor devices that perform addition and subtraction, one or more multiplier devices that perform multiplication, and an information processing device connected to the adder/subtractor device and the multiplier device. The information processing device includes an acquisition unit that acquires the addition/subtraction operation performance of the addition/subtraction device and the multiplication operation performance of the multiplication device; A calculation unit that calculates a matrix size equal to the processing time that is performed the number of times as a critical matrix size, and a selection unit that selects the number of divisions in the matrix to be calculated using the calculated critical matrix size.
一実施の形態に係る加減算装置は、加減算演算性能及び乗算を行う1または複数の乗算装置の乗算演算性能を取得する取得部と、部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、を有する情報処理装置に接続され、加減算を行う前記加減算演算性能を有する。 An addition/subtraction device according to an embodiment includes an acquisition unit that acquires addition/subtraction operation performance and multiplication operation performance of one or more multiplication units that perform multiplication, a processing time for one multiplication of a submatrix, and addition/subtraction of the submatrix. a calculation unit that calculates, as a critical matrix size, a matrix size that equals the processing time of performing a predetermined number of times, and a selection unit that selects the number of divisions in the matrix to be calculated using the calculated critical matrix size. It is connected to an information processing device having the addition/subtraction operation performance to perform addition/subtraction.
一実施の形態に係る乗算装置は、乗算演算性能及び加減算を行う1または複数の加減算装置の加減算演算性能を取得する取得部と、部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、を有する情報処理装置に接続され、乗算を行う前記乗算演算性能を有する。 A multiplication device according to an embodiment includes an acquisition unit that acquires multiplication operation performance and addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction, a processing time for one submatrix multiplication, and addition/subtraction of the submatrix. a calculation unit that calculates, as a critical matrix size, a matrix size that equals the processing time of performing a predetermined number of times, and a selection unit that selects the number of divisions in the matrix to be calculated using the calculated critical matrix size. It is connected to an information processing device having the above-mentioned multiplication operation performance for performing multiplication.
一実施の形態に係る情報処理方法は、加減算を行う1または複数の加減算装置の加減算演算性能、及び、乗算を行う1または複数の乗算装置の乗算演算性能を取得させるステップと、部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出させるステップと、算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定させるステップと、を備える。 An information processing method according to an embodiment comprises a step of acquiring addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction and a multiplication operation performance of one or more multiplication devices that perform multiplication; a step of calculating a matrix size that makes one processing time equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times as a critical matrix size; and using the calculated critical matrix size, the matrix to be calculated and selecting the number of divisions in.
一実施の形態に係る情報処理プログラムは、加減算を行う1または複数の加減算装置の加減算演算性能、及び、乗算を行う1または複数の乗算装置の乗算演算性能を取得させるステップと、部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出させるステップと、算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定させるステップと、をコンピュータに実行させる。 An information processing program according to an embodiment comprises steps of obtaining addition/subtraction operation performance of one or more addition/subtraction devices for performing addition/subtraction and multiplication operation performance of one or more multiplication devices for multiplication; a step of calculating a matrix size that makes one processing time equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times as a critical matrix size; and using the calculated critical matrix size, the matrix to be calculated and causing the computer to select the number of divisions in .
本開示によれば、大規模行列を高速に計算することができる情報処理装置、情報処理システム、加減算装置、乗算装置、情報処理方法及び情報処理プログラムを提供することができる。 According to the present disclosure, it is possible to provide an information processing device, an information processing system, an addition/subtraction device, a multiplication device, an information processing method, and an information processing program capable of calculating a large-scale matrix at high speed.
以下、実施形態について、図面を参照しながら説明する。説明の明確化のため、以下の記載及び図面は、適宜、省略、及び簡略化がなされている。また、各図面において、同一の要素には同一の符号が付されており、必要に応じて重複説明は省略されている。 Hereinafter, embodiments will be described with reference to the drawings. For clarity of explanation, the following descriptions and drawings are omitted and simplified as appropriate. Moreover, in each drawing, the same elements are denoted by the same reference numerals, and redundant description is omitted as necessary.
(実施形態1)
実施形態1に係る情報処理システム及び情報処理装置を説明する。本実施形態の情報処理システム及び情報処理装置は、行列を分割するアルゴリズムを用いた大規模行列の乗算を高速に計算する。行列の乗算は、基本的な線形代数計算の一つであり、多くの科学技術分野の数値計算で重要な位置を占めている。科学技術分野の進歩に伴い、大きなサイズの行列の乗算を必要とする機会が増えている。大きなサイズの行列の乗算を高速化するアルゴリズムとして、例えば、ストラッセンアルゴリズムが挙げられる。
(Embodiment 1)
An information processing system and an information processing apparatus according to the first embodiment will be described. The information processing system and information processing apparatus according to the present embodiment perform high-speed multiplication of large-scale matrices using a matrix partitioning algorithm. Matrix multiplication is one of the basic linear algebra calculations, and it occupies an important position in numerical computation in many fields of science and technology. As the scientific and technological fields advance, the occasions where multiplication of matrices of large size is required are increasing. Algorithms that speed up multiplication of large-sized matrices include, for example, the Strassen algorithm.
ストラッセンアルゴリズムによる大規模行列の乗算を高速化することを目的として、複数の装置を使用することが考えられる。部分行列の各演算のデータ依存性を考慮した上での、部分行列の加減算あるいは乗算の並列計算を行うことにより、行列計算は、高速化される。乗算する行列が大規模になるにつれてメモリ要求・並列化のために複数のマシンを使用することが必要となる。 In order to speed up the multiplication of large matrices by the Strassen algorithm, it is conceivable to use multiple devices. Matrix calculation is sped up by parallel calculation of addition/subtraction or multiplication of submatrices while taking into account the data dependency of each operation of submatrices. As the matrices to be multiplied become large, it becomes necessary to use multiple machines for memory requirements and parallelization.
ストラッセンアルゴリズムの産業上の利用として、特許文献4のように、データ信号を処理する方法、データ処理部及びコンピュータプログラム製品があげられる。以下では、行列を分割するアルゴリズムを用いた大規模行列の乗算の一例として、<ストラッセンアルゴリズム>を説明する。そして、<情報処理ステム>を説明し、情報処理システムを構成する<加減算管理装置>、<加減算装置>、<乗算管理装置>、<乗算装置>及び<情報処理装置>を説明する。その後、<情報処理方法>を説明する。
Industrial applications of the Strassen algorithm include a method for processing data signals, a data processing unit, and a computer program product, as in
<ストラッセンアルゴリズム>
図1は、実施形態1に係る通常の行列の乗算式及びストラッセンアルゴリズムによる行列の乗算式を例示した図である。図2は、実施形態1に係る通常の行列の乗算式及びストラッセンアルゴリズムによる行列の乗算式の関係を例示した図である。図1及び図2に示すように、通常の行列の乗算では、部分行列の乗算は8回、部分行列の加減算は4回行われる。具体的には、下記に示すように、(1)式の行列Aと行列Bとの乗算では、(2)~(5)式の各式に2回含まれる乗算(合計8回の乗算)、及び、(2)~(5)式の各式に1回含まれる加減算(合計4回の加減算)が行われる。
<Strassen Algorithm>
FIG. 1 is a diagram exemplifying a normal matrix multiplication formula and a matrix multiplication formula according to the Strassen algorithm according to the first embodiment. FIG. 2 is a diagram illustrating the relationship between a normal matrix multiplication formula and a matrix multiplication formula according to the Strassen algorithm according to the first embodiment. As shown in FIGS. 1 and 2, in normal matrix multiplication, submatrix multiplication is performed eight times and submatrix addition/subtraction is performed four times. Specifically, as shown below, in the multiplication of matrix A and matrix B in formula (1), the multiplication included twice in each of formulas (2) to (5) (8 multiplications in total) , and additions and subtractions included in each of the expressions (2) to (5) once (a total of four additions and subtractions) are performed.
C=AB (1) C=AB (1)
C11=A11B11+A12B21 (2)
C12=A11B12+A12B22 (3)
C21=A21B11+A22B21 (4)
C22=A21B12+A22B22 (5)
C11 = A11B11 + A12B21 ( 2)
C12 = A11B12 + A12B22 ( 3)
C21 = A21B11 + A22B21 (4 )
C22 = A21B12 + A22B22 ( 5)
一方、ストラッセンアルゴリズムによる行列の乗算では、(14)式~(20)式の各式に1回含まれる乗算(合計7回の乗算)、及び、(6)式~(13)式、(21)~(27)式の各式に1回含まれる加減算(合計15回の加減算)が行われる。
S1=A21+A22 (6)
S2=S1-A11 (7)
S3=A11-A21 (8)
S4=A12-A21 (9)
S5=B12-B11 (10)
S6=B22-S5 (11)
S7=B22-B12 (12)
S8=S6-A21 (13)
M1=S2S6 (14)
M2=A11B11 (15)
M3=A12B21 (16)
M4=S3S7 (17)
M5=S1S5 (18)
M6=S4B22 (19)
M7=A22S8 (20)
V1=M1+M2 (21)
V2=V1+M4 (22)
V3=M5+M6 (23)
C11=M2+M3 (24)
C12=V1+V3 (25)
C21=V2-M7 (26)
C22=V2+M5 (27)
On the other hand, in the matrix multiplication by the Strassen algorithm, the multiplication included once in each of the formulas (14) to (20) (7 multiplications in total), and the formulas (6) to (13), ( 21) to (27) include one addition/subtraction (total 15 additions/subtractions).
S1 = A21 + A22 (6)
S 2 =S 1 -A 11 (7)
S 3 =A 11 -A 21 (8)
S 4 = A 12 - A 21 (9)
S5 = B12 - B11 (10)
S 6 =B 22 -S 5 (11)
S7 = B22 - B12 (12)
S 8 =S 6 -A 21 (13)
M1 = S2S6 ( 14)
M 2 =A 11 B 11 (15)
M3 = A12B21 (16 )
M4 = S3S7 ( 17 )
M 5 =S 1 S 5 (18)
M6 = S4B22 (19 )
M7 = A22S8 (20 )
V1 = M1 + M2 (21)
V2 = V1 + M4 (22)
V3 = M5 + M6 (23)
C11 = M2 + M3 (24)
C12 = V1 + V3 (25)
C 21 =V 2 -M 7 (26)
C22 = V2 + M5 (27)
したがって、ストラッセンアルゴリズムによる行列の乗算は、通常の行列の乗算に比べて、部分行列の乗算の回数を、8回から7回に減少させる。一方、部分行列の加減算の回数を、4回から15回に増加させる。このように、ストラッセンアルゴリズムによる乗算は、部分行列の乗算の回数を減少させる。 Therefore, matrix multiplication by the Strassen algorithm reduces the number of submatrix multiplications from 8 to 7 compared to normal matrix multiplication. On the other hand, the number of submatrix additions and subtractions is increased from 4 to 15 times. Thus, multiplication by the Strassen algorithm reduces the number of submatrix multiplications.
N行N列の正方行列の場合には、行列の乗算における数の演算回数は、N3のオーダーで増加する。これに対して、行列の加減算における数の演算回数は、N2のオーダーで増加する。したがって、行列のサイズが大きくなるほど、ストラッセンアルゴリズムは、通常の行列乗算よりも高速になる。 For a square matrix with N rows and N columns, the number of number operations in matrix multiplication increases by the order of N3 . On the other hand, the number of arithmetic operations in matrix addition/subtraction increases on the order of N2 . Therefore, the larger the size of the matrix, the faster the Strassen algorithm is than the normal matrix multiplication.
ストラッセンアルゴリズムは、分割統治法の一つである。図1及び上記(14)式~(20)式に示したM1からM7の部分行列の乗算に、再び、ストラッセンアルゴリズムを適用することができる。また、その部分行列、すなわち、孫となる部分行列の乗算に、再びストラッセンアルゴリズムを適用することができる。このように分割を繰り返していくことにより、さらなる高速化が可能になる。分割をn回行うと、ストラッセンアルゴリズムによる計算の、通常の行列の乗算に対する高速化率(speed up、速度向上率とも呼ぶ。)は、近似的に(8/7)nとなる。よって、分割回数nが大きくなるほど、高速化率は、増加する。ここで、8は、通常の行列乗算での部分行列の乗算の回数であり、7は、ストラッセンアルゴリズムにおける部分行列の乗算の回数である。 The Strassen algorithm is one of the divide-and-conquer methods. Again, the Strassen algorithm can be applied to the multiplication of submatrices M1 through M7 shown in FIG. 1 and equations (14)-(20) above. Also, the Strassen algorithm can be applied again to the multiplication of submatrices thereof, that is, submatrices that are grandchildren. By repeating the division in this way, it becomes possible to further increase the speed. After n divisions, the speed up of the Strassen algorithm computation over the normal matrix multiplication is approximately (8/7) n . Therefore, the speedup rate increases as the number of divisions n increases. where 8 is the number of submatrix multiplications in the normal matrix multiplication and 7 is the number of submatrix multiplications in the Strassen algorithm.
しかし、行列の分割を繰り返していくと、部分行列のサイズは小さくなっていく。よって、部分行列の乗算の回数を減らし加減算の回数を増やすストラッセンアルゴリズムの利点が消失する。したがって、分割回数をどこまでも増やすことはできない。 However, as the matrix division is repeated, the size of the submatrices becomes smaller. Therefore, the advantage of the Strassen algorithm that reduces the number of submatrix multiplications and increases the number of additions and subtractions is lost. Therefore, the number of divisions cannot be increased endlessly.
ストラッセンアルゴリズムによる大規模行列の乗算のさらなる高速化を目的として、複数のマシン(装置とも呼ぶ。)を使用することが考えられる。部分行列の加減算あるいは乗算を、複数のマシンを用いた並列計算を行うことにより、行列計算を高速化することができる。この場合に、図1及び図2で示した部分行列の各演算のデータ依存性を考慮した上で、各演算が適する複数のマシンで並列計算することが好ましい。 In order to further speed up the multiplication of large matrices by the Strassen algorithm, it is conceivable to use multiple machines (also called devices). Matrix calculation can be sped up by performing addition/subtraction or multiplication of submatrices in parallel using a plurality of machines. In this case, it is preferable to consider the data dependence of each operation of the submatrices shown in FIGS. 1 and 2 and perform parallel calculations on a plurality of machines suitable for each operation.
また、乗算をする行列が大規模化するにつれて、メモリ容量に対する要求が高くなることからも、複数のマシンで並列計算することが必要となる。しかし、このように、複数のマシンを利用した場合に、ストラッセンアルゴリズム固有の高速化法である分割の最適回数を予測する方法は、これまで存在しなかった。 In addition, as the matrices to be multiplied become larger in scale, the demand for memory capacity also increases, making it necessary to perform parallel calculations on a plurality of machines. However, until now there has been no method for predicting the optimal number of divisions, which is a speed-up method unique to the Strassen algorithm when multiple machines are used.
最適な分割回数を選定するためには、ストラッセンアルゴリズムの利点が消失する部分行列のサイズ、すなわち、ストラッセンアルゴリズムによる乗算の、通常の乗算に対する高速化率が1.0になる臨界行列サイズを求める必要がある。例えば、臨界行列サイズは、実測によって見出すことができる。しかしながら、複数のマシンを利用する場合には、非常に手間のかかる作業となる。特に、マシンの空き状況によって、毎回使用できるマシンが異なる場合には、臨界行列サイズは、その度に異なることになる。例えば、加減算の演算性能が高いマシンが多く、乗算の演算性能が高いマシンが少ない場合には、乗算のコストを減らすために分割回数を多くする必要がある。また、その逆の場合には、加減算のコストの増加を減らすために、分割回数を抑える必要がある。 In order to select the optimum number of divisions, the size of the submatrix where the advantage of the Strassen algorithm disappears, that is, the critical matrix size at which the speed-up ratio of the multiplication by the Strassen algorithm to the normal multiplication becomes 1.0 need to ask. For example, the critical matrix size can be found by empirical measurements. However, when using a plurality of machines, it becomes a very time-consuming task. In particular, when machines that can be used each time are different depending on machine availability, the critical matrix size will be different each time. For example, if there are many machines with high addition/subtraction calculation performance and few machines with high multiplication calculation performance, the number of divisions must be increased in order to reduce the cost of multiplication. In the opposite case, it is necessary to reduce the number of divisions in order to reduce the increase in the cost of addition and subtraction.
本実施形態は、演算性能の異なる複数のマシンを、例えば、ストラッセンアルゴリズムによる大規模行列の乗算に使用した場合の最適な分割回数を決める。これにより、大規模行列を高速に計算する。 This embodiment determines the optimum number of divisions when a plurality of machines with different computational performances are used, for example, for multiplication of large-scale matrices by the Strassen algorithm. This enables fast calculation of large-scale matrices.
前述したように、分割を繰り返していくと、部分行列のサイズは、次第に小さくなる。これにより、部分行列の乗算の回数を減らし、加減算の回数を増やすストラッセンアルゴリズムの利点が消失する。まず、この利点がちょうど消失する行列のサイズ、すなわち、ストラッセンアルゴリズムによる行列の乗算が、標準的な行列の乗算よりも高速となる臨界行列サイズNCを、使用するマシンの演算性能を用いて算出する。以下で、臨界行列サイズNCの選定方法を具体的に説明する。 As described above, the size of the submatrices gradually decreases as the division is repeated. This eliminates the advantage of the Strassen algorithm, which reduces the number of submatrix multiplications and increases the number of additions and subtractions. First, determine the matrix size at which this advantage just vanishes, i.e., the critical matrix size N C at which matrix multiplication by the Strassen algorithm is faster than standard matrix multiplication, using the computational power of the machine used. calculate. A method for selecting the critical matrix size N C will be specifically described below.
ストラッセンアルゴリズムによる行列の乗算は、標準的な行列の乗算に比べて、部分行列の乗算回数が1回少なくなり、加減算の回数が11回多くなる。臨界行列サイズNCを、部分行列の乗算1回の処理時間と部分行列の加減算11回の処理時間が等しくなる行列サイズとして選定する。 Matrix multiplication by the Strassen algorithm requires one less submatrix multiplication and 11 more additions and subtractions than standard matrix multiplication. The critical matrix size N C is selected as the matrix size at which the processing time for one submatrix multiplication is equal to the processing time for 11 submatrix additions and subtractions.
そこで、まず、加減算及び乗算の処理時間を算出するために、加減算及び乗算に使用する演算装置の演算性能を取得する。その際に、加減算及び乗算のそれぞれに、演算装置をどのように並列に使用するか設定する。また、各演算装置が加減算または乗算を何回逐次計算するかを設定する。なお、加減算を行う演算装置を加減算装置と呼び、乗算を行う演算装置を乗算装置と呼ぶ。 Therefore, first, in order to calculate the processing time for addition/subtraction and multiplication, the calculation performance of the calculation unit used for addition/subtraction and multiplication is obtained. At that time, how to use arithmetic units in parallel is set for addition/subtraction and multiplication, respectively. It also sets how many additions/subtractions or multiplications each arithmetic unit performs. An arithmetic unit that performs addition and subtraction is called an addition/subtraction unit, and an arithmetic unit that performs multiplication is called a multiplication unit.
上記設定に基づいて、部分行列の乗算1回の処理時間、及び、部分行列の加減算11回の処理時間を行列サイズNの関数として表す。そして、部分行列の乗算1回の処理時間と部分行列の加減算11回の処理時間とが等しくなるサイズを臨界行列サイズNCとして導き出す。算出に用いる式は、以下の(28)式である。 Based on the above settings, the processing time for one submatrix multiplication and the processing time for 11 submatrix additions and subtractions are expressed as a function of the matrix size N. Then, the critical matrix size NC is derived so that the processing time for one submatrix multiplication and the processing time for 11 submatrix additions and subtractions are equal. The formula used for the calculation is the following formula (28).
ここで、以下のとおりである。
Rmiは、各乗算装置の乗算演算性能を示す。
Rsjは、各加減算装置の加減算演算性能を示す。
xi、xjは、各乗算装置及び各加減算装置の逐次演算回数を示す。
where:
Rmi indicates the multiplication performance of each multiplier.
R sj indicates the addition/subtraction operation performance of each addition/subtraction device.
x i and x j indicate the number of sequential operations of each multiplier and each adder/subtracter.
ストラッセンアルゴリズムによる乗算は、通常の乗算の場合に比べて、部分行列の乗算の回数が8から7に減少する。一方、部分行列の加減算の回数は11回増加する。(28)式の左辺は、行列の正方行列の乗算を8回から7回に減らしたことにより減少した計算時間である。(28)式の右辺は、同じ行列の加減算を11回増やしたことにより増加した計算時間である。左辺の(2NC-1)NC 2は、NC行NC列の正方行列の乗算での数の演算回数である。右辺のNC 2は、加減算での数の演算回数である。(28)式の両辺において、それらを使用する演算装置の演算性能(演算速度)で割っている。 Multiplication by the Strassen algorithm reduces the number of submatrix multiplications from 8 to 7 compared to normal multiplication. On the other hand, the number of submatrix additions and subtractions increases by 11 times. The left side of equation (28) is the reduced computation time due to the reduction of the square matrix multiplications of the matrix from 8 to 7 times. The right side of equation (28) is the computation time increased by increasing the number of additions and subtractions of the same matrix by 11 times. (2N C −1)N C 2 on the left side is the number of operations in the multiplication of the square matrix of N C rows and N C columns. N C 2 on the right-hand side is the number of arithmetic operations in addition and subtraction. Both sides of the equation (28) are divided by the computation performance (computation speed) of the computation device using them.
行列の乗算あるいは加減算に使用する演算装置が並列で処理を行う場合には、それらの演算性能は、加算される。一つの演算装置が行列の乗算あるいは加減算を逐次でx回行う場合には、その演算性能は、1/xになる。(28)式は、行列サイズNCでストラッセンアルゴリズムによる行列の乗算と通常の行列の乗算とが等しい速度になることを示している。 When the arithmetic units used for matrix multiplication or addition/subtraction operate in parallel, their arithmetic performance is added. When one arithmetic unit sequentially performs matrix multiplication or addition/subtraction x times, its arithmetic performance becomes 1/x. Equation (28) shows that matrix multiplication by the Strassen algorithm and normal matrix multiplication are equally fast for matrix size N C .
次に、(28)式で算出したNCを用いて、最も高速になる分割回数を、図3に示した方法で選定する。図3は、実施形態1に係るストラッセンアルゴリズムによる行列の乗算の分割回数の算出を例示した図である。図3に示すように、最初の行列がN行N列の場合、分割をn回行うと、部分行列のサイズは、N/2nとなる。最適な分割回数は、N/2nがNC以上でNCに最も近くなるものである。このようにして、使用する演算装置の演算性能のデータが与えられる。それらの演算装置をストラッセンアルゴリズムのどの部分行列の乗算あるいはどの加減算に割り当てるか決めてもよい。これにより、それらの演算装置の組み合わせにとって最適な分割回数を選定することができる。 Next, using the NC calculated by the equation (28), the number of divisions that provides the fastest speed is selected by the method shown in FIG. FIG. 3 is a diagram illustrating calculation of the number of divisions of matrix multiplication by the Strassen algorithm according to the first embodiment. As shown in FIG. 3, if the initial matrix has N rows and N columns, after n divisions, the size of the submatrix is N/ 2n . The optimal number of divisions is the one in which N/ 2n is greater than or equal to Nc and is closest to Nc . In this way, data on the computing performance of the computing device to be used is provided. You may decide to assign those arithmetic units to which submatrix multiplications or additions and subtractions of the Strassen algorithm. This makes it possible to select the optimum number of divisions for the combination of these arithmetic units.
<情報処理システム>
次に、大規模行列の乗算のための分割回数を選定する情報処理システムを説明する。図4は、実施形態1に係る情報処理システムを例示した構成図である。図4に示すように、情報処理システム1は、情報処理装置10、加減算管理装置20、1つまたは複数の加減算装置21~2j、乗算管理装置30、1つまたは複数の乗算装置31~3iを備えている。1つまたは複数の加減算装置21~2jを総称して、加減算装置2jと呼ぶ。1つまたは複数の乗算装置31~3iを総称して、乗算装置3iと呼ぶ。情報処理装置10、加減算管理装置20、加減算装置2j、乗算管理装置30、乗算装置3iは、それぞれ、情報処理手段、加減算管理手段、加減算手段、乗算管理手段、乗算手段としての機能を有している。
<Information processing system>
Next, an information processing system for selecting the number of divisions for multiplication of large matrices will be described. FIG. 4 is a configuration diagram illustrating an information processing system according to the first embodiment. As shown in FIG. 4, the
情報処理装置10は、加減算管理装置20に情報伝達可能な通信回線で接続されている。加減算管理装置20は、1つまたは複数の加減算装置2jに情報伝達可能な通信回線で接続されている。よって、情報処理装置10は、1つまたは複数の加減算装置2jに加減算管理装置20を介して接続されている。また、情報処理装置10は、乗算管理装置30に情報伝達可能な通信回線で接続されている。乗算管理装置30は、1つまたは複数の乗算装置3iに情報伝達可能な通信回線で接続されている。よって、情報処理装置10は、1つまたは複数の乗算装置3iに乗算管理装置30を介して接続されている。以下で、各構成を説明する。
The
<加減算管理装置>
図5は、実施形態1に係る情報処理システム1において、加減算管理装置20を例示したブロック図である。図5に示すように、加減算管理装置20は、取得部20a、記憶部20b及び送信部20cを備えている。取得部20a、記憶部20b及び送信部20cは、それぞれ、取得手段、記憶手段及び送信手段としての機能を有している。
<Addition/subtraction management device>
FIG. 5 is a block diagram illustrating the addition/
取得部20aは、各加減算装置2jの加減算演算性能を予め測定した結果を各加減算装置2jから取得する。記憶部20bは、各加減算装置2jの加減算演算性能をリスト化した加減算リストファイルLF20を記憶する。加減算リストファイルLF20は、各加減算装置2jの番号、担当演算、演算の種類(乗算か加減算か)、演算性能が記録されている。送信部20cは、各加減算装置2jの加減算演算性能及び演算結果を情報処理装置10に送信する。
The
<加減算装置>
図6は、実施形態1に係る情報処理システム1において、加減算装置2jを例示したブロック図である。図6に示すように、加減算装置2jは、取得部2ja、演算部2jb、送信部2jcを備えている。取得部2ja、演算部2jb、送信部2jcは、それぞれ、取得手段、演算手段、送信手段としての機能を有している。
<Addition/subtraction device>
FIG. 6 is a block diagram illustrating the addition/
取得部2jaは、情報処理装置10から加減算管理装置20を介して演算対象の部分行列を取得する。演算部2jbは、部分行列の加減算を行う。送信部2jcは、加減算の演算性能及び加減算の演算結果を、加減算管理装置20を介して情報処理装置10に送信する。
The acquisition unit 2ja acquires a submatrix to be operated from the
加減算装置2jは、加減算演算性能に優れたものが好ましい。一例として、加減算管理装置20に、1個の加減算装置21が接続されてもよい。この場合には、加減算装置21は、図2及び(6)式~(13)式、(21)~(27)式に示したS1~S8、V1~V3及びC11~C22の計算を割り当てられる。なお、加減算管理装置20に接続される加減算装置2jの個数は、1個に限らず、複数でもよい。また、加減算装置2jは、演算対象の部分行列を、加減算管理装置20を介さずに、直接、情報処理装置10から取得してもよい。加減算装置2jは、加減算の演算性能及び加減算の演算結果を、加減算管理装置20を介さずに直接、情報処理装置10に送信してもよい。
The addition/
<乗算管理装置>
図7は、実施形態1に係る情報処理システム1において、乗算管理装置30を例示したブロック図である。図7に示すように、乗算管理装置30は、取得部30a、記憶部30b及び送信部30cを備えている。取得部30a、記憶部30b及び送信部30cは、それぞれ、取得手段、記憶手段及び送信手段としての機能を有している。
<Multiplication management device>
FIG. 7 is a block diagram illustrating the
取得部30aは、各乗算装置3iの乗算演算性能を予め測定した結果を各乗算装置3iから取得する。記憶部30bは、各乗算装置3iの乗算演算性能をリスト化した乗算リストファイルLF30を記憶する。乗算リストファイルLF30は、各乗算装置3iの番号、担当演算、演算の種類(乗算か加減算か)、演算性能が記録されている。送信部30cは、各乗算装置3iの乗算演算性能及び演算結果を情報処理装置10に送信する。
The
<乗算装置>
図8は、実施形態1に係る情報処理システム1において、乗算装置3iを例示したブロック図である。図8に示すように、乗算装置3iは、取得部3ia、演算部3ib、送信部3icを備えている。取得部3ia、演算部3ib、送信部3icは、それぞれ、取得手段、演算手段、送信手段としての機能を有している。
<Multiplication device>
FIG. 8 is a block diagram illustrating the
取得部3iaは、情報処理装置10から乗算管理装置30を介して演算対象の部分行列を取得する。演算部3ibは、部分行列の乗算を行う。送信部3icは、乗算の演算能力及び乗算の演算結果を乗算管理装置30を介して情報処理装置10に送信する。
The acquisition unit 3ia acquires a submatrix to be operated on from the
乗算装置3iは、乗算演算性能に優れたものが好ましい。一例として、乗算管理装置30に、7個の乗算装置31~37が接続されてもよい。この場合には、乗算装置31~37は、図2に示したM1~M7の計算を割り当てられる。なお、乗算管理装置30に接続される乗算装置3iの個数は、7個に限らない。また、乗算装置3iは、演算対象の部分行列を、乗算管理装置30を介さずに、直接、情報処理装置10から取得してもよい。乗算装置3iは、乗算の演算性能及び乗算の演算結果を、乗算管理装置30を介さずに直接、情報処理装置10に送信してもよい。
The
<情報処理装置>
図9は、実施形態1に係る情報処理システム1において、情報処理装置10を例示したブロック図である。図9に示すように、情報処理装置10は、取得部10a、算出部10b及び選定部10cを備えている。取得部10a、算出部10b及び選定部10cは、それぞれ、取得手段、算出手段及び選定手段としての機能を有している。
<Information processing device>
FIG. 9 is a block diagram illustrating the
取得部10aは、加減算を行う1または複数の加減算装置2jの加減算演算性能、及び、乗算を行う1または複数の乗算装置3iの乗算演算性能を取得する。具体的には、取得部10aは、加減算装置2j及び乗算装置3iの演算性能を、加減算管理装置20のリストファイルLF20及び乗算管理装置30のリストファイルLF30から取得する。なお、取得部10aは、加減算装置2j及び乗算装置3iの演算性能を、加減算装置2j及び乗算装置3iから直接取得してもよい。
The
算出部10bは、部分行列の乗算1回の処理時間と、部分行列の加減算を所定回数行う処理時間とが略等しくなる行列サイズを臨界行列サイズNCとして算出する。具体的には、算出部10bは、取得した加減算装置2jの加減算演算性能及び乗算装置3iの乗算演算性能を用いて、上述した(28)式を用いて臨界行列サイズNCを算出する。
The
選定部10cは、算出した臨界行列サイズNCから、計算対象である行列における分割回数を選定する。例えば、選定部10cは、計算対象であるN行N列の行列における分割回数をnとした場合に、分割回数nを、N/(2n)が、臨界行列サイズNC以上で、臨界行列サイズNCに最も近くなるような分割回数nから選定する。
The
選定部10cは、分割回数nを選定する場合に、上限を設定してもよい。臨界行列サイズNCまで分割した場合に、加減算装置2j及び乗算装置3i等の演算装置が行う計算は、速度向上率が1.0倍となる計算を含む場合がある。この場合には、加減算装置2j及び乗算装置3iは、無駄な計算を行うことになる。そこで、速度向上率に閾値を設けることで、演算装置が余計な計算をしないようしてもよい。例えば、速度向上率の閾値として、1.01倍と設定し、それ以下の速度向上率になってしまう場合には、分割回数を増やさないようにしてもよい。このようにして、選定部10cは、速度向上率に基づいて、分割回数nを選定してもよい。
The
上述した情報処理装置10、加減算管理装置20、加減算装置2j、乗算管理装置30、乗算装置3iは、例えば、サーバ装置、パーソナルコンピュータ等のコンピュータを含む情報処理装置である。これらの装置は、それぞれ、制御部、通信部、記憶部及びインターフェース部を有している。制御部、通信部、記憶部及びインターフェース部は、それぞれ、制御手段、通信手段、記憶手段及びインターフェース手段としての機能を有している。
The
制御部は、例えば、CPU(Central Processing Unit)、MPU(Micro Processing Unit)、ECU(Electronic Control Unit)、FPGA(Field-Programmable Gate Array)やASIC(Application Specific Integrated Circuit)等のプロセッサを含む。制御部は、制御処理及び演算処理等を行う演算装置としての機能を有する。また、制御部は、通信部、記憶部、インターフェース部及び各装置の機能を実行するための各構成要素の動作を制御する。 The control unit includes, for example, processors such as a CPU (Central Processing Unit), MPU (Micro Processing Unit), ECU (Electronic Control Unit), FPGA (Field-Programmable Gate Array), and ASIC (Application Specific Integrated Circuit). The control unit has a function as an arithmetic device that performs control processing, arithmetic processing, and the like. Also, the control unit controls the operation of each component for executing the functions of the communication unit, the storage unit, the interface unit, and each device.
各装置の各構成要素は、例えば、制御部の制御によって、プログラムを実行させることによって実現できる。より具体的には、各構成要素は、記憶部に格納されたプログラムを、制御部が実行することによって実現され得る。また、必要なプログラムを任意の不揮発性記録媒体に記録しておき、必要に応じてインストールすることで、各構成要素を実現するようにしてもよい。また、各構成要素は、プログラムによるソフトウェアで実現することに限ることなく、ハードウェア、ファームウェア、及びソフトウェアのうちのいずれかの組み合わせ等により実現してもよい。 Each component of each device can be implemented by, for example, executing a program under the control of the control unit. More specifically, each component can be implemented by the control unit executing a program stored in the storage unit. Further, each component may be realized by recording necessary programs in an arbitrary non-volatile recording medium and installing them as necessary. Moreover, each component may be implemented by any combination of hardware, firmware, and software, without being limited to being implemented by program software.
通信部は、各装置が情報処理を行う上で必要な通信を行う。記憶部は、例えば、ROM(Read Only Memory)又はRAM(Random Access Memory)等である。記憶部は、制御部によって実行される制御プログラム及び演算プログラム等を記憶するための機能を有する。また、記憶部は、処理データ等を一時的に記憶するための機能を有する。 The communication unit performs communication necessary for each device to perform information processing. The storage unit is, for example, ROM (Read Only Memory) or RAM (Random Access Memory). The storage unit has a function of storing a control program, a calculation program, and the like executed by the control unit. Also, the storage unit has a function of temporarily storing processing data and the like.
インターフェース部は、例えば、ユーザインターフェース(User Interface)である。インターフェース部は、キーボード、タッチパネル又はマウス等の入力装置と、ディスプレイ又はスピーカ等の出力装置とを有する。インターフェース部は、ユーザ(オペレータ等)によるデータの入力の操作を受け付け、ユーザに対して情報を出力する。 The interface unit is, for example, a user interface. The interface unit has an input device such as a keyboard, touch panel, or mouse, and an output device such as a display or speaker. The interface unit receives a data input operation by a user (operator or the like) and outputs information to the user.
<具体例I>
以下で、最適な分割回数nを導く数値計算の具体例I及び具体例IIを示す。まず、具体例Iを説明する。例えば、行列の乗算用の装置として、乗算装置31及び32の2種類を考える。各乗算装置31及び32の演算速度を以下の(29)式及び(30)式と仮定する。
<Specific example I>
Specific example I and specific example II of numerical calculation for deriving the optimum number of divisions n are shown below. First, specific example I will be described. For example, consider two types of
Rm1=7.8×1012FLOPS (29)
Rm2=7.8×1012FLOPS (30)
R m1 =7.8×10 12 FLOPS (29)
R m2 =7.8×10 12 FLOPS (30)
例えば、行列の加減算用の装置として、加減算装置21の1種類を考える。加減算装置21の演算速度を以下の(31)と仮定する。
For example, consider one type of adder/
Rs1=3.75×1010FLOPS (31) R s1 =3.75×10 10 FLOPS (31)
これらの値は、所定の演算速度(例えば、NVIDA・GPU・V100及びP100)を参考にしている。また、ストラッセンアルゴリズムを8000行8000列の正方行列の乗算に適用する場合を考える。 These values refer to a given computing speed (eg, NVIDA GPU V100 and P100). Also, consider the application of the Strassen algorithm to multiplication of square matrices of 8000 rows and 8000 columns.
各乗算装置31及び32を部分行列の乗算に用い、加減算装置21を部分行列の加減算に用いる。行列の標準的な乗算では8個の部分行列の乗算がある。乗算装置31及び32は、並列にそれぞれ4個及び3個の乗算を逐次計算する。その結果、臨界行列サイズNCは次の(32)式で求められる。
(8/(Rm1/4+Rm2/4)-7/(Rm1/4+Rm2/3))(2NC-1)
=11/Rs1 (32)
(8/(R m1 /4+R m2 /4)−7/(R m1 /4+R m2 /3)) (2N C −1)
=11/R s1 (32)
上記式から臨界行列サイズNC=263が求められる。8000×(1/24)=500>臨界行列サイズNCである。この臨界行列サイズNC以上において、N=8000の行列は、4回分割可能である。最適分割回数は、4回となる。高速化率は、近似的に、以下の(33)式となる。 A critical matrix size N C =263 is obtained from the above equation. 8000×(1/2 4 )=500>critical matrix size N C . Above this critical matrix size N C , a matrix of N=8000 can be divided 4 times. The optimum number of divisions is four. The speed-up rate is approximately given by the following equation (33).
(8/7)4=1.71 (33) (8/7) 4 = 1.71 (33)
ただし、この高速化率は、使用する演算装置の演算速度を考慮したものである。他の因子、例えば、メモリの確保と開放や装置間でのデータの転送にかかる時間などの影響を無視している。 However, this speed-up rate takes into consideration the computing speed of the computing device to be used. It ignores the effects of other factors, such as the time it takes to allocate and free memory and transfer data between devices.
<具定例II>
次に、具体例IIを説明する。例えば、行列の乗算用の装置として、乗算装置31~34を考える。乗算装置31及び32の演算速度をRm1、乗算装置33及び34の演算速度をRm2と仮定する。また、行列の加減算用の装置として、加減算装置21の演算速度をRs1と仮定する。ストラッセンアルゴリズムを8000行8000列の正方行列の乗算に適用する場合を考える。
<Specific example II>
Next, specific example II will be described. For example, consider the multipliers 31-34 as devices for matrix multiplication. Assume that the operation speed of
各乗算装置31~34を部分行列の乗算に用い、加減算装置21を部分行列の加減算に用いる。臨界行列サイズNCは次の(34)式で求められる。
(8/(Rm1/2+Rm1/2+Rm2/2+Rm2/2)-7/(Rm1/2+Rm1/2+Rm2/2+Rm2/2))(2NC-1)
=11/Rs1 (34)
(8/(R m1 /2+R m1 /2+R m2 /2+R m2 /2)−7/(R m1 /2+R m1 /2+R m2 /2+R m2 /2))(2N C −1)
=11/R s1 (34)
上記式から臨界行列サイズNC=866が求められる。この臨界行列サイズNC以上において、N=8000の行列は、3回分割可能である。最適分割回数は、3回となる。高速化率は、近似的に、以下の(35)式となる。 A critical matrix size N C =866 is obtained from the above equation. Above this critical matrix size N C , an N=8000 matrix can be divided three times. The optimal number of divisions is three. The speed-up rate is approximately given by the following equation (35).
(8/7)3=1.47 (35) (8/7) 3 = 1.47 (35)
乗算装置3iを具体例Iより多く使用する一方で、高速化率が低下している。この理由は、標準的な乗算に同様のより多くの乗算装置3iを使用したためである。計算時間は、具体例IIの方が、具体例Iに比べ短くなっている。
While using
<情報処理方法>
次に、情報処理装置10を用いた情報処理方法を説明する。図10は、実施形態1に係る情報処理方法を例示したフローチャート図である。図10に示すように、情報処理方法は、取得ステップSTEP11、算出ステップSTEP12及び選定ステップSTEP13を備えている。
<Information processing method>
Next, an information processing method using the
まず、取得ステップSTEP11において、加減算を行う1または複数の加減算装置2jの加減算演算性能、及び、乗算を行う1または複数の乗算装置3iの乗算演算性能を取得する。具体的には、情報処理装置10の取得部10aに、加減算装置2j及び乗算装置3iの演算性能を、加減算管理装置20のリストファイルLF20及び乗算管理装置30のリストファイルLF30から取得させる。
First, in acquisition step STEP11, the addition/subtraction operation performance of one or a plurality of addition/
次に、算出ステップSTEP12において、部分行列の乗算1回の処理時間と、部分行列の加減算を所定回数行う処理時間とが等しくなる行列サイズを臨界行列サイズNCとして算出する。例えば、算出部10bに、所定回数を11回とした場合に、上述した(28)式により、臨界行列サイズであるNCを算出させてもよい。
Next, in the calculation step STEP12, the critical matrix size NC is calculated as the matrix size at which the processing time for one multiplication of the submatrix is equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times. For example, when the predetermined number of times is 11, the
次に、選定ステップSTEP13において、算出した臨界行列サイズNCを用いて、計算対象である行列における分割回数を選定する。具体的には、選定部10cに、臨界行列サイズNCを用いて、計算対象のN行N列の行列における分割回数nを、N/(2n)が、臨界行列サイズNC以上で、臨界行列サイズNCに最も近い分割回数nから選定させてもよい。さらに、選定部10cに、速度向上率に基づいて、分割回数nを選定させてもよい。このようにして、大規模行列を高速に計算するための情報処理を行う。
Next, in the selection step STEP13, the calculated critical matrix size N C is used to select the number of divisions in the matrix to be calculated. Specifically, using the critical matrix size N C in the
次に、本実施形態の効果を説明する。本実施形態の情報処理装置10は、ストラッセンアルゴリズムによる大規模行列の乗算に、加減算装置2j及び乗算装置3iを用いる。そして、その際に、各装置の演算性能に基づいて、ストラッセンアルゴリズムの分割回数nを決める。これにより、大規模行列の乗算に最適な状態で加減算装置2j及び乗算装置3iを利用することができる。よって、大規模行列を高速に計算することができる。例えば、複数の演算装置を必要とする大規模行列の乗算において、担当演算装置の空き状況によって、最適な分割回数nを採択することができる。よって、大規模の行列乗算を高速化することができ、数値計算の効率を向上させることができる。
Next, the effects of this embodiment will be described. The
なお、上述した部分行列に分割するアルゴリズムは、ストラッセンアルゴリズムに限らない。部分行列に分割することによって、加減算及び乗算の回数が通常の行列の加減算及び乗算の回数と変われば、他のアルゴリズムでもよい。その場合には、部分行列に分割する際に、通常の行列の乗法に比べて、加減算の増減と乗算の増減との関係から、部分行列の乗算1回の処理時間と、部分行列の加減算を所定回数行う処理時間とが等しくなる行列サイズを臨界行列サイズNCとして算出してもよい。 Note that the above-described algorithm for dividing into submatrices is not limited to the Strassen algorithm. Other algorithms may be used as long as the number of additions/subtractions and multiplications is changed from the number of additions/subtractions/multiplications of a normal matrix by dividing the matrix into submatrices. In that case, when dividing into submatrices, compared to normal matrix multiplication, the processing time for one submatrix multiplication and the addition and subtraction of submatrices can be reduced due to the relationship between the increase and decrease of addition and subtraction and the increase and decrease of multiplication. The critical matrix size NC may be calculated as the matrix size that takes the same processing time as the predetermined number of times.
(実施形態2)
次に、実施形態2を説明する。図11は、実施形態2に係る情報処理装置を例示したブロック図である。図11に示すように、本実施形態の情報処理装置40は、さらに、分割部10d、転送部10e、判断部10f及び統合部10gを備えている。分割部10d、転送部10e、判断部10f及び統合部10gは、それぞれ、分割手段、転送手段、判断手段及び統合手段としての機能を有している。
(Embodiment 2)
Next,
分割部10dは、行列を部分行列に分割する。転送部10eは、分割された部分行列を乗算装置3j及び加減算装置2iに転送する。判断部10fは、再分割するかどうか判断する。統合部10gは、乗算装置3j及び加減算装置2iの計算結果を統合する。
The dividing unit 10d divides the matrix into submatrices. The
次に、情報処理装置10を用いた情報処理方法を説明する。図12は、実施形態2に係る情報処理方法を例示したフローチャート図である。図12に示すように、本実施形態の情報処理方法は、取得ステップSTEP21、算出ステップSTEP22及び選定ステップSTEP23の他に、分割ステップSTEP24、転送ステップSTEP25、演算結果の取得ステップSTEP26、判断ステップSTEP27、演算結果の取得ステップSTEP28、及び、統合ステップSTEP29を備えている。
Next, an information processing method using the
まず、取得ステップSTEP21において、取得ステップSTEP11と同様に、取得部10aに、加減算装置2jの加減演算性能、及び、乗算装置3iの乗算演算性能を取得させる。
First, in acquisition step STEP21, the
次に、算出ステップSTEP22において、算出ステップSTEP12と同様に、算出部10bに、部分行列の乗算1回の処理時間と、部分行列の加減算を所定回数行う処理時間とが等しくなる行列サイズを臨界行列サイズNCとして算出させる。
Next, in the calculation step STEP22, similarly to the calculation step STEP12, the
次に、選定ステップSTEP23において、選定ステップSTEP13と同様に、選定部10cに、算出した臨界行列サイズNCを用いて、計算対象である行列における分割回数nを選定させる。上述したように、速度向上率に閾値を設定し、分割回数に上限を設けてもよい。
Next, in the selection step STEP23, similarly to the selection step STEP13, the
次に、分割ステップSTEP24において、分割部10dに計算対象の行列を部分行列に分割させる。分割部10dに、分割した分割回数を記憶させてもよい。 Next, in a dividing step STEP24, the dividing unit 10d divides the matrix to be calculated into submatrices. The division number of divisions may be stored in the division unit 10d.
次に、転送ステップSTEP25において、転送部10eに、分割された部分行列を、加減算装置2j及び乗算装置3iに転送させる。部分行列を転送された各演算装置は、分割可能なM1~M7の準備するためのS1~S8の計算を行う。
Next, in a transfer step STEP25, the
次に、演算結果の取得ステップSTEP26において、取得部10aに、演算結果を取得させる。
Next, in a calculation result acquisition step STEP26, the
次に、判断ステップSTEP27において、判断部10fに再分割を行うか判断させる。判断部10fは、選定した分割回数nと記憶された分割回数とを比較して判断する。判断部10fが再分割を行うと判断したYESの場合には、ステップSTEP24に戻り、ステップSTEP24~ステップSTEP27を繰り返す。
Next, in determination step STEP27, the
判断ステップSTEP27において、判断部10fが再分割を行わないと判断したNOの場合には、ステップSTEP28において、取得部10aに、演算結果を取得させる。演算結果は、各演算装置が行ったM1~M7、V1~V3、C11~C22までの計算結果である。
In the judgment step STEP27, when the
次に、統合ステップSTEP29において、統合部10gに、加減算装置2j及び乗算装置3iの計算結果を統合させる。具体的には、統合部10gに、算出された部分行列の計算結果C11~C22を統合させる。このようにして、大規模行列を高速に計算するための情報処理を行う。
Next, in an integration step STEP29, the
次に、本実施形態の効果を説明する。本実施形態では、情報処理装置40が選定した分割回数nで計算対象の行列を部分行列に分割する。そして、分割された部分行列を加減算装置2j及び乗算装置3iに計算させる。よって、大規模行列を高速に計算することができる。これ以外の構成及び効果は、実施形態1の記載に含まれている。
Next, the effects of this embodiment will be described. In this embodiment, the matrix to be calculated is divided into submatrices by the number of divisions n selected by the
なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。例えば、実施形態1及び2の各構成を組み合わせたものも実施形態の技術的思想の範囲に含まれる。また、情報処理方法をコンピュータに実行させる情報処理プログラムも実施形態の技術的思想の範囲に含まれる。
It should be noted that the present invention is not limited to the above embodiments, and can be modified as appropriate without departing from the scope of the invention. For example, a combination of the configurations of
上記の実施形態の一部又は全部は、以下の付記のようにも記載されうるが、以下には限られない。 Some or all of the above-described embodiments can also be described in the following supplementary remarks, but are not limited to the following.
(付記A1)
加減算を行う1または複数の加減算装置と、
乗算を行う1または複数の乗算装置と、
前記加減算装置及び前記乗算装置に接続された情報処理装置と、
を備え、
前記情報処理装置は、
前記加減算装置の加減算演算性能、及び、前記乗算装置の乗算演算性能を取得する取得部と、
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、
を有する、
情報処理システム。
(付記A2)
前記算出部は、前記所定回数を11回とした場合に、下記の(A)式により、前記臨界行列サイズであるNCを算出する、
ここで、
Rmiは、各乗算装置の前記乗算演算性能を示し、
Rsjは、各加減算装置の前記加減算演算性能を示し、
xi、xjは、各乗算装置及び各加減算装置の逐次演算回数を示す、
付記A1に記載の情報処理システム。
(付記A3)
前記選定部は、算出した前記臨界行列サイズであるNCを用いて、前記計算対象であるN行N列の前記行列における前記分割回数であるnを、N/(2n)が前記NC以上で、前記NCに最も近い前記nから選定する、
付記A1またはA2に記載の情報処理システム。
(付記A4)
前記選定部は、速度向上率に基づいて、前記nを選定する、
付記A3に記載の情報処理システム。
(付記A5)
前記情報処理装置は、
前記行列を前記部分行列に分割する分割部と、
分割された前記部分行列を前記加減算装置及び前記乗算装置に転送する転送部と、
前記加減算装置及び前記乗算装置の計算結果を統合する統合部と、
をさらに有する、
付記A1~A4のいずれか1項に記載の情報処理システム。
(付記B1)
加減算演算性能及び乗算を行う1または複数の乗算装置の乗算演算性能を取得する取得部と、
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、
を有する情報処理装置に接続され、
加減算を行う前記加減算演算性能を有する、
加減算装置。
(付記B2)
前記算出部は、前記所定回数を11回とした場合に、下記の(A)式により、前記臨界行列サイズであるNCを算出する、
ここで、
Rmiは、各乗算装置の前記乗算演算性能を示し、
Rsjは、各加減算装置の前記加減算演算性能を示し、
xi、xjは、各乗算装置及び各加減算装置の逐次演算回数を示す、
付記B1に記載の加減算装置。
(付記B3)
前記選定部は、算出した前記臨界行列サイズであるNCを用いて、前記計算対象であるN行N列の前記行列における前記分割回数であるnを、N/(2n)が前記NC以上で、前記NCに最も近い前記nから選定する、
付記B1またはB2に記載の加減算装置。
(付記B4)
前記選定部は、速度向上率に基づいて、前記nを選定する、
付記B3に記載の加減算装置。
(付記B5)
前記情報処理装置は、
前記行列を前記部分行列に分割する分割部と、
分割された前記部分行列を前記加減算装置及び前記乗算装置に転送する転送部と、
前記加減算装置及び前記乗算装置の計算結果を統合する統合部と、
をさらに有する、
付記B1~B4のいずれか1項に記載の加減算装置。
(付記C1)
乗算演算性能及び加減算を行う1または複数の加減算装置の加減算演算性能を取得する取得部と、
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、
を有する情報処理装置に接続され、
乗算を行う前記乗算演算性能を有する、
乗算装置。
(付記C2)
前記算出部は、前記所定回数を11回とした場合に、下記の(A)式により、前記臨界行列サイズであるNCを算出する、
ここで、
Rmiは、各乗算装置の前記乗算演算性能を示し、
Rsjは、各加減算装置の前記加減算演算性能を示し、
xi、xjは、各乗算装置及び各加減算装置の逐次演算回数を示す、
付記C1に記載の乗算装置。
(付記C3)
前記選定部は、算出した前記臨界行列サイズであるNCを用いて、前記計算対象であるN行N列の前記行列における前記分割回数であるnを、N/(2n)が前記NC以上で、前記NCに最も近い前記nから選定する、
付記C1またはC2に記載の乗算装置。
(付記C4)
前記選定部は、速度向上率に基づいて、前記nを選定する、
付記C3に記載の乗算装置。
(付記C5)
前記情報処理装置は、
前記行列を前記部分行列に分割する分割部と、
分割された前記部分行列を前記加減算装置及び前記乗算装置に転送する転送部と、
前記加減算装置及び前記乗算装置の計算結果を統合する統合部と、
をさらに有する、
付記C1~C4のいずれか1項に記載の乗算装置。
(付記D1)
加減算を行う1または複数の加減算装置の加減算演算性能、及び、乗算を行う1または複数の乗算装置の乗算演算性能を取得させるステップと、
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出させるステップと、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定させるステップと、
を備えた情報処理方法。
(付記D2)
前記算出させるステップにおいて、
前記所定回数を11回とした場合に、下記の(A)式により、前記臨界行列サイズであるNCを算出させる、
ここで、
Rmiは、各乗算装置の前記乗算演算性能を示し、
Rsjは、各加減算装置の前記加減算演算性能を示し、
xi、xjは、各乗算装置及び各加減算装置の逐次演算回数を示す、
付記D1に記載の情報処理方法。
(付記D3)
前記選定させるステップにおいて、
算出した前記臨界行列サイズであるNCを用いて、前記計算対象であるN行N列の前記行列における前記分割回数であるnを、N/(2n)が前記NC以上で、前記NCに最も近い前記nから選定させる、
付記D1またはD2に記載の情報処理方法。
(付記D4)
前記選定させるステップにおいて、
速度向上率に基づいて、前記nを選定させる、
付記D3に記載の情報処理方法。
(付記D5)
前記行列を前記部分行列に分割させるステップと、
分割された前記部分行列を前記加減算装置及び前記乗算装置に転送させるステップと、
前記加減算装置及び前記乗算装置の計算結果を統合させるステップと、
をさらに備えた、
付記D1~D4のいずれか1項に記載の情報処理方法。
(付記E1)
加減算を行う1または複数の加減算装置の加減算演算性能、及び、乗算を行う1または複数の乗算装置の乗算演算性能を取得させるステップと、
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出させるステップと、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定させるステップと、
をコンピュータに実行させる情報処理プログラム。
(付記E2)
前記算出させるステップにおいて、
前記所定回数を11回とした場合に、下記の(A)式により、前記臨界行列サイズであるNCを算出させる、
ここで、
Rmiは、各乗算装置の前記乗算演算性能を示し、
Rsjは、各加減算装置の前記加減算演算性能を示し、
xi、xjは、各乗算装置及び各加減算装置の逐次演算回数を示す、
付記E1に記載の情報処理プログラム。
(付記E3)
前記選定させるステップにおいて、
算出した前記臨界行列サイズであるNCを用いて、前記計算対象であるN行N列の前記行列における前記分割回数であるnを、N/(2n)が前記NC以上で、前記NCに最も近い前記nから選定させる、
付記E1またはE2に記載の情報処理プログラム。
(付記E4)
前記選定させるステップにおいて、
速度向上率に基づいて、前記nを選定させる、
付記E3に記載の情報処理プログラム。
(付記E5)
前記行列を前記部分行列に分割させるステップと、
分割された前記部分行列を前記加減算装置及び前記乗算装置に転送させるステップと、
前記加減算装置及び前記乗算装置の計算結果を統合させるステップと、
をさらにコンピュータに実行させる付記E1~E2のいずれか1項に記載の情報処理プログラム。
(Appendix A1)
one or more addition/subtraction devices that perform addition/subtraction;
one or more multipliers for multiplication;
an information processing device connected to the addition/subtraction device and the multiplication device;
with
The information processing device is
an acquisition unit that acquires the addition/subtraction operation performance of the addition/subtraction device and the multiplication operation performance of the multiplication device;
a calculation unit that calculates, as a critical matrix size, a matrix size that makes the processing time for one multiplication of a submatrix equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
a selection unit that selects the number of divisions in a matrix to be calculated using the calculated critical matrix size;
having
Information processing system.
(Appendix A2)
When the predetermined number of times is 11, the calculation unit calculates NC , which is the critical matrix size, according to the following formula (A):
here,
R mi indicates the multiplication operation performance of each multiplier,
R sj indicates the addition/subtraction operation performance of each addition/subtraction device,
x i and x j indicate the number of sequential operations of each multiplier and each adder/subtractor;
The information processing system according to appendix A1.
(Appendix A3)
The selection unit uses the calculated critical matrix size NC to determine n, which is the number of divisions in the matrix of N rows and N columns, which is the calculation target, so that N/(2 n ) is the NC above, select from the n closest to the N C ,
The information processing system according to appendix A1 or A2.
(Appendix A4)
The selection unit selects the n based on the speed improvement rate.
The information processing system according to appendix A3.
(Appendix A5)
The information processing device is
a dividing unit that divides the matrix into the submatrices;
a transfer unit that transfers the divided submatrices to the addition/subtraction device and the multiplication device;
an integration unit that integrates the calculation results of the addition/subtraction device and the multiplication device;
further having
The information processing system according to any one of Appendices A1 to A4.
(Appendix B1)
an acquisition unit that acquires addition/subtraction operation performance and multiplication operation performance of one or more multiplication devices that perform multiplication;
a calculation unit that calculates, as a critical matrix size, a matrix size that makes the processing time for one multiplication of a submatrix equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
a selection unit that selects the number of divisions in a matrix to be calculated using the calculated critical matrix size;
connected to an information processing device having
Having the addition and subtraction operation performance to perform addition and subtraction,
Adder/Subtractor.
(Appendix B2)
When the predetermined number of times is 11, the calculation unit calculates NC , which is the critical matrix size, according to the following formula (A):
here,
R mi indicates the multiplication operation performance of each multiplier,
R sj indicates the addition/subtraction operation performance of each addition/subtraction device,
x i and x j indicate the number of sequential operations of each multiplier and each adder/subtractor;
An addition/subtraction device according to Appendix B1.
(Appendix B3)
The selection unit uses the calculated critical matrix size NC to determine n, which is the number of divisions in the matrix of N rows and N columns, which is the calculation target, so that N/(2 n ) is the NC above, select from the n closest to the N C ,
An addition/subtraction device according to Appendix B1 or B2.
(Appendix B4)
The selection unit selects the n based on the speed improvement rate.
An addition/subtraction device according to Appendix B3.
(Appendix B5)
The information processing device is
a dividing unit that divides the matrix into the submatrices;
a transfer unit that transfers the divided submatrices to the addition/subtraction device and the multiplication device;
an integration unit that integrates the calculation results of the addition/subtraction device and the multiplication device;
further having
An addition/subtraction device according to any one of Appendixes B1 to B4.
(Appendix C1)
an acquisition unit that acquires multiplication operation performance and addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction;
a calculation unit that calculates, as a critical matrix size, a matrix size that makes the processing time for one multiplication of a submatrix equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
a selection unit that selects the number of divisions in a matrix to be calculated using the calculated critical matrix size;
connected to an information processing device having
Having the multiplication operation performance to perform multiplication,
multiplier.
(Appendix C2)
When the predetermined number of times is 11, the calculation unit calculates NC , which is the critical matrix size, according to the following formula (A):
here,
R mi indicates the multiplication operation performance of each multiplier,
R sj indicates the addition/subtraction operation performance of each addition/subtraction device,
x i and x j indicate the number of sequential operations of each multiplier and each adder/subtractor;
Multiplication device according to Appendix C1.
(Appendix C3)
The selection unit uses the calculated critical matrix size NC to determine n, which is the number of divisions in the matrix of N rows and N columns, which is the calculation target, so that N/(2 n ) is the NC above, select from the n closest to the N C ,
Multiplication device according to Appendix C1 or C2.
(Appendix C4)
The selection unit selects the n based on the speed improvement rate.
Multiplication device according to Appendix C3.
(Appendix C5)
The information processing device is
a dividing unit that divides the matrix into the submatrices;
a transfer unit that transfers the divided submatrices to the addition/subtraction device and the multiplication device;
an integration unit that integrates the calculation results of the addition/subtraction device and the multiplication device;
further having
A multiplication device according to any one of Appendices C1 to C4.
(Appendix D1)
Acquiring addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction and multiplication operation performance of one or more multiplication devices that perform multiplication;
a step of calculating a matrix size as a critical matrix size at which the processing time for one multiplication of a submatrix is equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
using the calculated critical matrix size to select the number of divisions in the matrix to be calculated;
An information processing method comprising
(Appendix D2)
In the calculating step,
When the predetermined number of times is 11, calculate N C , which is the critical matrix size, by the following formula (A),
here,
R mi indicates the multiplication operation performance of each multiplier,
R sj indicates the addition/subtraction operation performance of each addition/subtraction device,
x i and x j indicate the number of sequential operations of each multiplier and each adder/subtractor;
The information processing method according to appendix D1.
(Appendix D3)
In the selecting step,
Using N C which is the calculated critical matrix size, n, which is the number of divisions in the matrix of N rows and N columns, which is the calculation target, is calculated so that N/(2 n ) is equal to or greater than N C and N having the n closest to C selected from;
The information processing method according to appendix D1 or D2.
(Appendix D4)
In the selecting step,
selecting the n based on the speedup rate;
The information processing method according to appendix D3.
(Appendix D5)
partitioning said matrix into said sub-matrices;
transferring the divided submatrices to the adder/subtractor and the multiplier;
integrating the calculation results of the adder/subtractor and the multiplier;
further comprising
The information processing method according to any one of Appendices D1 to D4.
(Appendix E1)
Acquiring addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction and multiplication operation performance of one or more multiplication devices that perform multiplication;
calculating a matrix size as a critical matrix size at which the processing time for one multiplication of a submatrix is equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
using the calculated critical matrix size to select the number of divisions in the matrix to be calculated;
An information processing program that causes a computer to execute
(Appendix E2)
In the calculating step,
When the predetermined number of times is 11, calculate N C , which is the critical matrix size, by the following formula (A),
here,
R mi indicates the multiplication operation performance of each multiplier,
R sj indicates the addition/subtraction operation performance of each addition/subtraction device,
x i and x j indicate the number of sequential operations of each multiplier and each adder/subtractor;
The information processing program according to appendix E1.
(Appendix E3)
In the selecting step,
Using N C which is the calculated critical matrix size, n, which is the number of divisions in the matrix of N rows and N columns which is the calculation target, is calculated so that N/(2 n ) is equal to or greater than N C and N having the n closest to C selected from;
The information processing program according to appendix E1 or E2.
(Appendix E4)
In the selecting step,
selecting the n based on the speedup rate;
The information processing program according to appendix E3.
(Appendix E5)
partitioning said matrix into said sub-matrices;
transferring the divided submatrices to the adder/subtractor and the multiplier;
integrating the calculation results of the adder/subtractor and the multiplier;
The information processing program according to any one of Appendices E1 to E2, further causing the computer to execute
プログラムは、コンピュータに読み込まれた場合に、実施形態で説明された1又はそれ以上の機能をコンピュータに行わせるための命令群(又はソフトウェアコード)を含む。プログラムは、非一時的なコンピュータ可読媒体又は実体のある記憶媒体に格納されてもよい。限定ではなく例として、コンピュータ可読媒体又は実体のある記憶媒体は、random-access memory(RAM)、read-only memory(ROM)、フラッシュメモリ、solid-state drive(SSD)又はその他のメモリ技術、CD-ROM、digital versatile disc(DVD)、Blu-ray(登録商標)ディスク又はその他の光ディスクストレージ、磁気カセット、磁気テープ、磁気ディスクストレージ又はその他の磁気ストレージデバイスを含む。プログラムは、一時的なコンピュータ可読媒体又は通信媒体上で送信されてもよい。限定ではなく例として、一時的なコンピュータ可読媒体又は通信媒体は、電気的、光学的、音響的、またはその他の形式の伝搬信号を含む。 A program includes instructions (or software code) that, when read into a computer, cause the computer to perform one or more of the functions described in the embodiments. The program may be stored in a non-transitory computer-readable medium or tangible storage medium. By way of example, and not limitation, computer readable media or tangible storage media may include random-access memory (RAM), read-only memory (ROM), flash memory, solid-state drives (SSD) or other memory technology, CDs -ROM, digital versatile disc (DVD), Blu-ray disc or other optical disc storage, magnetic cassette, magnetic tape, magnetic disc storage or other magnetic storage device. The program may be transmitted on a transitory computer-readable medium or communication medium. By way of example, and not limitation, transitory computer readable media or communication media include electrical, optical, acoustic, or other forms of propagated signals.
1 情報処理システム
10、40 情報処理装置
10a 取得部
10b 算出部
10c 選定部
10d 分割部
10e 転送部
10f 判断部
10g 統合部
20 加減算管理装置
20a 取得部
20b 記憶部
20c 送信部
21、2j 加減算装置
2ja 取得部
2jb 演算部
2jc 送信部
30 乗算管理装置
30a 取得部
30b 記憶部
30c 送信部
31、3i 乗算装置
3ja 取得部
3jb 演算部
3jc 送信部
LF20 加減算リストファイル
LF30 乗算リストファイル
1
Claims (10)
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、
を備えた情報処理装置。 an acquisition unit that acquires addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction and multiplication operation performance of one or more multiplication devices that perform multiplication;
a calculation unit that calculates, as a critical matrix size, a matrix size that makes the processing time for one multiplication of a submatrix equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
a selection unit that selects the number of divisions in a matrix to be calculated using the calculated critical matrix size;
Information processing device with
ここで、
Rmiは、各乗算装置の前記乗算演算性能を示し、
Rsjは、各加減算装置の前記加減算演算性能を示し、
xi、xjは、各乗算装置及び各加減算装置の逐次演算回数を示す、
請求項1に記載の情報処理装置。 When the predetermined number of times is 11, the calculation unit calculates NC , which is the critical matrix size, according to the following formula (A):
here,
R mi indicates the multiplication operation performance of each multiplier,
R sj indicates the addition/subtraction operation performance of each addition/subtraction device,
x i and x j indicate the number of sequential operations of each multiplier and each adder/subtractor;
The information processing device according to claim 1 .
請求項1または2に記載の情報処理装置。 The selection unit uses the calculated critical matrix size NC to determine n, which is the number of divisions in the matrix of N rows and N columns, which is the calculation target, so that N/(2 n ) is the NC above, select from the n closest to the N C ,
The information processing apparatus according to claim 1 or 2.
請求項3に記載の情報処理装置。 The selection unit selects the n based on the speed improvement rate.
The information processing apparatus according to claim 3.
分割された前記部分行列を前記加減算装置及び前記乗算装置に転送する転送部と、
前記加減算装置及び前記乗算装置の計算結果を統合する統合部と、
をさらに備えた、
請求項1~4のいずれか1項に記載の情報処理装置。 a dividing unit that divides the matrix into the submatrices;
a transfer unit that transfers the divided submatrices to the addition/subtraction device and the multiplication device;
an integration unit that integrates the calculation results of the addition/subtraction device and the multiplication device;
further comprising
The information processing apparatus according to any one of claims 1 to 4.
乗算を行う1または複数の乗算装置と、
前記加減算装置及び前記乗算装置に接続された情報処理装置と、
を備え、
前記情報処理装置は、
前記加減算装置の加減算演算性能、及び、前記乗算装置の乗算演算性能を取得する取得部と、
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、
を有する、
情報処理システム。 one or more addition/subtraction devices that perform addition/subtraction;
one or more multipliers for multiplication;
an information processing device connected to the addition/subtraction device and the multiplication device;
with
The information processing device is
an acquisition unit that acquires the addition/subtraction operation performance of the addition/subtraction device and the multiplication operation performance of the multiplication device;
a calculation unit that calculates, as a critical matrix size, a matrix size that makes the processing time for one multiplication of a submatrix equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
a selection unit that selects the number of divisions in a matrix to be calculated using the calculated critical matrix size;
having
Information processing system.
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、
を有する情報処理装置に接続され、
加減算を行う前記加減算演算性能を有する、
加減算装置。 an acquisition unit that acquires addition/subtraction operation performance and multiplication operation performance of one or more multiplication devices that perform multiplication;
a calculation unit that calculates, as a critical matrix size, a matrix size that makes the processing time for one multiplication of a submatrix equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
a selection unit that selects the number of divisions in a matrix to be calculated using the calculated critical matrix size;
connected to an information processing device having
Having the addition and subtraction operation performance to perform addition and subtraction,
Adder/Subtractor.
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出する算出部と、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定する選定部と、
を有する情報処理装置に接続され、
乗算を行う前記乗算演算性能を有する、
乗算装置。 an acquisition unit that acquires multiplication operation performance and addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction;
a calculation unit that calculates, as a critical matrix size, a matrix size that makes the processing time for one multiplication of a submatrix equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
a selection unit that selects the number of divisions in a matrix to be calculated using the calculated critical matrix size;
connected to an information processing device having
Having the multiplication operation performance to perform multiplication,
multiplier.
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出させるステップと、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定させるステップと、
を備えた情報処理方法。 Acquiring addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction and multiplication operation performance of one or more multiplication devices that perform multiplication;
a step of calculating a matrix size as a critical matrix size at which the processing time for one multiplication of a submatrix is equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
using the calculated critical matrix size to select the number of divisions in the matrix to be calculated;
An information processing method comprising
部分行列の乗算1回の処理時間と、前記部分行列の加減算を所定回数行う前記処理時間とが等しくなる行列サイズを臨界行列サイズとして算出させるステップと、
算出した前記臨界行列サイズを用いて、計算対象である行列における分割回数を選定させるステップと、
をコンピュータに実行させる情報処理プログラム。 Acquiring addition/subtraction operation performance of one or more addition/subtraction devices that perform addition/subtraction and multiplication operation performance of one or more multiplication devices that perform multiplication;
a step of calculating a matrix size as a critical matrix size at which the processing time for one multiplication of a submatrix is equal to the processing time for performing addition and subtraction of the submatrix a predetermined number of times;
using the calculated critical matrix size to select the number of divisions in the matrix to be calculated;
An information processing program that causes a computer to execute
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022018009A JP2023115660A (en) | 2022-02-08 | 2022-02-08 | Information processing apparatus, information processing system, addition and subtraction apparatus, multiplication apparatus, information processing method, and information processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022018009A JP2023115660A (en) | 2022-02-08 | 2022-02-08 | Information processing apparatus, information processing system, addition and subtraction apparatus, multiplication apparatus, information processing method, and information processing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2023115660A true JP2023115660A (en) | 2023-08-21 |
Family
ID=87576418
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2022018009A Pending JP2023115660A (en) | 2022-02-08 | 2022-02-08 | Information processing apparatus, information processing system, addition and subtraction apparatus, multiplication apparatus, information processing method, and information processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2023115660A (en) |
-
2022
- 2022-02-08 JP JP2022018009A patent/JP2023115660A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190087718A1 (en) | Hardware Implementation of a Deep Neural Network with Variable Output Data Format | |
JP2020524318A (en) | Alternate loop limit | |
US8570336B2 (en) | Texture unit for general purpose computing | |
CN109521994B (en) | Multiplication hardware circuit, system on chip and electronic equipment | |
US8756268B2 (en) | Montgomery multiplier having efficient hardware structure | |
KR20150145167A (en) | Processing method and apparatus for single-channel convolution layer, and processing method and apparatus for multi-channel convolution layer | |
US20170206089A1 (en) | Information processing apparatus and computational method | |
JPH09153029A (en) | Memory distributed parallel computer for execution of fast fourier transform and its method | |
WO2021036729A1 (en) | Matrix computation method, computation device, and processor | |
US11907681B2 (en) | Semiconductor device and method of controlling the semiconductor device | |
WO2017012351A1 (en) | Parallel computing method and terminal | |
JP2023115660A (en) | Information processing apparatus, information processing system, addition and subtraction apparatus, multiplication apparatus, information processing method, and information processing program | |
CN111160541A (en) | Integrated circuit chip device and related product | |
CN111381882B (en) | Data processing device and related product | |
CN111091189B (en) | Integrated circuit chip device and related products | |
JP2017228223A (en) | Signal processor | |
JP2022019681A (en) | Division system determination method, determination device, calculation system, and program | |
KR102614966B1 (en) | Computing system for subgraph and reduce allocation in graph coded distributed computing for communication load reduction, and method of the same | |
CN114065123A (en) | Sparse matrix calculation method and acceleration device | |
JP2021501406A (en) | Methods, devices, and systems for task processing | |
CN111984399A (en) | Arithmetic processing device, control method thereof, and storage medium for storing program | |
CN111985628A (en) | Computing device and neural network processor including the same | |
KR102215449B1 (en) | Matrix calculation device | |
JP7233636B2 (en) | Data quantization processing method, device, electronic device and storage medium | |
CN112596912B (en) | Acceleration operation method and device for convolution calculation of binary or ternary neural network |