JP7253468B2 - Neural network processor, neural network processing method, and program - Google Patents
Neural network processor, neural network processing method, and program Download PDFInfo
- Publication number
- JP7253468B2 JP7253468B2 JP2019137468A JP2019137468A JP7253468B2 JP 7253468 B2 JP7253468 B2 JP 7253468B2 JP 2019137468 A JP2019137468 A JP 2019137468A JP 2019137468 A JP2019137468 A JP 2019137468A JP 7253468 B2 JP7253468 B2 JP 7253468B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- processing
- neural network
- layer
- feature extraction
- 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 OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/06—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
- G06N3/063—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Algebra (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Neurology (AREA)
- Complex Calculations (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Description
本発明は、ニューラルネットワークの技術に関する。 The present invention relates to neural network technology.
近年、ニューラルネットワーク技術の1つである、CNN(Convolutional Neural Network)を用いた多様な技術が開発されている(例えば、特許文献1を参照)。CNNの中でも、中間層を多く設けたDCNN(Deep Convolutional Neural Network)を用いた技術が、多様な分野で成果を上げているため、特に注目を集めている。 In recent years, various techniques using CNN (Convolutional Neural Network), which is one of neural network techniques, have been developed (see, for example, Patent Document 1). Among CNNs, a technique using a DCNN (Deep Convolutional Neural Network) with many intermediate layers is attracting particular attention because it has achieved results in various fields.
DCNNは、一般物体認識やセマンティックセグメンテーション等の様々なタスクにおいて高い認識性能を実現している。その一方で、DCNNは、処理を実行するために必要なパラメータ数が非常に多いため、DCNNをハードウェアにより実現する場合、そのハードウェア規模が大きくなる。特に、パラメータ(例えば、重み係数のデータ)を記憶保持するためのメモリを実装するためのハードウェア規模が大きくなるため、DCNNをハードウェアにより実現する場合のコストを低減させることが困難である。 DCNN achieves high recognition performance in various tasks such as general object recognition and semantic segmentation. On the other hand, the DCNN requires an extremely large number of parameters to execute processing, and therefore the hardware scale becomes large when the DCNN is implemented by hardware. In particular, the scale of hardware for implementing a memory for storing and holding parameters (e.g., data of weighting coefficients) increases, making it difficult to reduce the cost of implementing a DCNN in hardware.
そこで、本発明は、上記課題に鑑み、ハードウェア規模の増大を抑えつつ、高性能なニューラルネットワーク処理を実行するニューラルネットワーク用プロセッサ、ニューラルネットワーク用データ処理方法、および、プログラムを実現することを目的とする。 Therefore, in view of the above problems, it is an object of the present invention to realize a neural network processor, a neural network data processing method, and a program that execute high-performance neural network processing while suppressing an increase in hardware scale. and
上記課題を解決するために、第1の発明は、特徴抽出層の処理と判定層の処理とを含むニューラルネットワーク用処理を実行するためのニューラルネットワーク用プロセッサであって、読み出し専用メモリと、ランダムアクセスメモリと、制御部と、内積処理部と、を備える。 In order to solve the above problems, a first invention is a neural network processor for executing neural network processing including feature extraction layer processing and determination layer processing, comprising: a read-only memory; An access memory, a control unit, and an inner product processing unit are provided.
読み出し専用メモリは、特徴抽出層の処理用のデータを記憶保持する。 The read-only memory stores data for processing of the feature extraction layer.
ランダムアクセスメモリは、データの読み出し、および、データ書き込みを行うことができ、判定層の処理用のデータを記憶保持する。 The random access memory can read and write data, and stores and holds data for the processing of the decision layer.
制御部は、読み出し専用メモリと、ランダムアクセスメモリとを制御する。 The controller controls the read-only memory and the random access memory.
内積処理部は、読み出し専用メモリから特徴抽出層の処理用のデータを第1データとして読み出し、第1データを用いて、特徴抽出層の処理を実行するとともに、ランダムアクセスメモリから判定層の処理用のデータを第2データとして読み出し、第2データを用いて、判定層の処理を実行する。 The inner product processing unit reads data for processing the feature extraction layer from the read-only memory as the first data, executes processing of the feature extraction layer using the first data, and reads data for processing the determination layer from the random access memory. is read out as the second data, and the second data is used to execute the processing of the decision layer.
このニューラルネットワーク用プロセッサでは、ニューラルネットワークのモデルを決定したら確定する特徴抽出層の処理用データ(例えば、重み係数データ)を、ハードウェア化したときのハード規模が小さくてすむ読み出し専用メモリ(ROM)に書き込み、データが変更される可能性のある判定層の処理用データ(例えば、重み係数データ)を、データ書き換えができるランダムアクセスメモリ(RAM)に保持する。そして、このニューラルネットワーク用プロセッサでは、上記の状態により、ニューラルネットワークによる処理を実行する。つまり、このニューラルネットワーク用プロセッサでは、変更されることがない特徴抽出層の処理用データ(例えば、重み係数データ)を、ハードウェア規模が小さくてすむ読み出し専用メモリで保持し、変更する可能性がある判定層の処理用データ(例えば、重み係数データ)をランダムアクセスメモリで保持して、ニューラルネットワーク用処理を実行するので、ハードウェア規模の増大を抑えつつ、高性能なニューラルネットワーク処理を実行することができる。 In this neural network processor, the processing data (e.g., weighting coefficient data) of the feature extraction layer, which is determined once the neural network model is determined, is implemented as hardware in a read-only memory (ROM) that requires a small hardware scale. , and data for processing of the decision layer (for example, weighting coefficient data) whose data may be changed is held in a rewritable random access memory (RAM). Then, in this neural network processor, processing by the neural network is executed according to the above state. In other words, in this neural network processor, processing data (for example, weighting coefficient data) of the feature extraction layer, which is not changed, is held in a read-only memory that requires a small hardware scale, and it is possible to change it. Processing data (e.g., weight coefficient data) for a certain decision layer is held in random access memory and neural network processing is executed, so high-performance neural network processing can be executed while suppressing an increase in hardware scale. be able to.
第2の発明は、第1の発明であって、読み出し専用メモリは、特徴抽出層の処理用のデータの読み出し時間を特定するためのデータを含むヘッダデータと、特徴抽出層の処理を実行するときに必要となる順番に、特徴抽出層の処理用のデータとを出力できるように、特徴抽出層の処理用のデータを記憶保持している。 A second invention is the first invention, wherein the read-only memory executes the processing of the feature extraction layer and header data including data for specifying the read time of the data for the processing of the feature extraction layer. The data for processing the feature extraction layer is stored and held so that the data for processing the feature extraction layer can be output in order of necessity.
そして、制御部が読み出し専用メモリに対して、読み出し指令信号を出力した場合、読み出し専用メモリは、特徴抽出層の処理用のデータを、特徴抽出層の処理を実行するときに必要となる順番に出力する。 Then, when the control unit outputs a read command signal to the read-only memory, the read-only memory stores the data for the processing of the feature extraction layer in the order required when executing the processing of the feature extraction layer. Output.
このニューラルネットワーク用プロセッサでは、特徴抽出層のネットワーク構成にしたがって確定する重み係数データを、予測処理を実行するときに必要となる順番に(予測処理のときの処理順に)読み出されるように、読み出し専用メモリに記憶している。したがって、このニューラルネットワーク用プロセッサでは、予測処理実行時において、読み出し指令信号(例えば、単発のトリガー信号)を読み出し専用メモリに入力するだけで、内積処理部は、予測処理を実行するときに必要となる順番に、特徴抽出層の処理のための重み係数データを取得することができる。つまり、このニューラルネットワーク用プロセッサでは、読み出し指令信号(例えば、単発のトリガー信号)を読み出し専用メモリに入力するだけで、必要な特徴抽出層の処理のための重み係数データが、処理順に取得できるため、従来技術のように、ROMに対する複雑なアドレス指定を行う必要がない。 In this neural network processor, the weighting coefficient data determined according to the network configuration of the feature extraction layer are read out in the order required when executing the prediction processing (in the processing order during the prediction processing). stored in memory. Therefore, in this neural network processor, when executing prediction processing, only a read command signal (for example, a single-shot trigger signal) is input to the read-only memory, and the inner product processing unit does not need to execute prediction processing. Weighting factor data for processing the feature extraction layer can be obtained in the order of In other words, in this neural network processor, simply by inputting a readout command signal (for example, a single trigger signal) into the read-only memory, the necessary weighting coefficient data for processing the feature extraction layers can be obtained in the order of processing. , there is no need to perform complex addressing for the ROM as in the prior art.
第3の発明は、第2の発明であって、制御部は、読み出し専用メモリに記憶されているヘッダデータを読み出し、当該ヘッダデータに基づいて、読み出し専用メモリから、特徴抽出層の処理用のデータの出力処理が完了する時刻を特定し、特定した時刻よりも前の時刻において、判定層の処理用のデータがランダムアクセスメモリに記憶保持されている状態となるように制御する。 A third invention is the second invention, wherein the control unit reads the header data stored in the read-only memory, and based on the header data, reads the header data for the processing of the feature extraction layer from the read-only memory. The time at which the data output processing is completed is specified, and control is performed so that the data for the processing of the decision layer is stored and retained in the random access memory at a time before the specified time.
このニューラルネットワーク用プロセッサでは、読み出し専用メモリに記憶されているヘッダデータにより、特徴抽出層の処理用のデータ(例えば、重み係数データ)を読み出す時間を特定することができる。したがって、このニューラルネットワーク用プロセッサでは、特定した特徴抽出層の処理用のデータ(例えば、重み係数データ)を読み出す時間に基づいて、判定層の処理用のデータ(重み係数データ)を、例えば、所定のROMからランダムアクセスメモリに予め転送しておくことができる。これにより、このニューラルネットワーク用プロセッサでは、特徴抽出層の処理が完了すると、すぐに、判定層の処理用のデータ(例えば、重み係数データ)をランダムアクセスメモリから取得できる(読み出すことができる)状態にすることができる。つまり、このニューラルネットワーク用プロセッサでは、特徴抽出層の処理が完了すると、すぐに、判定層の処理が実行できる状態にできる。その結果、このニューラルネットワーク用プロセッサでは、ニューラルネットワーク用処理を高速化することができる(判定層の処理が完了するまでの時間を短くすることができる)。 In this neural network processor, the header data stored in the read-only memory can specify the time to read the data (for example, weighting coefficient data) for the processing of the feature extraction layer. Therefore, in this neural network processor, the data for processing of the determination layer (weighting factor data) is read out based on the specified time for reading out the data for processing of the feature extraction layer (for example, weighting factor data). can be previously transferred from the ROM to the random access memory. As a result, in this neural network processor, as soon as processing of the feature extraction layer is completed, data for processing of the judgment layer (for example, weight coefficient data) can be acquired (read out) from the random access memory. can be That is, in this neural network processor, as soon as the processing of the feature extraction layer is completed, the processing of the determination layer can be executed. As a result, this neural network processor can speed up the processing for the neural network (the time until the processing of the decision layer is completed can be shortened).
第4の発明は、第1から第3のいずれかの発明であって、圧縮されたデータに対して伸張処理を実行する伸張部をさらに備える。 A fourth invention is the invention according to any one of the first to third inventions, further comprising a decompression unit that decompresses the compressed data.
読み出し専用メモリは、特徴抽出層の処理用のデータを圧縮されたデータとして記憶保持している。 The read-only memory stores data for processing of the feature extraction layer as compressed data.
伸張部は、読み出しメモリに記憶保持されている圧縮されたデータに対して伸張処理を実行する。 The decompression unit decompresses the compressed data stored in the read memory.
内積処理部は、伸張部により伸張されたデータを用いて、特徴抽出層の処理を実行する。 The inner product processing unit uses the data decompressed by the decompression unit to process the feature extraction layer.
このニューラルネットワーク用プロセッサでは、特徴抽出層のデータを、圧縮したデータとして、読み出し専用メモリに記憶保持するため、さらに、読み出し専用メモリで必要となるメモリ容量が少なくなる。したがって、このニューラルネットワーク用プロセッサでは、読み出し専用メモリのハードウェア規模をさらに小さくすることができる。その結果、このニューラルネットワーク用プロセッサのハードウェア規模を、さらに小さくできる。 In this neural network processor, the data of the feature extraction layer is stored in the read-only memory as compressed data, so the memory capacity required for the read-only memory is further reduced. Therefore, in this neural network processor, the hardware scale of the read-only memory can be further reduced. As a result, the hardware scale of this neural network processor can be further reduced.
第5の発明は、特徴抽出層の処理と判定層の処理とを含むニューラルネットワーク用処理を実行するためのニューラルネットワーク用プロセッサであって、
特徴抽出層の処理用のデータを記憶保持する読み出し専用メモリと、
データの読み出し、および、データ書き込みを行うことができ、判定層の処理用のデータを記憶保持するランダムアクセスメモリと、
読み出し専用メモリと、ランダムアクセスメモリとを制御する制御部と、
を備えるニューラルネットワーク用プロセッサを用いて実行するニューラルネットワーク用処理方法である。ニューラルネットワーク用処理方法は、第1ステップと、第2ステップとを備える。
A fifth invention is a neural network processor for executing neural network processing including feature extraction layer processing and determination layer processing,
a read-only memory that stores and retains data for processing of the feature extraction layer;
a random access memory capable of reading and writing data and storing and holding data for processing of the decision layer;
a control unit that controls the read-only memory and the random access memory;
is a neural network processing method executed using a neural network processor comprising A neural network processing method includes a first step and a second step.
第1ステップは、読み出し専用メモリから特徴抽出層の処理用のデータを第1データとして読み出し、第1データを用いて、特徴抽出層の処理を実行する。 A first step reads data for processing the feature extraction layer from the read-only memory as the first data, and executes the processing of the feature extraction layer using the first data.
第2ステップは、ランダムアクセスメモリから判定層の処理用のデータを第2データとして読み出し、第2データを用いて、判定層の処理を実行する。 A second step reads out data for the processing of the decision layer from the random access memory as the second data, and executes the processing of the decision layer using the second data.
これにより、第1の発明と同様の効果を奏するニューラルネットワーク用処理方法を実現することができる。 As a result, it is possible to realize a neural network processing method that has the same effect as the first invention.
第6の発明は、第5の発明であるニューラルネットワーク用処理方法をコンピュータに実行させるためのプログラムである。 A sixth invention is a program for causing a computer to execute the neural network processing method of the fifth invention.
これにより、第1の発明と同様の効果を奏するニューラルネットワーク用処理方法をコンピュータに実行させるためのプログラムを実現することができる。 Thus, it is possible to realize a program for causing a computer to execute the neural network processing method that has the same effect as the first invention.
本発明によれば、ハードウェア規模の増大を抑えつつ、高性能なニューラルネットワーク処理を実行するニューラルネットワーク用プロセッサ、ニューラルネットワーク用データ処理方法、および、プログラムを実現することができる。 According to the present invention, it is possible to realize a neural network processor, a neural network data processing method, and a program that perform high-performance neural network processing while suppressing an increase in hardware scale.
[第1実施形態]
第1実施形態について、図面を参照しながら、以下、説明する。
[First embodiment]
A first embodiment will be described below with reference to the drawings.
<1.1:ニューラルネットワーク用プロセッサの構成>
図1は、第1実施形態に係るニューラルネットワーク用プロセッサ100の概略構成図である。
<1.1: Configuration of Neural Network Processor>
FIG. 1 is a schematic configuration diagram of a
ニューラルネットワーク用プロセッサ100は、図1に示すように、第1インターフェース部IF1と、制御部1と、第1ROM(Read Only Memory)2と、第2ROM3と、量子化処理部4と、第1RAM(Random Access Memory)5と、第2RAM6と、内積処理部7と、バスB1とを備える。図1に示すように、ニューラルネットワーク用プロセッサ100の各機能部は、バスB1により接続されており、必要なデータ、コマンド等を、バスB1を介して、入出力することができる。なお、上記機能部の一部または全部は、バス接続ではなく、必要に応じて、直接接続されるものであってもよい。
As shown in FIG. 1, the
第1インターフェース部IF1は、外部から処理対象となるデータDinを入力し、ニューラルネットワーク用プロセッサ100による処理結果を含むデータをデータDoutとして外部に出力する。第1インターフェース部IF1は、入力したデータDinを、バスB1を介して、第1RAM5に出力し(書き込み)、ニューラルネットワーク用プロセッサ100による処理結果を含むデータを、バスB1を介して、第1RAM5から取得する(読み出す)。
The first interface unit IF1 inputs data Din to be processed from the outside, and outputs data including the result of processing by the
制御部1は、ニューラルネットワーク用プロセッサ100の全体制御、各機能部の制御およびニューラルネットワーク用処理に必要な処理を行う。制御部CPU1は、CPU(Central Processing Unit)やCPUコアにより実現される。
The
第1ROM2は、読み出し専用メモリであって、特徴抽出層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を記憶保持する。第1ROM2は、図1に示すように、バスB1に接続されており、また、内積処理部7に接続されている。なお、第1ROM2は、バスB1を介して、内積処理部7に接続されるものであってもよい。第1ROM2は、制御部1からのトリガー信号Sig_trgを受信すると、例えば、ヘッダデータを、バスB1を介して、制御部1に出力するともに、ヘッダデータおよび特徴抽出層の処理に用いられるデータを内積処理部7に連続的に出力する。
The
第2ROM3は、読み出し専用メモリであって、バスB1に接続されている。第2ROM3は、判定層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を記憶保持する。第2ROM3は、制御部1からの指令に従い、判定層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を、バスB1を介して、第2RAM6に転送する。
A
量子化処理部4は、第1RAMとデータの送受信ができるように接続されている。量子化処理部4は、特徴抽出層(例えば、DCNN(Deep Convolution Neural Network)の畳み込み層)の入力である特徴マップのデータに対して、量子化処理を行う。また、量子化処理部4は、判定層(例えば、DCNNの全結合層)の入力データに対して、量子化処理を行う。なお、量子化処理部4は、量子化処理の対象のデータを、第1RAM5の所定の領域から読み出し、量子化処理後のデータを、第1RAM5の所定の領域に書き込む。また、量子化処理部4は、図1に示すように、第1RAM5と直接接続されるものであってもよいし、バス(例えば、バスB1)を介して接続されるものであってもよい。
The
第1RAM5は、ニューラルネットワーク用処理を実行するために必要なデータを記憶保持するためのRAM(Random Access Memory)である。第1RAM5は、図1に示すように、バスB1に接続されており、また、量子化処理部4と接続されている。
The
第2RAM6は、ランダムアクセスメモリである。第2RAM6は、図1に示すように、バスB1に接続されており、また、内積処理部7に接続されている。第2RAM6は、第2ROM3から転送される、判定層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を記憶保持する。第2RAM6は、制御部1からの指令に従い、所定のタイミングで、記憶保持している判定層の処理に用いられるデータを内積処理部7に出力する。
The
内積処理部7は、図1に示すように、第2インターフェース部71と、内積演算処理部72とを備える。内積処理部7は、図1に示すように、第1ROM2、第1RAM5、第2RAM6、および、バスB1に接続されている。内積処理部7は、制御部1から、例えば、バスB1を介して、制御信号Ctr1を受信し、受信した制御信号Ctr1に従い、所定の処理を実行する。
The inner
第2インターフェース部71は、第1ROM2、第1RAM5、第2RAM6とのインターフェースである。
(1)特徴抽出層の処理が実行される場合、第2インターフェース部71は、第1ROM2から、特徴抽出層の処理用のデータ(例えば、パラメータ、重み係数)D_wij_featureを読み出し、読み出したデータを、データD_wijとして、内積演算処理部72に出力する。また、第2インターフェース部71は、第1RAM5の所定の領域から、量子化処理後のデータD_Qinを読み出し、読み出したデータを、データD_Qinとして、内積演算処理部72に出力する。
(2)判定層の処理が実行される場合、第2インターフェース部71は、第2RAM6から、判定層の処理用のデータ(例えば、パラメータ、重み係数)D_wij_deciを読み出し、読み出したデータを、データD_wijとして、内積演算処理部72に出力する。また、第2インターフェース部71は、第1RAM5の所定の領域から、量子化処理後のデータD_Qinを読み出し、読み出したデータを、データD_Qinとして、内積演算処理部72に出力する。
The
(1) When the processing of the feature extraction layer is executed, the
(2) When the process of the judgment layer is executed, the
内積演算処理部72は、第2インターフェース部71から出力されるデータD_Qin、および、データD_wijを入力する。内積演算処理部72は、データD_Qin、および、データD_wijを用いて、内積演算処理を実行し、内積演算処理結果のデータをデータDoとして取得する。そして、内積演算処理部72は、取得したデータDoを第1RAM5に出力する。
The inner product
<1.2:ニューラルネットワーク用プロセッサの動作>
以上のように構成されたニューラルネットワーク用プロセッサ100の動作について、以下、説明する。
<1.2: Operation of Neural Network Processor>
The operation of the
図2は、ニューラルネットワーク用プロセッサ100で実行される処理のタイミングチャートである。
FIG. 2 is a timing chart of processing executed by the
図3は、ニューラルネットワーク用プロセッサ100で実行される処理のフローチャートである。
FIG. 3 is a flow chart of processing executed by the
以下では、図1~図3を参照しながら、ニューラルネットワーク用プロセッサ100の動作について、説明する。
The operation of the
一般に、CNNでは、入力層と、畳み込み層(コンボリューション層)と、全結合層とを含む。例えば、ニューラルネットワーク用プロセッサ100の第1インターフェース部IF1に、入力データDinとして、画像データが入力され、CNNによる画像認識処理が実行され、画像認識処理結果が出力データDoutとして外部に出力される。
In general, a CNN includes an input layer, a convolution layer, and a fully connected layer. For example, image data is input as input data Din to the first interface unit IF1 of the
CNNでは、畳み込み層の処理、あるいは、全結合層の処理において、入力データに対して重み演算処理が実行され、当該処理結果に対して活性化関数(例えば、ランプ関数(ReLU:Rectified Linear Unit)、シグモイド関数、Softmax関数等)により処理が実行されることで、畳み込み層あるいは全結合層の出力が得られる。 In CNN, in the processing of the convolutional layer or the processing of the fully connected layer, weighting operation processing is performed on the input data, and an activation function (for example, a ramp function (ReLU: Rectified Linear Unit) is applied to the processing result. , sigmoid function, Softmax function, etc.) to obtain the output of the convolutional layer or the fully connected layer.
説明便宜のため、ニューラルネットワーク用プロセッサ100において、CNNによる処理が実行される場合(一例)について、以下説明する。なお、CNNの畳み込み層がN層(N:自然数)からなるものとして、以下、説明する。
For convenience of explanation, a case (one example) where CNN processing is executed in the
(ステップS1):
ステップS1において、ニューラルネットワーク用プロセッサ100において、処理対象となるデータ(例えば、画像認識処理を行う場合、処理対象の画像データ)の入力処理を実行する。具体的には、ニューラルネットワーク用プロセッサ100において、外部から処理対象となるデータDinを第1インターフェース部IF1により取得(入力)する。そして、データDinは、第1インターフェース部IF1から、バスB1を介して、第1RAM5に転送され、データDinは、第1RAM5の所定の領域に記憶保持される。
(Step S1):
In step S1, the
また、ニューラルネットワーク用プロセッサ100では、量子化処理が実行される。具体的には、量子化処理部4は、データDinを、第1RAM5の所定の領域から読み出し、読み出したデータに対して、量子化処理を実行し、量子化後のデータをデータD_Qinとして取得する。そして、量子化処理部4は、取得した量子化後のデータD_Qinを第1RAM5の所定の領域に書き込む。
Further, the
なお、量子化処理は、データを量子化する処理に加えて、例えば、ダイナミックレンジ調整、二値化処理、オフセット調整処理を含むものであってもよい。 Note that the quantization processing may include, for example, dynamic range adjustment, binarization processing, and offset adjustment processing in addition to data quantization processing.
(ステップS2、ステップS3):
ステップS2において、制御部1は、バスB1を介して、第1ROM2に対して、トリガー信号Sig_trigを送信する。
(Step S2, Step S3):
In step S2, the
第1ROM2は、制御部1からのトリガー信号Sig_trigを受信すると、第1ROM2に記憶保持されているヘッダデータD_headを読み出し、当該ヘッダデータD_headを、バスB1を介して、制御部1および内積処理部7の第2インターフェース部71に出力する(ステップS3)。
Upon receiving the trigger signal Sig_trig from the
ヘッダデータD_headには、例えば、特徴抽出層を構成する層の数、各層のデータ長、データ数等のデータが含まれている。 The header data D_head includes, for example, data such as the number of layers constituting the feature extraction layer, the data length of each layer, the number of data, and the like.
(ステップS41~S45):
ステップS41~S45では、特徴抽出層の層ごとの処理が、特徴抽出層の層数分、繰り返し実行される。
(Steps S41 to S45):
In steps S41 to S45, the process for each layer of the feature extraction layer is repeatedly executed for the number of feature extraction layers.
第1ROM2は、ヘッダデータD_headを出力した後、特徴抽出層のデータを、特徴抽出層の第1層のデータから第N層のデータまで、順番に、読み出し、読み出したデータをデータD_wij_featureとして、内積処理部7に出力する(重み係数データ取得処理、ステップS42)。
After outputting the header data D_head, the
具体的には、(1)特徴抽出層の第1層の重み係数データ、(2)特徴抽出層の第2層の重み係数データ、・・・、(N)特徴抽出層の第N層の重み係数データが、上記順番で、第1ROM2から読み出され、データD_wij_featureとして、内積処理部7に出力される。
Specifically, (1) weighting coefficient data of the first layer of the feature extraction layer, (2) weighting coefficient data of the second layer of the feature extraction layer, . The weighting factor data are read from the
ステップS43では、内積演算処理が実行される。具体的には、以下のようにして、内積演算処理が実行される。 In step S43, an inner product calculation process is executed. Specifically, the inner product calculation process is executed as follows.
内積処理部7の第2インターフェース部71は、第1ROM2から出力される特徴抽出層の第1層の重み係数データを、データD_wij_featureとして、取得し、当該データをデータD_wijとして、内積演算処理部72に出力する。
The
また、内積処理部7の第2インターフェース部71は、特徴抽出層の第1層に入力するデータの量子化後のデータを、第1RAM5から読み出し、データD_Qinとして取得する。そして、第2インターフェース部71は、取得したデータD_Qinを内積演算処理部72に出力する。
Further, the
内積演算処理部72は、データD_Qin、および、データD_wijを用いて、内積演算処理を実行する。例えば、データD_Qinがn次元ベクトルデータ(n:自然数)であり、データD_wij(重み係数データ)がn次元ベクトルデータであり、下記のように表現される場合、
D_Qin=[x1 x2 x3 ・・・ xn]
D_wij=[w1 w2 w3 ・・・ wn]
内積演算処理部72は、2つのn次元ベクトルの内積を算出する処理、すなわち、下記数式に相当する処理を実行することで、内積演算結果を取得する。
なお、内積演算処理部72は、行列演算処理を行う場合、上記内積演算処理を繰り返し実行することで、行列演算処理結果を取得する。例えば、内積演算処理部72は、2つの行列A、Bの積(行列の積)を求める演算を行う場合、行列Aのi行目の1行に含まれる要素からなる行ベクトルと、行列Bのj列目の1列に含まれる要素からなる列ベクトルとに対して、上記と同様に内積演算処理を実行することで、行列A、Bの積により取得される行列のi行j列目の要素の値(データ)を取得することができる。
The inner product
D_Qin=[ x1x2x3 ... xn ]
D_wij=[w 1 w 2 w 3 . . . wn ]
The inner product
When performing matrix calculation processing, the inner product
このように処理することで、内積演算処理部72では、任意の行列演算の処理結果を取得することができる。
By processing in this manner, the inner product
内積演算処理部72では、上記のようにして、特徴抽出層の第1層の処理(例えば、CNNのコンボリューション処理(データに対する重み付け加算処理))を実行し、特徴抽出層の第1層の各シナプスの出力に相当するデータを取得する。
In the inner product
なお、内積演算処理部72には、特徴抽出層の第1層の処理の順番に一致した、重み係数データが当該順番の通りに、データD_wijとして入力される。したがって、内積演算処理部72では、当該データD_wijと、それに対応する量子化後のデータ(処理対象のデータ(第1RAM5から読み出したデータ))とに対して、内積演算処理部72に入力される順番に、上記内積演算処理を繰り返し実行することで、特徴抽出層の第1層の各シナプスの出力に相当するデータを取得することができる。
It should be noted that weighting coefficient data matching the order of the processing of the first layer of the feature extraction layer is input as data D_wij to the inner product
内積演算処理部72では、上記処理により、特徴抽出層の第1層の各シナプスの出力に相当するデータ(このデータを「データD0」とする)を取得したら、当該取得したデータに対して、活性化関数による処理を実行し、データDoを取得する。つまり、内積演算処理部72は、
Do=f_act(D0)
f_act():活性化関数(例えば、ReLU関数、Softmax関数、シグモイド関数等)
に相当する処理を実行することで、データDoを取得する。
In the inner product
Do=f_act(D0)
f_act(): activation function (e.g. ReLU function, Softmax function, sigmoid function, etc.)
Data Do is acquired by executing the process corresponding to .
ステップS44において、内積演算処理部72は、上記により取得したデータDoを第1RAM5に出力し、当該データDoを第1RAM5の所定の領域に書き込む。
In step S<b>44 , the inner product
以上のようにして、ニューラルネットワーク用プロセッサ100では、特徴抽出層の第1層の処理が実行される。図2のタイミングチャートでは、時刻t11から時刻t12の間において、第1ROM2から、特徴抽出層の第1層の処理用のデータ(重み係数データ)D_wij_feature(図2では、特徴抽出層の第1層の処理用のデータをデータDf_1st_Lと表記)が、処理順に読み出され、読み出した当該データ(重み係数データ)D_wij_featureと、処理対象の量子化後のデータD_Qinとを用いて、内積演算処理が実行される。そして、ニューラルネットワーク用プロセッサ100では、上記のように、活性化関数に相当する処理が実行されて、データDoが取得される。
As described above, the
そして、ニューラルネットワーク用プロセッサ100では、特徴抽出層の第2層、第3層、・・・、第N層の処理が、上記の第1層の処理と同様に、実行される(ステップS41~S45、図2の時刻t12~t2の間の処理)。
Then, in the
そして、上記処理により取得したデータDo(特徴抽出層の処理により取得したデータ)が、第1RAM5に出力される(書き込まれる)。
Then, the data Do acquired by the above process (data acquired by the process of the feature extraction layer) is output (written) to the
(ステップS51):
ステップS51において、特徴抽出層のデータ読み出し終了時刻を特定する処理が実行される。具体的には、制御部1は、第1ROM2からヘッダデータD_headerを読み出し(図2の時刻t1~t11)、当該ヘッダデータD_headerに含まれるデータから、第1ROM2から内積処理部7に、特徴抽出層の処理用のデータ(重み係数データ)を転送するのに必要な時間T1を算出する。
(Step S51):
In step S51, a process of specifying the data reading end time of the feature extraction layer is executed. Specifically, the
例えば、第1ROM2から取得されるヘッダデータD_headerには、
(1)特徴抽出層に含まれる層の数N(N:自然数)と、
(2)特徴抽出層に含まれる第k層(k:自然数、1≦k≦N)の処理における実数演算に必要な時間と、特徴抽出層に含まれる第k層(k:自然数、1≦k≦N)の処理における実数演算の計算精度と、
(3)特徴抽出層に含まれる第k層(k:自然数、1≦k≦N)の処理における整数演算に必要な時間と、特徴抽出層に含まれる第k層(k:自然数、1≦k≦N)の処理における整数演算の計算精度と、
が含まれる。そして、制御部1は、上記データに基づいて、例えば、下記数式に相当する処理を実行することで、特徴抽出層の処理用のデータ(重み係数データ)を転送するのに必要な時間T1を算出する。
L(k).Real_D_time
=L(k).Real_D_num×L(k).Real_D_accuracy
L(k).Int_D_time
=L(k).Int_D_num×L(k).Int_D_accuracy
L(k).Real_D_time:第k層の実数演算に必要な処理時間
L(k).Int_D_time:第k層の整数演算に必要な処理時間
L(k).Real_D_num:第k層の実数演算対象のデータ数
L(k).Real_D_accuracy:第k層の実数演算の計算精度
L(k).Int_D_num:第k層の整数演算対象のデータ数
L(k).Int_D_accuracy:第k層の整数演算の計算精度
そして、制御部1は、上記により取得した時間T1と、特徴抽出層の処理用のデータ(重み係数データ)の転送が開始される時刻t11とから、特徴抽出層の処理用のデータ(重み係数データ)の転送が完了する時刻t2を、
t2=t11+T1
により算出する。これにより、制御部1は、特徴抽出層の処理用のデータ(重み係数データ)の転送が完了する時刻t2を特定する。
For example, in the header data D_header acquired from the
(1) the number of layers N (N: natural number) included in the feature extraction layer;
(2) The time required for real number calculation in the processing of the k-th layer (k: natural number, 1 ≤ k ≤ N) included in the feature extraction layer, and the k-th layer (k: natural number, 1 ≤ N) included in the feature extraction layer k ≤ N) calculation accuracy of real number arithmetic in the process,
(3) The time required for integer arithmetic in the processing of the k-th layer (k: natural number, 1 ≤ k ≤ N) included in the feature extraction layer, and the k-th layer (k: natural number, 1 ≤ N) included in the feature extraction layer k ≤ N) calculation accuracy of integer arithmetic in the process,
is included. Based on the above data, the
L(k). Real_D_time
=L(k). Real_D_num*L(k). Real_D_accuracy
L(k). Int_D_time
=L(k). Int_D_num*L(k). Int_D_accuracy
L(k). Real_D_time: Processing time required for real number calculation in the k-th layer L(k). Int_D_time: Processing time required for k-th layer integer arithmetic L(k). Real_D_num: Number of real number operation target data in the k-th layer L(k). Real_D_accuracy: Calculation accuracy of real number operation in the k-th layer L(k). Int_D_num: number of data for integer operation in the k-th layer L(k). Int_D_accuracy: Calculation accuracy of k-th layer integer arithmetic Then, from the time T1 obtained above and the time t11 at which the transfer of the data for the processing of the feature extraction layer (weighting coefficient data) is started, the
t2=t11+T1
Calculated by Thereby, the
(ステップS52):
ステップS52において、判定層の重み係数データの転送処理が実行される。具体的には、制御部1は、第2ROM3に記憶保持されている判定層の重み係数データD_wij_deciを第2RAM6に転送するのにかかる時間T2を取得する。そして、制御部1は、時刻t20(=t2-T2)以前の時刻において、第2ROM3に記憶保持されている判定層の重み係数データD_wij_deciを第2RAM6に転送する指令を第2ROM3、第2RAM6に出力し、時刻t20(=t2-T2)以前の時刻において、判定層の重み係数データD_wij_deciのデータ転送処理を開始させる。
(Step S52):
In step S52, a process of transferring the weighting factor data of the determination layer is executed. Specifically, the
これにより、判定層の重み係数データD_wij_deciの第2ROM3から第2RAM6への転送処理を、特徴抽出層のデータ読み出し処理が完了する時刻t2までに完了させることができる。
As a result, the process of transferring the weighting coefficient data D_wij_deci of the determination layer from the
ニューラルネットワーク用プロセッサ100では、このように、特徴抽出層の処理(ステップS41~S45)と、並行に、ステップS51、S52の処理を行うことで、特徴抽出層の処理が完了する時刻t2の直後から、判定層の処理を実行することができる。
In the
(ステップS6、S7):
ステップS6、S7では、判定層の処理が実行される(図2の時刻t2~t3の処理)。
(Steps S6, S7):
In steps S6 and S7, processing of the judgment layer is executed (processing at times t2 to t3 in FIG. 2).
時刻t2(判定層の処理の開始時刻)までに、特徴抽出層の処理が完了しており、かつ、判定層の処理用のデータ(判定層の処理用の重み係数データ)の第2ROM3から第2RAM6へのデータ転送処理が完了している。したがって、ステップS6では、内積処理部7の第2インターフェース部71は、判定層の処理用データ(判定層の処理用の重み係数データ)D_wij_deciを、第2RAM6から取得する(読み出す)。そして、第2インターフェース部71は、取得したデータD_wij_deciを、データD_wijとして、内積演算処理部72に出力する。
By the time t2 (the start time of the processing of the judgment layer), the processing of the feature extraction layer is completed, and the data for the processing of the judgment layer (weight coefficient data for the processing of the judgment layer) is transferred from the
また、内積処理部7の第2インターフェース部71は、判定層に入力するデータの量子化後のデータを、第1RAM5から読み出し、データD_Qinとして取得する。そして、第2インターフェース部71は、取得したデータD_Qinを内積演算処理部72に出力する。
Further, the
内積演算処理部72は、データD_Qin、および、データD_wijを用いて、内積演算処理を実行する。例えば、データD_Qinがn次元ベクトルデータ(n:自然数)であり、データD_wij(重み係数データ)がn次元ベクトルデータであり、下記のように表現される場合、
D_Qin=[x1 x2 x3 ・・・ xn]
D_wij=[w1 w2 w3 ・・・ wn]
内積演算処理部72は、2つのn次元ベクトルの内積を算出する処理、すなわち、下記数式に相当する処理を実行することで、内積演算結果を取得する。
なお、内積演算処理部72は、行列演算処理を行う場合、上記内積演算処理を繰り返し実行することで、行列演算処理結果を取得する。例えば、内積演算処理部72は、2つの行列A、Bの積(行列の積)を求める演算を行う場合、行列Aのi行目の1行に含まれる要素からなる行ベクトルと、行列Bのj列目の1列に含まれる要素からなる列ベクトルとに対して、上記と同様に内積演算処理を実行することで、行列A、Bの積により取得される行列のi行j列目の要素の値(データ)を取得することができる。
The inner product
D_Qin=[ x1x2x3 ... xn ]
D_wij=[w 1 w 2 w 3 . . . wn ]
The inner product
When performing matrix calculation processing, the inner product
このように処理することで、内積演算処理部72では、任意の行列演算の処理結果を取得することができる。
By processing in this manner, the inner product
内積演算処理部72では、上記のようにして、判定層の処理(例えば、データの次元数を調整するためのアウトマッピング処理(Out Maaping)、全結合層の処理(ベクトル内積処理に相当)、Softmax層の処理等)を実行し、判定層の処理の出力結果に相当するデータをデータDoとして取得する。そして、取得したデータDoは、内積演算処理部72から第1RAM5に出力され、当該データDoは、第1RAM5の所定の領域に書き込まれる。
In the inner product
なお、判定層の処理においても、特徴抽出層の処理と同様に、必要に応じて、活性化関数に相当する処理が実行されてもよい。 It should be noted that in the processing of the judgment layer as well, as in the processing of the feature extraction layer, processing corresponding to the activation function may be executed as necessary.
以上の処理により取得された判定層の処理結果のデータは、例えば、第1インターフェース部IF1により、第1RAM5から読み出され、出力データDoutとして、例えば、外部に送信される。
The data of the processing result of the judgment layer acquired by the above processing is read from the
以上のように、ニューラルネットワーク用プロセッサ100では、ニューラルネットワークのモデルを決定したら確定する特徴抽出層の処理用データ(重み係数データ)を、ハードウェア化したときのハード規模が小さくてすむROM(本実施形態の場合、第1ROM2)に書き込み、データが変更される可能性のある判定層の処理用データ(重み係数データ)を、データ書き換えができるRAM(本実施形態の場合、第2RAM6)に保持する。そして、ニューラルネットワーク用プロセッサ100では、上記の状態により、ニューラルネットワークによる処理を実行する。つまり、ニューラルネットワーク用プロセッサ100では、変更されることがない特徴抽出層の処理用データ(重み係数データ)を、ハードウェア規模が小さくてすむROMで保持し、変更する可能性がある判定層の処理用データ(重み係数データ)をRAMで保持して、ニューラルネットワーク用処理を実行するので、ハードウェア規模の増大を抑えつつ、高性能なニューラルネットワーク処理を実行することができる。
As described above, in the
また、ニューラルネットワーク用プロセッサ100では、特徴抽出層のネットワーク構成にしたがって確定する重み係数データを、予測処理を実行するときに必要となる順番に(予測処理のときの処理順に)読み出されるように、ROM(本実施形態では、第1ROM2)に記憶している。したがって、ニューラルネットワーク用プロセッサ100では、予測処理実行時において、単発のトリガー信号(制御部1から第1ROM2に出力されるトリガー信号Sig_trig)を第1ROM2に入力するだけで、内積処理部7は、予測処理を実行するときに必要となる順番に、特徴抽出層の処理のための重み係数データを取得することができる。つまり、ニューラルネットワーク用プロセッサ100では、単発のトリガー信号を第1ROMに入力するだけで、必要な特徴抽出層の処理のための重み係数データが、処理順に取得できるため、従来技術のように、ROMに対する複雑なアドレス指定を行う必要がない。なお、上記実施形態では、単発のトリガー信号により、連続的に、第1ROM2から特徴抽出層の処理に必要なデータが、処理順に、第1ROM2から内積処理部7にデータ転送される場合について、説明したが、これに限定されることはない。例えば、ニューラルネットワーク用プロセッサ100において、第1ROM2の1つのアドレスを指定することで、その後、連続的に、第1ROM2から特徴抽出層の処理に必要なデータが、処理順に、第1ROM2から内積処理部7にデータ転送されるようにしてもよい。
Further, in the
また、ニューラルネットワーク用プロセッサ100では、上記で説明したように、第1ROM2に記憶されているヘッダデータにより、特徴抽出層の処理用のデータ(重み係数データ)を読み出す時間を特定することができる。したがって、ニューラルネットワーク用プロセッサ100では、特定した特徴抽出層の処理用のデータ(重み係数データ)を読み出す時間に基づいて、判定層の処理用のデータ(重み係数データ)を、第2ROM3から第2RAM6に予め転送しておくことができる。これにより、ニューラルネットワーク用プロセッサ100では、特徴抽出層の処理が完了すると、すぐに、判定層の処理用のデータ(重み係数データ)を第2RAM6から取得できる(読み出すことができる)状態にすることができる。つまり、ニューラルネットワーク用プロセッサ100では、特徴抽出層の処理が完了すると、すぐに、判定層の処理が実行できる状態にできる。その結果、ニューラルネットワーク用プロセッサ100では、ニューラルネットワーク用処理を高速化することができる(判定層の処理が完了するまでの時間を短くすることができる)。
Further, in the
なお、上記では、判定層の処理用のデータ(重み係数データ)が第2ROM3に記憶保持されている場合について、説明したが、これに限定されることはなく、判定層の処理用のデータ(重み係数データ)は、外部からニューラルネットワーク用プロセッサ100に入力されるものであってもよい。この場合、ニューラルネットワーク用プロセッサ100では、以下のように処理が実行される。すなわち、判定層の処理用のデータ(重み係数データ)は、データDinとして、外部から第1インターフェース部IF1に入力される。そして、ニューラルネットワーク用プロセッサ100では、上記で説明したのと同様に、特定した特徴抽出層の処理用のデータ(重み係数データ)を読み出す時間に基づいて、判定層の処理用のデータ(重み係数データ)を、第1インターフェース部IF1から第2RAM6に予め転送しておく。これにより、ニューラルネットワーク用プロセッサ100では、ニューラルネットワーク用プロセッサ100では、判定層の処理用のデータ(重み係数データ)が外部から入力される場合においても、特徴抽出層の処理が完了すると、すぐに、判定層の処理用のデータ(重み係数データ)を第2RAM6から取得できる(読み出すことができる)状態にすることができる。
In the above description, the case where the data (weight coefficient data) for the processing of the judgment layer is stored and held in the
つまり、ニューラルネットワーク用プロセッサ100では、判定層の処理用のデータ(重み係数データ)が外部から入力される場合においても、特徴抽出層の処理が完了すると、すぐに、判定層の処理が実行できる状態にできる。その結果、ニューラルネットワーク用プロセッサ100では、ニューラルネットワーク用処理を高速化することができる(判定層の処理が完了するまでの時間を短くすることができる)。
In other words, in the
また、第2RAM6には、判定処理(判定層の処理)に必要なデータのみを記憶保持すれば良いので、第2RAM6のメモリ容量を小さくすることができる。
また、ニューラルネットワーク用プロセッサ100において、
(1)1回目の特徴抽出層の処理(例えば、第1層~第N層の処理)を実行し、
(2)1回目の判定層の処理を実行し、
(3)2回目の特徴抽出層の処理(例えば、第1層~第N層の処理)を実行し、
(4)2回目の判定層の処理を実行する、
場合、上記処理(2)の前に、1回目の判定層の処理の実行に必要なデータが第2RAM6に記憶保持され、上記処理(4)の前に、1回目の判定層の処理の実行に必要なデータが第2RAM6に記憶保持される。
In addition, the memory capacity of the
Further, in the
(1) Execute the first feature extraction layer processing (for example, the processing of the 1st to Nth layers),
(2) Execute the first determination layer process,
(3) Execute the second feature extraction layer processing (for example, the processing of the 1st to Nth layers),
(4) Execute the process of the second decision layer;
In this case, the data necessary for executing the first judgment layer process is stored in the
このとき、第2RAM6において、2回目の判定層の処理(次の判定層の処理)の実行に必要なデータのうち、1回目の判定層の処理の実行に必要なデータと異なるデータのみを更新するようにすればよい。これにより、ニューラルネットワーク用プロセッサ100では、第2RAM6のメモリ容量を小さくすることができるとともに、第2RAM6のデータ転送量(更新するデータの量)を少なくすることができる。
At this time, in the
≪第1変形例≫
次に、第1実施形態の第1変形例について、説明する。なお、上記実施形態と同様の部分については、同一符号を付し、詳細な説明を省略する。
<<First Modification>>
Next, the 1st modification of 1st Embodiment is demonstrated. Parts similar to those of the above-described embodiment are given the same reference numerals, and detailed description thereof is omitted.
図4は、第1実施形態の第1変形例に係るニューラルネットワーク用プロセッサ100Aの概略構成図である。
FIG. 4 is a schematic configuration diagram of a
本変形例のニューラルネットワーク用プロセッサ100Aは、第1実施形態のニューラルネットワーク用プロセッサ100において、伸張部8を追加した構成を有している。それ以外については、本変形例のニューラルネットワーク用プロセッサ100Aは、第1実施形態のニューラルネットワーク用プロセッサ100と同様である。
The
本変形例のニューラルネットワーク用プロセッサ100Aでは、第1ROM2に圧縮されたデータが書き込まれている。
Compressed data is written in the
伸張部8は、第1ROM2に記憶保持されている圧縮データD1を読み出し、当該圧縮データD1に対して伸張処理を実行し、伸張処理後のデータD_wij_featureを取得する。つまり、伸張部8は、上記伸張処理を実行することで、第1実施形態において、第1ROM2から出力されるデータD_wij_featureを取得する。そして、伸張部8は、伸張処理後のデータD_wij_featureを内積処理部7に出力する。
The
ニューラルネットワーク用プロセッサ100Aでは、第1実施形態の第1ROMから出力されるデータD_wij_featureの代わりに、伸張部8から出力されるデータD_wij_featureを用いて、内積処理部7での処理が実行される。内積処理部7での処理は、第1実施形態と同様である。
In the
本変形例のニューラルネットワーク用プロセッサ100Aでは、特徴抽出層のデータを、圧縮したデータとして、第1ROM2に記憶保持するため、第1実施形態に比べて、さらに、第1ROM2で必要となるメモリ容量が少なくなる。したがって、本変形例のニューラルネットワーク用プロセッサ100Aでは、第1ROM2のハードウェア規模をさらに小さくすることができる。その結果、本変形例のニューラルネットワーク用プロセッサ100Aは、第1実施形態のニューラルネットワーク用プロセッサ100に比べて、さらにハードウェア規模を小さくできる。
In the
[他の実施形態]
ニューラルネットワーク用プロセッサ100、100Aの各機能部の一部または全部は、マイクロコードにより、あるいは、マイクロコードとともに所定のハードウェアにより実現されるものであってもよい。
[Other embodiments]
Some or all of the functional units of the
また、ニューラルネットワーク用プロセッサ100、100Aにおいて、下記先行技術文献Aに開示されているように、Binarized-DCNN(DCNN:Deep Convolution Neural Network)(以下、「BNN」という)によるニューラルネットワークを実現するようにしてもよい。この場合、BNNにより実現される特徴抽出層の重み係数データをROM(例えば、第1ROM2)に、非圧縮データ、あるいは、圧縮データとして記憶させるようにすればよい。
(先行技術文献A):
神谷龍司等 “Binarized-DCNNによる識別計算の高速化とモデル圧縮” 信学技報116(366), 47-52, 2016-12-15 電子情報通信学会
また、ニューラルネットワーク用プロセッサ100、100Aにおいて、BNNのベクトル分解により取得される二値基底行列を多値基底行列としたニューラルネットワーク(これを「多値ニューラルネットワーク」という)を実装するようにしてもよい。この場合、多値ニューラルネットワークにより実現される特徴抽出層の重み係数データをROM(例えば、第1ROM2)に、非圧縮データ、あるいは、圧縮データとして記憶させるようにすればよい。
Further, in the
(Prior art document A):
Ryuji Kamiya et al., “Acceleration of identification calculation and model compression by Binarized-DCNN” IEICE Technical Report 116(366), 47-52, 2016-12-15 The Institute of Electronics, Information and Communication Engineers In addition, in
上記実施形態(変形例を含む)では、ニューラルネットワーク用プロセッサ100、100Aが、RAMを第1RAM5、第2RAM6を有する構成である場合について、説明したが、これに限定されることはない。ニューラルネットワーク用プロセッサ100、100Aにおいて、例えば、第1RAM5、第2RAM6を1つのRAMにより実現するようにしてもよい。
In the above embodiments (including modifications), the
また、上記実施形態(変形例を含む)における各種のデータ転送、信号の送受信は、上記で説明した形態に限定されるものではなく、各機能部において、直接接続された信号線により、データ転送、信号の送受信が実行されるものであってもよいし、また、バスを介して、データ転送、信号の送受信が実行されるものであってもよい。 Various data transfers and signal transmission/reception in the above embodiments (including modifications) are not limited to the forms described above. , signal transmission/reception may be performed, or data transfer and signal transmission/reception may be performed via the bus.
また、上記実施形態(変形例を含む)において、ROMやRAMの個数については一例として説明したが、これに限定されることはなく、ROM、RAMの個数や配置は、上記以外のものであってもよい。また、ROM、RAMは、ニューラルネットワーク用プロセッサ100、100Aの外部に設けられるものであってもよい。
In addition, in the above embodiments (including modifications), the number of ROMs and RAMs has been described as an example, but the present invention is not limited to this, and the number and arrangement of ROMs and RAMs may be other than those described above. may Also, the ROM and RAM may be provided outside the
上記実施形態で説明したニューラルネットワーク用プロセッサ100、100Aの各ブロック(各機能部)は、LSIなどの半導体装置により個別に1チップ化されても良いし、一部又は全部を含むように1チップ化されても良い。また、上記実施形態で説明したニューラルネットワーク用プロセッサ100の各ブロック(各機能部)は、複数のLSIなどの半導体装置により実現されるものであってもよい。
Each block (each functional unit) of the
なお、ここでは、LSIとしたが、集積度の違いにより、IC、システムLSI、スーパーLSI、ウルトラLSIと呼称されることもある。 Although LSI is used here, it may also be called IC, system LSI, super LSI, or ultra LSI depending on the degree of integration.
また、集積回路化の手法はLSIに限るものではなく、専用回路又は汎用プロセサで実現してもよい。LSI製造後に、プログラムすることが可能なFPGA(Field Programmable Gate Array)や、LSI内部の回路セルの接続や設定を再構成可能なリコンフィギュラブル・プロセッサーを利用しても良い。 Further, the method of circuit integration is not limited to LSI, and may be implemented by a dedicated circuit or a general-purpose processor. An FPGA (Field Programmable Gate Array) that can be programmed after the LSI is manufactured, or a reconfigurable processor that can reconfigure the connections and settings of the circuit cells inside the LSI may be used.
また、上記各実施形態の各機能ブロックの処理の一部または全部は、プログラムにより実現されるものであってもよい。そして、上記各実施形態の各機能ブロックの処理の一部または全部は、コンピュータにおいて、中央演算装置(CPU)により行われる。また、それぞれの処理を行うためのプログラムは、ハードディスク、ROMなどの記憶装置に格納されており、ROMにおいて、あるいはRAMに読み出されて実行される。 Also, part or all of the processing of each functional block in each of the above embodiments may be implemented by a program. Part or all of the processing of each functional block in each of the above embodiments is performed by a central processing unit (CPU) in a computer. A program for performing each process is stored in a storage device such as a hard disk or ROM, and is read from the ROM or RAM and executed.
また、上記実施形態の各処理をハードウェアにより実現してもよいし、ソフトウェア(OS(オペレーティングシステム)、ミドルウェア、あるいは、所定のライブラリとともに実現される場合を含む。)により実現してもよい。さらに、ソフトウェアおよびハードウェアの混在処理により実現しても良い。 Further, each process of the above embodiments may be realized by hardware, or may be realized by software (including cases where it is realized together with an OS (operating system), middleware, or a predetermined library). Furthermore, it may be realized by mixed processing of software and hardware.
例えば、上記実施形態(変形例を含む)の各機能部を、ソフトウェアにより実現する場合、図5に示したハードウェア構成(例えば、CPU、GPU、ROM、RAM、入力部、出力部等をバスBusにより接続したハードウェア構成)を用いて、各機能部をソフトウェア処理により実現するようにしてもよい。 For example, when the functional units of the above embodiments (including modifications) are realized by software, the hardware configuration shown in FIG. Each functional unit may be realized by software processing using a hardware configuration connected by a Bus.
また、上記実施形態における処理方法の実行順序は、必ずしも、上記実施形態の記載に制限されるものではなく、発明の要旨を逸脱しない範囲で、実行順序を入れ替えることができるものである。 Also, the execution order of the processing methods in the above embodiments is not necessarily limited to the description of the above embodiments, and the execution order can be changed without departing from the gist of the invention.
前述した方法をコンピュータに実行させるコンピュータプログラム及びそのプログラムを記録したコンピュータ読み取り可能な記録媒体は、本発明の範囲に含まれる。ここで、コンピュータ読み取り可能な記録媒体としては、例えば、フレキシブルディスク、ハードディスク、CD-ROM、MO、DVD、DVD-ROM、DVD-RAM、大容量DVD、次世代DVD、半導体メモリを挙げることができる。 A computer program that causes a computer to execute the method described above and a computer-readable recording medium that records the program are included in the scope of the present invention. Examples of computer-readable recording media include flexible disks, hard disks, CD-ROMs, MOs, DVDs, DVD-ROMs, DVD-RAMs, large-capacity DVDs, next-generation DVDs, and semiconductor memories. .
上記コンピュータプログラムは、上記記録媒体に記録されたものに限られず、電気通信回線、無線又は有線通信回線、インターネットを代表とするネットワーク等を経由して伝送されるものであってもよい。 The computer program is not limited to being recorded on the recording medium, and may be transmitted via an electric communication line, a wireless or wired communication line, a network represented by the Internet, or the like.
また、文言「部」は、「サーキトリー(circuitry)」を含む概念であってもよい。サーキトリーは、ハードウェア、ソフトウェア、あるいは、ハードウェアおよびソフトウェアの混在により、その全部または一部が、実現されるものであってもよい。 In addition, the word "department" may be a concept including "circuitry". A circulatory may be implemented in whole or in part by hardware, software, or a mixture of hardware and software.
ここに開示される要素の機能は、当該開示される要素を実行するように構成された、あるいは当該開示される機能を実行するようにプログラミングされた汎用プロセッサ、専用プロセッサ、集積回路、ASIC(「特定用途向け集積回路」)、従来の回路構成及び/またはそれらの組み合わせを含む回路構成あるいは処理回路構成が用いられて実装されてもよい。プロセッサは、それが、その中にトランジスタ及び他の回路構成を含むとき、処理回路構成あるいは回路構成として見なされる。本開示において、回路構成、ユニットあるいは手段は、挙げられた機能を実行するハードウェア、あるいは当該機能を実行するようにプログラミングされたハードウェアである。ハードウェアは、挙げられた機能を実行するようにプログラミングされた、あるいは当該機能を実行するように構成された、ここで開示されるいかなるハードウェアあるいは既知の他のものであってもよい。ハードウェアが、あるタイプの回路構成として見なされるかもしれないプロセッサであるとき、回路構成、手段あるいはユニットは、ハードウェアとソフトウェアの組み合わせ、ハードウェアを構成するために用いられるソフトウェア及び/またはプロセッサである。 The functionality of the elements disclosed herein may be effected by any general purpose processor, special purpose processor, integrated circuit, ASIC (" may be implemented using circuitry or processing circuitry including "application specific integrated circuits"), conventional circuitry and/or combinations thereof. A processor is referred to as processing circuitry or circuitry when it includes transistors and other circuitry therein. In this disclosure, a circuit arrangement, unit or means is hardware that performs or is programmed to perform the recited function. The hardware may be any hardware disclosed herein or otherwise known that is programmed or configured to perform the functions recited. When the hardware is a processor, which may be viewed as a type of circuitry, the circuitry, means or unit is a combination of hardware and software, the software used to configure the hardware and/or the processor. be.
なお、本発明の具体的な構成は、前述の実施形態に限られるものではなく、発明の要旨を逸脱しない範囲で種々の変更および修正が可能である。 The specific configuration of the present invention is not limited to the above-described embodiment, and various changes and modifications are possible without departing from the gist of the invention.
100、100A ニューラルネットワーク用プロセッサ
1 制御部
2 第1ROM
3 第2ROM
5 第1RAM
6 第2RAM
7 内積処理部
8 伸張部
100, 100A
3 Second ROM
5 1st RAM
6 Second RAM
7 inner
Claims (6)
前記特徴抽出層の処理用のデータを記憶保持する読み出し専用メモリと、
データの読み出し、および、データ書き込みを行うことができ、前記判定層の処理用のデータを記憶保持するランダムアクセスメモリと、
前記読み出し専用メモリと、前記ランダムアクセスメモリとを制御する制御部と、
前記読み出し専用メモリから前記特徴抽出層の処理用のデータを第1データとして読み出し、前記第1データを用いて、前記特徴抽出層の処理を実行するとともに、前記ランダムアクセスメモリから前記判定層の処理用のデータを第2データとして読み出し、前記第2データを用いて、前記判定層の処理を実行する内積処理部と、
を備えるニューラルネットワーク用プロセッサ。 A neural network processor for executing neural network processing including feature extraction layer processing and determination layer processing,
a read-only memory that stores and holds data for processing of the feature extraction layer;
a random access memory capable of reading and writing data and storing and holding data for processing of the decision layer;
a control unit that controls the read-only memory and the random access memory;
Data for processing the feature extraction layer is read from the read-only memory as first data, and the processing of the feature extraction layer is executed using the first data, and the determination layer is processed from the random access memory. an inner product processing unit that reads data for as second data and executes the processing of the determination layer using the second data;
Neural network processor with
前記特徴抽出層の処理用のデータの読み出し時間を特定するためのデータを含むヘッダデータと、
前記特徴抽出層の処理を実行するときに必要となる順番に、前記特徴抽出層の処理用のデータとを出力できるように、前記特徴抽出層の処理用のデータを記憶保持しており、
前記制御部が前記読み出し専用メモリに対して、読み出し指令信号を出力した場合、前記読み出し専用メモリは、前記特徴抽出層の処理用のデータを、前記特徴抽出層の処理を実行するときに必要となる順番に出力する、
請求項1に記載のニューラルネットワーク用プロセッサ。 The read-only memory is
Header data including data for specifying readout time of data for processing of the feature extraction layer;
storing data for processing the feature extraction layer so that the data for processing the feature extraction layer can be output in the order required when executing the processing for the feature extraction layer;
When the control unit outputs a read command signal to the read-only memory, the read-only memory stores the data for the processing of the feature extraction layer as required when executing the processing of the feature extraction layer. output in the order that
2. The neural network processor according to claim 1.
前記読み出し専用メモリに記憶されている前記ヘッダデータを読み出し、当該ヘッダデータに基づいて、前記読み出し専用メモリから、前記特徴抽出層の処理用のデータの出力処理が完了する時刻を特定し、
特定した時刻よりも前の時刻において、前記判定層の処理用のデータが前記ランダムアクセスメモリに記憶保持されている状態となるように制御する、
請求項2に記載のニューラルネットワーク用プロセッサ。 The control unit
reading the header data stored in the read-only memory, and based on the header data, identifying a time at which output processing of data for processing of the feature extraction layer is completed from the read-only memory;
controlling so that the data for processing of the decision layer is stored and retained in the random access memory at a time before the specified time;
3. The neural network processor according to claim 2.
前記読み出し専用メモリは、
前記特徴抽出層の処理用のデータを圧縮されたデータとして記憶保持しており、
前記伸張部は、
前記読み出しメモリに記憶保持されている前記圧縮されたデータに対して伸張処理を実行し、
前記内積処理部は、
前記伸張部により伸張されたデータを用いて、前記特徴抽出層の処理を実行する、
請求項1から3のいずれかに記載のニューラルネットワーク用プロセッサ。 further comprising a decompression unit that decompresses the compressed data;
The read-only memory is
Data for processing of the feature extraction layer is stored as compressed data,
The extension is
decompressing the compressed data stored in the read memory;
The inner product processing unit
using the data decompressed by the decompression unit to process the feature extraction layer;
4. The neural network processor according to claim 1.
前記特徴抽出層の処理用のデータを記憶保持する読み出し専用メモリと、
データの読み出し、および、データ書き込みを行うことができ、前記判定層の処理用のデータを記憶保持するランダムアクセスメモリと、
前記読み出し専用メモリと、前記ランダムアクセスメモリとを制御する制御部と、
を備えるニューラルネットワーク用プロセッサを用いて実行するニューラルネットワーク用処理方法であって、
前記読み出し専用メモリから前記特徴抽出層の処理用のデータを第1データとして読み出し、前記第1データを用いて、前記特徴抽出層の処理を実行する第1ステップと、
前記ランダムアクセスメモリから前記判定層の処理用のデータを第2データとして読み出し、前記第2データを用いて、前記判定層の処理を実行する第2ステップと、
を備えるニューラルネットワーク用処理方法。 A neural network processor for executing neural network processing including feature extraction layer processing and determination layer processing,
a read-only memory that stores and holds data for processing of the feature extraction layer;
a random access memory capable of reading and writing data and storing and holding data for processing of the decision layer;
a control unit that controls the read-only memory and the random access memory;
A neural network processing method executed using a neural network processor comprising
a first step of reading data for processing the feature extraction layer from the read-only memory as first data, and performing processing of the feature extraction layer using the first data;
a second step of reading data for processing of the decision layer from the random access memory as second data and performing the processing of the decision layer using the second data;
A processing method for a neural network comprising:
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2019137468A JP7253468B2 (en) | 2019-07-26 | 2019-07-26 | Neural network processor, neural network processing method, and program |
| PCT/JP2020/009057 WO2021019815A1 (en) | 2019-07-26 | 2020-03-04 | Neural network processor, neural network processing method, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2019137468A JP7253468B2 (en) | 2019-07-26 | 2019-07-26 | Neural network processor, neural network processing method, and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2021022087A JP2021022087A (en) | 2021-02-18 |
| JP7253468B2 true JP7253468B2 (en) | 2023-04-06 |
Family
ID=74228621
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2019137468A Active JP7253468B2 (en) | 2019-07-26 | 2019-07-26 | Neural network processor, neural network processing method, and program |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP7253468B2 (en) |
| WO (1) | WO2021019815A1 (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017021483A (en) | 2015-07-08 | 2017-01-26 | 株式会社デンソー | Arithmetic processing unit |
| JP2018116469A (en) | 2017-01-18 | 2018-07-26 | 株式会社日立製作所 | Arithmetic system and arithmetic method for neural network |
-
2019
- 2019-07-26 JP JP2019137468A patent/JP7253468B2/en active Active
-
2020
- 2020-03-04 WO PCT/JP2020/009057 patent/WO2021019815A1/en not_active Ceased
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017021483A (en) | 2015-07-08 | 2017-01-26 | 株式会社デンソー | Arithmetic processing unit |
| JP2018116469A (en) | 2017-01-18 | 2018-07-26 | 株式会社日立製作所 | Arithmetic system and arithmetic method for neural network |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2021019815A1 (en) | 2021-02-04 |
| JP2021022087A (en) | 2021-02-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102783993B1 (en) | Neural network device and operating method for the same | |
| KR102877638B1 (en) | Method and apparatus for neural network quantization | |
| KR102808579B1 (en) | Method and apparatus for performing operation in neural network | |
| EP3817236B1 (en) | Neural network data processing method and apparatus | |
| US12072806B2 (en) | Compression and decompression module in a cache controller for reducing off-chip data traffic | |
| US11662904B2 (en) | Non-volatile memory with on-chip principal component analysis for generating low dimensional outputs for machine learning | |
| KR102871496B1 (en) | Neural network apparatus and operating method of the same | |
| CN110826721B (en) | Information processing method and information processing system | |
| US11411575B2 (en) | Irreversible compression of neural network output | |
| CN107516132A (en) | The simplification device and method for simplifying of artificial neural networks | |
| CN216053088U (en) | Processing device for performing convolutional neural network operations | |
| KR20210053791A (en) | Method and apparatus for processing data of neural network | |
| KR102862810B1 (en) | Electronic device and controlling method of electronic device | |
| JP2019194851A (en) | Method and device for processing parameter in neural network for classification | |
| KR102518057B1 (en) | Cache for artificial intelligence processor | |
| KR20240025827A (en) | In memory computing(imc) processor and operating method of imc processor | |
| US11341066B2 (en) | Cache for artificial intelligence processor | |
| US20200057932A1 (en) | System and method for generating time-spectral diagrams in an integrated circuit solution | |
| CN109508782B (en) | Neural network deep learning-based acceleration circuit and method | |
| JP7253468B2 (en) | Neural network processor, neural network processing method, and program | |
| US11741349B2 (en) | Performing matrix-vector multiply operations for neural networks on electronic devices | |
| CN107710277A (en) | Image recognition device and image recognition method | |
| CN112836815A (en) | Processing device and processing method for performing convolutional neural network operations | |
| US20200293865A1 (en) | Using identity layer in a cellular neural network architecture | |
| CN112102183B (en) | Sparse processing method, device and equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20220117 |
|
| 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: 20230314 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230327 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7253468 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |