JP7120308B2 - DATA PROCESSING DEVICE, DATA PROCESSING CIRCUIT AND DATA PROCESSING METHOD - Google Patents
DATA PROCESSING DEVICE, DATA PROCESSING CIRCUIT AND DATA PROCESSING METHOD Download PDFInfo
- Publication number
- JP7120308B2 JP7120308B2 JP2020528664A JP2020528664A JP7120308B2 JP 7120308 B2 JP7120308 B2 JP 7120308B2 JP 2020528664 A JP2020528664 A JP 2020528664A JP 2020528664 A JP2020528664 A JP 2020528664A JP 7120308 B2 JP7120308 B2 JP 7120308B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- precision
- arithmetic
- accuracy
- processing means
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Complex Calculations (AREA)
- Advance Control (AREA)
- Design And Manufacture Of Integrated Circuits (AREA)
Description
本発明は、2種類の演算精度による演算を含むデータ処理を行うデータ処理装置、データ処理回路およびデータ処理方法に関する。 The present invention relates to a data processing device, a data processing circuit, and a data processing method that perform data processing including calculations with two types of calculation accuracy.
機械学習の普及が進み、時々刻々と変化する状況に対応するための更なる工夫が求められている。 With the spread of machine learning, further ingenuity is required to cope with ever-changing situations.
そのためには、実際に使用される環境で取得される多様な生データを学習用データとして学習に取り入れる必要がある。学習用データを用いた学習(機械学習)では、例えば、学習用データで示される入力と出力の関係等に基づいて、所定の学習器で使用される演算式や判別式のパラメタが調整される。学習器は、例えば、データが入力されると、1つまたは複数のラベルについての判別を行う判別モデル等である。 For that reason, it is necessary to incorporate various raw data obtained in the actual environment as learning data into learning. In learning (machine learning) using learning data, for example, parameters of arithmetic expressions and discriminants used in predetermined learning devices are adjusted based on the relationship between input and output indicated by learning data. . A learner is, for example, a discriminant model or the like that discriminates about one or more labels when data is input.
機械学習における演算資源と演算精度の関係について、例えば、非特許文献1には、ニューラルネットワークの深層学習を効率的に、特に低い消費電力で実行するための学習用演算回路および学習方法の例が記載されている。
Regarding the relationship between computational resources and computational accuracy in machine learning, for example, Non-Patent
また、非特許文献2には、CNN(Convolutional Neural Network)における深層学習において、複数ある畳込み層を、重みが固定される層と重みが更新される層(拡張機能層)に分けて学習範囲を制限することで、学習時間の短縮を図る学習方法の例が記載されている。
In addition, in
また、機械学習における学習演算用の回路構成の例として、非特許文献3には、FPGA(Field-Programmable Gate Array)をベースとしたアクセラレータ設計の最適化例が記載されている。
As an example of circuit configuration for learning calculation in machine learning, Non-Patent
学習用データを用いた機械学習の多くは、汎用用途の学習アルゴリズムに対応すべく、大規模な高精度演算回路を構築可能なクラウド環境で行われていた。 Most of the machine learning using training data is performed in a cloud environment where large-scale high-precision arithmetic circuits can be constructed in order to support general-purpose learning algorithms.
しかし、現場によっては、ネットワーク帯域の制限やプライバシの保護等、種々のデータ移動の制約があるため、クラウド環境ではなく、現場にあるデバイス内(以下、エッジ・デバイス層という)で学習できる仕組みが望まれる。そのためには、より少ないコンピュータ資源ひいては低消費電力で、十分な認識率を得られる学習方法が望まれる。 However, depending on the site, there are various restrictions on data movement, such as network bandwidth restrictions and privacy protection. desired. For that purpose, a learning method that can obtain a sufficient recognition rate with less computer resources and lower power consumption is desired.
非特許文献1に記載の学習方法によれば、32bit浮動小数点の演算回路を用いて学習を行うNVIDIA社のTK1(Jetson Kit)と比較して、16bit固定小数点の演算回路を用いることで、より低い消費電力で学習を実現できるとされている。しかし、当該方法は、すべての学習演算(パラメータの調整を行うための全ての演算)を行う演算回路におけるビット幅を削減することにより、演算精度の低下と引き換えに消費電力を低減しようというものにすぎず、演算回路そのものの演算精度が低下することによる弊害については何ら考慮されていない。例えば、学習演算を実施するのに十分な演算精度が確保されないおそれ等については何ら考慮されていない。
According to the learning method described in
例えば、深層学習を行う演算回路では、複数のユニットが層状に結合された構成を利用した多層演算が行われるが、この時の多層演算は、層ごとにユニットの出力を計算する部分(いわゆる推論処理。例えば、順伝搬処理)と、該計算に用いるパラメタ(例えば、重み等)を更新するための計算をする部分(いわゆるパラメタ更新処理。例えば、逆伝搬処理)とに大別される。このうちの特にパラメタ更新処理が、機械学習における実際の学習演算部分に相当するといえる。したがって、パラメタ更新処理の演算精度は、運用時の認識率に大きく影響を与える演算であり、高精度であればあるほど好ましい。一方で、推論処理の演算精度は、それほど高くなくてもよい場合が多い。 For example, in an arithmetic circuit that performs deep learning, multi-layered calculations are performed using a structure in which multiple units are connected in layers. Processing (for example, forward propagation processing) and calculation for updating parameters (for example, weights) used in the calculation (so-called parameter update processing (for example, back propagation processing)). It can be said that parameter update processing, in particular, among these processes corresponds to the actual learning calculation part in machine learning. Therefore, the calculation accuracy of the parameter updating process greatly affects the recognition rate during operation, and the higher the accuracy, the better. On the other hand, it is often the case that the calculation accuracy of inference processing does not need to be so high.
したがって、学習処理に含まれる演算のうち、例えば高い精度を必要とする演算のみを高精度演算を行い、高い精度を必要としない演算は低い精度で演算すれば、消費電力を低減しつつ十分な精度での学習が可能になる。そこで、高い精度を必要とする演算と高い精度を必要としない演算が混在している処理を行う装置が2種類の演算精度の演算回路を有し、当該処理において行われる各演算の実施先とする回路を、該演算が必要とする精度に応じて切り替えながら実行することを考える。その場合、該装置では、演算精度が異なるコア(演算回路)間のデータ交換が必須要件となる。このような、演算精度が異なるコア間のデータ交換を含む学習処理のさらなる効率化を図るには、コア間のデータ交換の高速化が重要となる。 Therefore, among the calculations included in the learning process, for example, if only calculations that require high accuracy are performed with high accuracy, and calculations that do not require high accuracy are performed with low accuracy, sufficient power consumption can be achieved while reducing power consumption. Accurate learning becomes possible. Therefore, a device that performs processing that requires a mixture of computations that require high accuracy and computation that does not require high accuracy has arithmetic circuits with two types of computational accuracies. Consider executing the circuit while switching according to the accuracy required for the operation. In that case, data exchange between cores (arithmetic circuits) with different arithmetic accuracies is an essential requirement in the device. In order to further improve the efficiency of learning processing including data exchange between cores with different calculation accuracies, it is important to increase the speed of data exchange between cores.
なお、非特許文献2に記載の学習方法は、学習範囲を制限することで学習時間の短縮をしようとするものにすぎず、演算精度が異なるコア間のデータ交換を含む学習処理の効率化、特に異なる精度を有するコア間のデータ交換の効率化については何ら考慮されていない。また、非特許文献3に記載の方法は、すべての学習演算を行う回路の回路構成の最適化により回路規模や計算時間の縮小を行おうというものにすぎず、やはり演算精度が異なるコア間のデータ交換を含む学習処理の効率化、特に異なる精度を有するコア間のデータ交換の効率化については何ら考慮されていない。
It should be noted that the learning method described in Non-Patent
本発明は、上述した課題に鑑みて、高い精度を必要とする演算と高い精度を必要としない演算が混在する処理のさらなる効率化が可能なデータ処理装置、データ処理回路およびデータ処理方法を提供することを目的とする。 SUMMARY OF THE INVENTION In view of the above problems, the present invention provides a data processing device, a data processing circuit, and a data processing method capable of further improving the efficiency of processing in which operations that require high accuracy and operations that do not require high accuracy are mixed. intended to
本発明によるデータ処理装置は、第1の精度で所定の演算を行う低精度演算処理手段と、第1の精度よりも高い第2の精度で所定の演算を行う高精度演算処理手段と、高精度演算処理手段と低精度演算処理手段との間でデータの受け渡しを行うための通信路の高精度演算処理手段側の端点に設けられる第1のデータ変換手段とを備え、第1のデータ変換手段は、接続先の高精度演算処理手段との間で受け渡されるデータが高精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量以下となり、かつ通信路を通るデータの精度が第1の精度以下となるように、通信路と高精度演算処理手段との間を通るデータに対して所定の変換を行い、通信路の低精度演算処理手段側の端点に設けられる第2のデータ変換手段をさらに備え、第1のデータ変換手段および第2のデータ変換手段は、接続先の演算処理手段との間で受け渡されるデータが接続先の演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量よりも少なく、かつ通信路を通るデータの精度が第1の精度よりも低くなるように、通信路と接続先の演算処理手段との間を通るデータに対して所定の変換を行うことを特徴とする。 A data processing apparatus according to the present invention comprises low-accuracy arithmetic processing means for performing predetermined arithmetic operations with a first precision, high-precision arithmetic processing means for performing predetermined arithmetic operations with a second precision higher than the first precision, and high-precision arithmetic processing means. a first data conversion means provided at an end point on the side of the high-precision arithmetic processing means of a communication path for exchanging data between the precision arithmetic processing means and the low-precision arithmetic processing means; The means is that the data transferred between the high-precision arithmetic processing means of the connection destination is data that can be handled by the high-precision arithmetic processing means, and the amount of data passing through the communication path is data of the first precision. and the accuracy of the data passing through the communication channel is equal to or less than the first accuracy, performing a predetermined conversion on the data passing between the communication channel and the high-precision arithmetic processing means, and communicating a second data conversion means provided at an end point of the low-precision arithmetic processing means side of the path; The data to be transmitted is data that can be handled by the arithmetic processing means of the connection destination, the amount of data passing through the communication channel is smaller than the amount of data when data of the first accuracy is used, and the accuracy of the data passing through the communication channel is It is characterized by performing a predetermined conversion on data passing between the communication path and the arithmetic processing means of the connection destination so as to be lower than the first accuracy .
本発明によるデータ処理回路は、第1の精度で所定の演算を行う低精度演算回路と、第1の精度よりも高い第2の精度で所定の演算を行う高精度演算回路と、高精度演算回路と低精度演算回路との間でデータの受け渡しを行うための通信路の高精度演算回路側の端点に設けられ、通信路と高精度演算回路との間を通るデータに対して、予め定められた変換を行う第1のデータ変換回路とを備え、第1のデータ変換回路と接続先の高精度演算回路との間で受け渡されるデータが高精度演算回路が扱うデータであり、通信路の低精度演算回路側の端点に設けられ、通信路と低精度演算回路との間を通るデータに対して、予め定められた変換を行う第2のデータ変換回路をさらに備え、第2のデータ変換回路と接続先の低精度演算回路との間で受け渡されるデータが低精度演算回路が扱うデータであり、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量より少なく、かつ当該通信路を通るデータの精度が第1の精度よりも低いことを特徴とする。 A data processing circuit according to the present invention comprises a low-precision arithmetic circuit that performs predetermined arithmetic with a first precision, a high-precision arithmetic circuit that performs predetermined arithmetic with a second precision higher than the first precision, and a high-precision arithmetic circuit. It is provided at the end point of the high-precision arithmetic circuit side of the communication path for exchanging data between the circuit and the low-precision arithmetic circuit, and is predetermined for the data passing between the communication path and the high-precision arithmetic circuit. and a first data conversion circuit for performing the conversion, data transferred between the first data conversion circuit and the high-precision arithmetic circuit to which the high-precision arithmetic circuit is connected is data handled by the high-precision arithmetic circuit, and the communication path further comprising a second data conversion circuit provided at an end point on the low-precision arithmetic circuit side of the second data conversion circuit for performing predetermined conversion on data passing between the communication path and the low-precision arithmetic circuit; The data transferred between the conversion circuit and the connected low-precision arithmetic circuit is the data handled by the low-precision arithmetic circuit, and the amount of data passing through the communication channel is the amount of data when the first precision data is used. and the accuracy of data passing through the communication path is lower than the first accuracy .
本発明によるデータ処理方法は、第1の精度で所定の演算を行う低精度演算処理手段と、第1の精度よりも高い第2の精度で所定の演算を行う高精度演算処理手段との間でデータの受け渡しを行うための通信路の高精度演算処理手段側の端点に設けられる第1のデータ変換手段が、接続先の高精度演算処理手段との間で受け渡されるデータが高精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量以下となり、かつ通信路を通るデータの精度が第1の精度以下となるように、通信路と高精度演算処理手段との間を通るデータに対して所定の変換を行い、第1のデータ変換手段が、接続先の高精度演算処理手段との間で受け渡されるデータが高精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量より少なく、かつ通信路を通るデータの精度が第1の精度より低くなるように、通信路と高精度演算処理手段との間を通るデータに対して所定の変換を行い、通信路の低精度演算処理手段側の端点に設けられる第2のデータ変換手段が、接続先の低精度演算処理手段との間で受け渡されるデータが低精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量より少なく、かつ通信路を通るデータの精度が第1の精度より低くなるように、通信路と低精度演算処理手段との間を通るデータに対して所定の変換を行うことを特徴とする。 In the data processing method according to the present invention, a low-precision arithmetic processing means for performing a predetermined arithmetic operation with a first accuracy and a high-precision arithmetic processing means for performing a predetermined arithmetic operation with a second accuracy higher than the first accuracy are provided. The first data conversion means provided at the end point of the high-precision arithmetic processing means side of the communication path for exchanging data with the high-precision arithmetic processing means of the connection destination performs high-precision arithmetic operation on the data transferred between It is data that can be handled by the processing means, and the amount of data passing through the communication channel is equal to or less than the amount of data when data with the first accuracy is used, and the accuracy of the data passing through the communication channel is equal to or less than the first accuracy. Then, the data passing between the communication channel and the high-precision arithmetic processing means is subjected to a predetermined conversion, and the first data conversion means transfers the data to and from the high-precision arithmetic processing means of the connection destination. is data that can be handled by the high-precision arithmetic processing means, the amount of data passing through the communication channel is less than the amount of data when using data of the first precision, and the accuracy of the data passing through the communication channel is the first precision Data passing between the communication path and the high-precision arithmetic processing means is subjected to a predetermined conversion so that the data passing between the communication path and the high-precision arithmetic processing means is further reduced, and the second data conversion means provided at the end point of the communication path on the side of the low-precision arithmetic processing means is , the data transferred between the low-precision arithmetic processing means of the connection destination is data that can be handled by the low-precision arithmetic processing means, and the amount of data passing through the communication path is data in the case of using data of the first precision A predetermined conversion is performed on data passing between the communication channel and the low-precision arithmetic processing means so that the accuracy of the data passing through the communication channel is less than the amount and the accuracy of the data passing through the communication channel is lower than the first accuracy. .
本発明によれば、高い精度を必要とする演算と高い精度を必要としない演算が混在する処理をさらに効率化できる。 According to the present invention, it is possible to further improve the efficiency of processing in which operations that require high accuracy and operations that do not require high accuracy are mixed.
以下、本発明の実施形態について図面を参照して説明する。以下では、高い精度を必要とする演算と高い精度を必要としない演算が混在する処理の例に深層学習における学習処理を用いて本発明を説明するが、本発明が適用される処理、装置およびデータ処理方法は学習処理、学習装置および学習方法に限定されない。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described with reference to the drawings. Hereinafter, the present invention will be described using learning processing in deep learning as an example of processing in which calculations that require high accuracy and calculations that do not require high accuracy are mixed. The data processing method is not limited to the learning process, learning device and learning method.
まず、本発明のデータ処理の例としての学習処理の概略を説明する。図1(a)は、入力層と出力層との間に1つ以上の中間層を含むニューラルネットワークにおける一般的な学習方法およびそのための回路構成の例を示す説明図であり、図1(b)は、本発明のデータ処理方法の例としての学習方法およびそのための回路構成の例を示す説明図である。 First, an outline of learning processing as an example of data processing of the present invention will be described. FIG. 1(a) is an explanatory diagram showing a general learning method in a neural network including one or more intermediate layers between an input layer and an output layer and an example of a circuit configuration therefor; ) is an explanatory diagram showing an example of a learning method and a circuit configuration therefor as an example of the data processing method of the present invention.
図1(a)に示す例では、汎用用途の学習アルゴリズムに対応すべく、大規模学習回路90を用いて、所定の判別モデルであるニューラルネットワーク全体を学習する。
In the example shown in FIG. 1(a), a large-
なお、図1では、回路に付した吹き出しに、ニューラルネットワークの学習過程における処理の方向およびその範囲を模式的に示している。吹き出し内において、符号51(図中の丸)はニューラルネットワークにおけるニューロンに相当するユニットを表す。また、符号52(図中のユニット間を結ぶ線)は、ユニット間結合を表す。また、符号53(図中の右向きの太線矢印)は、推論処理およびその範囲を表す。また、符号54(図中の左向きの太線矢印)は、パラメタ更新処理およびその範囲を表す。なお、図1では、各ユニットへの入力が前段の層のユニットの出力となるフィードフォワード型のニューラルネットワークの例を示しているが、各ユニットへの入力はこれに限らない。例えば、時系列情報を保持している場合には、リカレント型のニューラルネットワークのように、各ユニットへの入力に、前の時刻における前段の層のユニットの出力を含めることも可能である。なお、そのような場合も、推論処理の方向は、入力層から出力層へと向かう方向(順方向)であるとみなされる。このように入力層から所定の順番で行われる推論処理は「順伝搬」とも呼ばれる。一方、パラメタ更新処理の方向は、特に限定されない。図中のパラメタ更新処理のように、出力層から入力層へと向かう方向(逆方向)であってもよい。なお、図中のパラメタ更新処理の方向は、誤差逆伝搬法の例であるが、パラメタ更新処理は誤差逆伝搬法に限定されない。例えば、パラメタ更新処理がSTDP(Spike Timing Dependent Plasticity)等であってもよい。 In FIG. 1, the balloon attached to the circuit schematically shows the direction and range of processing in the learning process of the neural network. In the balloon, reference numerals 51 (circles in the figure) represent units corresponding to neurons in the neural network. Reference numeral 52 (a line connecting units in the drawing) represents a connection between units. Reference numeral 53 (rightward thick arrow in the figure) represents the inference process and its range. Reference numeral 54 (thick leftward arrow in the figure) represents parameter update processing and its range. Note that FIG. 1 shows an example of a feedforward neural network in which the input to each unit is the output of the unit in the preceding layer, but the input to each unit is not limited to this. For example, when time-series information is held, the input to each unit can include the output of the previous layer unit at the previous time, like a recurrent neural network. Even in such a case, the direction of inference processing is considered to be the direction (forward direction) from the input layer to the output layer. Such inference processing performed in a predetermined order from the input layer is also called “forward propagation”. On the other hand, the direction of parameter update processing is not particularly limited. It may be in the direction (reverse direction) from the output layer to the input layer as in the parameter update processing in the figure. The direction of the parameter updating process in the figure is an example of the error backpropagation method, but the parameter updating process is not limited to the error backpropagation method. For example, the parameter update process may be STDP (Spike Timing Dependent Plasticity) or the like.
ニューラルネットワークに限らず、深層学習におけるモデルの学習方法の例としては、次のような学習方法が挙げられる。まず、入力層に学習用データを入力した後、出力層までの各層で順方向に各ユニットの出力を計算する推論処理を行う(順伝搬:図中の矢印53参照)。次いで、出力層からの出力(最終出力)と学習用データで示される入力と出力の関係等とから算出される誤差に基づいて、その誤差を最小化するように、出力層から第1層までの各層を逆方向に辿って、層内の各ユニットの出力を計算するためのパラメタを更新するパラメタ更新処理を行う(逆伝搬:図中の矢印54参照)。
Examples of model learning methods in deep learning, not limited to neural networks, include the following learning methods. First, after inputting learning data to the input layer, inference processing is performed to calculate the output of each unit in the forward direction in each layer up to the output layer (forward propagation: see
図1(a)に示すように、モデル全体を学習対象とした場合、パラメタ更新処理で、入力層より後段の全ての層(第1層~第n層)において層内の各ユニットの出力を計算するためのパラメタ(例えば、層内の各ユニットと他の層のユニットを結合するユニット結合の重み等)を更新する。このようなパラメタ更新処理を、例えば学習用データを替えながら複数回繰り返すことにより、高い認識率を有する学習済みモデルを生成できる。図1(a)では、そのような学習を行う演算回路の実現例として、上記の推論処理とパラメタ更新処理とを高い演算精度で行う大規模学習回路90が示されている。しかし、推論処理やパラメタ更新処理の演算精度が高いほど、またその処理の計算範囲が広いほど、誤差関数の展開項数が増えて回路が大規模化するため、消費電力が非常に増大する。
As shown in Fig. 1(a), when the entire model is targeted for learning, in the parameter update process, the output of each unit in each layer in all layers (1st to nth layers) after the input layer is Update the parameters for the calculation (eg, the weight of the unit connection that connects each unit in a layer with units in other layers). By repeating such parameter update processing a plurality of times while changing the learning data, for example, a trained model having a high recognition rate can be generated. FIG. 1A shows a large-
一方、本発明では、図1(b)に示すように、モデルの一部のみを学習対象とする。なお、ここでいう学習は、上記と同様、より実際の学習処理である、パラメタ更新処理を指す。モデルの一部のみを学習対象とした場合、順伝搬までは上記と同様に行う。その上で、出力層からの出力(最終出力)と学習用データで示される入力と出力の関係等とから算出される誤差に基づいて、指定されたユニット(例えば、出力層である第n層から第k層までの各層内のユニット)についてのみ、当該ユニットの出力を計算するためのパラメタ(例えば、他ユニットとの結合にかかる重み等)を更新するパラメタ更新処理を行う。 On the other hand, in the present invention, as shown in FIG. 1B, only part of the model is subject to learning. Note that learning here refers to parameter update processing, which is more actual learning processing, as in the above case. If only part of the model is to be learned, forward propagation is performed in the same manner as above. Then, based on the error calculated from the output (final output) from the output layer and the relationship between the input and output indicated by the learning data, a specified unit (for example, the nth layer which is the output layer to the k-th layer), a parameter updating process is performed to update the parameters for calculating the output of the unit (for example, the weight for coupling with other units, etc.).
図1(b)では、そのような学習を行う演算回路10の実現例として、高い演算精度で指定された一部のユニットのパラメタ更新処理を行う高精度演算回路12と、高精度演算回路12よりも低い演算精度で少なくとも指定されたユニットの推論処理を行う低精度演算回路11とを組み合わせた例が示されている。このような2つの異なる演算精度を有する演算回路を備えた上で、高精度演算回路12に対しては、例えば、高精度演算が必要な一部のユニットについてパラメタ更新処理を行わせ、低精度演算回路11に対しては、高精度演算が必要でない他の処理を行わせる。このようにして1つの学習用データに対する学習演算の中で、推論処理の少なくとも一部を低い演算精度で実施し、かつパラメタ更新処理の少なくとも一部を高い演算精度で実施するとともに、高い演算精度で実施するパラメタ更新処理の範囲を最適化することで、コンピュータ資源を効率化(低消費電力等)しつつ、十分な演算精度を確保する。
In FIG. 1B, as an implementation example of the
なお、図1(b)では出力側の一部の層をパラメタの更新を行う範囲(実際の学習範囲)とする例を示したが、パラメタの更新範囲は出力側の層に限られず、例えば、第1層~第n層のうちの奇数層や偶数層などといった個別的な指定も可能である。また、図1(b)では、パラメタ更新処理自体の範囲を制限する例を示したが、パラメタ更新処理自体の範囲は制限せず、高演算精度で実施するパラメタ更新処理の範囲を制限してもよい。すなわち、全てのユニットのうちの一部のユニットについてのみ高演算精度でパラメタ更新処理を行い、それ以外のユニットについては低い演算精度でパラメタ更新処理を行うことも可能である。なお、パラメタ更新処理の対象として、高精度演算により実施されるユニットと、低精度演算により実施されるユニットと、実施されないユニット(その際、パラメタは固定される)の3種類に分けることも可能である。 Although FIG. 1(b) shows an example in which some layers on the output side are used as the range for updating parameters (actual learning range), the range for updating parameters is not limited to the layers on the output side. , odd-numbered layers and even-numbered layers among the first to n-th layers can also be specified individually. Also, FIG. 1B shows an example in which the range of the parameter update process itself is limited, but the range of the parameter update process itself is not limited, and the range of the parameter update process performed with high calculation accuracy is limited. good too. In other words, it is possible to perform parameter update processing with high calculation accuracy only for some units among all units, and to perform parameter update processing with low calculation accuracy for other units. It is also possible to divide the target of parameter update processing into three types: units that are executed by high-precision calculations, units that are executed by low-precision calculations, and units that are not executed (in which case the parameters are fixed). is.
また、高精度演算と低精度演算の対象とする処理の分け方の他の例としては、全てのユニットの推論処理を低精度演算で行い、かつ全てのユニットのパラメタ更新処理を高精度演算で行うことも可能である。また、例えば、全てのユニットの推論処理を低精度演算で行い、かつ一部のユニットのパラメタ更新処理を高精度演算で行うことも可能である。その場合、高精度演算の対象外とされた残りの一部のユニットについては、低精度演算でパラメタ更新処理を行ってもよいし、パラメタ更新処理の対象外としてもよい。また、例えば、一部のユニットについては推論処理およびパラメタ更新処理を低精度演算で行い、残りの一部のユニットについては推論処理およびパラメタ更新処理を高精度演算で行うことも可能である。 Another example of how to divide the processing targeted for high-precision calculations and low-precision calculations is to perform inference processing for all units using low-precision calculations, and perform parameter update processing for all units using high-precision calculations. It is also possible to Further, for example, it is possible to perform the inference processing of all units by low-precision calculations and perform the parameter update processing of some units by high-precision calculations. In this case, the remaining units excluded from high-precision calculation may be subjected to parameter update processing using low-precision calculation, or may be excluded from parameter update processing. Also, for example, it is possible to perform inference processing and parameter update processing with low-precision calculations for some units, and perform inference processing and parameter update processing with high-precision calculations for some remaining units.
換言すると、本発明のデータ処理方法の例としての学習方法は、学習装置が、相対的に低い演算精度を有する低精度演算回路と、相対的に高い演算精度を有する高精度演算回路とを備え、低精度演算回路に少なくとも一部のユニットの推論処理を行わせ、かつ高精度演算回路に少なくとも一部のユニットのパラメタ更新処理を行わせるものであればよい。その上で、残りの一部のユニットの推論処理については低精度演算回路で行ってもよいし、高精度演算回路で行ってもよい。また、上記の残りの一部のユニットのパラメタ更新処理については低精度演算回路で行ってもよいし、処理そのものを省略してもよい。どのユニットについて高精度の推論処理の対象とするか低精度の推論処理の対象とするかや、どのユニットについて高精度のパラメタ更新処理の対象とするか低精度のパラメタ更新処理の対象とするかもしくは処理対象外とするか等については、特に限定されない。 In other words, in the learning method as an example of the data processing method of the present invention, the learning device includes a low-accuracy arithmetic circuit having relatively low arithmetic accuracy and a high-accuracy arithmetic circuit having relatively high arithmetic accuracy. , the low-precision arithmetic circuit is caused to perform the inference processing of at least some of the units, and the high-precision arithmetic circuit is made to perform the parameter update processing of at least some of the units. After that, the inference processing of the remaining part of the units may be performed by the low-precision arithmetic circuit or by the high-precision arithmetic circuit. Further, the parameter update processing of the remaining part of the units may be performed by a low-precision arithmetic circuit, or the processing itself may be omitted. Which units are targeted for high-precision inference processing or low-precision inference processing, and which units are targeted for high-precision parameter update processing or low-precision parameter update processing There is no particular limitation as to whether or not to be processed.
なお、上記は、異なる演算精度を有する2つの演算回路を利用する場合の例であるが、例えば、異なる演算精度を有する2以上の演算回路を利用する場合も基本的に同様である。すなわち、ある一部のユニットの推論処理を行う演算回路の演算精度に対して、より高い演算精度を有する演算回路にてある一部のユニットのパラメタ更新処理が行われる構成であれば、他の一部のユニットの推論処理およびパラメタ更新処理が具体的にどの演算回路で行われるかまたは処理自体が行われないかは特に限定されない。 The above is an example of using two arithmetic circuits with different arithmetic accuracies, but basically the same applies to the case of using two or more arithmetic circuits with different arithmetic accuracies, for example. That is, if the configuration is such that the parameter update processing of some units is performed in an arithmetic circuit having a higher arithmetic accuracy than the arithmetic circuit that performs the inference processing of some units, other There is no particular limitation as to which arithmetic circuit specifically performs the inference processing and parameter update processing of some units or whether the processing itself is not performed.
図2は、1つのユニットに着目したときの当該ユニットの入出力および他ユニットとの結合の例を示す説明図である。図2(a)に1つのユニットの入出力の例、(b)に2層に並べられたユニット間の結合の例を示す。図2(a)に示すように、1つのユニットに対して4つの入力(x1~x4)と1つの出力(z)があった場合に、当該ユニットの動作は例えば、式(1A)のように表される。ここで、f()は活性化関数を表している。FIG. 2 is an explanatory diagram showing an example of input/output of a unit and connection with other units when focusing attention on one unit. FIG. 2A shows an example of input/output of one unit, and FIG. 2B shows an example of connection between units arranged in two layers. As shown in FIG. 2(a), when there are four inputs (x 1 to x 4 ) and one output (z) for one unit, the operation of the unit is expressed by equation (1A). is represented as where f() represents the activation function.
z=f(u) ・・・(1A)
ただし、u=a+w1x1+w2x2+w3x3+w4x4 ・・・(1B)z=f(u) (1A)
However, u= a +w1x1 + w2x2 + w3x3 + w4x4 ( 1B )
式(1B)において、aは切片、w1~w4は各入力(x1~x4)に対応した重み等のパラメタを表す。In equation (1B), a is an intercept, and w 1 to w 4 are parameters such as weights corresponding to each input (x 1 to x 4 ).
一方、図2(b)に示すように、2層に並べられた層間で各ユニットが結合されている場合、後段の層に着目すると、当該層内の各ユニットへの入力(それぞれx1~x4)に対する当該各ユニットの出力(z1~z4)は、例えば、次のように表される。なお、iは同一層内のユニットの識別子(本例ではi=1~3)である。On the other hand, as shown in FIG. 2(b), when each unit is connected between layers arranged in two layers, focusing on the latter layer, the input to each unit in the layer (each x 1 to x 4 ) of each unit (z 1 to z 4 ) are expressed as follows, for example. Note that i is an identifier of a unit in the same layer (i=1 to 3 in this example).
zi=f(ui) ・・・(2A)
ただし、ui=a+wi,1x1+wi,2x2+wi,3x3+wi,4x4 ・・・(2B)z i =f(u i ) (2A)
However, u i =a+wi ,1 x 1 +wi ,2 x 2 +wi ,3 x 3 +wi ,4 x 4 (2B)
以下では、式(2B)を単純化して、zi=Σwi,k*xkと記す場合がある。なお、切片aは省略した。なお、切片aを値1の定数項の係数(パラメタの1つ)とみなすことも可能である。ここで、kは当該層における各ユニットへの入力、より具体的にはその入力を行う他のユニットの識別子を表す。このとき、当該層における各ユニットへの入力が前段の層の各ユニットの出力のみである場合には、上述の簡略式を、ui (L)=Σwi,k (L)*zk (L-1)と記すことも可能である。なお、Lは層の識別子を表す。これらの式において、wi,kが、当該層(第L層)における各ユニットiのパラメタ、より具体的には、各ユニットiと他のユニットkとの結合(ユニット間結合)の重みに相当する。以下では、ユニットを特に区別せず、ユニットの出力値を決める関数(活性化関数)を簡略化して、z=Σw*xと記す場合がある。Equation (2B) may be simplified below as z i =Σw i,k *x k . In addition, the intercept a is omitted. It is also possible to regard the intercept a as a constant term coefficient (one of the parameters) with a value of 1. Here, k represents the input to each unit in the layer, more specifically, the identifier of another unit that performs the input. At this time, when the input to each unit in the layer is only the output of each unit in the previous layer, the above simplified expression is u i (L) =Σw i,k (L) * z k ( L-1) can also be written. Note that L represents a layer identifier. In these expressions, wi ,k is the parameter of each unit i in the layer (L-th layer), more specifically, the weight of the connection (inter-unit connection) between each unit i and another unit k. Equivalent to. In the following description, a function (activation function) that determines the output value of a unit may be simply expressed as z=Σw*x without distinguishing between units.
上記の例において、あるユニットについて入力xから出力zを求める計算が、当該ユニットにおける推論処理に相当する。このとき、パラメタwは固定される。一方、あるユニットについてパラメタwを求める計算が当該ユニットにおけるパラメタ更新処理に相当する。 In the above example, the calculation for obtaining the output z from the input x for a certain unit corresponds to the inference processing in that unit. At this time, the parameter w is fixed. On the other hand, the calculation for obtaining the parameter w for a certain unit corresponds to parameter update processing for that unit.
実施形態1.
図3は、第1の実施形態の学習装置の構成例を示すブロック図である。図3に示す学習装置100は、学習前モデル記憶部101と、学習用データ記憶部102と、学習処理部106と、学習後モデル記憶部107とを備える。
FIG. 3 is a block diagram showing a configuration example of the learning device of the first embodiment. The
学習前モデル記憶部101は、学習前のモデルの情報を記憶する。学習前のモデルの情報には、パラメタの初期値が含まれていてもよい。
The pre-learning
学習用データ記憶部102は、モデルの学習に用いるデータである学習用データを記憶する。なお、学習用データの形式は特に問わない。
The learning
学習処理部106は、学習用データ記憶部102に記憶された学習用データを用いて、学習前モデル記憶部101に記憶されているモデルの学習を行う。
The
本実施形態の学習処理部106は、少なくとも高効率推論処理部103aと高精度パラメタ更新処理部104bと制御部105とを含む。なお、学習処理部106は、図3に示すように、さらに高精度推論処理部103bと高効率パラメタ更新処理部104aを含んでいてもよい。
The
高効率推論処理部103aは、指定された層またはユニットを対象とする推論処理を、第1の演算精度で行う。
The high-efficiency
高精度パラメタ更新処理部104bは、指定された層、ユニットまたはパラメタを対象とするパラメタ更新処理を、第1の演算精度よりも高い演算精度の第2の演算精度で行う。
The high-precision parameter
制御部105は、学習処理を実施する各処理部(本例では、高効率推論処理部103a、高精度推論処理部103b、高効率パラメタ更新処理部104aおよび高精度パラメタ更新処理部104b)を制御して、必要な学習処理を実施させる。制御部105は、より具体的には、学習前のモデルおよび学習用データの読み込み、学習処理を実施する各処理部へ演算の指示を行うことによる学習処理にかかる演算精度の切替制御を行う。演算の指示には、演算対象とするユニットの指定や演算に必要なパラメータの入力が含まれる。
The control unit 105 controls each processing unit (in this example, the high efficiency
学習後モデル記憶部107は、学習後のモデルの情報を記憶する。学習後のモデルの情報には、各ユニットの更新後のパラメタの値が含まれていてもよい。
The learned
また、図4は、学習処理部106のハードウエア構成の例を示す構成図である。図4に示すように、学習処理部106は、低精度演算回路11と、高精度演算回路12と、メモリ13と、制御装置14とがそれぞれバス15を介して接続された演算処理装置等により実現されてもよい。なお、高精度演算回路12は、低精度演算回路11よりも高い演算精度で演算が可能な回路であればよい。
4 is a configuration diagram showing an example of the hardware configuration of the
その場合において、高効率推論処理部103aおよび高効率パラメタ更新処理部104aは、例えば、低精度演算回路11により実現されてもよい。また、高精度推論処理部103bおよび高精度パラメタ更新処理部104bは、例えば、高精度演算回路12により実現されてもよい。また、制御部105は、例えば、制御装置14により実現されてもよい。
In that case, the highly
本例において、低精度演算回路11と高精度演算回路12はそれぞれバス15を介して接続されており、バス15を介してお互いの演算結果を通知するなどのデータのやり取りを行うことができる。なお、バス15にはさらにメモリ13が接続されていてもよく、その場合、低精度演算回路11と高精度演算回路12がそれぞれメモリ13を介してデータのやりとりを行うことも可能である。その場合、メモリ13は通信路の一部として扱われる。なお、メモリ13は、On-chip memoryとして、低精度演算回路11および高精度演算回路12と同一のチップ上に実装されてもよい。すなわち、低精度演算回路11、高精度演算回路12およびメモリ13が、チップ内で内部接続されていてもよい。また、メモリ13は、Off-chip memoryとして、低精度演算回路11や高精度演算回路12と同一のチップ上に実装されなくてもよい。すなわち、外部メモリインタフェースを介して外部接続されていてもよい。
In this example, the low-
本実施形態では、学習処理(特に、推論処理およびパラメタ更新処理)を実施する処理部が実際に演算に用いる数字データの値域の広さ・細かさの尺度(より具体的には、その処理部を実現する演算回路におけるビット幅および小数点の取り扱い等で定まる数字データの値域の広さおよび細かさの尺度)を、「精度」または「演算精度」と呼ぶ。低精度演算回路11における演算精度である低演算精度と高精度演算回路12における演算精度である高演算精度の組み合わせの例としては、例えば、図5に示すような組み合わせが挙げられる。図5は、低精度演算回路11における演算精度である低演算精度と高精度演算回路12における演算精度である高演算精度の組み合わせの例を示す説明図である。
In the present embodiment, the scale of the range and fineness of numeric data actually used in calculations by the processing unit that performs learning processing (especially inference processing and parameter update processing) (more specifically, the processing unit A measure of the breadth and fineness of the range of numerical data determined by the bit width and the handling of decimal points in an arithmetic circuit that implements is called "precision" or "calculation accuracy". Examples of combinations of low arithmetic accuracy, which is the arithmetic accuracy in the low-
なお、低精度演算回路11における演算精度と高精度演算回路12における演算精度の組み合わせは、図5に示すものに限定されない。例えば、低精度演算回路11における演算精度(低演算精度)を、固定少数点の{1,2,8,16}ビットのいずれかまたは整数の{1,2,8,16}ビットのいずれかとし、高精度演算回路12における演算精度(高演算精度)を、固定小数点の{2,8,16,32}ビット、浮動小数点の{9,16,32}ビットのいずれかまたはpower of 2の浮動小数点の{8,16,24,32}ビットのいずれかとしてもよい。ただし、高演算精度は、低演算精度に比べて、高精度(例えば、数字データの値域がより広い、数値データの値域がより細かいなど、表現可能な有効桁数がより大きい)であるものとする。
Note that the combination of the arithmetic accuracy in the low-
また、図6は、学習装置100にかかるコンピュータの構成例を示す概略ブロック図である。コンピュータ1000は、プロセッサ1008と、主記憶装置1002と、補助記憶装置1003と、インタフェース1004と、ディスプレイ装置1005と、入力デバイス1006とを備える。また、プロセッサ1008は、CPU1001や、GPU1007などの各種演算・処理装置を含んでいてもよい。
FIG. 6 is a schematic block diagram showing a configuration example of a computer related to the
学習装置100は、例えば、図6に示すようなコンピュータ1000に実装されてもよい。その場合、学習装置100(特に、制御部105)の動作は、プログラムの形式で補助記憶装置1003に記憶されていてもよい。CPU1001は、プログラムを補助記憶装置1003から読み出して主記憶装置1002に展開し、そのプログラムに従って学習装置100における所定の処理を実施する。なお、CPU1001は、プログラムに従って動作する情報処理装置の一例であり、コンピュータ1000は、CPU(Central Processing Unit)以外にも、例えば、MPU(Micro Processing Unit)やMCU(Memory Control Unit)やGPU(Graphics Processing Unit)を備えていてもよい。
The
図6では、コンピュータ1000が、CPU1001に加えて、上記の低精度演算回路11および高精度演算回路12を実装するGPU1007をさらに備える例が示されているが、低精度演算回路11および高精度演算回路12が他のプロセッサや演算装置(後述するMAC(multiplier-accumulator)や乗算器ツリーやALU(Arthmetic Logic Unit)アレイ等)により実装される場合は本例の限りではなく、当該他のプロセッサや演算装置を備えていればよい。また、低精度演算回路11および高精度演算回路12は異なるチップに実装されてもよく、具体的なチップ構成は特に限定されない。
FIG. 6 shows an example in which the
補助記憶装置1003は、一時的でない有形の媒体の一例である。一時的でない有形の媒体の他の例として、インタフェース1004を介して接続される磁気ディスク、光磁気ディスク、CD-ROM、DVD-ROM、半導体メモリ等が挙げられる。また、このプログラムが通信回線によってコンピュータ1000に配信される場合、配信を受けたコンピュータは1000がそのプログラムを主記憶装置1002に展開し、学習装置100における所定の処理を実行してもよい。
また、プログラムは、学習装置100における所定の処理の一部を実現するためのものであってもよい。さらに、プログラムは、補助記憶装置1003に既に記憶されている他のプログラムとの組み合わせで学習装置100における所定の処理を実現する差分プログラムであってもよい。
Further, the program may be for realizing a part of predetermined processing in
インタフェース1004は、他の装置との間で情報の送受信を行う。また、ディスプレイ装置1005は、ユーザに情報を提示する。また、入力デバイス1006は、ユーザからの情報の入力を受け付ける。
また、学習装置100における処理内容によっては、コンピュータ1000の一部の要素は省略可能である。例えば、コンピュータ1000がユーザに情報を提示しないのであれば、ディスプレイ装置1005は省略可能である。例えば、コンピュータ1000がユーザから情報入力を受け付けないのであれば、入力デバイス1006は省略可能である。
Also, some elements of the
また、上記の各構成要素の一部または全部は、汎用または専用の回路(Circuitry)、プロセッサ等やこれらの組み合わせによって実施される。これらは単一のチップによって構成されてもよいし、バスを介して接続される複数のチップによって構成されてもよい。また、上記の各構成要素の一部又は全部は、上述した回路等とプログラムとの組み合わせによって実現されてもよい。 Also, some or all of the above components are implemented by general-purpose or dedicated circuits (Circuitry), processors, etc., or combinations thereof. These may be composed of a single chip, or may be composed of multiple chips connected via a bus. Also, part or all of the components described above may be realized by a combination of the circuits and the like described above and a program.
上記の各構成要素の一部又は全部が複数の情報処理装置や回路等により実現される場合には、複数の情報処理装置や回路等は、集中配置されてもよいし、分散配置されてもよい。例えば、情報処理装置や回路等は、クライアントアンドサーバシステム、クラウドコンピューティングシステム等、各々が通信ネットワークを介して接続される形態として実現されてもよい。 When part or all of the above components are realized by a plurality of information processing devices, circuits, etc., the plurality of information processing devices, circuits, etc. may be centrally arranged or distributed. good. For example, the information processing device, circuits, and the like may be implemented as a client-and-server system, a cloud computing system, or the like, each of which is connected via a communication network.
[回路構成]
次に、少なくとも高効率推論処理部103aの実装例とされる推論回路の構成をいくつか例示する。高効率推論処理部103aは、例えば、指定された層の各ユニットまたは指定されたユニットについて、当該ユニットへの入力を受け付けると、当該ユニットの出力を計算する推論処理を所定の低演算精度で行い、計算結果を出力してもよい。そのとき、高効率推論処理部103aは、ユニットの出力を計算する際に用いる入力の値および他の変数(重みや切片等のパラメタ)の値を入力として受け付けて、上記の処理を行ってもよい。以下、推論処理で行われる演算を推論演算という場合がある。[Circuit configuration]
Next, some configurations of inference circuits, which are implementation examples of at least the high-efficiency
以下では、推論演算を行うための回路を「推論回路」と呼び、特に、高精度パラメタ更新処理部104bが行うパラメタ更新演算の演算精度よりも低い演算精度で推論演算を行うための回路を「高効率推論回路」と呼ぶ。このようにして、推論回路の演算精度をできるだけ低く、少なくとも高精度パラメタ更新処理部104bが行うパラメタ更新演算の演算精度よりも低くする(例えば、ビット幅を32ビットから16ビットにする、浮動小数点演算を固定少数点演算にする等)ことで、消費電力を低減する。なお、高効率推論回路と区別するために、高精度パラメタ更新処理部104bが行うパラメタ更新演算の演算精度と同じ演算精度で推論演算を行うための回路を「高精度推論回路」と呼ぶ場合がある。上述した高精度推論処理部(図示せず)は、そのような高精度推論回路により実現されてもよい。
Hereinafter, a circuit for performing an inference operation will be referred to as an "inference circuit". It is called a high-efficiency inference circuit. In this way, the calculation precision of the inference circuit is made as low as possible, at least lower than the calculation precision of the parameter update calculation performed by the high-precision parameter
以下に示す推論回路の構成は、推論演算が高精度で行われるか低精度で行われる回路かを問わず実現可能である。すなわち、高効率推論処理部103aと高精度推論処理部103bの違いが、当該処理部の動作を実装した演算回路において演算に用いる各変数、加算器、乗算器の精度のみであってもよい。
The configuration of the inference circuit shown below can be implemented regardless of whether the inference operation is performed with high accuracy or low accuracy. That is, the difference between the high-efficiency
推論回路の最も単純な例は、乗算器と加算器を組み合わせた乗加算器(MAC)221を1つ備えた構成である(図7(a)の演算回路22a参照)。なお、符号21はバスを表している。
The simplest example of an inference circuit is a configuration including one multiplier-adder (MAC) 221 combining a multiplier and an adder (see
MAC221は、乗算器と、加算器と、3つの入力を保持する記憶素子と、1つの出力を保持する記憶素子とを含んでいてもよい(図7(b)参照)。図7(b)に示すMAC221は、3つの変数a,w,xを受け付けると、1つの出力変数z=a+w*xを計算する演算回路の例である。本例において、zがユニットの出力、a、wがパラメタ(推論処理では固定)、xがユニットの入力に相当する。このような構成において、当該回路の演算精度は、当該回路が含む乗算器や加算器のビット幅および小数点の取り扱い(浮動小数点か固定小数点か等)により決定される。例えば、高効率推論処理部103aが演算回路22aにより実現される場合、当該回路が含むMAC221における各変数(a,w,x,z)、加算器および乗算器による演算が低演算精度(第1の演算精度)に対応していればよい。このとき、当該回路における各変数、加算および乗算のすべてが同じ精度である必要はない(以下、同様)。例えば、各変数、加算および乗算のいずれかで用いられる精度が、高精度パラメタ更新処理部104bを実現する演算回路の各変数、加算および乗算のいずれかで用いられる精度よりも低ければよい。
The
図8~10は、推論演算用の演算回路(推論回路)の他の例を示す概略構成図である。推論回路は、例えば、図8に示す演算回路22bのように、複数のMAC221を並列に接続した構成(いわゆるGPUの構成)であってもよい。このような構成においても、当該回路の演算精度は、当該回路が含む乗算器や加算器のビット幅および小数点の取り扱い(浮動小数点か固定小数点か等)により決定される。
8 to 10 are schematic configuration diagrams showing other examples of arithmetic circuits (inference circuits) for inference operations. The inference circuit may have a configuration in which a plurality of
また、推論回路は、例えば図9に示す演算回路22cのように、メモリ層222を介して複数の乗加算ツリー223が並列に接続された構成であってもよい。図9に示す乗加算ツリー223は、4つの乗算器と2つの加算器と1つの加算器がツリー状に接続された構成の回路である。なお、図9に示す演算回路22cの一例は、非特許文献3にも開示されている。このような構成においても、当該回路の演算精度は、当該回路が含む乗算器や加算器のビット幅および小数点の取り扱い(浮動小数点か固定小数点か等)により決定される。
Also, the inference circuit may have a configuration in which a plurality of multiplication-
また、推論回路は、例えば図10に示す演算回路22dのように、メモリ層222を介して複数のALU224がアレイ状に接続された構成(シストリックアレイ構成)であってもよい。なお、図10に示す演算回路22dの一例は、非特許文献1にも開示されている。このような構成においても、当該回路の演算精度は、当該回路が含む乗算器や加算器のビット幅および小数点の取り扱い(浮動小数点か固定小数点か等)により決定される。
Also, the inference circuit may have a configuration (systolic array configuration) in which a plurality of
なお、例えば、高効率推論処理部103aが図8~図10に示した演算回路22b、演算回路22cまたは演算回路22dにより実現される場合、当該回路において演算に用いられる各変数、加算器または乗算器による演算が低演算精度(第1の演算精度)に対応していればよい。
For example, when the high-efficiency
一方、例えば、高精度推論処理部103bが演算回路22a,演算回路22b、演算回路22cまたは演算回路22dにより実現される場合、当該回路において演算に用いられる各変数、加算器または乗算器による演算が高演算精度(第2の演算精度)に対応していればよい。
On the other hand, for example, when the high-precision
次に、少なくとも高精度パラメタ更新処理部104bの実装例とされるパラメタ更新用回路の構成をいくつか例示する。高精度パラメタ更新処理部104bは、例えば、指定された層の各ユニットにおける各パラメタ、指定されたユニットにおける各パラメタまたは指定されたパラメタについて、当該パラメタを調整パラメータとして含む誤差関数などの目的関数の最適化問題を解いて該調整パラメータを更新するパラメタ更新処理を所定の高演算精度で行い、更新後の値を出力してもよい。そのとき、高精度パラメタ更新処理部104bは、最適化問題を解く際に用いる変数の値(更新前のパラメタの値を含みうる)をパラメータとして受け付けて、上記の処理を行ってもよい。以下、パラメタ更新処理で行われる演算をパラメタ更新演算という場合がある。
Next, some configurations of parameter update circuits, which are implementation examples of at least the high-precision parameter
以下では、パラメタ更新演算を行うための回路を「パラメタ更新回路」と呼び、特に、高効率推論処理部103aが行う推論演算の演算精度よりも高い演算精度で思い学習演算を行うための回路を「高精度パラメタ更新回路」と呼ぶ。なお、高精度パラメタ更新回路と区別するために、高効率推論処理部103aが行う推論演算の演算精度と同じ演算精度でパラメタ更新演算を行うための回路を「高効率パラメタ更新回路」と呼ぶ場合がある。上述した高効率パラメタ更新処理部(図示せず)は、そのような高効率パラメタ更新回路により実現されてもよい。
Hereinafter, a circuit for performing parameter update calculations will be referred to as a "parameter update circuit", and in particular, a circuit for performing learning calculations with higher calculation accuracy than the calculation accuracy of the inference calculations performed by the high-efficiency
以下に示すパラメタ更新回路の構成は、パラメタ更新演算が高精度で行われるか低精度で行われる回路かを問わず実現可能である。すなわち、高効率パラメタ更新処理部104aと高精度パラメタ更新処理部104bの違いが、当該処理部の動作を実装した演算回路において演算に用いる各変数、加算器または乗算器の精度のみであってもよい。
The configuration of the parameter update circuit described below can be realized regardless of whether the parameter update operation is performed with high precision or with low precision. That is, even if the difference between the high-efficiency parameter update processing unit 104a and the high-precision parameter
パラメタ更新回路の最も単純な例は、推論回路と同様、乗算器と加算器を組み合わせた乗加算器(MAC)221を1つ備えた構成である(図7(a)の演算回路22a,図7(b)のMAC221等参照)。また、パラメタ更新回路は、例えば、図8~10に示す演算回路22b、演算回路22c、演算回路22dによっても実現できる。すなわち、図7~図10に示す演算回路は、パラメタ更新演算用の演算回路の例でもある。
The simplest example of the parameter updating circuit is a configuration including one multiplier-adder (MAC) 221 combining a multiplier and an adder, as in the inference circuit (
例えば、高精度パラメタ更新処理部104bが演算回路22a,演算回路22b、演算回路22cまたは演算回路22dにより実現される場合、当該回路において演算に用いられる各変数、加算器および乗算器による演算が高演算精度(第2の演算精度)に対応していればよい。このとき、各変数、加算および乗算のすべてが同じ精度である必要はなく、当該回路においてパラメタ更新演算に用いられる各変数、加算および乗算のいずれかの精度が、高効率推論処理部103aを実現する演算回路において推論演算に用いられる各変数、加算および乗算のいずれかの精度よりも高ければよい。
For example, when the high-precision parameter
一方、例えば、高効率パラメタ更新処理部104aが演算回路22a,演算回路22b、演算回路22cまたは演算回路22dにより実現される場合、当該回路において演算に用いられる各変数、加算器および乗算器による演算が低演算精度(第1の演算精度)に対応していればよい。
On the other hand, for example, when the high-efficiency parameter update processing unit 104a is realized by the
[動作]
次に、本実施形態の学習装置100の動作を説明する。図11は、本実施形態の学習装置100の動作の例を示すフローチャートである。図11に示す動作は、例えば、制御部105による制御に基づいて実行される。[motion]
Next, the operation of the
図11に示す例では、まず、制御部105が、学習前モデル記憶部101から学習前モデルを読み出すとともに、学習用データ記憶部102から学習用データを読み出す(ステップS11)。
In the example shown in FIG. 11, first, the control unit 105 reads a pre-learning model from the pre-learning
次いで、制御部105は、必要に応じて高効率推論処理部103aおよび高精度推論処理部103bを制御して、第1層~第n層までの全ての層に含まれる各ユニットについて順に推論処理を実施する(ステップS12:順伝搬)。このとき、制御部105は、少なくとも一部のユニットの推論処理を高効率推論処理部103aに実施させる。なお、制御部105は、全てのユニットの推論処理を高効率推論処理部103aに実施させてもよいし、一部のユニットの推論処理を高効率推論処理部103aに実施させてもよい。順伝搬で、高効率推論処理部103aに一部のユニットの推論処理を実施させる場合、制御部105は、残りのユニットの推論処理を高精度推論処理部103bに実施させてもよい。
Next, the control unit 105 controls the high-efficiency
高効率推論処理部103aおよび高精度推論処理部103bは、制御部105からの指示に応じて、指定された層またはユニットの推論処理を実施する。
The high-efficiency
次いで、制御部105は、必要に応じて高効率パラメタ更新処理部104aおよび高精度パラメタ更新処理部104bを制御して、各層のユニットの出力を計算するためのパラメタのうちの所定のパラメタについて、パラメタ更新処理を実施する(ステップS13:パラメタ更新処理)。このとき、制御部105は、少なくとも一部のパラメタについてパラメタ更新処理を高精度パラメタ更新処理部104bに実施させる。なお、制御部105は、全てのパラメタのパラメタ更新処理を高精度パラメタ更新処理部104bに実施させてもよいし、一部のパラメタのパラメタ更新処理を高精度パラメタ更新処理部104bに実施させてもよい。パラメタ更新処理で、高精度パラメタ更新処理部104bに一部のパラメタのパラメタ更新処理のみを実施させる場合、制御部105は、残りのパラメタの全てのパラメタ更新処理を高効率パラメタ更新処理部104aに実施させてもよいし、残りのパラメタの一部のパラメタ更新処理を高効率パラメタ更新処理部104aに実施させてもよい。なお、後者の場合、一部のパラメタについてはパラメタ更新処理自体が省略される。
Next, the control unit 105 controls the high-efficiency parameter update processing unit 104a and the high-accuracy parameter
高効率パラメタ更新処理部104aおよび高精度パラメタ更新処理部104bは、制御部105からの指示に応じて、指定されたパラメタのパラメタ更新処理を実施する。
The high-efficiency parameter update processing unit 104a and the high-precision parameter
最後に、制御部105は、ステップS13で更新されたパラメタを含む学習済みモデルを学習後モデル記憶部107に記憶する(ステップS14)。 Finally, the control unit 105 stores the learned model including the parameters updated in step S13 in the post-learning model storage unit 107 (step S14).
上記動作の他のバリエーションとして、例えば、複数の学習用データが保持されている場合には、学習用データの数分、ステップS11~ステップS14の動作を繰り返してもよい。なお、その場合、1つ前の学習用データに対する学習結果としての学習済みモデルが、次の学習用データに対する学習の学習前モデルとして使用される。 As another variation of the above operation, for example, when a plurality of learning data are held, the operations of steps S11 to S14 may be repeated by the number of learning data. In this case, a trained model as a learning result for the previous learning data is used as a pre-learning model for learning for the next learning data.
また、例えば、複数の学習用データが保持されている場合において、学習用データの数分、ステップS12~ステップS13の動作を繰り返し行うことも可能である。 Further, for example, when a plurality of pieces of learning data are held, it is possible to repeat the operations of steps S12 and S13 by the number of pieces of learning data.
さらには、学習用データの数に関わらず、同じ学習用データを使って上記のステップS11~ステップS14の繰り返し動作またはステップS12~ステップS14の繰り返し動作を、複数回繰り返すことも可能である(epoch処理)。 Furthermore, regardless of the number of pieces of learning data, it is also possible to repeat the repeating operations of steps S11 to S14 or the repeating operations of steps S12 to S14 a plurality of times using the same learning data (epoch process).
また、ステップS12の順伝搬で、例えば、低演算精度で推論処理を行う範囲(低精度推論範囲)を、予め定めておくだけでなく、ユーザから指定できるようにしたり、学習用データ毎やepoch処理の繰り返し毎に変化させることも可能である。 Further, in forward propagation in step S12, for example, the range in which inference processing is performed with low calculation accuracy (low-precision inference range) is not only predetermined, but also can be specified by the user, or can be specified for each learning data or epoch. It is also possible to change each iteration of the process.
また、ステップS13のパラメタ更新処理で、例えば、高演算精度でパラメタ更新処理を行う範囲(高精度パラメタ更新範囲)を全結合層のみに限定してもよい。また、例えば、高精度パラメタ更新範囲、低演算精度でパラメタ更新処理を行う範囲(低精度パラメタ更新範囲)、パラメタ更新処理を行わない範囲を、予め定めておくだけでなく、ユーザから指定できるようにしたり、処理の度(学習用データ毎やepoch処理の繰り返し毎)に変化させることも可能である。 Further, in the parameter update process of step S13, for example, the range in which the parameter update process is performed with high calculation accuracy (high-precision parameter update range) may be limited only to the fully connected layers. In addition, for example, the high-precision parameter update range, the range in which parameter update processing is performed with low calculation precision (low-precision parameter update range), and the range in which parameter update processing is not performed are not only determined in advance, but also can be specified by the user. Alternatively, it can be changed each time processing is performed (for each learning data or each repetition of epoch processing).
また、図12および図13は、本実施形態の学習装置100のより具体的な動作例を示すフローチャートである。なお、図12および図13に示す動作例は、学習装置100を構成するハードウエアに着目して各ステップの動作を例示した例である。なお、ハードウエア構成は図4に示す構成とした。
12 and 13 are flow charts showing a more specific operation example of the
図12に示す例では、まず高効率推論処理部103aとしての低精度演算回路11が、制御部105としての制御装置14からの指示に応じて、学習用データ・学習前モデルをメモリ13から読み出す(ステップS111)。
In the example shown in FIG. 12, first, the low-
次いで、該低精度演算回路11が、順伝搬の一部(本例では第1層~第(k-1)層までの各層に含まれる各ユニットの出力を計算する推論演算)を低演算精度で実施する(ステップS112)。そして、低精度演算回路11は、ステップS112の演算結果(本例では、第k-1層の各ユニットからの出力)をメモリ13に保存する(ステップS113)。
Next, the low-
なお、本例では、学習前モデルは、入力層を第0層、出力層を第n層として、第0層から第n層までのn+1層の多層構造のニューラルネットワークであるとする。また、上記の第(k-1)層は、入力層(第0層)よりも後段でかつ出力層(第n層)よりも前段の中間層とする。すなわち、kは、0<k-1<nを満たす整数とする。 In this example, the pre-learning model is assumed to be a multi-layered neural network of n+1 layers from the 0th layer to the nth layer, where the input layer is the 0th layer and the output layer is the nth layer. The (k−1)-th layer is an intermediate layer that is located after the input layer (0th layer) and before the output layer (nth layer). That is, k is an integer that satisfies 0<k-1<n.
次いで、高精度推論処理部103bとしての高精度演算回路12が、制御装置14の指示に応じて、ステップS113で保存された演算結果(第k-1層の各ユニットからの出力)を読み出す(ステップS211)。
Next, the high-
そして、該高精度演算回路12は、順伝搬の続き(本例では、第k層~第n層までの各層に含まれる各ユニットの出力を計算する推論演算)を高演算精度で実施する(ステップS212)。
Then, the high-
次いで、高精度パラメタ更新処理部104bとしての高精度演算回路12が、制御装置14の指示に応じて、一部の層(本例では第k層~第n層までの各層)に含まれる各ユニットにおけるパラメタ(他ユニットとの結合重み等)を更新するためのパラメタ更新演算を高演算精度で実施する(ステップS212)。そして、高精度演算回路12は、ステップS212の演算結果(本例では、第k層~第n層の各層に含まれる各ユニットにおける更新後のパラメタ)をメモリ13に保存する(ステップS213)。
Next, the high-
なお、ステップS213で演算結果として保存された更新後のパラメタが、上述した学習済みモデルに相当する。 It should be noted that the updated parameters stored as the calculation results in step S213 correspond to the learned model described above.
図12に示す例は、まず低精度演算回路11が、高効率推論処理部103aとして、一部の層について推論処理を行った上で、高精度演算回路12が、高精度パラメタ更新処理部104bとして、残りの層について推論処理とパラメタ更新処理とを行う動作例である。
In the example shown in FIG. 12, first, the low-
また、図13に示す例では、まず高効率推論処理部103aとしての低精度演算回路11が、制御部105としての制御装置14からの指示に応じて、学習用データ・学習前モデルをメモリ13から読み出す(ステップS121)。
In the example shown in FIG. 13, first, the low-
次いで、該低精度演算回路11が、順伝搬(本例では第1層~第n層までの各層に含まれる各ユニットの出力を計算する推論演算)を低演算精度で実施する(ステップS122)。そして、低精度演算回路11は、ステップS122の演算結果(本例では、出力層である第n層のユニットからの出力)をメモリ13に保存する(ステップS123)。
Next, the low-
なお、本例でも、学習前モデルは、入力層を第0層、出力層を第n層として、第0層から第n層までのn+1層の多層構造のニューラルネットワークであるとする。 Also in this example, the pre-learning model is assumed to be a multi-layered neural network of n+1 layers from the 0th layer to the nth layer, where the input layer is the 0th layer and the output layer is the nth layer.
次いで、高精度推論処理部103bとしての高精度演算回路12が、制御装置14の指示に応じて、ステップS123で保存された演算結果(出力層である第n層のユニットからの出力)を読み出す(ステップS221)。
Next, the high-
次いで、該高精度演算回路12は、制御装置14の指示に応じて、一部の層(本例では第k層~第n層までの各層)に含まれる各ユニットにおけるパラメタ(他ユニットとの結合重み等)を更新するためのパラメタ更新演算を高演算精度で実施する(ステップS222)。そして、高精度演算回路12は、ステップS222の演算結果(本例では、第k層~第n層の各層に含まれる各ユニットにおける更新後のパラメタ)をメモリ13に保存する(ステップS223)。
Next, the high-
なお、ステップS223で演算結果として保存された更新後のパラメタが、上述した学習済みモデルに相当する。 It should be noted that the updated parameters stored as the calculation results in step S223 correspond to the learned model described above.
図13に示す例は、低精度演算回路11が、高効率推論処理部103aとして、全ての層について推論処理を行った上で、高精度演算回路12が、高精度パラメタ更新処理部104bとして、一部の層についてパラメタ更新処理を行う動作例である。
In the example shown in FIG. 13, the low-
なお、図12のステップS213や図13のステップS223の後に、さらに、低精度演算回路11が、高効率パラメタ更新処理部104aとして、図14に示すような動作を行うことも可能である。
After step S213 in FIG. 12 and step S223 in FIG. 13, the low-
すなわち、低精度演算回路11が、高効率パラメタ更新処理部104aとして、メモリ13に保存されていた第k層~第n層の各層に含まれる各ユニットにおける更新後のパラメタを読み出す(ステップS231)。
That is, the low-
次いで、該低精度演算回路11が、残りの層(本例では、第1層~第(k-1)層までの各層)に含まれる各ユニットにおけるパラメタ(他ユニットとの結合重み等)を更新するためのパラメタ更新演算を低演算精度で実施する(ステップS232)。そして、低精度演算回路11は、ステップS232の演算結果(本例では、第1層~第(k-1)層の各層に含まれる各ユニットにおける更新後のパラメタ)をメモリ13に保存する(ステップS233)。
Next, the low-
本例の場合、ステップS213またはステップS223で演算結果として保存された更新後のパラメタとステップS233で演算結果として保存された更新後のパラメタとが、上述した学習済みモデルに相当する。 In the case of this example, the updated parameter saved as the calculation result in step S213 or step S223 and the updated parameter saved as the calculation result in step S233 correspond to the learned model described above.
なお、図12~図14に示す動作は、1つの学習用データに対する学習処理の例である。したがって、複数の学習用データが保持されている場合には、学習用データの数分、上記動作や上記動作に含まれる各演算ステップを繰り返すことも可能である。また、学習用データの数に関わらず、同じ学習用データを使って上記動作または上記動作に含まれる各演算ステップを、複数回繰り返すことも可能である(epoch処理)。また、上記動作において高精度パラメタ更新範囲とされる第k層~第n層は全結合層であってもよいし、kをユーザが指定したり、処理の度に変化させることも可能である。 Note that the operations shown in FIGS. 12 to 14 are examples of learning processing for one piece of learning data. Therefore, when a plurality of pieces of learning data are stored, it is possible to repeat the above operation and each operation step included in the above operation as many times as the number of pieces of learning data. Moreover, regardless of the number of learning data, it is also possible to repeat the above operation or each operation step included in the above operation a plurality of times using the same learning data (epoch processing). In addition, the k-th layer to the n-th layer, which are the high-precision parameter update range in the above operation, may be fully connected layers, or k may be specified by the user or changed for each process. .
以上のように、本実施形態によれば、学習アルゴリズムの演算処理を、推論処理とパラメタ更新処理とに分け、推論処理の少なくとも一部を低演算精度で演算し、かつパラメタ更新処理の少なくとも一部を高演算精度で演算することで、高演算精度を必要とする演算部分を最適化できるので、消費電力を低減しつつ十分な精度での学習が可能になる。 As described above, according to the present embodiment, the arithmetic processing of the learning algorithm is divided into the inference processing and the parameter update processing, at least part of the inference processing is operated with low arithmetic accuracy, and at least one of the parameter update processing is performed. By calculating the part with high calculation accuracy, the calculation part that requires high calculation accuracy can be optimized, so that power consumption can be reduced and learning with sufficient accuracy becomes possible.
実施形態2.
次に、本発明の第2の実施形態を説明する。図15は、第2の実施形態のデータ処理装置の要部の構成例を示すブロック図である。図15に示すデータ処理装置300は、低精度演算処理部31と、高精度演算処理部32と、通信路33と、データ変換部34とを備える。
Next, a second embodiment of the invention will be described. FIG. 15 is a block diagram showing a configuration example of the main part of the data processing device of the second embodiment. A
低精度演算処理部31は、相対的に低い演算精度で所定の演算を行う処理部である。ここで、相対的に低い演算精度とは、高精度演算処理部32が行う演算の演算精度よりも低い演算精度であればよい。
The low-precision
高精度演算処理部32は、相対的に高い演算精度で所定の演算を行う処理部である。ここで、相対的に高い演算精度とは、低精度演算処理部31が行う演算の演算精度よりも高い演算精度であればよい。
The high-accuracy
低精度演算処理部31は、例えば、上記の高効率推論処理部103aや高効率パラメタ更新処理部104aであってもよい。また、高精度演算処理部32は、例えば、上記の高精度推論処理部103bや高精度パラメタ更新処理部104bであってもよい。本実施形態においても、低精度演算処理部31および高精度演算処理部32が行うデータ処理において実際に行われる演算に用いる数字データの値域の広さ・細かさの尺度(より具体的には、その処理部を実現する演算回路におけるビット幅および小数点の取り扱い等で定まる数字データの値域の広さ・細かさの尺度)を、「精度」または「演算精度」と呼ぶ。
The low-accuracy
本例では、低精度演算処理部31と高精度演算処理部32は、通信路33およびデータ変換部34を介して接続される。なお、データ変換部34は、高精度演算処理部32と通信路33との間に設けられる。
In this example, the low-precision
通信路33は、例えば、バスによって実現されてもよい。なお、通信路33は、チップ内部に設けられる接続回路(Inter-connect)によって実現されていてもよい。また、通信路33には、バスや接続回路だけでなく、該バスや該接続回路に接続されるメモリ(外部メモリやバッファ等)を含んでいてもよい。
The
データ変換部34は、低精度演算処理部31と高精度演算処理部32との間でやりとりされるデータを対象に、所定の変換処理を行う。このとき、データ変換部34によるデータ変換は、例えば、通信路33において行われる通信(データのやりとり)において、データ量(1データあたりの通信量)がより少なくなる演算精度のデータのデータ通信になるように行われる。
The
例えば、データ変換部34は、通信路33を通る各データが、低精度演算処理部31の演算精度と高精度演算処理部32の演算精度のうちのよりデータ量が少ない演算精度のデータになるように、送受信データの変換を行う。なお、データ量が同じであればより低い演算精度のデータになるように、送受信データの変換を行う。なお、図15の構成であれば、データ変換部34は、通信路33を通る各データが、低精度演算処理部31の演算精度のデータとなるようにデータの変換を行えばよい。低い方の演算精度に合わせることで、データ交換による演算精度の劣化を最小限にしつつ、低精度演算処理部31側でのデータ変換を不要にできる。
For example, the
ここで、データの変換には、データ型を、通信端点とされる処理部のうちより低い演算精度のデータ型に合わせる型変換や、データの圧縮(特に、数値列圧縮や桁数の削減等の数値データ圧縮)や、2以上の変換後のデータの合成が含まれる。 Here, the data conversion includes type conversion to match the data type with a data type with lower arithmetic precision in the processing unit that is the communication end point, data compression (in particular, numeric string compression, digit number reduction, etc.). numerical data compression) and synthesis of two or more transformed data.
データ変換部34は、例えば、低精度演算処理部31から高精度演算処理部32に向けて送信されたデータを通信路33を介して受信し、該受信データ(低演算精度のデータ)を高精度演算処理部32が扱う演算精度(高演算精度)のデータに変換して、高精度演算処理部32に渡す。また、データ変換部34は、例えば、高精度演算処理部32から低精度演算処理部31に向けて送信されたデータを受信し、該受信データ(高演算精度のデータ)を低精度演算処理部31が扱う演算精度(低演算精度)のデータに変換して、通信路33に送出する。
The
例えば、低精度演算処理部31の演算精度(ここでは、演算に用いられる数値のデータ型)が整数16ビット(INT16)であり、高精度演算処理部32の演算精度が浮動小数点32ビット(FP32)である場合、データ変換部34は、通信路33を通るデータが整数16ビットのデータとなるようにデータ変換を行えばよい。また、例えば、低精度演算処理部31の演算精度が整数16ビット(INT16)であり、高精度演算処理部32の演算精度が浮動小数点16ビット(FP16)である場合、データ変換部34は、通信路33を通るデータが整数16ビットのデータとなるようにデータ変換を行えばよい。
For example, the arithmetic precision of the low-precision arithmetic processing unit 31 (here, the data type of numerical values used for arithmetic) is 16-bit integer (INT16), and the arithmetic precision of the high-precision
なお、通信路33を通るデータの通信が、片方向通信(例えば、低精度演算処理部31から高精度演算処理部32への送信のみ、高精度演算処理部32から低精度演算処理部31への送信のみ等)であってもよい。その場合、データ変換部34は、実際に行われる通信に対応したデータ変換のみを行えばよい。
Data communication through the
本実施形態において、データ変換部34は、データ処理装置300の構成および動作に併せて設計されたデータ変換を行う専用のデータ変換回路により実現されていてもよい。データ変換部34を専用の回路に実装することで、設定値や状態の読み出しやそれらに応じた分岐といった汎用化のための処理を省くことができ、さらなる効率化を図ることができる。また、データ変換を専用化することで、複数のデータをまとめて変換処理したり、複数のデータのデータ変換を並列で行ってその結果をとりまとめて一括送信する等の処理も容易に実装できるので、さらなる効率化を図ることができる。ここで、データ変換の並列処理およびその結果のとりまとめは、各データの変換と変換後のデータの合成とを組み合わせたデータ変換例の1つである。データ変換部34は、そのようなデータ変換を、例えば、SIMD(Single instruction multiple data)演算により実現してもよい。
In this embodiment, the
また、図16は、第2の実施形態のデータ処理装置の他の構成例を示すブロック図である。図15に示す例では、データ変換部34が、高精度演算処理部32側にのみ設けられていたが、データ変換部は低精度演算処理部31側にも設けることが可能である。図16に示すデータ処理装置300は、図15に示す構成と比べて、低精度演算処理部31と通信路33との間に、さらにデータ変換部35を備える点が異なる。すなわち、本例では、低精度演算処理部31と高精度演算処理部32が、データ変換部35、通信路33およびデータ変換部34を介して接続される。
FIG. 16 is a block diagram showing another configuration example of the data processing device of the second embodiment. In the example shown in FIG. 15, the
データ変換部35は、低精度演算処理部31と高精度演算処理部32との間でやりとりされるデータを対象に、所定の変換処理を行う。
The
本例において、データ変換部34およびデータ変換部35によるデータ変換は、通信路33において行われる通信(データのやりとり)において、データ量が、低精度演算処理部31で扱う演算精度で行うデータ通信のデータ量よりもさらに少なくなる演算精度のデータのデータ通信になるように行われる。
In this example, the data conversion by the
例えば、データ変換部34およびデータ変換部35は、通信路33を通る各データが、低精度演算処理部31の演算精度で行うデータ通信量よりも少なくなる演算精度(以下、超低演算精度)のデータになるように、送受信データの変換を行う。
For example, the
本例では、データ変換部34は、例えば、低精度演算処理部31から高精度演算処理部32に向けて送信されたデータを、データ変換部35および通信路33を介して受信し、該受信データ(データ変換部35による変換後の超低演算精度のデータ)を高精度演算処理部32が扱う演算精度(高演算精度)のデータに変換して、高精度演算処理部32に渡す。また、データ変換部34は、例えば、高精度演算処理部32から低精度演算処理部31に向けて送信されたデータを受信し、該受信データ(高演算精度のデータ)を超低演算精度のデータに変換して、通信路33に送出する。
In this example, the
また、データ変換部35は、例えば、高精度演算処理部32から低精度演算処理部31に向けて送信されたデータを、データ変換部34および通信路33を介して受信し、該受信データ(データ変換部34による変換後の超低演算精度のデータ)を低精度演算処理部31が扱う演算精度(低演算精度)のデータに変換して、低精度演算処理部31に渡す。また、データ変換部35は、例えば、高精度演算処理部32から低精度演算処理部31に向けて送信されたデータを受信し、該受信データ(高演算精度のデータ)を超低演算精度のデータに変換して、通信路33に送出する。
Further, the
例えば、低精度演算処理部31の演算精度(ここでは、演算に用いられる数値のデータ型)が整数16ビット(INT16)であり、高精度演算処理部32の演算精度が浮動小数点32ビット(FP32)である場合、データ変換部34およびデータ変換部35は、通信路33を通るデータが、INT16よりもデータ量が小さい整数12ビット(INT12)や整数8ビット(INT8)になるようにデータを圧縮してもよい。データ変換部34およびデータ変換部35は、データ圧縮をする際、データが数値データとしての意味を失わないように精度のみを低下させる数値データ圧縮(例えば、下位ビットの削減等)を行う。
For example, the arithmetic precision of the low-precision arithmetic processing unit 31 (here, the data type of numerical values used for arithmetic) is 16-bit integer (INT16), and the arithmetic precision of the high-precision
なお、データ変換部34およびデータ変換部35は、深層学習における活性化関数の特徴を用いてデータ圧縮を行うことも可能である。例えば、活性化関数の1つであるステップ関数を利用すると、データを1ビットに圧縮できる。また、ReLU(ランプ関数)を利用すると、データの符号ビットを削減できる。
Note that the
また、データ変換部34およびデータ変換部35は、ビット数を削減するデータ変換を行う際に、半端なビット数の複数のデータを詰めて纏めたり、そのようにして纏められたデータを複数のデータに分解する処理(パック/アンパック処理)を行ってもよい。このようなパック/アンパック処理も、専用化することで効率化を図ることができる。
Further, when performing data conversion for reducing the number of bits, the
このようにして通信路33を通るデータ量を削減することで、演算精度が異なるコア(演算回路)間のデータ交換を高速化できる。さらに、コア間のデータ交換をメモリを介して行う場合には、データ交換のためのメモリの使用量を削減できるので、メモリ使用にかかる消費電力の削減も可能である。
By reducing the amount of data passing through the
なお、データ交換を行う異なる演算精度のコアの組み合わせが2以上ある場合、各組み合わせ毎に、当該組み合わせにおけるコア間通信の通信路の一方または両方の端点に、上記のデータ変換部34やデータ変換部35を設ければよい。
Note that when there are two or more combinations of cores with different arithmetic accuracies that perform data exchange, for each combination, one or both end points of the communication path for inter-core communication in the combination are connected to the
次に、本発明の概要を説明する。図17は、本発明のデータ処理装置の概要を示すブロック図である。図17に示すデータ処理装置500は、低精度演算処理手段501と、高精度演算処理手段502と、第1のデータ変換手段504とを備える。
Next, an outline of the present invention will be described. FIG. 17 is a block diagram showing the outline of the data processing device of the present invention. A
低精度演算処理手段501(例えば、低精度演算処理部31)は、第1の精度で所定の演算を行う。 The low-precision arithmetic processing means 501 (for example, the low-precision arithmetic processing section 31) performs a predetermined arithmetic operation with a first precision.
高精度演算処理手段502(例えば、高精度演算処理部32)は、第1の精度よりも高い第2の精度で所定の演算を行う。 The high-precision arithmetic processing means 502 (for example, the high-precision arithmetic processing section 32) performs a predetermined arithmetic operation with a second precision higher than the first precision.
第1のデータ変換手段504(例えば、データ変換部34)は、高精度演算処理手段502と低精度演算処理手段501との間でデータの受け渡しを行うための通信路503の高精度演算処理手段502側の端点に設けられる。
The first data conversion means 504 (for example, the data conversion unit 34) is a high-precision arithmetic processing means of the
第1のデータ変換手段504は、接続先の高精度演算処理手段502との間で受け渡されるデータが高精度演算処理手段502で扱えるデータであるとともに、通信路503を通るデータ量が、第1の精度のデータを使用した場合のデータ量以下となり、かつ通信路503を通るデータの精度が第1の精度以下となるように、通信路503と高精度演算処理手段502との間を通るデータに対して所定の変換を行う。
The first data conversion means 504 ensures that the data transferred to and from the high-precision arithmetic processing means 502 of the connection destination is data that can be handled by the high-precision arithmetic processing means 502, and that the amount of data passing through the
このような構成により、高い精度を必要とする演算と高い精度を必要としない演算が混在する処理であっても効率化できる。 With such a configuration, it is possible to improve efficiency even in a process in which calculations requiring high accuracy and calculations not requiring high accuracy are mixed.
また、図18は、本発明のデータ処理回路の構成例を示す構成図である。図18に示すデータ処理回路600は、低精度演算回路601と、高精度演算回路602と、第1のデータ変換回路604とを備える。
FIG. 18 is a configuration diagram showing a configuration example of the data processing circuit of the present invention. A data processing circuit 600 shown in FIG. 18 includes a low-
低精度演算回路601(例えば、低精度演算処理部31や低精度演算回路11)は、第1の精度で所定の演算を行う。
The low-precision arithmetic circuit 601 (for example, the low-precision
高精度演算回路602(例えば、高精度演算処理部32や高精度演算回路12)は、第1の精度よりも高い第2の精度で所定の演算を行う。
The high-precision arithmetic circuit 602 (for example, the high-precision
第1のデータ変換回路604(例えば、データ変換部34)は、高精度演算回路602と低精度演算回路601との間でデータの受け渡しを行うための通信路603の高精度演算回路602側の端点に設けられ、通信路603と高精度演算回路602との間を通るデータに対して、予め定められた変換を行う。
The first data conversion circuit 604 (for example, the data conversion unit 34) is provided on the high-
このようなデータ処理回路600において、第1のデータ変換回路604と接続先の高精度演算回路602との間で受け渡されるデータが高精度演算回路602が扱うデータであり、通信路603を通るデータ量が、第1の精度のデータを使用した場合のデータ量以下であり、かつ当該通信路を通るデータの精度が第1の精度以下であるよう構成される。
In such a data processing circuit 600 , the data transferred between the first
このような構成によっても、高い精度を必要とする演算と高い精度を必要としない演算が混在する処理を効率化できる。 With such a configuration as well, it is possible to improve the efficiency of processing in which operations that require high accuracy and operations that do not require high accuracy are mixed.
なお、データ処理回路600は、図19に示すように、さらに、通信路603の低精度演算回路601側の端点に設けられ、通信路603と低精度演算回路601との間を通るデータに対して、予め定められた変換を行う第2のデータ変換回路605を備えていてもよい。
As shown in FIG. 19, the data processing circuit 600 is further provided at the end point of the
このようなデータ処理回路600において、さらに、第2のデータ変換回路605と接続先の低精度演算回路601との間で受け渡されるデータが低精度演算回路601が扱うデータであるとともに、通信路603を通るデータ量が、第1の精度のデータを使用した場合のデータ量より少なく、かつ当該通信路603を通るデータの精度が第1の精度よりも低い構成であってもよい。
In the data processing circuit 600 as described above, the data transferred between the second
このような構成によれば、高い精度を必要とする演算と高い精度を必要としない演算が混在する処理をさらに効率化できる。 According to such a configuration, it is possible to further improve the efficiency of processing in which calculations that require high accuracy and calculations that do not require high accuracy are mixed.
なお、上記の実施形態は以下の付記のようにも記載できる。 It should be noted that the above embodiment can also be described as the following additional remarks.
(付記1)第1の精度で所定の演算を行う低精度演算処理手段と、第1の精度よりも高い第2の精度で所定の演算を行う高精度演算処理手段と、高精度演算処理手段と低精度演算処理手段との間でデータの受け渡しを行うための通信路の高精度演算処理手段側の端点に設けられる第1のデータ変換手段とを備え、第1のデータ変換手段は、接続先の高精度演算処理手段との間で受け渡されるデータが高精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量以下となり、かつ通信路を通るデータの精度が第1の精度以下となるように、通信路と高精度演算処理手段との間を通るデータに対して所定の変換を行うことを特徴とするデータ処理装置。 (Appendix 1) Low-precision arithmetic processing means for performing predetermined arithmetic operations with a first precision, high-precision arithmetic processing means for performing predetermined arithmetic operations with a second precision higher than the first precision, and high-precision arithmetic processing means and a first data conversion means provided at the end point of the high-precision arithmetic processing means side of the communication path for exchanging data between the low-precision arithmetic processing means and the first data conversion means, the connection The data transferred to and from the high-precision arithmetic processing means is data that can be handled by the high-precision arithmetic processing means, and the amount of data passing through the communication path is equal to or less than the amount of data when using data of the first precision. and performing a predetermined conversion on the data passing between the communication channel and the high-precision arithmetic processing means so that the accuracy of the data passing through the communication channel is equal to or lower than the first accuracy. Device.
(付記2)第1のデータ変換手段は、通信路から、低精度演算処理手段より高精度演算処理手段に渡されるデータを第1の精度のデータとして受け付け、受け付けた第1の精度のデータを高精度演算処理手段で扱える精度のデータに変換し、第1のデータ変換手段は、高精度演算処理手段より低精度演算処理手段に渡されるデータを高精度演算処理手段で扱えるデータのままで受け付け、受け付けたデータを低精度演算処理手段で扱える精度のデータに変換する付記1に記載のデータ処理装置。
(Appendix 2) The first data conversion means accepts data passed from the low-precision arithmetic processing means to the high-precision arithmetic processing means from the communication path as first precision data, and converts the received first precision data to The first data conversion means receives the data passed from the high-precision arithmetic processing means to the low-precision arithmetic processing means as data that can be handled by the high-precision arithmetic processing means. , the data processing device according to
(付記3)通信路の低精度演算処理手段側の端点に設けられる第2のデータ変換手段をさらに備え、第1のデータ変換手段および第2のデータ変換手段は、接続先の演算処理手段との間で受け渡されるデータが接続先の演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量よりも少なく、かつ通信路を通るデータの精度が第1の精度よりも低くなるように、通信路と接続先の演算処理手段との間を通るデータに対して所定の変換を行う付記1または付記2に記載のデータ処理装置。
(Appendix 3) Further comprising a second data conversion means provided at an end point of the communication path on the side of the low-precision arithmetic processing means, the first data conversion means and the second data conversion means are connected to the arithmetic processing means of the connection destination. The data passed between the 3. The data processing device according to
(付記4)第1のデータ変換手段および第2のデータ変換手段は、通信路から、接続先の演算処理手段より相手側の演算処理手段に渡されるデータを第1の精度よりも低い所定の第3の精度のデータとして受け付け、受け付けた第3の精度のデータを接続先の演算処理手段で扱える精度のデータに変換し、第1のデータ変換手段および第2のデータ変換手段は、接続先の演算処理手段から相手先の演算処理手段に渡されるデータを接続先の演算処理手段で扱えるデータのままで受け付け、受け付けたデータを相手側の演算処理手段で扱える精度のデータに変換する付記3に記載のデータ処理装置。
(Appendix 4) The first data conversion means and the second data conversion means convert the data passed from the connection destination arithmetic processing means to the counterpart arithmetic processing means through the communication path into a predetermined accuracy lower than the first accuracy. receiving as third precision data, converting the received third precision data into precision data that can be handled by the arithmetic processing means of the connection destination, and the first data conversion means and the second data conversion means
(付記5)第1のデータ変換手段および第2のデータ変換手段の少なくともいずれかは、通信路に変換後のデータを送出する際に、複数の変換後のデータを纏めて送出し、第1のデータ変換手段および第2のデータ変換手段の少なくともいずれかは、通信路から、纏められた複数の変換後のデータを受け付け、受け付けた複数の変換後のデータを分解した上で、分解後の各データに対して、接続先の演算処理手段で扱える精度のデータへの変換を行う付記3または付記4に記載のデータ処理装置。
(Appendix 5) At least one of the first data conversion means and the second data conversion means, when sending the converted data to the communication channel, collectively sends a plurality of converted data, at least one of the data conversion means and the second data conversion means receives a plurality of data after conversion from the communication channel, decomposes the received data after conversion, and decomposes the data after decomposing 4. The data processing device according to
(付記6)第1のデータ変換手段および第2のデータ変換手段で行う変換が予め定められ、かつ固定されている付記3から付記5のうちのいずれかに記載のデータ処理装置。
(Appendix 6) The data processing apparatus according to any one of
(付記7)前記データ処理装置が、層状に結合された2以上のユニットで構成される所定の判別モデルを学習する学習装置であり、学習用データが入力されると、前記判別モデルの各ユニットの出力を所定の順番で計算する推論処理と、前記推論処理の結果に基づいて、前記各ユニットの出力の計算に用いられるパラメタの少なくとも一部を更新するパラメタ更新処理とを行う学習手段を備え、前記学習手段は、前記低精度演算処理手段として、前記推論処理において行われる演算のうちの指定された演算を、第1の演算精度で実施する高効率推論手段と、前記高精度演算処理手段として、前記パラメタ更新処理において行われる演算のうちの指定された演算を、前記第1の演算精度よりも高い第2の演算精度で実施する高精度パラメタ更新手段とを含む付記1から付記6のうちのいずれかに記載のデータ処理装置。 (Appendix 7) The data processing device is a learning device that learns a predetermined discriminant model composed of two or more units connected in layers, and when learning data is input, each unit of the discriminant model and a parameter update process for updating at least part of the parameters used in calculating the output of each unit based on the result of the inference process. , the learning means includes, as the low-precision arithmetic processing means, high-efficiency inference means for performing a specified arithmetic operation among the arithmetic operations performed in the inference processing with a first arithmetic precision, and the high-accuracy arithmetic processing means. and high-precision parameter update means for performing a specified operation among the operations performed in the parameter update process with a second operation accuracy higher than the first operation accuracy. A data processing device according to any one of the above.
(付記8A)第1の精度で所定の演算を行う低精度演算回路と、第1の精度よりも高い第2の精度で所定の演算を行う高精度演算回路と、高精度演算回路と低精度演算回路との間でデータの受け渡しを行うための通信路の高精度演算回路側の端点に設けられ、通信路と高精度演算回路との間を通るデータに対して、予め定められた変換を行う第1のデータ変換回路とを備え、第1のデータ変換回路と接続先の高精度演算回路との間で受け渡されるデータが高精度演算回路が扱うデータであり、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量以下であり、かつ当該通信路を通るデータの精度が第1の精度以下であることを特徴とするデータ処理回路。 (Appendix 8A) A low-precision arithmetic circuit that performs a predetermined operation with a first precision, a high-precision arithmetic circuit that performs a predetermined arithmetic operation with a second precision that is higher than the first precision, a high-precision arithmetic circuit, and a low-precision It is provided at the end point of the high-precision arithmetic circuit side of the communication path for exchanging data with the arithmetic circuit, and performs a predetermined conversion on the data passing between the communication path and the high-precision arithmetic circuit. data transferred between the first data conversion circuit and the connected high-precision arithmetic circuit is data handled by the high-precision arithmetic circuit, and the amount of data passing through the communication path is less than or equal to the amount of data when using data with a first precision, and the precision of data passing through the communication path is less than or equal to the first precision.
(付記8B)通信路の低精度演算回路側の端点に設けられ、通信路と低精度演算回路との間を通るデータに対して、予め定められた変換を行う第2のデータ変換回路をさらに備え、第2のデータ変換回路と接続先の低精度演算回路との間で受け渡されるデータが低精度演算回路が扱うデータであり、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量より少なく、かつ当該通信路を通るデータの精度が第1の精度よりも低い付記8Bに記載のデータ処理回路。 (Appendix 8B) Further, a second data conversion circuit is provided at an end point of the communication path on the low-precision arithmetic circuit side and performs predetermined conversion on data passing between the communication path and the low-precision arithmetic circuit. The data transferred between the second data conversion circuit and the connected low-precision arithmetic circuit is the data handled by the low-precision arithmetic circuit, and the amount of data passing through the communication path is the data of the first precision. 8B. The data processing circuit of clause 8B, wherein the amount of data is less than the amount of data used and the accuracy of the data passing through the channel is less than the first accuracy.
(付記9)第1の精度で所定の演算を行う低精度演算処理手段と、第1の精度よりも高い第2の精度で所定の演算を行う高精度演算処理手段との間でデータの受け渡しを行うための通信路の高精度演算処理手段側の端点に設けられる第1のデータ変換手段が、接続先の高精度演算処理手段との間で受け渡されるデータが高精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量以下となり、かつ通信路を通るデータの精度が第1の精度以下となるように、通信路と高精度演算処理手段との間を通るデータに対して所定の変換を行うことを特徴とするデータ処理方法。 (Appendix 9) Transferring data between low-precision arithmetic processing means that performs predetermined arithmetic operations with a first precision and high-precision arithmetic processing means that performs predetermined arithmetic operations with a second precision that is higher than the first precision The first data conversion means provided at the end point of the high-precision arithmetic processing means side of the communication path for performing the above, the data transferred between the high-precision arithmetic processing means of the connection destination can be handled by the high-precision arithmetic processing means In addition to being data, the amount of data passing through the communication channel is equal to or less than the amount of data when data with the first accuracy is used, and the accuracy of the data passing through the communication channel is equal to or less than the first accuracy. and a high-precision arithmetic processing means, wherein a predetermined conversion is performed on data passing between the high-precision arithmetic processing means.
(付記10)第1のデータ変換手段が、接続先の高精度演算処理手段との間で受け渡されるデータが高精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量より少なく、かつ通信路を通るデータの精度が第1の精度より低くなるように、通信路と高精度演算処理手段との間を通るデータに対して所定の変換を行い、通信路の低精度演算処理手段側の端点に設けられる第2のデータ変換手段が、接続先の低精度演算処理手段との間で受け渡されるデータが低精度演算処理手段で扱えるデータであるとともに、通信路を通るデータ量が、第1の精度のデータを使用した場合のデータ量より少なく、かつ通信路を通るデータの精度が第1の精度より低くなるように、通信路と低精度演算処理手段との間を通るデータに対して所定の変換を行う付記9に記載のデータ処理方法。
(Supplementary Note 10) The data transferred between the first data conversion means and the high-precision arithmetic processing means of the connection destination is data that can be handled by the high-precision arithmetic processing means, and the amount of data passing through the communication path is For data passing between the communication channel and the high-precision arithmetic processing means so that the amount of data is less than when data with a precision of 1 is used, and the precision of the data passing through the communication channel is lower than the first precision the second data conversion means provided at the end point of the communication path on the low-precision arithmetic processing means side performs the low-precision arithmetic processing on the data transferred between the low-precision arithmetic processing means of the connection destination In addition to being data that can be handled by means, the amount of data passing through the communication channel is less than the amount of data when using data with the first accuracy, and the accuracy of the data passing through the communication channel is lower than the
以上、実施形態および実施例を参照して本願発明を説明したが、本願発明は上記実施形態および実施例に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。 Although the present invention has been described with reference to the embodiments and examples, the present invention is not limited to the above embodiments and examples. Various changes that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.
本発明は、深層学習に限らず、高い精度を必要とする演算と高い精度を必要としない演算が混在している処理を行う装置において、消費電力を抑えつつ該処理を行いたい場合に好適に適用可能である。 The present invention is not limited to deep learning, and is suitable for devices that perform processing that requires high accuracy and processing that does not require high accuracy, and is suitable when it is desired to perform the processing while suppressing power consumption. Applicable.
10 演算回路
11 低精度演算回路
12 高精度演算回路
13 メモリ
14 制御装置
15 バス
51 ユニット
52 ユニット間結合
53 推論処理
54 パラメタ更新処理
100 学習装置
101 学習前モデル記憶部
102 学習用データ記憶部
103a 高効率推論処理部
103b 高精度推論処理部
104a 高効率パラメタ更新処理部
104b 高精度パラメタ更新処理部
105 制御部
106 学習処理部
107 学習後モデル記憶部
1000 コンピュータ
1001 CPU
1002 主記憶装置
1003 補助記憶装置
1004 インタフェース
1005 ディスプレイ装置
1006 入力デバイス
1007 GPU
1008 プロセッサ
21 バス
22a、22b、22c、22d 演算回路
221 MAC
222 メモリ層
223 乗加算ツリー
224 ALU
300 データ処理装置
31 低精度演算処理部
32 高精度演算処理部
33 通信路
34、35 データ変換部
500 データ処理装置
501 低精度演算処理手段
502 高精度演算処理手段
503 通信路
504 第1のデータ変換手段
600 データ処理回路
601 低精度演算回路
602 高精度演算回路
603 通信路
604 第1のデータ変換回路
605 第2のデータ変換回路
90 大規模学習回路10
1002
1008
222
300
Claims (7)
前記第1の精度よりも高い第2の精度で所定の演算を行う高精度演算処理手段と、
前記高精度演算処理手段と前記低精度演算処理手段との間でデータの受け渡しを行うための通信路の前記高精度演算処理手段側の端点に設けられる第1のデータ変換手段とを備え、
前記第1のデータ変換手段は、接続先の前記高精度演算処理手段との間で受け渡されるデータが前記高精度演算処理手段で扱えるデータであるとともに、前記通信路を通るデータ量が、前記第1の精度のデータを使用した場合のデータ量以下となり、かつ前記通信路を通るデータの精度が前記第1の精度以下となるように、前記通信路と前記高精度演算処理手段との間を通るデータに対して所定の変換を行い、
前記通信路の前記低精度演算処理手段側の端点に設けられる第2のデータ変換手段をさらに備え、
前記第1のデータ変換手段および前記第2のデータ変換手段は、接続先の演算処理手段との間で受け渡されるデータが前記接続先の演算処理手段で扱えるデータであるとともに、前記通信路を通るデータ量が、前記第1の精度のデータを使用した場合のデータ量よりも少なく、かつ前記通信路を通るデータの精度が前記第1の精度よりも低くなるように、前記通信路と前記接続先の演算処理手段との間を通るデータに対して所定の変換を行う
ことを特徴とするデータ処理装置。 low-precision arithmetic processing means for performing a predetermined arithmetic operation with a first precision;
high-precision arithmetic processing means for performing a predetermined arithmetic operation with a second precision higher than the first precision;
A first data conversion means provided at an end point on the high-precision arithmetic processing means side of a communication path for exchanging data between the high-precision arithmetic processing means and the low-precision arithmetic processing means,
In the first data conversion means, the data transferred between the high-precision arithmetic processing means of the connection destination is data that can be handled by the high-precision arithmetic processing means, and the amount of data passing through the communication path is between the communication path and the high-precision arithmetic processing means so that the amount of data is equal to or less than the amount of data when data with a first accuracy is used, and the accuracy of data passing through the communication path is equal to or less than the first accuracy. performs a predetermined transformation on the data passing through
Further comprising a second data conversion means provided at an end point of the communication path on the low-precision arithmetic processing means side,
In the first data conversion means and the second data conversion means, the data transferred between the arithmetic processing means of the connection destination is data that can be handled by the arithmetic processing means of the connection destination, and the communication path is The communication path and the Performs a predetermined conversion on the data passing between it and the arithmetic processing means of the connection destination
A data processing device characterized by:
前記第1のデータ変換手段および前記第2のデータ変換手段は、前記接続先の演算処理手段から相手先の演算処理手段に渡されるデータを前記接続先の演算処理手段で扱えるデータのままで受け付け、受け付けた前記データを前記第3の精度のデータに変換する
請求項1に記載のデータ処理装置。 The first data conversion means and the second data conversion means convert data passed from the communication path from the counterpart arithmetic processing means to the connection destination arithmetic processing means to a predetermined precision lower than the first accuracy. and converting the received data of the third precision into data of precision that can be handled by the arithmetic processing means of the connection destination,
The first data conversion means and the second data conversion means accept data transferred from the arithmetic processing means of the connection destination to the arithmetic processing means of the other party as data that can be handled by the arithmetic processing means of the connection destination. , converting the received data into data of the third accuracy .
前記第1のデータ変換手段および前記第2のデータ変換手段の少なくともいずれかは、前記通信路から、纏められた前記複数の変換後のデータを受け付け、受け付けた前記複数の変換後のデータを分解した上で、分解後の各データに対して、接続先の演算処理手段で扱える精度のデータへの変換を行う
請求項1または請求項2に記載のデータ処理装置。 At least one of the first data conversion means and the second data conversion means collectively sends a plurality of converted data when sending the converted data to the communication path,
At least one of the first data conversion means and the second data conversion means receives from the communication path the plurality of converted data that have been put together, and decomposes the received plurality of converted data. 3. The data processing apparatus according to claim 1 , further comprising converting each piece of decomposed data into data with a precision that can be handled by the arithmetic processing means of the connection destination.
請求項1から請求項3のうちのいずれかに記載のデータ処理装置。 4. The data processing apparatus according to any one of claims 1 to 3 , wherein conversions performed by said first data conversion means and said second data conversion means are predetermined and fixed.
学習用データが入力されると、前記判別モデルの各ユニットの出力を所定の順番で計算する推論処理と、前記推論処理の結果に基づいて、前記各ユニットの出力の計算に用いられるパラメタの少なくとも一部を更新するパラメタ更新処理とを行う学習手段を備え、
前記学習手段は、
前記低精度演算処理手段として、前記推論処理において行われる演算のうちの指定された演算を、第1の演算精度で実施する高効率推論手段と、
前記高精度演算処理手段として、前記パラメタ更新処理において行われる演算のうちの指定された演算を、前記第1の演算精度よりも高い第2の演算精度で実施する高精度パラメタ更新手段とを含む
請求項1から請求項4のうちのいずれかに記載のデータ処理装置。 The data processing device is a learning device that learns a predetermined discriminant model composed of two or more units connected in layers,
When learning data is input, inference processing for calculating the output of each unit of the discriminant model in a predetermined order; A learning means for performing parameter update processing for partially updating,
The learning means is
high-efficiency inference means for performing, as the low-precision arithmetic processing means, a specified arithmetic operation among the arithmetic operations performed in the inference processing with a first arithmetic precision;
high-precision parameter update means for performing a specified calculation among the calculations performed in the parameter update process with a second calculation precision higher than the first calculation precision, as the high-precision calculation processing means. 5. A data processing apparatus according to any one of claims 1 to 4 .
前記第1の精度よりも高い第2の精度で所定の演算を行う高精度演算回路と、
前記高精度演算回路と前記低精度演算回路との間でデータの受け渡しを行うための通信路の前記高精度演算回路側の端点に設けられ、前記通信路と前記高精度演算回路との間を通るデータに対して、予め定められた変換を行う第1のデータ変換回路とを備え、
前記第1のデータ変換回路と接続先の前記高精度演算回路との間で受け渡されるデータが前記高精度演算回路が扱うデータであり、
前記通信路の前記低精度演算回路側の端点に設けられ、前記通信路と前記低精度演算回路との間を通るデータに対して、予め定められた変換を行う第2のデータ変換回路をさらに備え、
前記第2のデータ変換回路と接続先の前記低精度演算回路との間で受け渡されるデータが前記低精度演算回路が扱うデータであり、
前記通信路を通るデータ量が、前記第1の精度のデータを使用した場合のデータ量より少なく、かつ当該通信路を通るデータの精度が前記第1の精度よりも低い
ことを特徴とするデータ処理回路。 a low-precision arithmetic circuit that performs a predetermined arithmetic operation with a first precision;
a high-precision arithmetic circuit that performs a predetermined arithmetic operation with a second precision higher than the first precision;
provided at an end point on the high-precision arithmetic circuit side of a communication path for exchanging data between the high-precision arithmetic circuit and the low-precision arithmetic circuit, and connecting between the communication path and the high-precision arithmetic circuit a first data conversion circuit that performs a predetermined conversion on passing data,
Data transferred between the first data conversion circuit and the high-precision arithmetic circuit to which it is connected is data handled by the high-precision arithmetic circuit,
a second data conversion circuit provided at an end point of the communication path on the low-precision arithmetic circuit side and performing predetermined conversion on data passing between the communication path and the low-precision arithmetic circuit; prepared,
Data transferred between the second data conversion circuit and the low-precision arithmetic circuit to which it is connected is data handled by the low-precision arithmetic circuit,
The amount of data passing through the communication channel is less than the amount of data when using the data with the first accuracy, and the accuracy of the data passing through the communication channel is lower than the first accuracy.
A data processing circuit characterized by:
接続先の前記高精度演算処理手段との間で受け渡されるデータが前記高精度演算処理手段で扱えるデータであるとともに、前記通信路を通るデータ量が、前記第1の精度のデータを使用した場合のデータ量以下となり、かつ前記通信路を通るデータの精度が前記第1の精度以下となるように、前記通信路と前記高精度演算処理手段との間を通るデータに対して所定の変換を行い、
前記第1のデータ変換手段が、接続先の前記高精度演算処理手段との間で受け渡されるデータが前記高精度演算処理手段で扱えるデータであるとともに、前記通信路を通るデータ量が、前記第1の精度のデータを使用した場合のデータ量より少なく、かつ前記通信路を通るデータの精度が前記第1の精度より低くなるように、前記通信路と前記高精度演算処理手段との間を通るデータに対して所定の変換を行い、
前記通信路の前記低精度演算処理手段側の端点に設けられる第2のデータ変換手段が、接続先の前記低精度演算処理手段との間で受け渡されるデータが前記低精度演算処理手段で扱えるデータであるとともに、前記通信路を通るデータ量が、前記第1の精度のデータを使用した場合のデータ量より少なく、かつ前記通信路を通るデータの精度が前記第1の精度より低くなるように、前記通信路と前記低精度演算処理手段との間を通るデータに対して所定の変換を行う
ことを特徴とするデータ処理方法。 To exchange data between low-precision arithmetic processing means for performing predetermined arithmetic operations with a first precision and high-precision arithmetic processing means for performing predetermined arithmetic operations with a second precision higher than the first precision. A first data conversion means provided at an end point of the communication path on the side of the high-precision arithmetic processing means,
The data transferred between the high-precision arithmetic processing means of the connection destination is data that can be handled by the high-precision arithmetic processing means, and the amount of data passing through the communication path uses the data of the first precision. data passing between the communication channel and the high-precision arithmetic processing means so that the amount of data passing through the communication channel is less than or equal to the first precision, and the accuracy of the data passing through the communication channel is less than or equal to the first precision and
In the first data conversion means, the data transferred between the high-precision arithmetic processing means of the connection destination is data that can be handled by the high-precision arithmetic processing means, and the amount of data passing through the communication path is between the communication path and the high-precision arithmetic processing means so that the amount of data is less than the amount of data when data with the first accuracy is used, and the accuracy of the data passing through the communication path is lower than the first accuracy. performs a predetermined transformation on the data passing through
The second data conversion means provided at the end point of the communication path on the low-precision arithmetic processing means side can handle the data transferred between the low-accuracy arithmetic processing means to which it is connected and the low-accuracy arithmetic processing means. data, the amount of data passing through the communication path is less than the amount of data when using data with the first accuracy, and the accuracy of the data passing through the communication path is lower than the first accuracy. and performing a predetermined conversion on the data passing between the communication path and the low-precision arithmetic processing means
A data processing method characterized by:
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2018/025773 WO2020008643A1 (en) | 2018-07-06 | 2018-07-06 | Data processing device, data processing circuit, and data processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPWO2020008643A1 JPWO2020008643A1 (en) | 2021-03-11 |
JP7120308B2 true JP7120308B2 (en) | 2022-08-17 |
Family
ID=69060857
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020528664A Active JP7120308B2 (en) | 2018-07-06 | 2018-07-06 | DATA PROCESSING DEVICE, DATA PROCESSING CIRCUIT AND DATA PROCESSING METHOD |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP7120308B2 (en) |
WO (1) | WO2020008643A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20210377122A1 (en) * | 2020-05-26 | 2021-12-02 | Synopsys, Inc. | Mixed-precision neural networks |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002008060A (en) | 2000-06-23 | 2002-01-11 | Hitachi Ltd | Data processing method, recording medium and data processing device |
JP2002517038A (en) | 1998-05-27 | 2002-06-11 | エイアールエム リミテッド | Recirculation register file |
JP2018010618A (en) | 2016-05-03 | 2018-01-18 | イマジネイション テクノロジーズ リミテッド | Convolutional neural network hardware configuration |
-
2018
- 2018-07-06 JP JP2020528664A patent/JP7120308B2/en active Active
- 2018-07-06 WO PCT/JP2018/025773 patent/WO2020008643A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002517038A (en) | 1998-05-27 | 2002-06-11 | エイアールエム リミテッド | Recirculation register file |
JP2002008060A (en) | 2000-06-23 | 2002-01-11 | Hitachi Ltd | Data processing method, recording medium and data processing device |
JP2018010618A (en) | 2016-05-03 | 2018-01-18 | イマジネイション テクノロジーズ リミテッド | Convolutional neural network hardware configuration |
Non-Patent Citations (1)
Title |
---|
LIN, Darryl D., et al.,Fixed Point Quantization of Deep Convolutional Networks [online],arXiv,米国,arXiv,2016年06月02日,[retrieved on 2018.8.31], インターネット<URL: https://arxiv.org/abs/1511.06393v3> |
Also Published As
Publication number | Publication date |
---|---|
WO2020008643A1 (en) | 2020-01-09 |
JPWO2020008643A1 (en) | 2021-03-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107729989B (en) | Device and method for executing artificial neural network forward operation | |
CN110263925B (en) | Hardware acceleration implementation device for convolutional neural network forward prediction based on FPGA | |
CN107301456B (en) | Deep neural network multi-core acceleration implementation method based on vector processor | |
CN110543939B (en) | Hardware acceleration realization device for convolutional neural network backward training based on FPGA | |
US20210357735A1 (en) | Split accumulator for convolutional neural network accelerator | |
US20210064985A1 (en) | Machine learning hardware having reduced precision parameter components for efficient parameter update | |
US20220164663A1 (en) | Activation Compression Method for Deep Learning Acceleration | |
Bao et al. | LSFQ: A low precision full integer quantization for high-performance FPGA-based CNN acceleration | |
JP7120308B2 (en) | DATA PROCESSING DEVICE, DATA PROCESSING CIRCUIT AND DATA PROCESSING METHOD | |
TW202020654A (en) | Digital circuit with compressed carry | |
US20210374509A1 (en) | Modulo Operation Unit | |
Lu et al. | A reconfigurable DNN training accelerator on FPGA | |
JP7044160B2 (en) | Learning equipment, learning circuits, learning methods and learning programs | |
Jadhav et al. | A novel high speed FPGA architecture for FIR filter design | |
CN115357854A (en) | Efficient matrix multiplication operation accelerating device and method | |
AU2020395435B2 (en) | Flexible precision neural inference processing units | |
Shao et al. | An FPGA-based reconfigurable accelerator for low-bit DNN training | |
Khalil | FPGA implementation of artificial neurons: Comparison study | |
Su et al. | Processing element architecture design for deep reinforcement learning with flexible block floating point exploiting signal statistics | |
CN112633500A (en) | Multi-objective optimization evolutionary computation method of convolutional neural network proxy model based on decomposition idea | |
US20230409285A1 (en) | Multi-dimensional logarithmic number system processor for inner product computations | |
Strizic et al. | Deep Learning Accelerator on Programmable Heterogeneous System with RISC-V Processor | |
US20240094986A1 (en) | Method and apparatus for matrix computation using data conversion in a compute accelerator | |
US20240134930A1 (en) | Method and apparatus for neural network weight block compression in a compute accelerator | |
CN114723032B (en) | Long-short term memory neural network hardware acceleration method and computing system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200918 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210907 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20211018 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20220308 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220418 |
|
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: 20220705 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20220718 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 7120308 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |