Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7253468B2 - Neural network processor, neural network processing method, and program - Google Patents
[go: Go Back, main page]

JP7253468B2 - Neural network processor, neural network processing method, and program - Google Patents

Neural network processor, neural network processing method, and program Download PDF

Info

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
Application number
JP2019137468A
Other languages
Japanese (ja)
Other versions
JP2021022087A (en
Inventor
真人 松本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
MegaChips Corp
Original Assignee
MegaChips Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by MegaChips Corp filed Critical MegaChips Corp
Priority to JP2019137468A priority Critical patent/JP7253468B2/en
Priority to PCT/JP2020/009057 priority patent/WO2021019815A1/en
Publication of JP2021022087A publication Critical patent/JP2021022087A/en
Application granted granted Critical
Publication of JP7253468B2 publication Critical patent/JP7253468B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical 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.

特開2015-197702号公報JP 2015-197702 A

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実施形態に係るニューラルネットワーク用プロセッサ100の概略構成図。1 is a schematic configuration diagram of a neural network processor 100 according to a first embodiment; FIG. ニューラルネットワーク用プロセッサ100で実行される処理のタイミングチャート。4 is a timing chart of processing executed by the neural network processor 100; ニューラルネットワーク用プロセッサ100で実行される処理のフローチャート。4 is a flowchart of processing executed by the neural network processor 100; 第1実施形態の第1変形例に係るニューラルネットワーク用プロセッサ100Aの概略構成図。FIG. 2 is a schematic configuration diagram of a neural network processor 100A according to a first modified example of the first embodiment; CPUバス構成を示す図。FIG. 4 is a diagram showing a CPU bus configuration;

[第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 neural network processor 100 according to the first embodiment.

ニューラルネットワーク用プロセッサ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 neural network processor 100 includes a first interface unit IF1, a control unit 1, a first ROM (Read Only Memory) 2, a second ROM 3, a quantization processing unit 4, and a first RAM ( Random Access Memory) 5, a second RAM 6, an inner product processing section 7, and a bus B1. As shown in FIG. 1, each functional unit of the neural network processor 100 is connected by a bus B1, and necessary data, commands, etc. can be input/output via the bus B1. Some or all of the above functional units may be connected directly, if necessary, instead of being connected via a bus.

第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 neural network processor 100 to the outside as data Dout. The first interface unit IF1 outputs (writes) the input data Din to the first RAM 5 via the bus B1, and transfers data including the processing result of the neural network processor 100 from the first RAM 5 via the bus B1. Get (read).

制御部1は、ニューラルネットワーク用プロセッサ100の全体制御、各機能部の制御およびニューラルネットワーク用処理に必要な処理を行う。制御部CPU1は、CPU(Central Processing Unit)やCPUコアにより実現される。 The control unit 1 performs overall control of the neural network processor 100, control of each functional unit, and processing necessary for neural network processing. The control unit CPU1 is realized by a CPU (Central Processing Unit) or a CPU core.

第1ROM2は、読み出し専用メモリであって、特徴抽出層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を記憶保持する。第1ROM2は、図1に示すように、バスB1に接続されており、また、内積処理部7に接続されている。なお、第1ROM2は、バスB1を介して、内積処理部7に接続されるものであってもよい。第1ROM2は、制御部1からのトリガー信号Sig_trgを受信すると、例えば、ヘッダデータを、バスB1を介して、制御部1に出力するともに、ヘッダデータおよび特徴抽出層の処理に用いられるデータを内積処理部7に連続的に出力する。 The first ROM 2 is a read-only memory, and stores and holds data (for example, parameter data, neural network weighting coefficient data) used for the processing of the feature extraction layer. The first ROM 2 is connected to the bus B1 and also to the inner product processing section 7, as shown in FIG. The first ROM 2 may be connected to the inner product processing section 7 via the bus B1. When the first ROM 2 receives the trigger signal Sig_trg from the control unit 1, it outputs, for example, header data to the control unit 1 via the bus B1, and the header data and the data used for the processing of the feature extraction layer are inner products. It is continuously output to the processing unit 7 .

第2ROM3は、読み出し専用メモリであって、バスB1に接続されている。第2ROM3は、判定層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を記憶保持する。第2ROM3は、制御部1からの指令に従い、判定層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を、バスB1を介して、第2RAM6に転送する。 A second ROM 3 is a read-only memory and is connected to the bus B1. The second ROM 3 stores and holds data (for example, parameter data, neural network weighting coefficient data) used for the processing of the decision layer. The second ROM 3, in accordance with a command from the control unit 1, transfers data used in the processing of the judgment layer (for example, parameter data, neural network weighting coefficient data) to the second RAM 6 via the bus B1.

量子化処理部4は、第1RAMとデータの送受信ができるように接続されている。量子化処理部4は、特徴抽出層(例えば、DCNN(Deep Convolution Neural Network)の畳み込み層)の入力である特徴マップのデータに対して、量子化処理を行う。また、量子化処理部4は、判定層(例えば、DCNNの全結合層)の入力データに対して、量子化処理を行う。なお、量子化処理部4は、量子化処理の対象のデータを、第1RAM5の所定の領域から読み出し、量子化処理後のデータを、第1RAM5の所定の領域に書き込む。また、量子化処理部4は、図1に示すように、第1RAM5と直接接続されるものであってもよいし、バス(例えば、バスB1)を介して接続されるものであってもよい。 The quantization processing unit 4 is connected so as to be able to transmit and receive data to and from the first RAM. The quantization processing unit 4 performs quantization processing on feature map data that is input to a feature extraction layer (for example, a convolution layer of a DCNN (Deep Convolution Neural Network)). Also, the quantization processing unit 4 performs quantization processing on input data of a decision layer (for example, a fully connected layer of DCNN). The quantization processing unit 4 reads data to be quantized from a predetermined area of the first RAM 5 and writes data after quantization to a predetermined area of the first RAM 5 . The quantization processing unit 4 may be directly connected to the first RAM 5 as shown in FIG. 1, or may be connected via a bus (for example, bus B1). .

第1RAM5は、ニューラルネットワーク用処理を実行するために必要なデータを記憶保持するためのRAM(Random Access Memory)である。第1RAM5は、図1に示すように、バスB1に接続されており、また、量子化処理部4と接続されている。 The first RAM 5 is a RAM (Random Access Memory) for storing and holding data necessary for executing neural network processing. The first RAM 5 is connected to the bus B1 and also to the quantization processing section 4, as shown in FIG.

第2RAM6は、ランダムアクセスメモリである。第2RAM6は、図1に示すように、バスB1に接続されており、また、内積処理部7に接続されている。第2RAM6は、第2ROM3から転送される、判定層の処理に用いられるデータ(例えば、パラメータのデータ、ニューラルネットワークの重み係数のデータ)を記憶保持する。第2RAM6は、制御部1からの指令に従い、所定のタイミングで、記憶保持している判定層の処理に用いられるデータを内積処理部7に出力する。 The second RAM 6 is a random access memory. The second RAM 6 is connected to the bus B1 and also to the inner product processing section 7, as shown in FIG. The second RAM 6 stores and holds data transferred from the second ROM 3 and used for the processing of the decision layer (for example, parameter data, neural network weighting coefficient data). The second RAM 6 outputs to the inner product processing unit 7 the stored data used for the processing of the judgment layer at a predetermined timing according to the command from the control unit 1 .

内積処理部7は、図1に示すように、第2インターフェース部71と、内積演算処理部72とを備える。内積処理部7は、図1に示すように、第1ROM2、第1RAM5、第2RAM6、および、バスB1に接続されている。内積処理部7は、制御部1から、例えば、バスB1を介して、制御信号Ctr1を受信し、受信した制御信号Ctr1に従い、所定の処理を実行する。 The inner product processing unit 7 includes a second interface unit 71 and an inner product calculation processing unit 72, as shown in FIG. The inner product processing unit 7 is connected to a first ROM 2, a first RAM 5, a second RAM 6, and a bus B1, as shown in FIG. The inner product processing unit 7 receives a control signal Ctr1 from the control unit 1 via, for example, the bus B1, and executes predetermined processing according to the received control signal Ctr1.

第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 second interface section 71 is an interface with the first ROM 2 , the first RAM 5 and the second RAM 6 .
(1) When the processing of the feature extraction layer is executed, the second interface unit 71 reads the data (for example, parameter, weight coefficient) D_wij_feature for the processing of the feature extraction layer from the first ROM 2, and stores the read data as It is output to the inner product calculation processing unit 72 as data D_wij. The second interface unit 71 also reads the quantized data D_Qin from a predetermined area of the first RAM 5 and outputs the read data to the inner product calculation processing unit 72 as data D_Qin.
(2) When the process of the judgment layer is executed, the second interface unit 71 reads the data (for example, parameter, weight coefficient) D_wij_deci for the process of the judgment layer from the second RAM 6, and converts the read data to the data D_wij , and is output to the inner product calculation processing unit 72 . The second interface unit 71 also reads the quantized data D_Qin from a predetermined area of the first RAM 5 and outputs the read data to the inner product calculation processing unit 72 as data D_Qin.

内積演算処理部72は、第2インターフェース部71から出力されるデータD_Qin、および、データD_wijを入力する。内積演算処理部72は、データD_Qin、および、データD_wijを用いて、内積演算処理を実行し、内積演算処理結果のデータをデータDoとして取得する。そして、内積演算処理部72は、取得したデータDoを第1RAM5に出力する。 The inner product calculation processing unit 72 receives data D_Qin and data D_wij output from the second interface unit 71 . The inner product calculation processing unit 72 executes inner product calculation processing using data D_Qin and data D_wij, and obtains data of the inner product calculation processing result as data Do. Then, the inner product calculation processing unit 72 outputs the acquired data Do to the first RAM 5 .

<1.2:ニューラルネットワーク用プロセッサの動作>
以上のように構成されたニューラルネットワーク用プロセッサ100の動作について、以下、説明する。
<1.2: Operation of Neural Network Processor>
The operation of the neural network processor 100 configured as described above will be described below.

図2は、ニューラルネットワーク用プロセッサ100で実行される処理のタイミングチャートである。 FIG. 2 is a timing chart of processing executed by the neural network processor 100. As shown in FIG.

図3は、ニューラルネットワーク用プロセッサ100で実行される処理のフローチャートである。 FIG. 3 is a flow chart of processing executed by the neural network processor 100 .

以下では、図1~図3を参照しながら、ニューラルネットワーク用プロセッサ100の動作について、説明する。 The operation of the neural network processor 100 will be described below with reference to FIGS. 1 to 3. FIG.

一般に、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 neural network processor 100, image recognition processing is performed by CNN, and the image recognition processing result is output to the outside as output data Dout.

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 neural network processor 100 will be explained below. The following description assumes that the convolutional layers of the CNN consist of N layers (N: natural number).

(ステップS1):
ステップS1において、ニューラルネットワーク用プロセッサ100において、処理対象となるデータ(例えば、画像認識処理を行う場合、処理対象の画像データ)の入力処理を実行する。具体的には、ニューラルネットワーク用プロセッサ100において、外部から処理対象となるデータDinを第1インターフェース部IF1により取得(入力)する。そして、データDinは、第1インターフェース部IF1から、バスB1を介して、第1RAM5に転送され、データDinは、第1RAM5の所定の領域に記憶保持される。
(Step S1):
In step S1, the neural network processor 100 executes input processing of data to be processed (for example, image data to be processed when performing image recognition processing). Specifically, in the neural network processor 100, data Din to be processed is acquired (input) from the outside by the first interface unit IF1. The data Din is transferred from the first interface section IF1 to the first RAM 5 via the bus B1, and the data Din is stored in a predetermined area of the first RAM5.

また、ニューラルネットワーク用プロセッサ100では、量子化処理が実行される。具体的には、量子化処理部4は、データDinを、第1RAM5の所定の領域から読み出し、読み出したデータに対して、量子化処理を実行し、量子化後のデータをデータD_Qinとして取得する。そして、量子化処理部4は、取得した量子化後のデータD_Qinを第1RAM5の所定の領域に書き込む。 Further, the neural network processor 100 executes quantization processing. Specifically, the quantization processing unit 4 reads the data Din from a predetermined area of the first RAM 5, performs quantization processing on the read data, and acquires the quantized data as data D_Qin. . Then, the quantization processing unit 4 writes the acquired quantized data D_Qin in a predetermined area of the first RAM 5 .

なお、量子化処理は、データを量子化する処理に加えて、例えば、ダイナミックレンジ調整、二値化処理、オフセット調整処理を含むものであってもよい。 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 control section 1 transmits a trigger signal Sig_trig to the first ROM 2 via the bus B1.

第1ROM2は、制御部1からのトリガー信号Sig_trigを受信すると、第1ROM2に記憶保持されているヘッダデータD_headを読み出し、当該ヘッダデータD_headを、バスB1を介して、制御部1および内積処理部7の第2インターフェース部71に出力する(ステップS3)。 Upon receiving the trigger signal Sig_trig from the control unit 1, the first ROM 2 reads the header data D_head stored in the first ROM 2, and sends the header data D_head to the control unit 1 and the inner product processing unit 7 via the bus B1. is output to the second interface unit 71 (step S3).

ヘッダデータ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 first ROM 2 sequentially reads the data of the feature extraction layers from the data of the first layer to the data of the Nth layer of the feature extraction layers, and uses the read data as data D_wij_feature. Output to the processing unit 7 (weighting factor data acquisition process, step S42).

具体的には、(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 first ROM 2 in the above order and output to the inner product processing section 7 as data D_wij_feature.

ステップ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 second interface unit 71 of the inner product processing unit 7 acquires the weight coefficient data of the first layer of the feature extraction layer output from the first ROM 2 as data D_wij_feature, and uses the data as data D_wij to perform the inner product calculation processing unit 72. output to

また、内積処理部7の第2インターフェース部71は、特徴抽出層の第1層に入力するデータの量子化後のデータを、第1RAM5から読み出し、データD_Qinとして取得する。そして、第2インターフェース部71は、取得したデータD_Qinを内積演算処理部72に出力する。 Further, the second interface unit 71 of the inner product processing unit 7 reads the data after quantization of the data input to the first layer of the feature extraction layer from the first RAM 5 and acquires it as data D_Qin. The second interface unit 71 then outputs the acquired data D_Qin to the inner product calculation processing unit 72 .

内積演算処理部72は、データD_Qin、および、データD_wijを用いて、内積演算処理を実行する。例えば、データD_Qinがn次元ベクトルデータ(n:自然数)であり、データD_wij(重み係数データ)がn次元ベクトルデータであり、下記のように表現される場合、
D_Qin=[x ・・・ x
D_wij=[w ・・・ w
内積演算処理部72は、2つのn次元ベクトルの内積を算出する処理、すなわち、下記数式に相当する処理を実行することで、内積演算結果を取得する。

Figure 0007253468000001

なお、内積演算処理部72は、行列演算処理を行う場合、上記内積演算処理を繰り返し実行することで、行列演算処理結果を取得する。例えば、内積演算処理部72は、2つの行列A、Bの積(行列の積)を求める演算を行う場合、行列Aのi行目の1行に含まれる要素からなる行ベクトルと、行列Bのj列目の1列に含まれる要素からなる列ベクトルとに対して、上記と同様に内積演算処理を実行することで、行列A、Bの積により取得される行列のi行j列目の要素の値(データ)を取得することができる。 The inner product calculation processing unit 72 uses data D_Qin and data D_wij to perform inner product calculation processing. For example, when data D_Qin is n-dimensional vector data (n: natural number) and data D_wij (weighting factor data) is n-dimensional vector data, expressed as follows:
D_Qin=[ x1x2x3 ... xn ]
D_wij=[w 1 w 2 w 3 . . . wn ]
The inner product calculation processing unit 72 acquires the inner product calculation result by executing the process of calculating the inner product of two n-dimensional vectors, that is, the process corresponding to the following formula.
Figure 0007253468000001

When performing matrix calculation processing, the inner product calculation processing unit 72 acquires a matrix calculation processing result by repeatedly executing the inner product calculation processing. For example, when the inner product operation processing unit 72 performs an operation to obtain the product of two matrices A and B (matrix product), the row vector consisting of the elements contained in the i-th row of the matrix A and the matrix B By performing inner product operation processing in the same manner as above on a column vector consisting of elements contained in the first column of the j-th column of the matrix A and B, the i-th row j-th column of the matrix obtained by the product of You can get the value (data) of the element of .

このように処理することで、内積演算処理部72では、任意の行列演算の処理結果を取得することができる。 By processing in this manner, the inner product calculation processing unit 72 can acquire the processing result of any matrix calculation.

内積演算処理部72では、上記のようにして、特徴抽出層の第1層の処理(例えば、CNNのコンボリューション処理(データに対する重み付け加算処理))を実行し、特徴抽出層の第1層の各シナプスの出力に相当するデータを取得する。 In the inner product operation processing unit 72, as described above, the processing of the first layer of the feature extraction layer (for example, the CNN convolution processing (weighted addition processing for data)) is executed, and the first layer of the feature extraction layer is Acquire the data corresponding to the output of each synapse.

なお、内積演算処理部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 calculation processing unit 72 in that order. Therefore, in the inner product operation processing unit 72, the data D_wij and the corresponding quantized data (data to be processed (data read from the first RAM 5)) are input to the inner product operation processing unit 72. By repeatedly executing the inner product calculation process in order, data corresponding to the output of each synapse in the first layer of the feature extraction layer can be obtained.

内積演算処理部72では、上記処理により、特徴抽出層の第1層の各シナプスの出力に相当するデータ(このデータを「データD0」とする)を取得したら、当該取得したデータに対して、活性化関数による処理を実行し、データDoを取得する。つまり、内積演算処理部72は、
Do=f_act(D0)
f_act():活性化関数(例えば、ReLU関数、Softmax関数、シグモイド関数等)
に相当する処理を実行することで、データDoを取得する。
In the inner product calculation processing unit 72, after acquiring data corresponding to the output of each synapse in the first layer of the feature extraction layer (this data is referred to as "data D0") through the above process, the acquired data is: Execute the processing by the activation function and acquire the data Do. That is, the inner product calculation processing unit 72
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 calculation processing unit 72 outputs the data Do acquired as described above to the first RAM 5 and writes the data Do in a predetermined area of the first RAM 5 .

以上のようにして、ニューラルネットワーク用プロセッサ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 neural network processor 100 executes the processing of the first layer of the feature extraction layer. In the timing chart of FIG. 2, between time t11 and time t12, data (weighting coefficient data) D_wij_feature (weighting coefficient data) for processing the first layer of the feature extraction layer is transferred from the first ROM 2 (in FIG. 2, the first layer of the feature extraction layer data for the processing of Df_1st_L) are read out in the order of processing, and the inner product calculation processing is executed using the read data (weighting coefficient data) D_wij_feature and the quantized data D_Qin to be processed. be done. Then, in the neural network processor 100, as described above, the processing corresponding to the activation function is executed to obtain the data Do.

そして、ニューラルネットワーク用プロセッサ100では、特徴抽出層の第2層、第3層、・・・、第N層の処理が、上記の第1層の処理と同様に、実行される(ステップS41~S45、図2の時刻t12~t2の間の処理)。 Then, in the neural network processor 100, the processing of the second layer, the third layer, . S45, processing between times t12 and t2 in FIG. 2).

そして、上記処理により取得したデータ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 first RAM 5 .

(ステップ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 control unit 1 reads the header data D_header from the first ROM 2 (time t1 to t11 in FIG. 2), and from the data included in the header data D_header, transfers the feature extraction layer from the first ROM 2 to the inner product processing unit 7. , the time T1 required to transfer the data (weighting coefficient data) for the processing of .

例えば、第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を算出する。

Figure 0007253468000002

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 first ROM 2,
(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 control unit 1, for example, executes a process corresponding to the following formula to determine the time T1 required to transfer the data for processing the feature extraction layer (weighting coefficient data). calculate.
Figure 0007253468000002

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 control unit 1 determines: The time t2 at which the transfer of data (weighting coefficient data) for processing of the feature extraction layer is completed is
t2=t11+T1
Calculated by Thereby, the control unit 1 specifies the time t2 at which the transfer of the data (weighting coefficient data) for the processing of the feature extraction layer is completed.

(ステップ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 control unit 1 acquires the time T2 required to transfer the weighting factor data D_wij_deci of the judgment layer stored in the second ROM 3 to the second RAM 6 . Then, at a time before time t20 (=t2-T2), the control unit 1 outputs a command to the second ROM 3 and the second RAM 6 to transfer the weighting coefficient data D_wij_deci of the judgment layer stored and held in the second ROM 3 to the second RAM 6. Then, at a time before time t20 (=t2-T2), data transfer processing of the weighting coefficient data D_wij_deci of the decision layer is started.

これにより、判定層の重み係数データ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 second ROM 3 to the second RAM 6 can be completed by the time t2 when the data reading process of the feature extraction layer is completed.

ニューラルネットワーク用プロセッサ100では、このように、特徴抽出層の処理(ステップS41~S45)と、並行に、ステップS51、S52の処理を行うことで、特徴抽出層の処理が完了する時刻t2の直後から、判定層の処理を実行することができる。 In the neural network processor 100, by performing the processing of steps S51 and S52 in parallel with the processing of the feature extraction layer (steps S41 to S45), immediately after the time t2 when the processing of the feature extraction layer is completed, , the processing of the decision layer can be performed.

(ステップ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 second ROM 3 to the second ROM 3 . 2 The data transfer process to the RAM 6 has been completed. Therefore, in step S<b>6 , the second interface section 71 of the inner product processing section 7 acquires (reads) the determination layer processing data (weight coefficient data for determination layer processing) D_wij_deci from the second RAM 6 . Then, the second interface unit 71 outputs the acquired data D_wij_deci to the inner product calculation processing unit 72 as data D_wij.

また、内積処理部7の第2インターフェース部71は、判定層に入力するデータの量子化後のデータを、第1RAM5から読み出し、データD_Qinとして取得する。そして、第2インターフェース部71は、取得したデータD_Qinを内積演算処理部72に出力する。 Further, the second interface unit 71 of the inner product processing unit 7 reads out the quantized data of the data input to the determination layer from the first RAM 5 and acquires it as data D_Qin. The second interface unit 71 then outputs the acquired data D_Qin to the inner product calculation processing unit 72 .

内積演算処理部72は、データD_Qin、および、データD_wijを用いて、内積演算処理を実行する。例えば、データD_Qinがn次元ベクトルデータ(n:自然数)であり、データD_wij(重み係数データ)がn次元ベクトルデータであり、下記のように表現される場合、
D_Qin=[x ・・・ x
D_wij=[w ・・・ w
内積演算処理部72は、2つのn次元ベクトルの内積を算出する処理、すなわち、下記数式に相当する処理を実行することで、内積演算結果を取得する。

Figure 0007253468000003

なお、内積演算処理部72は、行列演算処理を行う場合、上記内積演算処理を繰り返し実行することで、行列演算処理結果を取得する。例えば、内積演算処理部72は、2つの行列A、Bの積(行列の積)を求める演算を行う場合、行列Aのi行目の1行に含まれる要素からなる行ベクトルと、行列Bのj列目の1列に含まれる要素からなる列ベクトルとに対して、上記と同様に内積演算処理を実行することで、行列A、Bの積により取得される行列のi行j列目の要素の値(データ)を取得することができる。 The inner product calculation processing unit 72 uses data D_Qin and data D_wij to perform inner product calculation processing. For example, when data D_Qin is n-dimensional vector data (n: natural number) and data D_wij (weighting factor data) is n-dimensional vector data, expressed as follows:
D_Qin=[ x1x2x3 ... xn ]
D_wij=[w 1 w 2 w 3 . . . wn ]
The inner product calculation processing unit 72 acquires the inner product calculation result by executing the process of calculating the inner product of two n-dimensional vectors, that is, the process corresponding to the following formula.
Figure 0007253468000003

When performing matrix calculation processing, the inner product calculation processing unit 72 acquires a matrix calculation processing result by repeatedly executing the inner product calculation processing. For example, when the inner product operation processing unit 72 performs an operation to obtain the product of two matrices A and B (matrix product), the row vector consisting of the elements contained in the i-th row of the matrix A and the matrix B By performing inner product operation processing in the same manner as above on a column vector consisting of elements contained in the first column of the j-th column of the matrix A and B, the i-th row j-th column of the matrix obtained by the product of You can get the value (data) of the element of .

このように処理することで、内積演算処理部72では、任意の行列演算の処理結果を取得することができる。 By processing in this manner, the inner product calculation processing unit 72 can acquire the processing result of any matrix calculation.

内積演算処理部72では、上記のようにして、判定層の処理(例えば、データの次元数を調整するためのアウトマッピング処理(Out Maaping)、全結合層の処理(ベクトル内積処理に相当)、Softmax層の処理等)を実行し、判定層の処理の出力結果に相当するデータをデータDoとして取得する。そして、取得したデータDoは、内積演算処理部72から第1RAM5に出力され、当該データDoは、第1RAM5の所定の領域に書き込まれる。 In the inner product operation processing unit 72, as described above, the determination layer processing (for example, out mapping processing for adjusting the number of dimensions of data (Out Mapping), fully connected layer processing (corresponding to vector inner product processing), Softmax layer processing, etc.) is executed, and data corresponding to the output result of the judgment layer processing is acquired as data Do. Then, the acquired data Do is output from the inner product calculation processing unit 72 to the first RAM 5 and written in a predetermined area of the first RAM 5 .

なお、判定層の処理においても、特徴抽出層の処理と同様に、必要に応じて、活性化関数に相当する処理が実行されてもよい。 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 first RAM 5 by the first interface unit IF1, and is transmitted to the outside as the output data Dout, for example.

以上のように、ニューラルネットワーク用プロセッサ100では、ニューラルネットワークのモデルを決定したら確定する特徴抽出層の処理用データ(重み係数データ)を、ハードウェア化したときのハード規模が小さくてすむROM(本実施形態の場合、第1ROM2)に書き込み、データが変更される可能性のある判定層の処理用データ(重み係数データ)を、データ書き換えができるRAM(本実施形態の場合、第2RAM6)に保持する。そして、ニューラルネットワーク用プロセッサ100では、上記の状態により、ニューラルネットワークによる処理を実行する。つまり、ニューラルネットワーク用プロセッサ100では、変更されることがない特徴抽出層の処理用データ(重み係数データ)を、ハードウェア規模が小さくてすむROMで保持し、変更する可能性がある判定層の処理用データ(重み係数データ)をRAMで保持して、ニューラルネットワーク用処理を実行するので、ハードウェア規模の増大を抑えつつ、高性能なニューラルネットワーク処理を実行することができる。 As described above, in the neural network processor 100, the processing data (weighting coefficient data) of the feature extraction layer, which is determined when the neural network model is determined, is implemented as hardware in a small ROM (this ROM). In the case of the embodiment, the processing data (weighting coefficient data) of the judgment layer, which is written in the first ROM 2) and may be changed, is stored in the rewritable RAM (the second RAM 6 in the case of the present embodiment). do. Then, in the neural network processor 100, processing by the neural network is executed according to the above state. In other words, in the neural network processor 100, the processing data (weighting coefficient data) of the feature extraction layer that is not changed is held in a ROM that requires a small hardware scale, and the decision layer that may be changed is stored. Since processing data (weight coefficient data) is held in RAM and neural network processing is executed, high-performance neural network processing can be executed while suppressing an increase in hardware scale.

また、ニューラルネットワーク用プロセッサ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 neural network processor 100, the weighting factor data determined according to the network configuration of the feature extraction layer are read out in the order required when executing the prediction process (in the order of the process during the prediction process). It is stored in a ROM (first ROM 2 in this embodiment). Therefore, in the neural network processor 100, when the prediction process is executed, the inner product processing unit 7 can predict Weighting factor data for feature extraction layer processing can be obtained in the order required when performing the processing. In other words, in the neural network processor 100, only by inputting a single trigger signal into the first ROM, the weighting coefficient data for processing the necessary feature extraction layers can be obtained in the order of processing. There is no need to perform complex addressing for In the above embodiment, a single trigger signal is used to continuously transfer the data necessary for the processing of the feature extraction layer from the first ROM 2 to the inner product processing unit 7 in the order of processing. However, it is not limited to this. For example, in the neural network processor 100, by designating one address of the first ROM 2, the data necessary for the processing of the feature extraction layer are continuously transferred from the first ROM 2 to the inner product processing unit in the order of processing. 7 may be transferred.

また、ニューラルネットワーク用プロセッサ100では、上記で説明したように、第1ROM2に記憶されているヘッダデータにより、特徴抽出層の処理用のデータ(重み係数データ)を読み出す時間を特定することができる。したがって、ニューラルネットワーク用プロセッサ100では、特定した特徴抽出層の処理用のデータ(重み係数データ)を読み出す時間に基づいて、判定層の処理用のデータ(重み係数データ)を、第2ROM3から第2RAM6に予め転送しておくことができる。これにより、ニューラルネットワーク用プロセッサ100では、特徴抽出層の処理が完了すると、すぐに、判定層の処理用のデータ(重み係数データ)を第2RAM6から取得できる(読み出すことができる)状態にすることができる。つまり、ニューラルネットワーク用プロセッサ100では、特徴抽出層の処理が完了すると、すぐに、判定層の処理が実行できる状態にできる。その結果、ニューラルネットワーク用プロセッサ100では、ニューラルネットワーク用処理を高速化することができる(判定層の処理が完了するまでの時間を短くすることができる)。 Further, in the neural network processor 100, as described above, the header data stored in the first ROM 2 can specify the time to read the data (weighting coefficient data) for the processing of the feature extraction layer. Therefore, in the neural network processor 100, the data (weighting factor data) for processing the determination layer is transferred from the second ROM 3 to the second RAM 6 based on the specified time for reading the data (weighting factor data) for the process of the feature extraction layer. can be forwarded in advance to As a result, in the neural network processor 100, immediately after the processing of the feature extraction layer is completed, the data (weight coefficient data) for the processing of the determination layer can be obtained (read out) from the second RAM 6. can be done. In other words, in the neural network processor 100, when the processing of the feature extraction layer is completed, the processing of the determination layer can be immediately executed. As a result, the neural network processor 100 can speed up the processing for the neural network (the time until the processing of the judgment layer is completed can be shortened).

なお、上記では、判定層の処理用のデータ(重み係数データ)が第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 second ROM 3 has been described, but the data for the processing of the judgment layer (weighting coefficient data) is not limited to this. The weighting factor data) may be input to the neural network processor 100 from the outside. In this case, the neural network processor 100 performs processing as follows. That is, data (weighting coefficient data) for the processing of the decision layer is input from the outside to the first interface unit IF1 as data Din. Then, in the neural network processor 100, as described above, based on the time to read out the data (weighting coefficient data) for processing the specified feature extraction layer, the data for processing the determination layer (weighting coefficient data) data) is transferred from the first interface unit IF1 to the second RAM 6 in advance. As a result, in the neural network processor 100, even when data (weighting coefficient data) for processing the decision layer is input from the outside, the neural network processor 100 immediately after the processing of the feature extraction layer is completed. , the data (weighting factor data) for the processing of the judgment layer can be obtained (read out) from the second RAM 6 .

つまり、ニューラルネットワーク用プロセッサ100では、判定層の処理用のデータ(重み係数データ)が外部から入力される場合においても、特徴抽出層の処理が完了すると、すぐに、判定層の処理が実行できる状態にできる。その結果、ニューラルネットワーク用プロセッサ100では、ニューラルネットワーク用処理を高速化することができる(判定層の処理が完了するまでの時間を短くすることができる)。 In other words, in the neural network processor 100, even when data (weighting coefficient data) for processing the judgment layer is input from the outside, the processing of the judgment layer can be executed immediately after the processing of the feature extraction layer is completed. state. As a result, the neural network processor 100 can speed up the processing for the neural network (the time until the processing of the judgment layer is completed can be shortened).

また、第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 second RAM 6 can be reduced because the second RAM 6 only needs to store and hold data necessary for the determination process (process of the determination layer).
Further, in the neural network processor 100,
(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 second RAM 6 before the process (2), and the first judgment layer process is executed before the process (4). The data required for is stored in the second RAM 6 .

このとき、第2RAM6において、2回目の判定層の処理(次の判定層の処理)の実行に必要なデータのうち、1回目の判定層の処理の実行に必要なデータと異なるデータのみを更新するようにすればよい。これにより、ニューラルネットワーク用プロセッサ100では、第2RAM6のメモリ容量を小さくすることができるとともに、第2RAM6のデータ転送量(更新するデータの量)を少なくすることができる。 At this time, in the second RAM 6, among the data necessary for executing the second judgment layer processing (the next judgment layer processing), only the data that is different from the data necessary for executing the first judgment layer processing is updated. You should do it. Thereby, in the neural network processor 100, the memory capacity of the second RAM 6 can be reduced, and the amount of data transfer (the amount of data to be updated) of the second RAM 6 can be reduced.

≪第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 neural network processor 100A according to a first modification of the first embodiment.

本変形例のニューラルネットワーク用プロセッサ100Aは、第1実施形態のニューラルネットワーク用プロセッサ100において、伸張部8を追加した構成を有している。それ以外については、本変形例のニューラルネットワーク用プロセッサ100Aは、第1実施形態のニューラルネットワーク用プロセッサ100と同様である。 The neural network processor 100A of this modified example has a configuration in which an extension unit 8 is added to the neural network processor 100 of the first embodiment. Otherwise, the neural network processor 100A of this modification is the same as the neural network processor 100 of the first embodiment.

本変形例のニューラルネットワーク用プロセッサ100Aでは、第1ROM2に圧縮されたデータが書き込まれている。 Compressed data is written in the first ROM 2 in the neural network processor 100A of this modification.

伸張部8は、第1ROM2に記憶保持されている圧縮データD1を読み出し、当該圧縮データD1に対して伸張処理を実行し、伸張処理後のデータD_wij_featureを取得する。つまり、伸張部8は、上記伸張処理を実行することで、第1実施形態において、第1ROM2から出力されるデータD_wij_featureを取得する。そして、伸張部8は、伸張処理後のデータD_wij_featureを内積処理部7に出力する。 The decompression unit 8 reads the compressed data D1 stored in the first ROM 2, decompresses the compressed data D1, and obtains data D_wij_feature after decompression. That is, the decompression unit 8 acquires the data D_wij_feature output from the first ROM 2 in the first embodiment by executing the decompression process described above. The decompression unit 8 then outputs the decompressed data D_wij_feature to the inner product processing unit 7 .

ニューラルネットワーク用プロセッサ100Aでは、第1実施形態の第1ROMから出力されるデータD_wij_featureの代わりに、伸張部8から出力されるデータD_wij_featureを用いて、内積処理部7での処理が実行される。内積処理部7での処理は、第1実施形態と同様である。 In the neural network processor 100A, the data D_wij_feature output from the decompression unit 8 is used instead of the data D_wij_feature output from the first ROM of the first embodiment, and the processing in the inner product processing unit 7 is executed. The processing in the inner product processing unit 7 is the same as in the first embodiment.

本変形例のニューラルネットワーク用プロセッサ100Aでは、特徴抽出層のデータを、圧縮したデータとして、第1ROM2に記憶保持するため、第1実施形態に比べて、さらに、第1ROM2で必要となるメモリ容量が少なくなる。したがって、本変形例のニューラルネットワーク用プロセッサ100Aでは、第1ROM2のハードウェア規模をさらに小さくすることができる。その結果、本変形例のニューラルネットワーク用プロセッサ100Aは、第1実施形態のニューラルネットワーク用プロセッサ100に比べて、さらにハードウェア規模を小さくできる。 In the neural network processor 100A of this modified example, since the data of the feature extraction layer are stored in the first ROM 2 as compressed data, the memory capacity required in the first ROM 2 is further reduced compared to the first embodiment. less. Therefore, in the neural network processor 100A of this modified example, the hardware scale of the first ROM 2 can be further reduced. As a result, the neural network processor 100A of this modification can further reduce the hardware scale compared to the neural network processor 100 of the first embodiment.

[他の実施形態]
ニューラルネットワーク用プロセッサ100、100Aの各機能部の一部または全部は、マイクロコードにより、あるいは、マイクロコードとともに所定のハードウェアにより実現されるものであってもよい。
[Other embodiments]
Some or all of the functional units of the neural network processors 100 and 100A may be implemented by microcode or by predetermined hardware together with microcode.

また、ニューラルネットワーク用プロセッサ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 neural network processors 100 and 100A, as disclosed in Prior Art Document A below, a neural network based on a Binarized-DCNN (DCNN: Deep Convolution Neural Network) (hereinafter referred to as "BNN") is implemented. can be In this case, the weight coefficient data of the feature extraction layer realized by BNN may be stored in the ROM (eg, the first ROM 2) as uncompressed data or compressed data.
(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 neural network processors 100 and 100A, A neural network (referred to as a “multivalued neural network”) having a multivalued basis matrix that is a binary basis matrix obtained by vector decomposition of BNN may be implemented. In this case, the weight coefficient data of the feature extraction layer realized by the multivalued neural network may be stored in the ROM (eg, the first ROM 2) as uncompressed data or compressed data.

上記実施形態(変形例を含む)では、ニューラルネットワーク用プロセッサ100、100Aが、RAMを第1RAM5、第2RAM6を有する構成である場合について、説明したが、これに限定されることはない。ニューラルネットワーク用プロセッサ100、100Aにおいて、例えば、第1RAM5、第2RAM6を1つのRAMにより実現するようにしてもよい。 In the above embodiments (including modifications), the neural network processors 100 and 100A are configured to have the first RAM 5 and the second RAM 6, but the configuration is not limited to this. In the neural network processors 100 and 100A, for example, the first RAM 5 and the second RAM 6 may be realized by one RAM.

また、上記実施形態(変形例を含む)における各種のデータ転送、信号の送受信は、上記で説明した形態に限定されるものではなく、各機能部において、直接接続された信号線により、データ転送、信号の送受信が実行されるものであってもよいし、また、バスを介して、データ転送、信号の送受信が実行されるものであってもよい。 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 neural network processors 100 and 100A.

上記実施形態で説明したニューラルネットワーク用プロセッサ100、100Aの各ブロック(各機能部)は、LSIなどの半導体装置により個別に1チップ化されても良いし、一部又は全部を含むように1チップ化されても良い。また、上記実施形態で説明したニューラルネットワーク用プロセッサ100の各ブロック(各機能部)は、複数のLSIなどの半導体装置により実現されるものであってもよい。 Each block (each functional unit) of the neural network processors 100 and 100A described in the above embodiments may be individually integrated into one chip by a semiconductor device such as LSI, or may be integrated into one chip so as to include part or all of them. may be changed. Also, each block (each functional unit) of the neural network processor 100 described in the above embodiment may be implemented by a plurality of semiconductor devices such as LSIs.

なお、ここでは、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 neural network processor 1 control unit 2 first ROM
3 Second ROM
5 1st RAM
6 Second RAM
7 inner product processing unit 8 decompression unit

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:
請求項5に記載のニューラルネットワーク用処理方法をコンピュータに実行させるためのプログラム。 A program for causing a computer to execute the neural network processing method according to claim 5 .
JP2019137468A 2019-07-26 2019-07-26 Neural network processor, neural network processing method, and program Active JP7253468B2 (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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