JP6003744B2 - 演算処理装置及び演算処理方法 - Google Patents
演算処理装置及び演算処理方法 Download PDFInfo
- Publication number
- JP6003744B2 JP6003744B2 JP2013060018A JP2013060018A JP6003744B2 JP 6003744 B2 JP6003744 B2 JP 6003744B2 JP 2013060018 A JP2013060018 A JP 2013060018A JP 2013060018 A JP2013060018 A JP 2013060018A JP 6003744 B2 JP6003744 B2 JP 6003744B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- input
- multiplier
- input data
- output
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims description 3
- 239000011159 matrix material Substances 0.000 claims description 80
- 238000013500 data storage Methods 0.000 claims description 20
- 238000000034 method Methods 0.000 description 39
- 238000004364 calculation method Methods 0.000 description 30
- 229940050561 matrix product Drugs 0.000 description 26
- 238000004886 process control Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 7
- XUIMIQQOPSSXEZ-UHFFFAOYSA-N Silicon Chemical compound [Si] XUIMIQQOPSSXEZ-UHFFFAOYSA-N 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 229910052710 silicon Inorganic materials 0.000 description 1
- 239000010703 silicon Substances 0.000 description 1
- 230000017105 transposition Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/544—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
- G06F7/5443—Sum of products
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Complex Calculations (AREA)
Description
前述したように行列積演算は、1つの要素に係る演算では同じデータを使用しないため、1つの要素に係る演算をベクトル演算化してもデータ格納部と演算処理部との間でのデータの移動回数が減らない。しかし、行が異なり列が同じ要素の演算では同じ列のデータが使用され、列が異なり行が同じ要素の演算では同じ行のデータが使用される。そこで、本実施形態では、行列積演算における行、列が異なる要素の演算処理を1つの命令で行うようにして入力データの共有を可能にし、データ格納部と演算処理部との間でのデータ移動の回数を低減できるようにする。
本発明の第1の実施形態について説明する。
図1は、第1の実施形態における演算処理装置が有する演算処理部の構成例を示す図である。演算処理部10Aは、2つの2×2行列を入力とし、これら入力行列の行列積を出力とする行列積演算器である。第1の入力行列は、データa0、a1、a2、a3を要素とするベクトルデータaであり、第2の入力行列は、データb0、b1、b2、b3を要素とするベクトルデータbであり、出力行列は、データc0、c1、c2、c3を要素とするベクトルデータcである。ここで、データa0、b0、c0を各行列における第1行第1列のデータ、データa1、b1、c1を各行列における第1行第2列のデータ、データa2、b2、c2を各行列における第2行第1列のデータ、データa3、b3、c3を各行列における第2行第2列のデータとする。また、各データa0〜a3、b0〜b3、c0〜c3は、数値データであり、データ型は任意である。各データa0〜a3、b0〜b3、c0〜c3のデータ型は、例えば浮動小数点数型、固定小数点数型、整数型などである。
処理を開始すると、ステップS201にて、処理制御部32は、変数jを0に初期化する。次に、ステップS202にて、処理制御部32は、変数jの値を確認し、変数jの値がNより小さければステップS203へ進み、そうでなければ処理を終了する。ステップS203にて、処理制御部32は、変数iを0に初期化する。次に、ステップS204にて、処理制御部32は、変数iの値を確認し、変数iの値がNより小さければステップS205へ進み、そうでなければステップS210にて変数jの値に2を加算してステップS202へ進む。ステップS205にて、処理制御部32は、変数kを0に初期化する。次に、ステップS206にて、処理制御部32は、変数kの値を確認し、変数kの値がNより小さければステップS207へ進み、そうでなければステップS209にて変数iの値に2を加算してステップS204へ進む。
次に、本発明の第2の実施形態について説明する。なお、以下に説明する第2〜第4の実施形態の各々において、演算処理装置の全体構成、及び演算処理装置によるN×N行列の行列積演算処理は、第1の実施形態と同様であるので説明は省略し、演算処理装置が有する演算処理部の構成について説明する。
次に、本発明の第3の実施形態について説明する。
図5は、第3の実施形態における演算処理装置が有する演算処理部の構成例を示す図である。図5において、図1に示した構成要素と同一の機能を有する構成要素には同一の符号を付し、重複する説明は省略する。演算処理部10Cは、2つの2×2行列及び制御信号(切り替え信号)Tを入力とし、制御信号Tによって第2の入力行列を転置するかを選択して、2つの入力行列の行列積を出力とする行列積演算器である。
次に、本発明の第4の実施形態について説明する。
図6は、第4の実施形態における演算処理装置が有する演算処理部の構成例を示す図である。図6において、図1に示した構成要素と同一の機能を有する構成要素には同一の符号を付し、重複する説明は省略する。第4の実施形態における演算処理部は、3つの2×2行列を入力とし、2つの入力行列(第1の入力行列及び第2の入力行列)の行列積と1つの入力行列(第3の入力行列)との和を出力とする行列積演算器である。
11−1〜11−2 乗算器
12−1〜12−4 加算器
13−1〜13−4 セレクタ
20A、20B、20C 演算処理部
21−1〜21−4 加算器
31 データ格納部
32 処理制御部
33 行列演算器
Claims (7)
- 第1組の4つの入力データのうちの第1の入力データを第1入力に受けるとともに、第2組の4つの入力データのうちの第1の入力データを第2入力に受けて、当該入力データの積を出力する第1の乗算器と、
前記第1組の第2の入力データを第1入力に受けるとともに、前記第2組の第3の入力データを第2入力に受けて、当該入力データの積を出力する第2の乗算器と、
前記第1組の前記第2の入力データを第1入力に受けるとともに、前記第2組の第4の入力データを第2入力に受けて、当該入力データの積を出力する第3の乗算器と、
前記第1組の前記第1の入力データを第1入力に受けるとともに、前記第2組の第2の入力データを第2入力に受けて、当該入力データの積を出力する第4の乗算器と、
前記第1組の第3の入力データを第1入力に受けるとともに、前記第2組の前記第1の入力データを第2入力に受けて、当該入力データの積を出力する第5の乗算器と、
前記第1組の第4の入力データを第1入力に受けるとともに、前記第2組の前記第3の入力データを第2入力に受けて、当該入力データの積を出力する第6の乗算器と、
前記第1組の前記第4の入力データを第1入力に受けるとともに、前記第2組の前記第4の入力データを第2入力に受けて、当該入力データの積を出力する第7の乗算器と、
前記第1組の前記第3の入力データを第1入力に受けるとともに、前記第2組の前記第2の入力データを第2入力に受けて、当該入力データの積を出力する第8の乗算器と、
前記第1の乗算器の出力と前記第2の乗算器の出力とを加算し、第1の出力データとして加算結果を出力する第1の加算器と、
前記第3の乗算器の出力と前記第4の乗算器の出力とを加算し、第2の出力データとして加算結果を出力する第2の加算器と、
前記第5の乗算器の出力と前記第6の乗算器の出力とを加算し、第3の出力データとして加算結果を出力する第3の加算器と、
前記第7の乗算器の出力と前記第8の乗算器の出力とを加算し、第4の出力データとして加算結果を出力する第4の加算器とを有することを特徴とする演算処理装置。 - 第3組の4つの入力データのうちの第1の入力データと前記第1の加算器の出力とを加算し、前記第1の出力データとして加算結果を出力する第5の加算器と、
前記第3組の第2の入力データと前記第2の加算器の出力とを加算し、前記第2の出力データとして加算結果を出力する第6の加算器と、
前記第3組の第3の入力データと前記第3の加算器の出力とを加算し、前記第3の出力データとして加算結果を出力する第7の加算器と、
前記第3組の第4の入力データと前記第4の加算器の出力とを加算し、前記第4の出力データとして加算結果を出力する第8の加算器とをさらに有することを特徴とする請求項1記載の演算処理装置。 - 前記第2の乗算器及び前記第6の乗算器が、前記第2組の前記第2の入力データを前記第2入力に受け、
前記第4の乗算器及び前記第8の乗算器が、前記第2組の前記第3の入力データを前記第2入力に受けることを特徴とする請求項1又は2記載の演算処理装置。 - 前記第2組の前記第2の入力データ又は前記第3の入力データを、制御信号に応じて選択して出力する複数のセレクタを有し、
前記第2の乗算器及び前記第6の乗算器は、第1のセレクタの出力を前記第2入力に受け、
前記第2の乗算器及び前記第6の乗算器は、前記第1のセレクタが前記制御信号に応じて前記第2の入力データを出力しているときに前記第3の入力データを出力し、前記第1のセレクタが前記制御信号に応じて前記第3の入力データを出力しているときに前記第2の入力データを出力する第2のセレクタの出力を前記第2入力に受けることを特徴とする請求項1又は2記載の演算処理装置。 - 複数組の前記入力データが格納されるデータ格納部から前記入力データを読み出して前記乗算器に供給する処理制御部をさらに有することを特徴とする請求項1〜4の何れか1項に記載の演算処理装置。
- 前記データ格納部に格納される複数組の前記入力データは、N×N行列を分割した2×2部分行列における4つのデータであり、
前記処理制御部は、N×N行列において演算対象の行に対応する第1のN×N行列内の複数の2×2部分行列における4つのデータを前記第1組の入力データとして前記乗算器に順次供給するとともに、演算対象の列に対応する第2のN×N行列内の複数の2×2部分行列における4つのデータを前記第2組の入力データとして前記乗算器に順次供給することを特徴とする請求項5記載の演算処理装置。 - 複数の乗算器及び複数の加算器を有する演算処理装置による演算処理方法であって、
前記演算処理装置の第1の乗算器が、第1組の4つの入力データのうちの第1の入力データと第2組の4つの入力データのうちの第1の入力データとの積を出力し、
前記演算処理装置の第2の乗算器が、前記第1組の第2の入力データと前記第2組の第3の入力データとの積を出力し、
前記演算処理装置の第3の乗算器が、前記第1組の前記第2の入力データと前記第2組の第4の入力データとの積を出力し、
前記演算処理装置の第4の乗算器が、前記第1組の前記第1の入力データと前記第2組の第2の入力データとの積を出力し、
前記演算処理装置の第5の乗算器が、前記第1組の第3の入力データと前記第2組の前記第1の入力データとの積を出力し、
前記演算処理装置の第6の乗算器が、前記第1組の第4の入力データと前記第2組の前記第3の入力データとの積を出力し、
前記演算処理装置の第7の乗算器が、前記第1組の前記第4の入力データと前記第2組の前記第4の入力データとの積を出力し、
前記演算処理装置の第8の乗算器が、前記第1組の前記第3の入力データと前記第2組の前記第2の入力データとの積を出力し、
前記演算処理装置の第1の加算器が、前記第1の乗算器の出力と前記第2の乗算器の出力との和を第1の出力データとして出力し、
前記演算処理装置の第2の加算器が、前記第3の乗算器の出力と前記第4の乗算器の出力との和を第2の出力データとして出力し、
前記演算処理装置の第3の加算器が、前記第5の乗算器の出力と前記第6の乗算器の出力との和を第3の出力データとして出力し、
前記演算処理装置の第4の加算器が、前記第7の乗算器の出力と前記第8の乗算器の出力との和を第4の出力データとして出力することを特徴とする演算処理方法。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013060018A JP6003744B2 (ja) | 2013-03-22 | 2013-03-22 | 演算処理装置及び演算処理方法 |
US14/159,728 US9361065B2 (en) | 2013-03-22 | 2014-01-21 | Processor and processing method |
CN201410041737.8A CN104063357B (zh) | 2013-03-22 | 2014-01-28 | 处理器以及处理方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013060018A JP6003744B2 (ja) | 2013-03-22 | 2013-03-22 | 演算処理装置及び演算処理方法 |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014186461A JP2014186461A (ja) | 2014-10-02 |
JP6003744B2 true JP6003744B2 (ja) | 2016-10-05 |
Family
ID=51551074
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013060018A Active JP6003744B2 (ja) | 2013-03-22 | 2013-03-22 | 演算処理装置及び演算処理方法 |
Country Status (3)
Country | Link |
---|---|
US (1) | US9361065B2 (ja) |
JP (1) | JP6003744B2 (ja) |
CN (1) | CN104063357B (ja) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6003744B2 (ja) * | 2013-03-22 | 2016-10-05 | 富士通株式会社 | 演算処理装置及び演算処理方法 |
CN107305538B (zh) * | 2016-04-22 | 2020-07-31 | 中科寒武纪科技股份有限公司 | 一种子矩阵运算装置及方法 |
US10824934B2 (en) * | 2017-01-12 | 2020-11-03 | Texas Instruments Incorporated | Methods and apparatus for matrix processing in a convolutional neural network |
JP6604393B2 (ja) | 2018-03-08 | 2019-11-13 | 日本電気株式会社 | ベクトルプロセッサ、演算実行方法、プログラム |
CN110415157B (zh) * | 2018-04-26 | 2024-01-30 | 华为技术有限公司 | 一种矩阵乘法的计算方法及装置 |
US10754649B2 (en) | 2018-07-24 | 2020-08-25 | Apple Inc. | Computation engine that operates in matrix and vector modes |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5021987A (en) * | 1989-08-31 | 1991-06-04 | General Electric Company | Chain-serial matrix multipliers |
US5204830A (en) * | 1992-02-13 | 1993-04-20 | Industrial Technology Research Institute | Fast pipelined matrix multiplier |
JPH1063647A (ja) * | 1996-08-23 | 1998-03-06 | Matsushita Electric Ind Co Ltd | 行列演算装置 |
JPH10312374A (ja) | 1997-05-13 | 1998-11-24 | Kofu Nippon Denki Kk | ベクトル演算処理装置 |
US6427159B1 (en) * | 1999-08-03 | 2002-07-30 | Koninklijke Philips Electronics N.V. | Arithmetic unit, digital signal processor, method of scheduling multiplication in an arithmetic unit, method of selectively delaying adding and method of selectively adding during a first or second clock cycle |
US6526430B1 (en) * | 1999-10-04 | 2003-02-25 | Texas Instruments Incorporated | Reconfigurable SIMD coprocessor architecture for sum of absolute differences and symmetric filtering (scalable MAC engine for image processing) |
US20050240646A1 (en) * | 2004-04-23 | 2005-10-27 | The Research Foundation Of State University Of New York | Reconfigurable matrix multiplier architecture and extended borrow parallel counter and small-multiplier circuits |
US8122227B2 (en) | 2004-11-03 | 2012-02-21 | Silicon Hive B.V. | SIMD processor for performing data filtering and/or interpolation |
US8051124B2 (en) * | 2007-07-19 | 2011-11-01 | Itt Manufacturing Enterprises, Inc. | High speed and efficient matrix multiplication hardware module |
JP2009245381A (ja) * | 2008-03-31 | 2009-10-22 | Fujitsu Ltd | 積和演算回路、その設計装置、プログラム |
US8239442B2 (en) * | 2008-08-08 | 2012-08-07 | Analog Devices, Inc. | Computing module for efficient FFT and FIR hardware accelerator |
US8984043B2 (en) * | 2009-12-23 | 2015-03-17 | Intel Corporation | Multiplying and adding matrices |
JP5765280B2 (ja) * | 2012-03-27 | 2015-08-19 | カシオ計算機株式会社 | 行列計算装置およびプログラム |
CN102662623A (zh) * | 2012-04-28 | 2012-09-12 | 电子科技大学 | 基于单fpga的并行矩阵乘法器及其实现方法 |
US8959136B1 (en) * | 2012-05-08 | 2015-02-17 | Altera Corporation | Matrix operations in an integrated circuit device |
US9201848B2 (en) * | 2012-07-27 | 2015-12-01 | The United States Of America As Represented By The Secretary Of The Air Force | Floating point matrix multiplication co-processor |
JP6003744B2 (ja) * | 2013-03-22 | 2016-10-05 | 富士通株式会社 | 演算処理装置及び演算処理方法 |
-
2013
- 2013-03-22 JP JP2013060018A patent/JP6003744B2/ja active Active
-
2014
- 2014-01-21 US US14/159,728 patent/US9361065B2/en active Active
- 2014-01-28 CN CN201410041737.8A patent/CN104063357B/zh active Active
Also Published As
Publication number | Publication date |
---|---|
JP2014186461A (ja) | 2014-10-02 |
CN104063357B (zh) | 2017-04-12 |
US20140289300A1 (en) | 2014-09-25 |
US9361065B2 (en) | 2016-06-07 |
CN104063357A (zh) | 2014-09-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6003744B2 (ja) | 演算処理装置及び演算処理方法 | |
JP6977239B2 (ja) | 行列乗算器 | |
US8051124B2 (en) | High speed and efficient matrix multiplication hardware module | |
US20190155601A1 (en) | Processing device and a swizzle pattern generator | |
US11640303B2 (en) | Calculating device | |
JP5951570B2 (ja) | 行列演算装置 | |
US20030200237A1 (en) | Serial operation pipeline, arithmetic device, arithmetic-logic circuit and operation method using the serial operation pipeline | |
CN109144469B (zh) | 流水线结构神经网络矩阵运算架构及方法 | |
JP7038608B2 (ja) | 半導体装置 | |
EP4095719A1 (en) | Sparse matrix multiplication in hardware | |
CN111581595B (zh) | 一种矩阵乘法计算方法及计算电路 | |
US20220004364A1 (en) | Convolutional computation device | |
US8892615B2 (en) | Arithmetic operation circuit and method of converting binary number | |
CN112446007B (zh) | 一种矩阵运算方法、运算装置以及处理器 | |
JP5157484B2 (ja) | 行列演算コプロセッサ | |
CN112074810B (zh) | 并行处理设备 | |
JP2006099719A (ja) | 処理装置 | |
KR100960148B1 (ko) | 데이터 프로세싱 회로 | |
US20180267776A1 (en) | Arithmetic operation unit and method of controlling arithmetic operation unit | |
US20210117352A1 (en) | Semiconductor device and method of controlling the same | |
JP6378515B2 (ja) | Vliwプロセッサ | |
JPS6310263A (ja) | ベクトル処理装置 | |
CN114443146B (zh) | 基于存算一体存储器的矢量处理器及其运行方法 | |
KR19990017608A (ko) | 신호 처리 프로세서의 연산 유닛 및 입출력 장치 | |
CN119440462A (zh) | 一种存内计算模块以及相关方法、芯片和设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20151106 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160712 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20160809 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160822 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6003744 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |