WO2019164237A1 - Method and device for performing deep learning calculation by using systolic array - Google Patents

Method and device for performing deep learning calculation by using systolic array Download PDF

Info

Publication number
WO2019164237A1
WO2019164237A1 PCT/KR2019/002029 KR2019002029W WO2019164237A1 WO 2019164237 A1 WO2019164237 A1 WO 2019164237A1 KR 2019002029 W KR2019002029 W KR 2019002029W WO 2019164237 A1 WO2019164237 A1 WO 2019164237A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
input
feature map
input feature
operator
Prior art date
Application number
PCT/KR2019/002029
Other languages
French (fr)
Korean (ko)
Inventor
강성호
권형달
이천
임윤재
Original Assignee
삼성전자주식회사
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 삼성전자주식회사 filed Critical 삼성전자주식회사
Publication of WO2019164237A1 publication Critical patent/WO2019164237A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present disclosure provides a method and apparatus for performing a convolution operation of an input feature map and a filter using a systolic array in a deep learning operation based on a convolution neural network (CNN). It is about.
  • CNN convolution neural network
  • AI Artificial Intelligence
  • AI technology is composed of elementary technologies using machine learning (deep learning) and machine learning.
  • Machine learning is an algorithm technology that classifies / learns characteristics of input data by itself.
  • Element technology is a technology that simulates the functions of human brain cognition and judgment by using machine learning algorithms such as deep learning. It consists of technical areas such as understanding, reasoning / prediction, knowledge representation, and motion control.
  • Linguistic understanding is a technology for recognizing and applying / processing human language / characters and includes natural language processing, machine translation, dialogue system, question and answer, speech recognition / synthesis, and the like.
  • Visual understanding is a technology that recognizes and processes objects as human vision, and includes object recognition, object tracking, image retrieval, person recognition, scene understanding, spatial understanding, and image enhancement.
  • Inference prediction is a technique of judging information, logically inferring, and predicting information, and includes knowledge / probability based inference, optimization prediction, preference based planning, and recommendation.
  • Knowledge expression is a technology that automatically processes human experience information into knowledge data, and includes knowledge construction (data generation / classification) and knowledge management (data utilization).
  • Motion control is a technology for controlling autonomous driving of a vehicle and movement of a robot, and includes motion control (navigation, collision, driving), operation control (action control), and the like.
  • the present disclosure relates to a deep learning operation that learns output data by performing a convolution operation on input data through a systolic array, and operates through a mapping to change the order of data input to the systolic array operator. It is an object of the present invention to provide a method and apparatus for reducing the amount of power consumed to perform the operation and increasing the operation speed.
  • FIG. 1A is a diagram illustrating a deep learning calculation method using an artificial neural network
  • FIG. 1B is a diagram illustrating data and a filter of an input feature map provided as an input in a deep learning operation.
  • 1C is a diagram illustrating a process of performing a convolution operation.
  • FIG. 2 is a conceptual diagram illustrating a method of performing a convolution operation using a conventional systolic array.
  • FIG. 3A is a diagram illustrating a method of performing a deep learning based convolution operation according to an embodiment of the present disclosure
  • FIG. 3B illustrates an example of changing an input order of data of an input feature map according to an embodiment of the present disclosure. Schematic of how to map to a systolic array.
  • FIG. 3C is a diagram illustrating a method of generating an output feature map by performing a convolution operation using a systolic array operator and accumulating the calculated result values.
  • FIG. 4 is a flowchart illustrating a method of performing a deep learning operation using a systolic array according to an embodiment of the present disclosure.
  • FIG. 5A is a diagram illustrating a method of performing a deep learning based convolution operation according to an embodiment of the present disclosure
  • FIG. 5B is a diagram illustrating data of an input feature map and a weight of a filter according to an embodiment of the present disclosure. It is a figure which shows the method to do.
  • FIG. 6 is a block diagram illustrating components of an apparatus for performing a convolution operation using a systolic arrangement according to an embodiment of the present disclosure.
  • FIGS. 7A and 7B are diagrams illustrating a method of changing an input order of data of an input feature map and mapping the systolic array according to an embodiment of the present disclosure.
  • FIG. 8 is a block diagram illustrating components of an apparatus for performing a convolution operation using a systolic arrangement according to an embodiment of the present disclosure.
  • FIG. 9A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure
  • FIG. 9B is a convolution using a systolic arrangement according to an embodiment of the present disclosure.
  • FIG. 10A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure
  • FIG. 10B is used to perform a convolution operation using a systolic array according to an embodiment of the present disclosure. It is a flowchart showing how to do it.
  • FIG. 11A is a diagram illustrating an operation circuit for performing a convolution operation using a systolic array according to an embodiment of the present disclosure
  • FIG. 11B is an output feature map generated according to a convolution operation of an input feature map and a filter. Is a diagram illustrating.
  • an embodiment of the present disclosure provides an input feature map such that data having the same value is repeated a predetermined number of times according to a sequential clock and inputted to a multiplication addition operator in a systolic array operator.
  • the mapping may change an input order of the input data such that two identical input data values of the input feature map are repeatedly input to the systolic array operator.
  • the filter has an N by N (NXN) size
  • the mapping step may be such that data of the input feature map is repeatedly input to the systolic array operator as many times as the size N of the filter.
  • the order of input of data in the input feature map can be changed.
  • the generating of the output feature map may include performing a convolution operation based on the stride value of the filter and the data of the input feature map overlapping in the first and second directions due to the stride. Selecting output values and accumulating the selected output values to generate an output feature map due to the combination of the input feature map and the filter.
  • the method may further comprise identifying data having a zero value among the data of the input feature map.
  • mapping step may group data having the zero value so that data having the zero value is repeatedly input to the systolic operator.
  • the filter has an N by N (NXN) size
  • the mapping step causes the zero value to be repeatedly input to the systolic array operator as many times as the data is equal to the size N of the filter.
  • Value data can be collected and grouped by the size (N) of the filter.
  • the method further includes storing row and column positions on the input feature map of the data of the data having the zero value in memory, the convolution In the performing of the operation, the stored position information may be read from the memory, and multiplication and addition operations may be skipped with respect to the data having the zero value with reference to the read position information.
  • the method further includes acquiring position information on the systolic arrangement of the identified zero value data when data identified with zero value is input, wherein generating the output feature map comprises: The output values for each area of the input feature map may be accumulated and summed based on the acquired position information of the zero value data.
  • an embodiment of the present disclosure includes a processor that performs a convolution operation of data of an input feature map and a weight value of a filter using a systolic array, and the processor includes a sequential clock ( a mapper for mapping the data of the input feature map to a systolic array by changing the order of the data of the input feature map such that data having the same value is repeated a predetermined number of times according to a clock) and inputted to a multiplication adder.
  • a systolic array operator including a plurality of multiplication addition operators that perform a convolution operation on the mapped input feature map data or the weight value of the filter, and accumulate and output the convolutional output values.
  • Perform deep learning operations including an adder that generates an output feature map. It provides an electronic device (electronic device).
  • the mapper may change an input order of the input data such that two identical input data values of the input feature map are repeatedly input to the systolic array operator.
  • the filter has an N by N (NXN) size
  • the mapper repeatedly repeats the number of times the data of the input feature map is equal to the size N of the filter, the multiplication addition operator in the systolic array operator.
  • the input order of the data of the input feature map may be changed to be input to.
  • the accumulator selects the convolutionally calculated output values in consideration of the stride value of the filter and the data of the input feature map overlapping in the first and second directions due to the stride,
  • the output feature maps for each area of the input feature map may be generated by accumulating and adding the selected output values.
  • the mapper may identify data having a zero value among data of the input feature map.
  • the mapper may group the data having the zero value so that the data having the identified zero value is repeatedly input to the systolic operator.
  • the filter has a size of N by N (NXN), and the mapper uses the zero value to repeatedly input the zero value to the systolic array operator as many times as the data is equal to the size N of the filter.
  • Data having a may be collected and grouped by the size (N) of the filter.
  • the electronic device further includes a memory for storing row and column positions of the data having the zero value, and the processor reads the stored position information from the memory.
  • the multiplication and addition operations may be skipped with respect to the data having the zero value with reference to the read position information.
  • the electronic device may further include an unmapper that obtains location information on the systolic array of data identified by the value 0 of the data of the input feature map mapped by the mapper to the systolic array.
  • the unmapper includes an adder-tree control circuit for controlling the accumulator to accumulate and sum output values for each region of the input feature map based on the acquired position information of the zero value data. It may include.
  • an embodiment of the present disclosure provides a computer-readable recording medium, and the recording medium repeats a predetermined number of times data having the same value according to a sequential clock.
  • Changing the order of data of an input feature map to be input to a multiplication adder in a systolic array operator to map data of the input feature map into a systolic array, data and filters of the mapped input feature map Inputting the weight value to the systolic array operator to perform a convolution operation, and accumulating the convolutional output values to generate an output feature map. It may include instructions about.
  • ... unit means a unit for processing at least one function or operation, which is implemented in hardware or software or a combination of hardware and software. Can be.
  • FIG. 1A is a diagram illustrating a deep learning calculation method using an artificial neural network
  • FIG. 1B illustrates data and filters 110-1 to 110 of an input feature map 100 provided as an input in a deep learning operation.
  • -n is a schematic diagram.
  • An artificial intelligence (AI) algorithm including deep learning inputs the input data 10 to an artificial neural network (ANN), and outputs the output data 30 through operations such as convolution. It is characterized by learning.
  • Artificial neural networks can refer to a computer scientific architecture that models the biological brain. In an artificial neural network, nodes corresponding to neurons in the brain are connected to each other and operate collectively to process input data. Examples of various types of neural networks include convolutional neural networks (CNNs), recurrent neural networks (RNNs), deep belief networks (DBNs), and restricted Boltzman machines (Restricted Boltzman). Machine, RBM), but is not limited thereto.
  • CNNs convolutional neural networks
  • RNNs recurrent neural networks
  • DNNs deep belief networks
  • restricted Boltzman machines restricted Boltzman machines
  • Machine Restricted Boltzman
  • RBM restricted Boltzman machines
  • a feed-forward neural network neurons in the neural network have links with other neurons. Such connections may extend in one direction, for example in a forward
  • input data 10 is input to an artificial neural network, and output data 30 is transmitted through a convolutional neural network (CNN) 20 including one or more layers.
  • CNN convolutional neural network
  • the output structure is shown.
  • the artificial neural network may be a deep neural network having two or more layers.
  • the convolutional neural network 20 can be used to extract "features" such as borders, line colors, etc. from the input data 10.
  • the convolutional neural network 20 may include a plurality of layers. Each layer may receive data and may process data input to the layer to generate data output from the layer.
  • the data output from the layer may be a feature map generated by convolutional operation of an image or input feature map input to the convolutional neural network 20 with weight values of one or more filters. have.
  • Initial layers of the convolutional neural network 20 may be operated to extract low level features such as edges or gradients from the input.
  • Subsequent layers of the convolutional neural network 20 may extract progressively more complex features, such as eyes, nose, and the like in the image.
  • the input feature map 100 may be a set of pixel values or numerical data of an image input to an artificial neural network, but is not limited thereto.
  • the input feature map 100 may be defined as a pixel value of an image to be learned through an artificial neural network.
  • the input feature map 100 may have a pixel of 256 ⁇ 256 and a depth of K.
  • the value is exemplary and the pixel size of the input feature map 100 is not limited to the above example.
  • N filters 110-1 to 110-n may be formed.
  • Each of the plurality of filters 110-1 to 110-n may include a weight value of n by n (n ⁇ n).
  • each of the plurality of filters 110-1 to 110-n may have a pixel of 3 ⁇ 3 and a depth value of K.
  • the size of the filter is exemplary, and the size of each of the plurality of filters 110-1 to 110-n is not limited to the above example.
  • 1C is a diagram illustrating a process of performing a convolution operation on a deep learning basis.
  • multiplication and addition operations of the input feature map 100 and the filter 110 in each layer generate an output value, and an output value.
  • the process of performing a convolution operation is a process of performing a multiplication and an addition operation by applying a filter 110 having a predetermined size, that is, an n ⁇ n size, from the upper left to the lower right of the input feature map 100 in the current layer.
  • a filter 110 having a predetermined size that is, an n ⁇ n size, from the upper left to the lower right of the input feature map 100 in the current layer.
  • To x 33 ) are multiplied by the weights w 11 to w 33 of the filter 110, respectively.
  • the output of the multiplication operation that is, x 11 * w 11 , x 12 * w 12 , x 13 * w 13 , x 21 * w 21 , x 22 * w 22 , x 23 * w 23 , x 31 * w 31 , x 32 * w 32 and x 33 * w 33 are accumulated and summed to generate first-first output data y 11 of the output feature map 120.
  • the calculation is performed while moving by the unit of data from the first area 101 on the upper left side of the input feature map 100 to the second area 102.
  • the number of data movement in the input feature map 100 during the convolution operation is called a stride, and the size of the output feature map 120 generated according to the size of the stride may be determined.
  • the stride is 1, an operation of multiplying a total of nine input data (x 12 to x 34 ) included in the second region 102 by the weight values (w 11 to w 33 ) of the filter 110 is performed.
  • the number of multiplication and addition operations is performed according to the number of data of the input feature map 100 and the size of the filter 110. It will increase. In the case of an image file having a large pixel size, operations in units of gigabytes per second need to be performed, which causes a problem of increasing time and power required for the calculation.
  • FIG. 2 is a conceptual diagram illustrating a method of performing a convolution operation using a conventional systolic array.
  • each data of the input feature map 200 is mapped to a systolic array that is sequentially input to the multiplication adders 211 to 219 according to a clock having a constant latency.
  • a clock having a constant latency can be.
  • the first-first data x 11 of the first row 1 of the systolic array may be input to the first multiplication adder 211 to the first clock.
  • the 1-1 data x 11 may be multiplied by a weight value of w 11 in the first clock.
  • the first-first data x 11 is input to the second multiplication addition operator 212, and the second-first data x 21 is input to the first multiplication addition operator 211.
  • 1-2 data (x 12 ) may be input to fourth multiplication addition operator 214.
  • the first-first data x 11 is input to the third multiplication addition operator 213, and the second-first data x 21 is input to the second multiplication addition operator 212.
  • the 1-2 data x 12 may be input to the fifth multiplication addition operator 215.
  • the 3-1 data x 31 is input to the first multiplication adder 211, and the 2-2 data x 22 is input to the fourth multiplication adder 214.
  • the ⁇ 3 data x 13 may be input to the seventh multiplication addition operator 217.
  • the input data 200 is input to each multiplication adder in the multiplication adders 211 to 219 according to the sequential clocks, and multiplication and addition operations with the input weight value can be performed according to the clocks.
  • An output feature map may be generated by accumulating and summing values output through multiplication and addition of each data of the input feature map 200 sequentially input and weight values.
  • the convolution operation using the systolic array shown in FIG. 2 may be faster in speed than the convolution operation shown in FIG. 1C.
  • 3A is a diagram illustrating a method of performing a deep learning based convolution operation.
  • a process of performing a multiplication and an addition operation by applying a filter 310 having a predetermined size, that is, a 3 ⁇ 3 size, is performed from the upper left to the lower right of the input feature map 300.
  • a convolution operation may first perform three-by-three, that is, three data in a first direction and three data in a second direction in the upper left first region 301 of the input feature map 300. to perform the operation of multiplying the total of nine data (x 11 to x 33), a weight value (weight) (w 11 to w 33) of the filter 310 respectively include.
  • the output of the multiplication operation that is, x 11 * w 11 , x 12 * w 12 , x 13 * w 13 , x 21 * w 21 , x 22 * w 22 , x 23 * w 23 , x 31 * w 31 , x 32 * w 32 and x 33 * w 33 are accumulated and summed to generate first-first output data y 11 of the output feature map 320.
  • the stride by the second region 302 in the first area 301 at the top left of the input feature map 300 1, and a total of 9 input data contained in the second region 302 multiplies the weight values (w 11 to w 33 ) of the filter 310, and outputs x 12 * w 11 , x 13 * w 12 , x 14 * w 13 , x 22 *, which are output values of the multiplication operation.
  • the total of nine data included in the third region 303 is multiplied by the weight values w 11 to w 33 of the filter 310.
  • the operation is performed, and the output values of the multiplication operation are x 21 * w 11 , x 22 * w 12 , x 23 * w 13 , x 31 * w 21 , x 32 * w 22 , x 33 * w 23 , x 41 * w
  • the second-first output data y 21 of the output feature map 320 is generated.
  • Duplicate data among the data of the input feature map 300 between the third region 303 and the first region 301 to be used for calculation is x 21 , x 22 , x 23 , x 31 , x 32 , x 33 . There are a total of six data included.
  • the input data (x 22 , x 23 , x 32 , x 33 , x 42 , x 43 ) included in the specific area 300A among the input data is duplicated three times in total to multiply and add operations. Will be entered.
  • the number of overlaps may be determined according to the size of the filter and the value of the stride.
  • the data of the input feature map 300 is sequentially input as x 11 , x 12 , x 13 , x 12 , x 13 , x 14 , x 13 , x 14 , x 15 , ..., Must be toggled, resulting in increased power consumption.
  • FIG. 3B is a diagram illustrating a method of changing an input sequence of data of the input feature map 300 and mapping to a systolic array according to an embodiment of the present disclosure.
  • data of the input feature map 300 is mapped to a systolic array into which data is input according to a sequential clock, and data having the same value of the input feature map 300 is repeated to generate a system.
  • the order of the data of the input feature map 300 may be changed to be input to each multiplication addition operator 311 to 319 in the toll array operator. For example, in the first row 1 of the input feature map 300 mapped to the systolic array, the data input to the systolic array operator according to the first clock, the second clock, and the third clock are all the same x. 11 (300-1).
  • data input to the systolic array operator according to the fourth clock, the fifth clock, and the sixth clock are all the same x 12 (300-2), and the seventh and eighth clocks.
  • data input to the systolic array operator according to the ninth clock may be the same x 13 (300-3).
  • the data input to the systolic array operator according to the second clock, the third clock, and the fourth clock are all the same x 12 (300). -4), and the data input to the systolic array operator according to the third clock, the fourth clock, and the fifth clock in the third row 3 may all be the same x 13 (300-5).
  • the first multiplication addition operator 311 includes x 11 data 300-1 of the input feature map 300 according to the first to third clocks. ) May be repeatedly input.
  • the fourth multiplier addition computing unit 314, the second clock to the first and fourth input data x 12 (300-4) of the input feature map 300 according to the clock is repeated, and seventh multiplication addition operator 317 is The x 13 data 300-5 may be repeatedly input according to the third to fifth clocks.
  • the input feature map 300 may be mapped to a systolic array such that data having the same value is repeatedly input to the systolic array operator for a predetermined number of times.
  • the predetermined number of times may be equal to the size of the filter 310. That is, when the size of the filter is n ⁇ n, the input feature map 300 may be mapped such that data having the same value is duplicated n times and repeatedly input to the systolic array operator. For example, when the size of the filter 310 is 3 ⁇ 3, x 11 data 300-1, x 21 data 300-2, and x 31 data 300-3 of the input feature map 300 are shown. The input sequence may be changed such that the x 12 data 300-4 and the x 13 data 300-5 are repeated three times and input to the systolic array operator.
  • the number of times the data of the input feature map 300 is repeated is not limited to the size of the filter. In one embodiment, the number of times data in the input feature map 300 is repeated and input to the systolic array operator may be twice. This will be described with reference to FIGS. 5A and 5B.
  • FIG. 3C is a diagram illustrating a method of generating an output feature map by performing a convolution operation using a systolic array operator and accumulating the calculated result values.
  • a process of inputting a weight value of an input feature map and a filter to a systolic array operator and multiplying and adding data of the input feature map and a weight value of a filter according to a sequential clock is performed.
  • the first-first data x 11 and the first-first weight w 11 may be multiplied by the first-first calculator 1-1 in the first clock.
  • the first-first data x 11 and the first-two weight w 12 are multiplied by the first-first calculator 1-1, and x 11 * which has been calculated in the first clock. Can be added with w 11 .
  • each data of the input feature map and the weight value of the filter may be sequentially multiplied and added by a plurality of systolic array operators and output according to each cycle.
  • an output value computed by the systolic array operator is selected based on a combination of the data of the input feature map and the weight value of the filter that is changed as the filter is strided on the input feature map.
  • the output values may be cumulatively summed to generate an output feature map. That is, calculation is performed by the systolic array operator based on a combination of the data of the input feature map and the weight of the filter which are changed as the filter is stradded in the first direction (horizontal direction) and the second direction (vertical direction) on the input feature map. If the selected output value is selected and the selected output values are cumulatively summed, an output characteristic map identical to that of performing a convolution operation can be obtained.
  • x 11 * w 11 multiplied by the first-first calculator 1-1 For example, x 11 * w 11 multiplied by the first-first calculator 1-1, x 12 * w 12 multiplied by the 1-2 operator 1-2, and first-3.
  • X 13 * w 13 multiplied by the operator 1-3 x 21 * w 21 multiplied by the 2-1 operator 2-1, multiplication by the second-2 operator 2-2 Computed x 22 * w 22 , x 23 * w 23 multiplied by the 2-3 operator (2-3), x 31 * w 31 multiplied by the 3-1 operator (3-1),
  • Selectively accumulating and summing x 32 * w 32 multiplied by the 2-3 operator 3-2 and x 33 * w 33 multiplied by the 3-3 operator 3-3 A first-first output value y 11 of the feature map may be generated.
  • the conventional systolic array operation uses a method of sequentially inputting the data of the input feature map 300 without considering input data that is duplicated, and thus, it is necessary to toggle the value of the input data according to all clocks. do.
  • the data of the input feature map 300 is input according to a sequential clock, such as x 11 , x 12 , x 13 , x 12 , x 13 , x 14 , ..., buses at all clocks. You need to toggle the data.
  • a sequential clock such as x 11 , x 12 , x 13 , x 12 , x 13 , x 14 , ..., buses at all clocks. You need to toggle the data.
  • deep learning operations using convolutional neural networks require performing data operations in giga seconds per second, which is consumed inside the processor or chip when the bus data must be toggled according to each clock. The amount of power is increased. In mobile devices, applications, or computing environments where only limited power needs to be used, deep learning through convolutional computation
  • x of the data of the input feature map 300 is filtered as the filter 310 is straddled by 1 in the first direction (horizontal direction) and the second direction (vertical direction) on the input feature map 300.
  • 22 , x 23 , x 32 , x 33 , x 42 , and x 43 can be multiplied three times in total.
  • a systolic arrangement is repeated by overlapping data of the input feature map 300 by the number of times input and reused among the data of the input feature map 300 by multiplication and addition operations.
  • Data of the input feature map 300 may be mapped to be input to the calculator.
  • the number of iterations of data input to the systolic array operator may be determined by the size of the filter 310.
  • the size of the filter 310 is n ⁇ n
  • the data of the input feature map 300 may be mapped to be repeated n times and input to the systolic array operator.
  • the order of data input to the multiplication and addition operators in the systolic array operator is x 11 , x 11 , x 11 , x 21 , x 21 , x 21 , x 31 , x 31 , x
  • the data of the input feature map 300 may be mapped to be repeated three times in the order of 31 , ...,.
  • data of the mapped input feature map 300 is repeatedly input according to each clock, and a value output by multiplying and adding a weight value of the input data and a filter and outputting the same. These cumulative sums may be selectively generated to generate an output feature map.
  • the amount of accessing the memory as compared to the conventional convolution operation is determined.
  • the amount of bus data toggles is significantly reduced, which can reduce the amount of power consumed inside the processor or chip.
  • FIG. 4 is a flowchart illustrating a method of performing a deep learning operation using a systolic array according to an embodiment of the present disclosure.
  • Each step S410 to S430 illustrated in FIG. 4 includes a computing device or an application processor (AP) including a processor or a chip that performs a deep learning operation based on a convolutional neural network. May be performed by a mobile device.
  • AP application processor
  • the term 'electronic device' encompassing computing devices and mobile devices will be used.
  • the electronic device maps the data of the input feature map into the systolic array so that data having the same value is repeated a predetermined number of times and inputted to the multiplication addition operator in the systolic array operator.
  • the electronic device may map data of the input feature map into a systolic array so as to be sequentially input to the multiplication adder according to a clock having a constant latency.
  • the electronic device may change an input order of data of an input feature map in the systolic array so that input data input to the multiplication addition operator in the systolic array operator is repeatedly input at least two times.
  • the number of iterations of data input to the multiplication addition operator in the systolic array operator may be determined by the size of the filter. For example, when the size of the filter is n ⁇ n, the electronic device may map the data of the input feature map such that the data of the input feature map is repeated n times and input to the systolic array operator.
  • the electronic device inputs the weighted values of the mapped input feature map data and the filter to the systolic array operator to perform a convolution operation.
  • the electronic device repeatedly inputs the data of the input feature map to the multiplication adder in the systolic array operator according to the sequential clocks, and the weight value of the filter according to each clock is supplied to the multiplication adder. You can perform convolution operations as you type.
  • the electronic device accumulates the convolutionally calculated output values to generate an output feature map.
  • the electronic device may generate output data by accumulating and adding the input feature map data calculated by each of the plurality of multiplication addition operators in the systolic array operator and the weight product of the filter.
  • the electronic device may selectively accumulate the plurality of output data calculated by the plurality of multiplication adders by referring to the movement of the filter on the input feature map.
  • the electronic device may select a plurality of output values based on a combination of data of the input feature map according to the value of the stride and the weight of the filter, and accumulate and sum the selected output values to generate an output feature map. .
  • 5A is a diagram illustrating a method of performing a deep learning based convolution operation.
  • FIG. 5A there is shown a 3 ⁇ 3 filter 510 that is multiplied and added to the data values of the input feature map 500 while moving by stride 1 on the input feature map 500.
  • the data x 11 to x 33 are multiplied by the weights w 11 to w 33 of the filter 510, respectively.
  • the first region 501 of the input feature map 500 strides from the first region 501 to the second region 502 by a total of nine input data (x 12 to x 34 ) included in the second region 502.
  • the output values of the multiplication operation x 12 * w 11 , x 13 * w 12 , x 14 * w 13 , x 22 * w 21 , x 23 * w 22 , x 24 * w 23 , x 32 * w 31 , x 33 * w 32 , x 34 * w 33 are cumulatively summed to form the 1-2 output data (y 12 ) of the output feature map 520. Is generated.
  • the data used for the calculation is x 12 , x A total of six data including 13 , x 22 , x 23 , x 32 , and x 33 . That is, while the multiplication and addition operations for the first region 501 and the multiplication and addition operations for the second region 502 are sequentially calculated, x 12 , x 13 , and x 22 of the data of the input feature map 500 are calculated. , x 23 , x 32 and x 33 will be used twice each.
  • the term 'used' may mean that each value of the input data 500 is sequentially read in a processor or chip according to a clock. Since the value of the data changes according to each clock, the bus data must be toggled for each sequential clock in the processor or the chip, and thus the throughput is high, and thus, power may be consumed.
  • FIG. 5B is a diagram illustrating a method of convolutional operation of data of an input feature map and a weight of a filter using a systolic arrangement according to an embodiment of the present disclosure.
  • the input feature map 500 may be mapped to a systolic array in which data are input to the systolic operator 530 according to a sequential clock.
  • the data of the input feature map 500 may be mapped such that data having the same value is repeated twice and input into the systolic operator 530 according to the clock.
  • the input data is systolic in the order x 11 , x 12 , x 12 , x 13 , x 13 , x 14 , ..., It may be input to the calculator 530.
  • the input data x 12 (500-1) may be repeated twice and input to the systolic operator 530.
  • the input and the second clock from the systolic x 12 computing unit 530 the a x 12 in three clocks can be input to a systolic arithmetic unit 530.
  • the input data x 13 (500-2) in the first row may also be repeated twice and input to the systolic operator 530.
  • a 4 is input to clock the systolic operator 530 x 13 in the fifth clock may also be a 13 input x to a systolic arithmetic unit 530.
  • the input data may be repeatedly input twice to the systolic operator 530 according to a sequential clock.
  • the data of the input feature map 500 is a systolic operator 530 in the order of x 13 , x 14 , x 14 , x 15 , x 15 , x 16 , ...,. ) Can be entered.
  • x 14 (500-3) of the input data is repeated twice and input to the systolic operator 530, and x 15 (500-4) is also repeated twice and the systolic operator It may be input to 530.
  • Each data of the input feature map 500 illustrated in FIG. 5B may be multiplied and added to the filter 510 input to the systolic operator 530 according to the sequential clock.
  • the weight value of the filter 510 may be inputted to the systolic operator 530 by overlapping twice according to the sequential clock.
  • the input feature map 500 may be mapped to a systolic arrangement such that data having the same value is repeated twice and input to the systolic operator 530.
  • data values input to the systolic operator 530 are duplicated twice according to the sequential clocks.
  • data input to the systolic operator 530 is changed according to all conventional clocks.
  • the number of toggles of bus data can be significantly reduced. Accordingly, power consumption in the processor or chip performing multiplication and addition operations may be reduced through the systolic operator 530.
  • FIG. 6 is a block diagram illustrating components of an electronic device 600 that performs a convolution operation using a systolic arrangement, according to an embodiment of the present disclosure.
  • the electronic device 600 may include a processor 610.
  • the electronic device 600 may be a computing device or a mobile device that performs a deep learning operation based on a convolutional neural network.
  • the processor 610 may include a processing element (PE) that performs multiplication and addition operations.
  • PE processing element
  • the processor 610 may be configured with at least one of a central processing unit, a microprocessor, and a graphic processing unit, but is not limited thereto.
  • the processor 610 may be an application processor (AP) for executing an application.
  • AP application processor
  • the processor 610 may access the memory to read data needed for the operation and to store the result of the operation again.
  • the processor 610 may execute a load instruction that reads data from the memory and a store instruction that stores the data in the memory.
  • the processor 610 may include a mapper 611, a systolic operator 612, and an adder 613.
  • the mapper 611 stores the data of the input feature map or the weight of the filter such that data having the same value is repeatedly input to the systolic operator 612 with respect to the data of the input feature map or the weight of the filter. Mapping may be performed to change the input sequence of the. In one embodiment, the mapper 611 inputs the order of the data of the input feature map such that the data of the input feature map is repeatedly input to the multiplication addition operator in the systolic operator 611 by the same number of times as the size N of the filter. sequence) can be changed.
  • the mapper 611 inputs the input feature map such that x 11 , x 12 , x 13 ,..., Each input data is repeatedly input three times to the multiplication adder. Can be mapped to a systolic array.
  • the present invention is not limited thereto, and the mapper 611 may map the input feature map such that the data of the input feature map is repeated twice and input to the multiplication addition calculator.
  • the systolic operator 612 may include a plurality of multiplication addition operators.
  • Each of the plurality of multiplication addition operators may be configured as a flip-flop circuit.
  • Each of the plurality of multiplication addition operators may multiply the input data and the weight value of the filter according to a sequential clock having a constant latency, and perform an operation of adding the multiplied values.
  • An adder 613 may accumulate output values obtained by multiplying the data of the input feature map by the weight value of the filter to generate an output feature map.
  • the accumulator 613 is configured by each of the plurality of multiplication addition operators of the systolic array operator 612 based on a combination of the data of the input feature map and the weight value of the filter, which changes as the filter is strided on the input feature map. You can select the calculated output value.
  • the accumulator 613 may accumulate and sum the selected output values to generate an output feature map.
  • FIGS. 7A and 7B are diagrams illustrating a method of changing an input order of data of an input feature map and mapping the systolic array according to an embodiment of the present disclosure.
  • data of the input feature map 700 may be mapped to a systolic array into which data is input according to a sequential clock.
  • the input feature map 700 may include data having a value of zero.
  • the black pixel may have a pixel value of zero.
  • x 22 and x 33 of the data of the input feature map 700 may have a pixel value of zero.
  • zero-skipping a method of identifying data having a zero value among the data of the input feature map 700 and not performing multiplication and addition operations with reference to the identified position of the zero data is called zero-skipping.
  • x 22 having a zero value at the third clock is input to the multiplication addition operator in the systolic array operator 710, and x 22 having a zero value at the fifth clock is input to the multiplication addition calculator. Can be entered.
  • x 33 with zero values in the seventh and ninth clocks may be input to the multiplication addition operator in the systolic array operator 710.
  • x 32 having a non-zero value again may be input to the systolic array operator 710 according to the sixth clock in the first row 1.
  • a second line (2) in is input to a systolic array computing unit to the data x 22 and x 33 are data of which has a value other than 0 and shifts having a value of zero in accordance with the sequential clock.
  • FIG. 7B is a diagram illustrating a method of changing an input sequence of data of the input feature map 700 and mapping to a systolic array according to an embodiment of the present disclosure.
  • data of the input feature map 700 is mapped to a systolic array into which data is input according to a sequential clock, and data having the same value of the input feature map 700 is repeated.
  • the order of the data in the input feature map 700 may be changed to be input to each multiplication addition operator in the tonal array operator 710.
  • data (x 22 and x 33 ) having zero values among the data of the input feature map 700 may be grouped to be repeatedly input to the systolic operator 710.
  • x 22 which has zero value, may be grouped into the first group 701 to be repeated a predetermined number of times and input to the systolic array operator 710.
  • data of 33 x has a value of 0 can be grouped into a second group 702 so that x 22 is repeated as many times as the repetition number of times with the same input on a systolic array computing unit 710.
  • the number of times data having zero value is repeated may be determined by the size of the filter. For example, when the size of the filter is n ⁇ n, the value 0 may be mapped n times to be input to the systolic operator 710. In the embodiment illustrated in FIG. 7B, the filter has a size of 3 ⁇ 3, and may be mapped such that data x 22 and x 33 having a value of 0 are repeated three times and input to the systolic operator 710.
  • FIG. 8 is a block diagram illustrating components of an electronic device 800 that performs a convolution operation using a systolic arrangement according to an embodiment of the present disclosure.
  • the systolic operator 812 and the accumulator 813 illustrated in FIG. 8 are components that perform the same functions and operations as the systolic operator 612 and the accumulator 613 illustrated in FIG. 6. Description is omitted.
  • the electronic device 800 may include a processor 810 and an unmapper 820.
  • the processor 810 includes a central processing unit (CPU), a microprocessor, a graphics processing unit, and an application processor (PE) including processing elements (PEs) that perform multiplication and addition operations.
  • CPU central processing unit
  • PE application processor
  • PEs processing elements
  • At least one of AP may be configured, but is not limited thereto.
  • the mapper 811 may identify data having a zero value among the data of the input feature map.
  • the mapper 811 may also group data having zero values so that data having identified zero values are repeatedly input to the systolic operator 812.
  • the mapper 811 may change the input sequence of the zero values so that the data having the identified zero values are input to the systolic operator 812 a predetermined number of times.
  • the predetermined number of times may be determined by the size of the filter.
  • the mapper 811 maps the data of the input feature map such that data having zero value among the data of the input feature map is repeatedly input to the systolic operator 812 as many times as the size N of the filter. can do. For example, when the size of the filter is 3 ⁇ 3, the mapper 811 may map the input feature map into a systolic array such that data having zero values is repeatedly input three times to the multiplication addition operator.
  • the systolic operator 812 may include a plurality of multiplication addition operators. Each of the multiplication addition operators included in the systolic operator 812 may multiply the input data and the weight value of the filter according to a sequential clock having a constant latency, and perform an operation of adding the multiplied values. Can be. The systolic operator 812 may skip multiplication and addition operations when data having a zero value is input.
  • An adder 813 may accumulate output values obtained by multiplying the data of the input feature map by the weight value of the filter to generate an output feature map. Under the control of the accumulator controller 822 of the unmapper 820, the accumulator 813 receives position information of data having a zero value among input data and selectively accumulates the output values with reference to the accumulator 813. Can be.
  • the unmapper 820 may store location information of each of the data of the input feature map mapped by the mapper 811, and unmap the data of the input feature map into an array before mapping based on the location information. .
  • the relationship between the mapper 811 and the unmapper 820 is similar to the relationship between an encoder and a decoder.
  • the mapper 811 performs mapping to change the input sequence so that data of the input feature map is repeatedly input to the systolic operator 812 by a predetermined number of times, and the unmapper 820 maps the mapped input feature map. Restores to the array before mapping.
  • the unmapper 820 may include a memory 821 and an accumulator controller 822.
  • the memory 821 may store a look-up table (LUT) that stores location information of data having a zero value identified by the mapper 811 among data of the input feature map.
  • the memory 821 may be configured of, for example, at least one of a dynamic RAM (DRAM), a static RAM (SRAM), and a synchronous dynamic RAM (SDRAM), but is not limited thereto.
  • the memory 821 may store information about a position of data to be cumulatively summed within the size (n ⁇ n) of the filter among output values resulting from the multiplication and addition operation of the input data and the weight values of the filter. have. That is, the memory 821 may store location information in units of rows and columns of data having a zero value among data of the input feature map.
  • An adder-tree controller 822 may control the accumulator 813 to generate an output feature map by accumulating the sum of the output values by referring to position information of data having a zero value among the data of the input feature map. have.
  • the accumulator controller 822 reads the position information of the row and column units of the data identified by the zero value among the data of the input feature map stored in the memory 821 to zero. Reference may be made to the skipped number information.
  • the accumulator control unit 822 may map in real time information about how many cycles of data having zero value among the input feature map data input to the systolic operator 812 is calculated. Can be controlled to accumulate and sum output values with reference to the received information. This is because, in the convolution operation using a systolic array, if the operation of data having a zero value is skipped, the output value is shifted upward by the number of times the zero value data is skipped. I was thinking. That is, the accumulator controller 822 accumulates and sums output values by referring to shift information of output values according to the number of times data having zero values is skipped in multiplication and addition operations. You can create a map.
  • FIG. 9A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure
  • FIG. 9B is a convolution using a systolic arrangement according to an embodiment of the present disclosure.
  • FIG. 9A if there are four buffers 901 to 904 in the memory 900, input data other than zero is included in the first buffer 901, the third buffer 903, and the fourth buffer 904.
  • the data having zero value may be stored in the second buffer 902.
  • data having a value of zero may not be stored in a buffer of the memory 900.
  • data having a value of zero is not stored in the memory 900, inputs that have been stored in the fourth buffer 904 and x 32 , which are input data previously stored in the third buffer 903.
  • the data x 33 may be shifted and stored in the second buffer 902 and the third buffer 903, respectively.
  • the electronic device identifies data having a zero value among data of the input feature map.
  • the mapper in the processor may identify data having a zero value among the data of the input feature map input to the systolic array operator.
  • the electronic device groups the data having the zero value so that the data having the zero value is repeatedly input to the systolic array operator.
  • the mapper is configured to compare data with zero values identified in an input feature map such that input data with zero values is repeatedly input to the systolic array operator according to a sequential clock with a constant latency. Can be grouped
  • the electronic device stores the row and column positions of the data having the zero value in the memory.
  • the electronic device may include a memory that stores row and column location information of data having a zero value identified on an input feature map.
  • the memory may store the row and column positions of the input data having zero values in the form of a look up table (LUT). In this case, the memory may not store input data having a zero value in the buffer.
  • LUT look up table
  • the electronic device reads the stored position information from the memory and skips multiplication and addition operations on data having a zero value with reference to the read position information.
  • 9A and 9B do not store data having a zero value among data of an input feature map in a buffer of the memory 900, and use a row and a column of zero value data in a convolution operation. column) By referring to the location information, more storage space can be secured. In addition, by reducing the memory access, it is possible to reduce the amount of power consumed by the processor or chip in the electronic device.
  • FIG. 10A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure
  • FIG. 10B is used to perform a convolution operation using a systolic array according to an embodiment of the present disclosure. It is a flowchart showing how to do it.
  • data having a zero value is stored in the first buffer 1001 to the third buffer 1003 among the four buffers 1001 to 1004 of the memory 1000, and the fourth buffer 1004.
  • X 33 which is data having a value of zero, may be stored.
  • the embodiment illustrated in FIG. 10A also stores data having a zero value in a buffer of the memory 1000.
  • the multiplication and addition operations may be skipped through the position information of the zero value data. This will be described with reference to the flowchart of FIG. 10B.
  • step S1010 the electronic device identifies data having a zero value among data of an input feature map.
  • the mapper in the processor may identify data having a zero value among the data of the input feature map input to the systolic array operator.
  • the electronic device groups the data having the zero value so that the data having the zero value is repeatedly input to the systolic array operator.
  • the electronic device acquires position information of zero value data on the systolic arrangement.
  • the unmapper (see 820 of FIG. 8), which is a component included in the electronic device, may provide information on how many cycles zero-value data of the input feature map data input to the systolic calculator is calculated. May be received in real time from the mapper (see 811 of FIG. 8), and the accumulator (see 813 of FIG. 8) may be controlled to accumulate and sum output values with reference to the received information.
  • the unmapper may receive location information of data having zero value on the systolic array from the mapper in real time.
  • the electronic device controls an adder-tree that accumulatively sums output values for each region of the input feature map based on the position information of the zero value data.
  • the electronic device obtains, in real time, the position information of the zero value data identified in the input feature map mapped to the systolic array from the mapper 811 of FIG. 8, and based on the obtained position information of the zero value data.
  • An accumulator controller 822 of FIG. 8 may be configured to control an accumulator (see 813 of FIG. 8) to selectively accumulate and sum output values multiplied and added by the systolic operator.
  • 10A and 10B relate to a method of skipping operation of data having a zero value in a convolution operation using a systolic array, wherein the number of times zero value data is skipped.
  • This method focuses on shifting the output value upward. That is, even if the zero value data is stored in the buffer (see 1001 to 1003 of FIG. 10A), the processor in the electronic device does not read the buffers 1001 to 1003 in which the zero value data is stored in the memory 1000. Convolution operation values due to multiplication and addition operations are changed.
  • the position information of the zero value data input in real time is obtained as the zero value data is input in the multiplication and addition operation through the systolic operator.
  • the output values are cumulatively summed based on the obtained position information of the zero value data.
  • the processor does not access the zero value data, thereby reducing power consumption due to memory access.
  • FIG. 11A is a diagram illustrating an operation circuit for performing a convolution operation using a systolic array according to an embodiment of the present disclosure
  • FIG. 11B is an output feature map generated according to a convolution operation of an input feature map and a filter. Is a diagram illustrating.
  • the systolic operator 1110 includes five flip-flop 1110-1 through 1110-5, a multiplication operator 1120, and two addition operators 1130-1 and 1130. -2) and two clock gate circuits 1140-1 and 1140-2.
  • this is exemplary and flip-flop circuits 1110-1 to 1110-5 included in the systolic operator 1110, the addition operators 1130-1 and 1130-2, and the clock gate circuit 1140-1. , 1140-2) is not limited to the number shown in FIG. 11A.
  • the first clock gate circuit 1140-1 and the second clock gate circuit 1140-2 may generate sequential clocks having a constant latency.
  • a weight value of a filter may be input to the first flip-flop circuit 1110-1, and data of an input feature map may be input to the second flip-flop circuit 1110-2.
  • the weight value of the filter may be repeated twice and input to the first flip-flop circuit 1110-1 according to the sequential clock.
  • the data of the input feature map may be mapped in a systolic arrangement so as to be repeatedly input twice to the second flip-flop circuit 1110-2 according to a sequential clock.
  • the weight value input to the first flip flop circuit 1110-1 and the data input to the second flip flop circuit 1110-2 may be multiplied by the multiplication operator 1120.
  • the product of the input data and the weight value output from the multiplication operator 1120 according to the sequential clocks is transferred to the first addition operator 1130-1 and the second addition operator 1130-2.
  • the third flip-flop circuit 1110-3 may perform a binary counter function by the clock gate circuits 1140-1 and 1140-2. That is, when the third flip flop circuit 1110-3 is high, the product of the input data and the weight value is transferred to the first addition operator 1130-1, and the third flip flop circuit 1110-3 is performed.
  • the product of the input data and the weight value may be transferred to the second addition operator 1130-2.
  • the fourth flip flop circuit 1110-4 receives a value obtained by adding the product of the input data and the weight value transferred to the first addition operator 1130-1, and the fifth flip flop circuit 1110-5 receives the second addition.
  • the input data delivered to the calculator 1130-2 and the weight value added together may be received.
  • the fourth flip flop circuit 1110-4 may output S11 (x 11 * w 11 ) at the first clock and S13 (x 12 * w 12 ) at the third clock.
  • the fifth flip-flop circuit 1110-5 may output S12 (x 12 * w 11 ) at the second clock and S14 (x 13 * w 12 ) at the fourth clock.
  • FIG. 11A requires one more combination of an add operator and a flip flop circuit compared to a conventional systolic array operation circuit.
  • the amount of computation of the processor is not doubled by the increased addition operator and the flip flop circuit, because the third flip flop circuit 1110-3 performs a binary count function.
  • the data x 11 , x 12 , and x 13 of the input feature map 100 in the first region P1 on the input feature map FMap 1 are w 11 , w 12 , w of the filter 110.
  • the multiplication operation is performed with 13, and the multiplication result is cumulatively summed to generate the 1-1 st output data x 11 * w 11 + x 12 * w 12 + x 13 * w 13 of the output feature map 120.
  • the data x 12 , x 13 , and x 14 of the input feature map 100 are multiplied by w 11 , w 12 , and w 13 of the filter 110, respectively.
  • the calculated result is multiplied and accumulated to generate the 1-2 output data x 12 * w 11 + x 13 * w 12 + x 14 * w 13 of the output feature map 120.
  • This is the same as the result value output by the systolic operator 1110 shown in FIG. 11A. That is, when S 11 , S 13 , and S 15 are cumulatively summed in FIG. 11A, the 1-1st output data x 11 * w 11 + x 12 * w 12 + x 13 * w 13 of FIG. 11B is obtained. Similarly, when S 12 , S 14 , and S 16 are cumulatively summed in FIG. 11A, the 1-2 output data x 12 * w 11 + x 13 * w 12 + x 14 * w 13 of FIG. 11B is obtained.
  • the electronic device includes a processor, a memory for storing and executing program data, a permanent storage such as a disk drive, a communication port for communicating with an external device, a touch panel, a key, a button. And a user interface device such as the like.
  • Methods implemented by software modules or algorithms may be stored on a computer readable recording medium as computer readable codes or program instructions executable on the processor.
  • the computer-readable recording medium may be a magnetic storage medium (eg, read-only memory (ROM), random-access memory (RAM), floppy disk, hard disk, etc.) and an optical reading medium (eg, CD-ROM). ) And DVD (Digital Versatile Disc).
  • the computer readable recording medium can be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.
  • the medium is readable by the computer, stored in the memory, and can be executed by the processor.
  • Embodiments of the present disclosure may be represented by functional block configurations and various processing steps. Such functional blocks may be implemented in various numbers of hardware or / and software configurations that perform particular functions.
  • an embodiment may be an integrated circuit configuration such as memory, processing, logic, look-up table, etc., capable of executing various functions by the control of one or more microprocessors or other control devices. You can employ them.
  • the present embodiment includes various algorithms implemented in C, C ++, Java (data structures, processes, routines or other combinations of programming constructs). It may be implemented in a programming or scripting language such as Java), an assembler, or the like.
  • the functional aspects may be implemented with an algorithm running on one or more processors.
  • the present embodiment may employ the prior art for electronic configuration, signal processing, and / or data processing.
  • Terms such as “mechanism”, “element”, “means”, “configuration” can be used widely and are not limited to mechanical and physical configurations. The term may include the meaning of a series of routines of software in conjunction with a processor or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Complex Calculations (AREA)
  • Image Analysis (AREA)

Abstract

Provided is an artificial intelligence (AI) learning method and device for learning output data by performing a convolution calculation on input data through an systolic array. An embodiment of the present disclosure provides a method and device for decreasing power consumption required for a convolution calculation and increasing the calculation speed through mapping, by which the sequence of pieces of data input in a systolic array calculator is changed.

Description

시스톨릭 배열을 이용하여 딥 러닝 연산을 수행하는 방법 및 장치 Method and apparatus for performing deep learning operation using systolic array
본 개시는 컨볼루션 뉴럴 네트워크(Convolution Neural Network, CNN)를 기반으로 한 딥 러닝 연산에 있어서, 시스톨릭 배열(Systolic Array)을 이용하여 입력 특징 맵과 필터의 컨볼루션 연산을 수행하는 방법 및 장치에 관한 것이다. The present disclosure provides a method and apparatus for performing a convolution operation of an input feature map and a filter using a systolic array in a deep learning operation based on a convolution neural network (CNN). It is about.
인공 지능(Artificial Intelligence, AI) 시스템은 인간 수준의 지능을 구현하는 컴퓨터 시스템이며, 기존 Rule 기반 스마트 시스템과 달리 기계가 스스로 학습하고 판단하며 똑똑해지는 시스템이다. 인공지능 시스템은 사용할수록 인식률이 향상되고 사용자 취향을 보다 정확하게 이해할 수 있게 되어, 기존 Rule 기반 스마트 시스템은 점차 딥 러닝 기반 인공지능 시스템으로 대체되고 있다.Artificial Intelligence (AI) system is a computer system that implements human-level intelligence, and unlike conventional rule-based smart systems, machines learn and judge themselves and become smart. As the AI system is used, the recognition rate is improved and the user's taste can be understood more accurately, and the existing Rule-based smart system is gradually replaced by the deep learning-based AI system.
인공지능 기술은 기계학습(딥 러닝) 및 기계학습을 활용한 요소 기술들로 구성된다.AI technology is composed of elementary technologies using machine learning (deep learning) and machine learning.
기계학습은 입력 데이터들의 특징을 스스로 분류/학습하는 알고리즘 기술이며, 요소기술은 딥 러닝 등의 기계학습 알고리즘을 활용하여 인간 두뇌의 인지, 판단 등의 기능을 모사하는 기술로서, 언어적 이해, 시각적 이해, 추론/예측, 지식 표현, 동작 제어 등의 기술 분야로 구성된다.Machine learning is an algorithm technology that classifies / learns characteristics of input data by itself. Element technology is a technology that simulates the functions of human brain cognition and judgment by using machine learning algorithms such as deep learning. It consists of technical areas such as understanding, reasoning / prediction, knowledge representation, and motion control.
인공지능 기술이 응용되는 다양한 분야는 다음과 같다. 언어적 이해는 인간의 언어/문자를 인식하고 응용/처리하는 기술로서, 자연어 처리, 기계 번역, 대화시스템, 질의 응답, 음성 인식/합성 등을 포함한다. 시각적 이해는 사물을 인간의 시각처럼 인식하여 처리하는 기술로서, 객체 인식, 객체 추적, 영상 검색, 사람 인식, 장면 이해, 공간 이해, 영상 개선 등을 포함한다. 추론 예측은 정보를 판단하여 논리적으로 추론하고 예측하는 기술로서, 지식/확률 기반 추론, 최적화 예측, 선호 기반 계획, 추천 등을 포함한다. 지식 표현은 인간의 경험정보를 지식데이터로 자동화 처리하는 기술로서, 지식 구축(데이터 생성/분류), 지식 관리(데이터 활용) 등을 포함한다. 동작 제어는 차량의 자율 주행, 로봇의 움직임을 제어하는 기술로서, 움직임 제어(항법, 충돌, 주행), 조작 제어(행동 제어) 등을 포함한다.The various fields in which artificial intelligence technology is applied are as follows. Linguistic understanding is a technology for recognizing and applying / processing human language / characters and includes natural language processing, machine translation, dialogue system, question and answer, speech recognition / synthesis, and the like. Visual understanding is a technology that recognizes and processes objects as human vision, and includes object recognition, object tracking, image retrieval, person recognition, scene understanding, spatial understanding, and image enhancement. Inference prediction is a technique of judging information, logically inferring, and predicting information, and includes knowledge / probability based inference, optimization prediction, preference based planning, and recommendation. Knowledge expression is a technology that automatically processes human experience information into knowledge data, and includes knowledge construction (data generation / classification) and knowledge management (data utilization). Motion control is a technology for controlling autonomous driving of a vehicle and movement of a robot, and includes motion control (navigation, collision, driving), operation control (action control), and the like.
딥 러닝 연산을 수행할 때, 계산량이 많은 컨볼루션의 경우, 기가 단위(Giga)의 연산 또는 그에 상응하는 능력을 요구하며, 특히 32bit 또는 16 bit 입력 데이터와 필터의 웨이트(weight) 버스를 사용하는 경우, 추론만 하더라도 프로세서(processor) 내부에서 토글(toggle)되는 데이터의 양이 많다. 토글되는 데이터의 양이 많을수록 프로세서에서 소모되는 전력량이 증가하게 되는바, 최근의 모바일(mobile) 디바이스 환경에서 배터리의 용량 한계로 인한 문제점이 있다.When performing deep learning operations, high-volume convolution requires Giga operations or equivalent capabilities, especially using 32-bit or 16-bit input data and the filter's weight bus. In the case of inference alone, the amount of data toggled inside the processor is large. As the amount of data to be toggled increases, the amount of power consumed by the processor increases, which is a problem due to the limited capacity of the battery in a recent mobile device environment.
본 개시는 시스톨릭 배열을 통해 입력 데이터에 관하여 컨볼루션 연산을 수행하여 출력 데이터를 학습하는 딥 러닝 연산에 관한 것으로서, 시스톨릭 배열 연산기에 입력되는 데이터의 순서를 변경하는 매핑(mapping)을 통해 연산을 수행하는데 소모되는 전력량을 감소시키고, 연산 속도를 증가시키는 방법 및 장치를 제공하는 것을 목적으로 한다. The present disclosure relates to a deep learning operation that learns output data by performing a convolution operation on input data through a systolic array, and operates through a mapping to change the order of data input to the systolic array operator. It is an object of the present invention to provide a method and apparatus for reducing the amount of power consumed to perform the operation and increasing the operation speed.
본 개시는, 다음의 자세한 설명과 그에 수반되는 도면들의 결합으로 쉽게 이해될 수 있으며, 참조 번호(reference numerals)들은 구조적 구성요소(structural elements)를 의미한다.The present disclosure can be easily understood by the following detailed description and the accompanying drawings in which reference numerals refer to structural elements.
도 1a는 인공 뉴럴 네트워크(Artificial Neural Network)를 이용한 딥 러닝 연산 방법을 도식화한 도면이고, 도 1b는 딥 러닝 연산에서 입력으로 제공되는 입력 특징 맵의 데이터와 필터를 도식화한 도면이다. FIG. 1A is a diagram illustrating a deep learning calculation method using an artificial neural network, and FIG. 1B is a diagram illustrating data and a filter of an input feature map provided as an input in a deep learning operation.
도 1c는 컨볼루션 연산을 수행하는 과정을 도식화한 도면이다. 1C is a diagram illustrating a process of performing a convolution operation.
도 2는 종래의 시스톨릭 배열(Systolic Array)을 이용하여 컨볼루션 연산을 수행하는 방법을 설명하기 위한 개념도이다. 2 is a conceptual diagram illustrating a method of performing a convolution operation using a conventional systolic array.
도 3a는 본 개시의 일 실시예에 따른 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이고, 도 3b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터의 입력 순서를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면이다. 3A is a diagram illustrating a method of performing a deep learning based convolution operation according to an embodiment of the present disclosure, and FIG. 3B illustrates an example of changing an input order of data of an input feature map according to an embodiment of the present disclosure. Schematic of how to map to a systolic array.
도 3c는 본 개시의 일 실시예에 따른 시스톨릭 배열 연산기를 이용하여 컨볼루션 연산을 수행하고, 연산된 결과 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성하는 방법을 도식화한 도면이다.FIG. 3C is a diagram illustrating a method of generating an output feature map by performing a convolution operation using a systolic array operator and accumulating the calculated result values.
도 4는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 딥 러닝 연산을 수행하는 방법을 나타내는 흐름도이다. 4 is a flowchart illustrating a method of performing a deep learning operation using a systolic array according to an embodiment of the present disclosure.
도 5a는 본 개시의 일 실시예에 따른 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이고, 도 5b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터와 필터의 웨이트를 연산하는 방법을 도식화한 도면이다. FIG. 5A is a diagram illustrating a method of performing a deep learning based convolution operation according to an embodiment of the present disclosure, and FIG. 5B is a diagram illustrating data of an input feature map and a weight of a filter according to an embodiment of the present disclosure. It is a figure which shows the method to do.
도 6은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 장치의 구성 요소를 도시한 블록도이다.6 is a block diagram illustrating components of an apparatus for performing a convolution operation using a systolic arrangement according to an embodiment of the present disclosure.
도 7a 및 도 7b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터의 입력 순서를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면들이다.7A and 7B are diagrams illustrating a method of changing an input order of data of an input feature map and mapping the systolic array according to an embodiment of the present disclosure.
도 8은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 장치의 구성 요소를 도시한 블록도이다.8 is a block diagram illustrating components of an apparatus for performing a convolution operation using a systolic arrangement according to an embodiment of the present disclosure.
도 9a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼(buffer)에 저장된 데이터를 도식화한 도면이고, 도 9b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다. FIG. 9A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure, and FIG. 9B is a convolution using a systolic arrangement according to an embodiment of the present disclosure. A flowchart showing how to perform an operation.
도 10a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼에 저장된 데이터를 도식화한 도면이고, 도 10b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다. FIG. 10A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure, and FIG. 10B is used to perform a convolution operation using a systolic array according to an embodiment of the present disclosure. It is a flowchart showing how to do it.
도 11a는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 연산 회로를 도식화한 도면이고, 도 11b는 입력 특징 맵과 필터의 컨볼루션 연산에 따라 생성된 출력 특징 맵을 도식화한 도면이다. 11A is a diagram illustrating an operation circuit for performing a convolution operation using a systolic array according to an embodiment of the present disclosure, and FIG. 11B is an output feature map generated according to a convolution operation of an input feature map and a filter. Is a diagram illustrating.
상술한 기술적 과제를 해결하기 위하여, 본 개시의 일 실시예는 순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)하는 단계, 매핑된 상기 입력 특징 맵의 데이터 및 필터의 웨이트 값을 상기 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행하는 단계, 및 상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 단계를 포함하는, 시스톨릭 배열(systolic array)을 이용하여 딥 러닝(deep learning) 연산을 수행하는 방법을 제공한다. In order to solve the above technical problem, an embodiment of the present disclosure provides an input feature map such that data having the same value is repeated a predetermined number of times according to a sequential clock and inputted to a multiplication addition operator in a systolic array operator. Mapping the data of the input feature map into a systolic array by changing the order of the data of the data; inputting the weighted values of the data of the mapped input feature map and the filter into the systolic array operator; deep learning using a systolic array, comprising: performing a convolution; and generating an output feature map by accumulating the convolutionally calculated output values. Provides a way to perform deep learning operations.
예를 들어, 상기 매핑 단계는 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경할 수 있다. For example, the mapping may change an input order of the input data such that two identical input data values of the input feature map are repeatedly input to the systolic array operator.
예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매핑 단계는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경할 수 있다. For example, the filter has an N by N (NXN) size, and the mapping step may be such that data of the input feature map is repeatedly input to the systolic array operator as many times as the size N of the filter. The order of input of data in the input feature map can be changed.
예를 들어, 상기 출력 특징 맵을 생성하는 단계는 상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하는 단계, 및 선택된 출력값들을 누적 합산하여 상기 입력 특징 맵과 상기 필터의 조합으로 인한 출력 특징 맵을 생성하는 단계를 포함할 수 있다. For example, the generating of the output feature map may include performing a convolution operation based on the stride value of the filter and the data of the input feature map overlapping in the first and second directions due to the stride. Selecting output values and accumulating the selected output values to generate an output feature map due to the combination of the input feature map and the filter.
예를 들어, 상기 방법은 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별하는 단계를 더 포함할 수 있다.For example, the method may further comprise identifying data having a zero value among the data of the input feature map.
예를 들어, 상기 매핑 단계는 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)할 수 있다.For example, the mapping step may group data having the zero value so that data having the zero value is repeatedly input to the systolic operator.
예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매핑 단계는 상기 0값을 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터를 상기 필터의 크기(N) 만큼 모아서 그룹핑할 수 있다. For example, the filter has an N by N (NXN) size, and the mapping step causes the zero value to be repeatedly input to the systolic array operator as many times as the data is equal to the size N of the filter. Value data can be collected and grouped by the size (N) of the filter.
예를 들어, 상기 방법은 상기 0값을 갖는 데이터의 데이터의 상기 입력 특징 맵(input feature map) 상의 로(row) 및 컬럼(column) 위치를 메모리에 저장하는 단계를 더 포함하고, 상기 컨볼루션 연산을 수행하는 단계는 상기 저장된 위치 정보를 상기 메모리로부터 판독(read)하고, 판독된 위치 정보를 참조하여 상기 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)할 수 있다. For example, the method further includes storing row and column positions on the input feature map of the data of the data having the zero value in memory, the convolution In the performing of the operation, the stored position information may be read from the memory, and multiplication and addition operations may be skipped with respect to the data having the zero value with reference to the read position information.
예를 들어, 상기 방법은 0값으로 식별된 데이터가 입력되는 경우, 식별된 0값 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 단계를 더 포함하고, 상기 출력 특징 맵을 생성하는 단계는 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산할 수 있다. For example, the method further includes acquiring position information on the systolic arrangement of the identified zero value data when data identified with zero value is input, wherein generating the output feature map comprises: The output values for each area of the input feature map may be accumulated and summed based on the acquired position information of the zero value data.
상술한 기술적 과제를 해결하기 위하여 본 개시의 일 실시예는 시스톨릭 배열을 이용하여 입력 특징 맵의 데이터와 필터의 웨이트 값의 컨볼루션 연산을 수행하는 프로세서를 포함하고, 상기 프로세서는 순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑하는 매퍼(mapper), 매핑된 상기 입력 특징 맵 데이터 또는 상기 필터의 웨이트 값에 대하여 컨볼루션 연산을 수행하는 복수의 곱셈 덧셈 연산기를 포함하는 시스톨릭 배열 연산기, 및 상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 누산기(adder)를 포함하는, 딥 러닝 연산을 수행하는 전자 장치(electronic device)를 제공한다. In order to solve the above technical problem, an embodiment of the present disclosure includes a processor that performs a convolution operation of data of an input feature map and a weight value of a filter using a systolic array, and the processor includes a sequential clock ( a mapper for mapping the data of the input feature map to a systolic array by changing the order of the data of the input feature map such that data having the same value is repeated a predetermined number of times according to a clock) and inputted to a multiplication adder. A systolic array operator including a plurality of multiplication addition operators that perform a convolution operation on the mapped input feature map data or the weight value of the filter, and accumulate and output the convolutional output values. Perform deep learning operations, including an adder that generates an output feature map. It provides an electronic device (electronic device).
예를 들어, 상기 매퍼는 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경할 수 있다. For example, the mapper may change an input order of the input data such that two identical input data values of the input feature map are repeatedly input to the systolic array operator.
예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매퍼는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기 내의 상기 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경할 수 있다. For example, the filter has an N by N (NXN) size, and the mapper repeatedly repeats the number of times the data of the input feature map is equal to the size N of the filter, the multiplication addition operator in the systolic array operator. The input order of the data of the input feature map may be changed to be input to.
예를 들어, 상기 누산기는 상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하고, 상기 선택된 출력값들을 누적 합산하여 상기 입력 특징 맵의 각 영역에 대한 출력 특징 맵을 생성할 수 있다. For example, the accumulator selects the convolutionally calculated output values in consideration of the stride value of the filter and the data of the input feature map overlapping in the first and second directions due to the stride, The output feature maps for each area of the input feature map may be generated by accumulating and adding the selected output values.
예를 들어, 상기 매퍼는 상기 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. For example, the mapper may identify data having a zero value among data of the input feature map.
예를 들어, 상기 매퍼는 상기 식별된 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)할 수 있다. For example, the mapper may group the data having the zero value so that the data having the identified zero value is repeatedly input to the systolic operator.
예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매퍼는 상기 0값을 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터를 상기 필터의 크기(N) 만큼 모아서 그룹핑할 수 있다. For example, the filter has a size of N by N (NXN), and the mapper uses the zero value to repeatedly input the zero value to the systolic array operator as many times as the data is equal to the size N of the filter. Data having a may be collected and grouped by the size (N) of the filter.
예를 들어, 상기 전자 장치는 상기 0값을 갖는 데이터의 로(row) 및 컬럼(column) 위치를 저장하는 메모리를 더 포함하고, 상기 프로세서는 상기 저장된 위치 정보를 상기 메모리로부터 판독(read)하고, 판독된 위치 정보를 참조하여 상기 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)할 수 있다. For example, the electronic device further includes a memory for storing row and column positions of the data having the zero value, and the processor reads the stored position information from the memory. The multiplication and addition operations may be skipped with respect to the data having the zero value with reference to the read position information.
예를 들어, 상기 전자 장치는 상기 매퍼에 의해 시스톨릭 배열로 매핑된 상기 입력 특징 맵의 데이터 중 0값으로 식별된 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 언매퍼(unmapper)를 더 포함하고, 상기 언매퍼는 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하도록 상기 누산기를 제어하는 애더 트리 제어 회로(adder-tree control circuit)를 포함할 수 있다. For example, the electronic device may further include an unmapper that obtains location information on the systolic array of data identified by the value 0 of the data of the input feature map mapped by the mapper to the systolic array. And the unmapper includes an adder-tree control circuit for controlling the accumulator to accumulate and sum output values for each region of the input feature map based on the acquired position information of the zero value data. It may include.
상술한 기술적 과제를 해결하기 위하여, 본 개시의 일 실시예는 컴퓨터로 읽을 수 있는 기록 매체를 제공하고, 상기 기록 매체는 순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)하는 단계, 매핑된 상기 입력 특징 맵의 데이터 및 필터의 웨이트 값을 상기 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행하는 단계, 및 상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 단계에 관한 명령어(instruction)들을 포함할 수 있다.In order to solve the above technical problem, an embodiment of the present disclosure provides a computer-readable recording medium, and the recording medium repeats a predetermined number of times data having the same value according to a sequential clock. Changing the order of data of an input feature map to be input to a multiplication adder in a systolic array operator to map data of the input feature map into a systolic array, data and filters of the mapped input feature map Inputting the weight value to the systolic array operator to perform a convolution operation, and accumulating the convolutional output values to generate an output feature map. It may include instructions about.
본 명세서의 실시예들에서 사용되는 용어는 본 개시의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어들을 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도 또는 판례, 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한, 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 실시예의 설명 부분에서 상세히 그 의미를 기재할 것이다. 따라서 본 개시에서 사용되는 용어는 단순한 용어의 명칭이 아닌, 그 용어가 가지는 의미와 본 개시의 전반에 걸친 내용을 토대로 정의되어야 한다.The terms used in the embodiments of the present disclosure have been selected as widely used general terms as possible in consideration of the functions of the present disclosure, but may vary according to the intention or precedent of the person skilled in the art, the emergence of new technologies, etc. . In addition, in certain cases, there is a term arbitrarily selected by the applicant, and in this case, the meaning will be described in detail in the description of the corresponding embodiment. Therefore, the terms used in the present disclosure should be defined based on the meanings of the terms and the contents throughout the present disclosure, rather than simply the names of the terms.
명세서 전체에서 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있음을 의미한다. 또한, 명세서에 기재된 "...부", "...모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어 또는 소프트웨어로 구현되거나 하드웨어와 소프트웨어의 결합으로 구현될 수 있다.When any part of the specification is to "include" any component, this means that it may further include other components, except to exclude other components unless otherwise stated. In addition, the terms "... unit", "... module" described in the specification means a unit for processing at least one function or operation, which is implemented in hardware or software or a combination of hardware and software. Can be.
아래에서는 첨부한 도면을 참고하여 본 개시의 실시예에 대하여 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 개시는 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시 예에 한정되지 않는다.DETAILED DESCRIPTION Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art may easily implement the present disclosure. As those skilled in the art would realize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention.
이하에서는 도면을 참조하여 본 개시의 실시예들을 상세하게 설명한다. Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
도 1a는 인공 뉴럴 네트워크(Artificial Neural Network)를 이용한 딥 러닝 연산 방법을 도식화한 도면이고, 도 1b는 딥 러닝 연산에서 입력으로 제공되는 입력 특징 맵(100)의 데이터와 필터(110-1 내지 110-n)를 도식화한 도면이다. FIG. 1A is a diagram illustrating a deep learning calculation method using an artificial neural network, and FIG. 1B illustrates data and filters 110-1 to 110 of an input feature map 100 provided as an input in a deep learning operation. -n) is a schematic diagram.
딥 러닝(Deep Learning) 등을 포함하는 인공지능(AI) 알고리즘은 인공 뉴럴 네트워크(Artificial Neural Network, ANN)에 입력 데이터(10)을 입력시키고, 컨볼루션 등의 연산을 통해 출력 데이터(30)를 학습하는 것을 특징으로 한다. 인공 뉴럴 네트워크는 생물학적 뇌를 모델링한 컴퓨터 과학적 아키텍쳐(Computational Architecture)를 의미할 수 있다. 인공 뉴럴 네트워크 내에서, 뇌의 뉴런들에 해당되는 노드들은 서로 연결되어 있고, 입력 데이터를 처리하기 위하여 집합적으로 동작한다. 다양한 종류의 뉴럴 네트워크들을 예로 들면, 컨볼루션 뉴럴 네트워크(Convolutional Neural Network, CNN), 회귀 뉴럴 네트워크(Recurrent Neural Network, RNN), 딥 빌리프 네트워크(Deep Belief Network, DBN), 제한된 볼츠만 기계(Restricted Boltzman Machine, RBM) 방식 등이 있으나, 이에 제한되지 않는다. 피드-포워드(feed-forward) 뉴럴 네트워크에서, 뉴럴 네트워크의 뉴런들은 다른 뉴런들과의 연결들(links)을 갖는다. 이와 같은 연결들은 뉴럴 네트워크를 통해, 한 방향으로, 예를 들어 순방향(forward direction)으로 확장될 수 있다. An artificial intelligence (AI) algorithm including deep learning inputs the input data 10 to an artificial neural network (ANN), and outputs the output data 30 through operations such as convolution. It is characterized by learning. Artificial neural networks can refer to a computer scientific architecture that models the biological brain. In an artificial neural network, nodes corresponding to neurons in the brain are connected to each other and operate collectively to process input data. Examples of various types of neural networks include convolutional neural networks (CNNs), recurrent neural networks (RNNs), deep belief networks (DBNs), and restricted Boltzman machines (Restricted Boltzman). Machine, RBM), but is not limited thereto. In a feed-forward neural network, neurons in the neural network have links with other neurons. Such connections may extend in one direction, for example in a forward direction, via a neural network.
도 1a를 참조하면, 인공 뉴럴 네트워크에 입력 데이터(10)가 입력되고, 하나 이상의 레이어(layer)를 포함하는 컨볼루션 뉴럴 네트워크(Convolution Neural Network, CNN)(20)를 통해 출력 데이터(30)가 출력되는 구조가 도시된다. 인공 뉴럴 네트워크는 2개 이상의 레이어를 보유한 딥 뉴럴 네트워크(Deep Neural Network)일 수 있다.Referring to FIG. 1A, input data 10 is input to an artificial neural network, and output data 30 is transmitted through a convolutional neural network (CNN) 20 including one or more layers. The output structure is shown. The artificial neural network may be a deep neural network having two or more layers.
컨볼루션 뉴럴 네트워크(20)는 입력 데이터(10)로부터 테두리, 선 색 등과 같은 "특징들(features)"을 추출하기 위해 이용될 수 있다. 컨볼루션 뉴럴 네트워크(20)는 복수의 레이어를 포함할 수 있다. 각각의 레이어는 데이터를 수신할 수 있고, 해당 레이어에 입력되는 데이터를 처리하여 해당 레이어에서 출력되는 데이터를 생성할 수 있다. 레이어에서 출력되는 데이터는, 컨볼루션 뉴럴 네트워크(20)에 입력된 이미지 또는 입력된 특징 맵(Feature Map)을 하나 이상의 필터(filter)의 웨이트(weight) 값과 컨볼루션 연산하여 생성한 특징 맵일 수 있다. 컨볼루션 뉴럴 네트워크(20)의 초기 레이어들은 입력으로부터 에지들 또는 그레디언트들과 같은 낮은 레벨의 특징들을 추출하도록 동작될 수 있다. 컨볼루션 뉴럴 네트워크(20)의 다음 레이어들은 이미지 내의 눈, 코 등과 같은 점진적으로 더 복잡한 특징들을 추출할 수 있다.The convolutional neural network 20 can be used to extract "features" such as borders, line colors, etc. from the input data 10. The convolutional neural network 20 may include a plurality of layers. Each layer may receive data and may process data input to the layer to generate data output from the layer. The data output from the layer may be a feature map generated by convolutional operation of an image or input feature map input to the convolutional neural network 20 with weight values of one or more filters. have. Initial layers of the convolutional neural network 20 may be operated to extract low level features such as edges or gradients from the input. Subsequent layers of the convolutional neural network 20 may extract progressively more complex features, such as eyes, nose, and the like in the image.
도 1b를 참조하면, 인공 뉴럴 네트워크에 입력으로 제공되는 입력 특징 맵(100) 및 복수의 필터(110-1 내지 110-n)이 도시된다. 입력 특징 맵(100)은 인공 뉴럴 네트워크에 입력되는 이미지의 픽셀 값 또는 수치 데이터의 집합일 수 있으나, 이에 제한되지 않는다. 도 1b에서 입력 특징 맵(100)은 인공 뉴럴 네트워크를 통해 학습할 대상이 되는 이미지의 픽셀 값으로 정의될 수 있다. 예를 들어, 입력 특징 맵(100)은 256×256의 픽셀과 K의 깊이(depth)를 가질 수 있다. 그러나, 상기 값은 예시적인 것이고, 입력 특징 맵(100)의 픽셀 크기가 상기 예시로 한정되는 것은 아니다. 1B, an input feature map 100 and a plurality of filters 110-1 through 110-n provided as inputs to an artificial neural network are shown. The input feature map 100 may be a set of pixel values or numerical data of an image input to an artificial neural network, but is not limited thereto. In FIG. 1B, the input feature map 100 may be defined as a pixel value of an image to be learned through an artificial neural network. For example, the input feature map 100 may have a pixel of 256 × 256 and a depth of K. However, the value is exemplary and the pixel size of the input feature map 100 is not limited to the above example.
필터(110-1 내지 110-n)은 N개로 형성될 수 있다. 복수의 필터(110-1 내지 110-n) 각각은 n by n(n×n)의 웨이트(weight) 값을 포함할 수 있다. 예를 들어, 복수의 필터(110-1 내지 110-n) 각각은 3×3의 픽셀과 K의 깊이 값을 가질 수 있다. 그러나, 상기 필터의 크기는 예시적인 것이고, 복수의 필터(110-1 내지 110-n) 각각의 크기가 상기 예시로 한정되는 것은 아니다. N filters 110-1 to 110-n may be formed. Each of the plurality of filters 110-1 to 110-n may include a weight value of n by n (n × n). For example, each of the plurality of filters 110-1 to 110-n may have a pixel of 3 × 3 and a depth value of K. FIG. However, the size of the filter is exemplary, and the size of each of the plurality of filters 110-1 to 110-n is not limited to the above example.
도 1c는 딥 러닝 기반에서 컨볼루션 연산을 수행하는 과정을 도식화한 도면이다. 1C is a diagram illustrating a process of performing a convolution operation on a deep learning basis.
도 1c를 참조하면, 인공 뉴럴 네트워크에서 컨볼루션 연산을 수행하는 과정은, 각각의 레이어에서 입력 특징 맵(100)과 필터(110)와의 곱셈 및 덧셈 연산을 하여 출력 값을 생성하고, 출력 값을 누적하여 합산함으로써, 출력 특징 맵(120)을 생성하는 과정을 의미할 수 있다. Referring to FIG. 1C, in the process of performing a convolution operation in an artificial neural network, multiplication and addition operations of the input feature map 100 and the filter 110 in each layer generate an output value, and an output value. By accumulating and summing, it may mean a process of generating the output feature map 120.
컨볼루션 연산 수행 과정은, 현재 레이어에서 입력 특징 맵(100)의 좌측 상단으로부터 우측 하단까지 일정한 크기, 즉 n×n 크기의 필터(110)를 적용하여 곱셈 및 덧셈 연산을 수행하는 과정이다. 이하에서는, 필터(110)의 크기가 3×3인 경우에 컨볼루션 연산을 수행하는 과정을 설명하기로 한다. The process of performing a convolution operation is a process of performing a multiplication and an addition operation by applying a filter 110 having a predetermined size, that is, an n × n size, from the upper left to the lower right of the input feature map 100 in the current layer. Hereinafter, a process of performing a convolution operation when the size of the filter 110 is 3 × 3 will be described.
예를 들어, 먼저 입력 특징 맵(100)의 좌측 상단 제1 영역(101)에서 3×3, 즉 제1 방향으로 3개의 데이터와 제2 방향으로 3개의 데이터를 포함한 총 9개의 데이터(x 11 내지 x 33)를 각각 필터(110)의 웨이트 값(weight)(w 11 내지 w 33)과 곱하는 연산을 수행한다. 이후, 곱셈 연산의 출력 값, 즉 x 11*w 11, x 12*w 12, x 13*w 13, x 21*w 21, x 22*w 22, x 23*w 23, x 31*w 31, x 32*w 32, x 33*w 33을 모두 누적하여 합산하면 출력 특징 맵(120)의 제1-1 출력 데이터(y 11)가 생성된다. For example, first, in the upper left first area 101 of the input feature map 100, a total of nine data including 3 × 3, that is, three data in the first direction and three data in the second direction (x 11). To x 33 ) are multiplied by the weights w 11 to w 33 of the filter 110, respectively. Then, the output of the multiplication operation, that is, x 11 * w 11 , x 12 * w 12 , x 13 * w 13 , x 21 * w 21 , x 22 * w 22 , x 23 * w 23 , x 31 * w 31 , x 32 * w 32 and x 33 * w 33 are accumulated and summed to generate first-first output data y 11 of the output feature map 120.
이후, 입력 특징 맵(100)의 좌측 상단의 제1 영역(101)에서 제2 영역(102)으로 데이터의 단위만큼 이동하면서 연산한다. 이 때, 컨볼루션 연산 과정에서 입력 특징 맵(100) 내의 데이터가 이동하는 개수를 스트라이드(stride)라고 하며, 스트라이드의 크기에 따라 생성되는 출력 특징 맵(120)의 크기가 결정될 수 있다. 예를 들어, 스트라이드가 1인 경우, 제2 영역(102)에 포함된 총 9개의 입력 데이터(x 12 내지 x 34)를 필터(110)의 웨이트 값(w 11 내지 w 33)과 곱하는 연산을 수행하고, 곱셈 연산의 출력 값인 x 12*w 11, x 13*w 12, x 14*w 13, x 22*w 21, x 23*w 22, x 24*w 23, x 32*w 31, x 33*w 32, x 34*w 33을 모두 누적하여 합산하면 출력 특징 맵(120)의 제1-2 출력 데이터(y 12)가 생성된다. Subsequently, the calculation is performed while moving by the unit of data from the first area 101 on the upper left side of the input feature map 100 to the second area 102. In this case, the number of data movement in the input feature map 100 during the convolution operation is called a stride, and the size of the output feature map 120 generated according to the size of the stride may be determined. For example, when the stride is 1, an operation of multiplying a total of nine input data (x 12 to x 34 ) included in the second region 102 by the weight values (w 11 to w 33 ) of the filter 110 is performed. , And the output values of the multiplication operation are x 12 * w 11 , x 13 * w 12 , x 14 * w 13 , x 22 * w 21 , x 23 * w 22 , x 24 * w 23 , x 32 * w 31 , When x 33 * w 32 and x 34 * w 33 are accumulated and summed together, the 1-2 output data y 12 of the output feature map 120 is generated.
도 1c에 도시된 컨볼루션 연산을 수행하여 출력 특징 맵(120)을 생성하는 경우, 입력 특징 맵(100)의 데이터의 수와 필터(110)의 크기에 따라 곱셈 및 덧셈 연산을 수행하는 횟수가 많아지게 된다. 픽셀의 크기가 큰 이미지 파일의 경우 초당 기가(Giga) 단위의 연산을 수행해야 하므로, 연산에 소요되는 시간 및 전력량이 많아지게 되는 문제점이 있다.When the output feature map 120 is generated by performing the convolution operation illustrated in FIG. 1C, the number of multiplication and addition operations is performed according to the number of data of the input feature map 100 and the size of the filter 110. It will increase. In the case of an image file having a large pixel size, operations in units of gigabytes per second need to be performed, which causes a problem of increasing time and power required for the calculation.
도 2는 종래의 시스톨릭 배열(Systolic Array)을 이용하여 컨볼루션 연산을 수행하는 방법을 설명하기 위한 개념도이다.2 is a conceptual diagram illustrating a method of performing a convolution operation using a conventional systolic array.
도 2를 참조하면, 입력 특징 맵(200)의 각 데이터는 일정한 레이턴시(latency)를 갖는 클럭(clock)에 따라 순차적으로 곱셈 덧셈 연산기(211 내지 219)에 입력되는 시스톨릭 배열로 매핑(mapping)될 수 있다. 예를 들어, 제1 클럭에는 시스톨릭 배열의 제1 행(①)의 제1-1 데이터(x 11)가 제1 곱셈 덧셈 연산기(211)에 입력될 수 있다. 도 2에는 도시되지 않았지만, 제1-1 데이터(x 11)는 제1 클럭에서 w 11의 웨이트 값과 곱해질 수 있다. 이후 제2 클럭에서는 제1-1 데이터(x 11)는 제2 곱셈 덧셈 연산기(212)에 입력되고, 제2-1 데이터(x 21)는 제1 곱셈 덧셈 연산기(211)에 입력되며, 제1-2 데이터(x 12)는 제4 곱셈 덧셈 연산기(214)에 입력될 수 있다. 마찬가지로, 제3 클럭에서 제1-1 데이터(x 11)는 제3 곱셈 덧셈 연산기(213)에 입력되고, 제2-1 데이터(x 21)는 제2 곱셈 덧셈 연산기(212)에 입력되며, 제1-2 데이터(x 12)는 제5 곱셈 덧셈 연산기(215)에 입력 될 수 있다. 제3 클럭에서 제3-1 데이터(x 31)는 제1 곱셈 덧셈 연산기(211)에 입력되고, 제2-2 데이터(x 22)는 제4 곱셈 덧셈 연산기(214)에 입력되며, 제1-3 데이터(x 13)는 제7 곱셈 덧셈 연산기(217)에 입력될 수 있다. Referring to FIG. 2, each data of the input feature map 200 is mapped to a systolic array that is sequentially input to the multiplication adders 211 to 219 according to a clock having a constant latency. Can be. For example, the first-first data x 11 of the first row 1 of the systolic array may be input to the first multiplication adder 211 to the first clock. Although not shown in FIG. 2, the 1-1 data x 11 may be multiplied by a weight value of w 11 in the first clock. Subsequently, in the second clock, the first-first data x 11 is input to the second multiplication addition operator 212, and the second-first data x 21 is input to the first multiplication addition operator 211. 1-2 data (x 12 ) may be input to fourth multiplication addition operator 214. Similarly, in the third clock, the first-first data x 11 is input to the third multiplication addition operator 213, and the second-first data x 21 is input to the second multiplication addition operator 212. The 1-2 data x 12 may be input to the fifth multiplication addition operator 215. In the third clock, the 3-1 data x 31 is input to the first multiplication adder 211, and the 2-2 data x 22 is input to the fourth multiplication adder 214. The −3 data x 13 may be input to the seventh multiplication addition operator 217.
전술한 바와 같이, 입력 데이터(200)는 순차적인 클럭에 따라 곱셈 덧셈 연산기(211 내지 219) 내의 각 곱셈 덧셈 연산기에 입력되고, 각 클럭에 따라 입력된 웨이트 값과 곱셈 및 덧셈 연산이 수행될 수 있다. 순차적으로 입력된 입력 특징 맵(200)의 각 데이터와 웨이트 값의 곱셈 및 덧셈 연산을 통해 출력된 값들을 누적 합산함에 따라 출력 특징 맵이 생성될 수 있다.As described above, the input data 200 is input to each multiplication adder in the multiplication adders 211 to 219 according to the sequential clocks, and multiplication and addition operations with the input weight value can be performed according to the clocks. have. An output feature map may be generated by accumulating and summing values output through multiplication and addition of each data of the input feature map 200 sequentially input and weight values.
도 2에 도시된 시스톨릭 배열을 이용한 컨볼루션 연산은 도 1c에 도시된 컨볼루션 연산 보다 연산 속도가 더 빠를 수 있다. The convolution operation using the systolic array shown in FIG. 2 may be faster in speed than the convolution operation shown in FIG. 1C.
도 3a는 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이다. 3A is a diagram illustrating a method of performing a deep learning based convolution operation.
도 3a를 참조하면, 입력 특징 맵(300)의 좌측 상단으로부터 우측 하단까지 일정한 크기, 즉 3×3 크기의 필터(310)를 적용하여 곱셈 및 덧셈 연산을 수행하는 과정이 도시되어 있다. Referring to FIG. 3A, a process of performing a multiplication and an addition operation by applying a filter 310 having a predetermined size, that is, a 3 × 3 size, is performed from the upper left to the lower right of the input feature map 300.
본 개시의 일 실시예에 따른 컨볼루션 연산은, 먼저 입력 특징 맵(300)의 좌측 상단 제1 영역(301)에서 3×3, 즉 제1 방향으로 3개의 데이터와 제2 방향으로 3개의 데이터를 포함한 총 9개의 데이터(x 11 내지 x 33)를 각각 필터(310)의 웨이트 값(weight)(w 11 내지 w 33)과 곱하는 연산을 수행한다. 이후, 곱셈 연산의 출력 값, 즉 x 11*w 11, x 12*w 12, x 13*w 13, x 21*w 21, x 22*w 22, x 23*w 23, x 31*w 31, x 32*w 32, x 33*w 33을 모두 누적하여 합산하면 출력 특징 맵(320)의 제1-1 출력 데이터(y 11)가 생성된다. A convolution operation according to an embodiment of the present disclosure may first perform three-by-three, that is, three data in a first direction and three data in a second direction in the upper left first region 301 of the input feature map 300. to perform the operation of multiplying the total of nine data (x 11 to x 33), a weight value (weight) (w 11 to w 33) of the filter 310 respectively include. Then, the output of the multiplication operation, that is, x 11 * w 11 , x 12 * w 12 , x 13 * w 13 , x 21 * w 21 , x 22 * w 22 , x 23 * w 23 , x 31 * w 31 , x 32 * w 32 and x 33 * w 33 are accumulated and summed to generate first-first output data y 11 of the output feature map 320.
이후, 입력 특징 맵(300)의 좌측 상단의 제1 영역(301)에서 제2 영역(302)으로 1만큼 스트라이드하고, 제2 영역(302)에 포함된 총 9개의 입력 데이터(x 12 내지 x 34)를 필터(310)의 웨이트 값(w 11 내지 w 33)과 곱하는 연산을 수행하고, 곱셈 연산의 출력 값인 x 12*w 11, x 13*w 12, x 14*w 13, x 22*w 21, x 23*w 22, x 24*w 23, x 32*w 31, x 33*w 32, x 34*w 33을 모두 누적하여 합산하면 출력 특징 맵(320)의 제1-2 출력 데이터(y 12)가 생성된다. 스트라이드의 크기가 1인 경우, 제1 영역(301)과 제2 영역(302) 사이에서 입력 특징 맵(300)의 데이터 중 중복되어 연산에 사용되는 데이터는 x 12, x 13, x 22, x 23, x 32, x 33을 포함하는 총 6개의 데이터이다. Then, the stride by the second region 302 in the first area 301 at the top left of the input feature map 300 1, and a total of 9 input data contained in the second region 302 (x 12 to x 34 ) multiplies the weight values (w 11 to w 33 ) of the filter 310, and outputs x 12 * w 11 , x 13 * w 12 , x 14 * w 13 , x 22 *, which are output values of the multiplication operation. When the sum of w 21 , x 23 * w 22 , x 24 * w 23 , x 32 * w 31 , x 33 * w 32 and x 34 * w 33 is accumulated and summed, the output of the 1-2 of the output feature map 320 is output. Data y 12 is generated. When the size of the stride is 1, among the data of the input feature map 300 overlapped between the first region 301 and the second region 302 and used for the calculation, x 12 , x 13 , x 22 , x A total of six data including 23 , x 32 , and x 33 .
스트라이드를 계속하여 제3 영역(303)에 도달한 경우, 제3 영역(303)에 포함된 총 9개의 데이터, 즉 x21 내지 x43은 필터(310)의 웨이트 값(w 11 내지 w 33)과 곱하는 연산이 수행되고, 곱셈 연산의 출력 값인 x 21*w 11, x 22*w 12, x 23*w 13, x 31*w 21, x 32*w 22, x 33*w 23, x 41*w 31, x 42*w 32, x 43*w 33을 모두 누적하여 합산하면 출력 특징 맵(320)의 제2-1 출력 데이터(y 21)가 생성된다. 제3 영역(303)과 제1 영역(301) 사이에서 입력 특징 맵(300)의 데이터 중 중복되어 연산에 사용되는 데이터는 x 21, x 22, x 23, x 31, x 32, x 33을 포함하는 총 6개의 데이터이다. When the stride continues to reach the third region 303, the total of nine data included in the third region 303, that is, x21 to x43, is multiplied by the weight values w 11 to w 33 of the filter 310. The operation is performed, and the output values of the multiplication operation are x 21 * w 11 , x 22 * w 12 , x 23 * w 13 , x 31 * w 21 , x 32 * w 22 , x 33 * w 23 , x 41 * w When the sums 31 , x 42 * w 32 , and x 43 * w 33 are accumulated and added together, the second-first output data y 21 of the output feature map 320 is generated. Duplicate data among the data of the input feature map 300 between the third region 303 and the first region 301 to be used for calculation is x 21 , x 22 , x 23 , x 31 , x 32 , x 33 . There are a total of six data included.
즉, 스트라이드가 1인 경우 입력 데이터 중 특정 영역(300A)에 포함된 입력 데이터(x 22, x 23, x 32, x 33, x 42, x 43)는 총 3번씩 중복되어 곱셈 및 덧셈 연산에 입력되게 된다. 여기서, 중복되는 회수는 필터의 크기 및 스트라이드의 값에 따라 결정될 수 있다. 입력 특징 맵(300)의 데이터가 x 11, x 12, x 13, x 12, x 13, x 14, x 13, x 14, x 15,... , 로 순차적으로 입력됨에 따라 각 클럭마다 데이터를 토글(toggle)해야 하고, 이로 인하여 전력 소비량이 늘어나게 된다.That is, when the stride is 1, the input data (x 22 , x 23 , x 32 , x 33 , x 42 , x 43 ) included in the specific area 300A among the input data is duplicated three times in total to multiply and add operations. Will be entered. Here, the number of overlaps may be determined according to the size of the filter and the value of the stride. As the data of the input feature map 300 is sequentially input as x 11 , x 12 , x 13 , x 12 , x 13 , x 14 , x 13 , x 14 , x 15 , ..., Must be toggled, resulting in increased power consumption.
도 3b는 본 개시의 일 실시예에 따라 입력 특징 맵(300)의 데이터의 입력 순서(sequence)를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면이다.FIG. 3B is a diagram illustrating a method of changing an input sequence of data of the input feature map 300 and mapping to a systolic array according to an embodiment of the present disclosure.
도 3b를 참조하면, 입력 특징 맵(300)의 데이터들은 순차적인 클럭(clock)에 따라 데이터들이 입력되는 시스톨릭 배열로 매핑되고, 입력 특징 맵(300)의 동일한 값을 갖는 데이터가 반복되어 시스톨릭 배열 연산기 내의 각 곱셈 덧셈 연산기(311 내지 319)에 입력되도록 입력 특징 맵(300)의 데이터의 순서를 변경될 수 있다. 예를 들어, 시스톨릭 배열로 매핑된 입력 특징 맵(300)의 제1 행(①)에서, 제1 클럭, 제2 클럭 및 제3 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x 11(300-1)일 수 있다. 또한, 제1 행(①)에서, 제4 클럭, 제5 클럭 및 제6 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x 12(300-2)이고, 제7 클럭, 제8 클럭 및 제9 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x 13(300-3)일 수 있다. Referring to FIG. 3B, data of the input feature map 300 is mapped to a systolic array into which data is input according to a sequential clock, and data having the same value of the input feature map 300 is repeated to generate a system. The order of the data of the input feature map 300 may be changed to be input to each multiplication addition operator 311 to 319 in the toll array operator. For example, in the first row ① of the input feature map 300 mapped to the systolic array, the data input to the systolic array operator according to the first clock, the second clock, and the third clock are all the same x. 11 (300-1). Further, in the first row ①, data input to the systolic array operator according to the fourth clock, the fifth clock, and the sixth clock are all the same x 12 (300-2), and the seventh and eighth clocks. And data input to the systolic array operator according to the ninth clock may be the same x 13 (300-3).
마찬가지로, 시스톨릭 배열로 매핑된 입력 특징 맵(300)의 제2 행(②)에서 제2 클럭, 제3 클럭 및 제4 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x 12(300-4)이고, 제3 행(③)에서 제3 클럭, 제4 클럭 및 제5 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x 13(300-5)일 수 있다. Similarly, in the second row (②) of the input feature map 300 mapped to the systolic array, the data input to the systolic array operator according to the second clock, the third clock, and the fourth clock are all the same x 12 (300). -4), and the data input to the systolic array operator according to the third clock, the fourth clock, and the fifth clock in the third row ③ may all be the same x 13 (300-5).
시스톨릭 배열 연산기 내의 각 곱셈 덧셈 연산기(311 내지 319) 측면에서 보면, 제1 곱셈 덧셈 연산기(311)에는 제1 클럭 내지 제3 클럭에 따라 입력 특징 맵(300)의 x 11 데이터(300-1)가 반복되어 입력될 수 있다. 마찬가지로, 제4 곱셈 덧셈 연산기(314)에는 제2 클럭 내지 제4 클럭에 따라 입력 특징 맵(300)의 x 12 데이터(300-4)가 반복되어 입력되고, 제7 곱셈 덧셈 연산기(317)에는 제3 클럭 내지 제5 클럭에 따라 x 13 데이터(300-5)가 반복되어 입력될 수 있다. In view of each multiplication addition operator 311 to 319 in the systolic array operator, the first multiplication addition operator 311 includes x 11 data 300-1 of the input feature map 300 according to the first to third clocks. ) May be repeatedly input. Similarly, the fourth multiplier addition computing unit 314, the second clock to the first and fourth input data x 12 (300-4) of the input feature map 300 according to the clock is repeated, and seventh multiplication addition operator 317 is The x 13 data 300-5 may be repeatedly input according to the third to fifth clocks.
도 3b에 도시된 실시예에서, 입력 특징 맵(300)은 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복적으로 시스톨릭 배열 연산기에 입력되도록 시스톨릭 배열로 매핑될 수 있다. 여기서, 기설정된 회수는 필터(310)의 크기와 동일할 수 있다. 즉, 필터의 크기가 n×n인 경우, 입력 특징 맵(300)은 동일한 값을 갖는 데이터가 n번 중복되어 반복적으로 시스톨릭 배열 연산기에 입력되도록 매핑될 수 있다. 예를 들어, 필터(310)의 크기가 3×3인 경우, 입력 특징 맵(300)의 x 11 데이터(300-1), x 21 데이터(300-2), x 31 데이터(300-3), x 12 데이터(300-4) 및 x 13 데이터(300-5)는 총 3번씩 반복되어 시스톨릭 배열 연산기에 입력되도록 입력 순서(sequence)가 변경될 수 있다. In the embodiment illustrated in FIG. 3B, the input feature map 300 may be mapped to a systolic array such that data having the same value is repeatedly input to the systolic array operator for a predetermined number of times. Here, the predetermined number of times may be equal to the size of the filter 310. That is, when the size of the filter is n × n, the input feature map 300 may be mapped such that data having the same value is duplicated n times and repeatedly input to the systolic array operator. For example, when the size of the filter 310 is 3 × 3, x 11 data 300-1, x 21 data 300-2, and x 31 data 300-3 of the input feature map 300 are shown. The input sequence may be changed such that the x 12 data 300-4 and the x 13 data 300-5 are repeated three times and input to the systolic array operator.
그러나, 입력 특징 맵(300)의 데이터가 반복되는 회수가 필터의 크기로 한정되는 것은 아니다. 일 실시예에서, 입력 특징 맵(300)의 데이터가 반복되어 시스톨릭 배열 연산기에 입력되는 회수는 2회일 수 있다. 이에 대해서는 도 5a 및 도 5b를 참조하여 설명하기로 한다.However, the number of times the data of the input feature map 300 is repeated is not limited to the size of the filter. In one embodiment, the number of times data in the input feature map 300 is repeated and input to the systolic array operator may be twice. This will be described with reference to FIGS. 5A and 5B.
도 3c는 본 개시의 일 실시예에 따른 시스톨릭 배열 연산기를 이용하여 컨볼루션 연산을 수행하고, 연산된 결과 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성하는 방법을 도식화한 도면이다.FIG. 3C is a diagram illustrating a method of generating an output feature map by performing a convolution operation using a systolic array operator and accumulating the calculated result values.
도 3c를 참조하면, 시스톨릭 배열 연산기에 입력 특징 맵과 필터의 웨이트 값이 입력되고, 순차적인 클럭에 따라 입력된 특징 맵의 데이터와 필터의 웨이트 값을 곱셈 및 덧셈하는 연산이 수행되는 과정이 도시되어 있다. 예를 들어, 제1 클럭에서 제1-1 데이터(x 11)와 제1-1 웨이트(w 11)가 제1-1 연산기(1-1)에 의해 곱셈 연산될 수 있다. 제2 클럭에서는, 제1-1 데이터(x 11)와 제1-2 웨이트(w 12)가 제1-1 연산기(1-1)에 의해 곱셈 연산되고, 제1 클럭에서 연산되었던 x 11*w 11과 덧셈 연산될 수 있다. 마찬가지로, 제2 클럭에서 제1-1 데이터(x 11)는 제2-1 웨이트(w 21)과 제2-1 연산기(2-1)에 의해 곱셈 연산되고, 제1-2 데이터(x 12)는 제2-2 연산기(2-2)에 의해 제2-1 웨이트(w 21)와 곱셈 연산될 수 있다. 제3 클럭에서는, 제1-1 데이터(x 11)와 제1-3 웨이트(w 13)가 제1-1 연산기(1-1)에 의해 곱셈 연산되고, 기 연산되었던 x 11*w 11+x 11*x 12와 덧셈 연산될 수 있다. 또한, 제3 클럭에서 제1-1 데이터(x 11)와 제2-2 웨이트(w 22)가 제2-2 연산기(2-2)에 의해 곱셈 연산되고, 기 연산되었던 x 11*w 21과 덧셈 연산될 수 있다. 도 3c의 하단을 참조하면, 상기 방법으로 각 사이클(cycle)에 따라 입력 특징 맵의 각 데이터와 필터의 웨이트 값이 복수의 시스톨릭 배열 연산기에 의해 순차적으로 곱셈 및 덧셈 연산되어 출력될 수 있다. Referring to FIG. 3C, a process of inputting a weight value of an input feature map and a filter to a systolic array operator and multiplying and adding data of the input feature map and a weight value of a filter according to a sequential clock is performed. Is shown. For example, the first-first data x 11 and the first-first weight w 11 may be multiplied by the first-first calculator 1-1 in the first clock. In the second clock, the first-first data x 11 and the first-two weight w 12 are multiplied by the first-first calculator 1-1, and x 11 * which has been calculated in the first clock. Can be added with w 11 . Similarly, in the second clock, the 1-1 data x 11 is multiplied by the 2-1 weight w 21 and the 2-1 calculator 2-1, and the 1-2 data x 12. ) May be multiplied by the 2-1st weight w 21 by the 2-2nd calculator 2-2. In the third clock, the first-first data x 11 and the first-three weights w 13 are multiplied by the first-first calculator 1-1, and the previously calculated x 11 * w 11 + Can be added with x 11 * x 12 . In addition, in the third clock, the first-first data x 11 and the second-two weights w 22 are multiplied by the second-operator 2-2, and the previously calculated x 11 * w 21. And addition operations. Referring to the lower part of FIG. 3C, according to the method, each data of the input feature map and the weight value of the filter may be sequentially multiplied and added by a plurality of systolic array operators and output according to each cycle.
도 3c에 도시된 실시예에서, 필터가 입력 특징 맵 상에서 스트라이드 됨에 따라 변경되는 입력 특징 맵의 데이터와 필터의 웨이트 값의 조합에 기초하여 시스톨릭 배열 연산기에 의해 연산된 출력 값이 선택되고, 선택된 출력 값들이 누적 합산되어 출력 특징 맵이 생성될 수 있다. 즉, 입력 특징 맵 상에서 필터가 제1 방향(가로 방향) 및 제2 방향(세로 방향)으로 스트라이드 됨에 따라 변경되는 입력 특징 맵의 데이터와 필터의 웨이트 간의 조합에 기초하여 시스톨릭 배열 연산기에 의해 연산된 출력 값을 선택하고, 선택된 출력 값들을 누적 합산하면, 컨볼루션 연산을 수행한 것과 동일한 출력 특징 맵이 얻어질 수 있다. In the embodiment shown in FIG. 3C, an output value computed by the systolic array operator is selected based on a combination of the data of the input feature map and the weight value of the filter that is changed as the filter is strided on the input feature map. The output values may be cumulatively summed to generate an output feature map. That is, calculation is performed by the systolic array operator based on a combination of the data of the input feature map and the weight of the filter which are changed as the filter is stradded in the first direction (horizontal direction) and the second direction (vertical direction) on the input feature map. If the selected output value is selected and the selected output values are cumulatively summed, an output characteristic map identical to that of performing a convolution operation can be obtained.
예를 들어, 제1-1 연산기(1-1)에 의해 곱셈 연산된 x 11*w 11, 제1-2 연산기(1-2)에 의해 곱셈 연산된 x 12*w 12, 제1-3 연산기(1-3)에 곱셈 연산된 x 13*w 13, 제2-1 연산기(2-1)에 의해 곱셈 연산된 x 21*w 21, 제2-2 연산기(2-2)에 의해 곱셈 연산된 x 22*w 22, 제2-3 연산기(2-3)에 의해 곱셈 연산된 x 23*w 23, 제3-1 연산기(3-1)에 의해 곱셈 연산된 x 31*w 31, 제3-2 연산기(3-2)에 의해 곱셈 연산된 x 32*w 32, 및 제3-3 연산기(3-3)에 의해 곱셈 연산된 x 33*w 33을 선택적으로 누적 합산하면, 출력 특징 맵의 제1-1 출력 값(y 11)이 생성될 수 있다. 마찬가지로, 제1-2 연산기(1-2)에 의해 곱셈 연산된 x 12*w 11, 제1-3 연산기(1-3)에 의해 곱셈 연산된 x 13*w 12, 제1-4 연산기(1-4)에 곱셈 연산된 x 14*w 13, 제2-2 연산기(2-2)에 의해 곱셈 연산된 x 22*w 21, 제2-3 연산기(2-3)에 의해 곱셈 연산된 x 23*w 22, 제2-4 연산기(2-4)에 의해 곱셈 연산된 x 24*w 23, 제3-2 연산기(3-2)에 의해 곱셈 연산된 x 32*w 31, 제3-3 연산기(3-3)에 의해 곱셈 연산된 x 33*w 32, 및 제3-4 연산기(3-4)에 의해 곱셈 연산된 x 34*w 33을 선택적으로 누적 합산하면, 출력 특징 맵의 제1-2 출력 값(y 12)이 생성될 수 있다For example, x 11 * w 11 multiplied by the first-first calculator 1-1, x 12 * w 12 multiplied by the 1-2 operator 1-2, and first-3. X 13 * w 13 multiplied by the operator 1-3, x 21 * w 21 multiplied by the 2-1 operator 2-1, multiplication by the second-2 operator 2-2 Computed x 22 * w 22 , x 23 * w 23 multiplied by the 2-3 operator (2-3), x 31 * w 31 multiplied by the 3-1 operator (3-1), Selectively accumulating and summing x 32 * w 32 multiplied by the 2-3 operator 3-2 and x 33 * w 33 multiplied by the 3-3 operator 3-3, A first-first output value y 11 of the feature map may be generated. Similarly, x 12 * w 11 multiplied by the 1-2 operator 1-2, x 13 * w 12 multiplied by the 1-3 operator 1-3, and 1-4 operator ( X- 4 * w 13 multiplied by 1-4), x 22 * w 21 multiplied by the second-2 operator 2-2, multiplied by the 2-3 operator 2-3 x 23 * w 22 , x 24 * w 23 multiplied by 2-4 operator (2-4), x 32 * w 31 multiplied by 3-2 operator (3-2), third Selectively accumulating summing x 33 * w 32 multiplied by the -3 operator (3-3) and x 34 * w 33 multiplied by the 3-4 operator (3-4), the output feature map 1-2 output value y 12 of may be generated.
종래의 시스톨릭 배열 연산은 중복되어 연산되는 입력 데이터를 고려하지 않고, 입력 특징 맵(300)의 데이터를 순차적으로 입력시키는 방식을 사용하였으므로, 모든 클럭에 따라 입력 데이터의 값을 토글(toggle)해야 된다. 예를 들면, 입력 특징 맵(300)의 데이터가 순차적인 클럭에 따라 x 11, x 12, x 13, x 12, x 13, x 14, ... , 식으로 입력되는바, 모든 클럭에서 버스 데이터를 토글해야 한다. 일반적으로 컨볼루션 뉴럴 네트워크를 이용한 딥 러닝 연산에서는 초 당 기가(giga) 단위의 데이터 연산을 수행해야 되는바, 각 클럭에 따라 버스 데이터(bus data)를 토글 해야 하는 경우 프로세서 또는 칩 내부에서 소모되는 전력량이 증가하게 된다. 제한된 전력만을 사용해야 하는 모바일 디바이스(mobile device), 애플리케이션 또는 컴퓨팅 환경에서 컨볼루션 연산을 통한 딥 러닝에 제한이 있을 수 밖에 없다. The conventional systolic array operation uses a method of sequentially inputting the data of the input feature map 300 without considering input data that is duplicated, and thus, it is necessary to toggle the value of the input data according to all clocks. do. For example, the data of the input feature map 300 is input according to a sequential clock, such as x 11 , x 12 , x 13 , x 12 , x 13 , x 14 , ..., buses at all clocks. You need to toggle the data. In general, deep learning operations using convolutional neural networks require performing data operations in giga seconds per second, which is consumed inside the processor or chip when the bus data must be toggled according to each clock. The amount of power is increased. In mobile devices, applications, or computing environments where only limited power needs to be used, deep learning through convolutional computation is limited.
다시 도 3a를 참조하면, 입력 특징 맵(300) 상에서 필터(310)가 제1 방향(가로 방향) 및 제2 방향(세로 방향)으로 1만큼 스트라이드 됨에 따라 입력 특징 맵(300)의 데이터 중 x 22, x 23, x 32, x 33, x 42, x 43은 총 3번 중복되어 곱셈 연산될 수 있다. 본 개시의 실시예는, 입력 특징 맵(300)의 데이터 중 곱셈 및 덧셈 연산에 입력되어 다시 사용(reuse)되는 회수 만큼 입력 특징 맵(300)의 데이터를 중복(overlap)하여 반복적으로 시스톨릭 배열 연산기에 입력되도록 입력 특징 맵(300)의 데이터를 매핑할 수 있다. 일 실시예에서, 시스톨릭 배열 연산기에 입력되는 데이터의 반복 회수는 필터(310)의 크기에 의해 결정될 수 있다. 예를 들어, 필터(310)의 크기가 n×n인 경우, 입력 특징 맵(300)의 데이터가 n번 반복되어 시스톨릭 배열 연산기에 입력되도록 매핑될 수 있다. 예를 들어, 순차적인 클럭에 따라 시스톨릭 배열 연산기 내의 곱셈 및 덧셈 연산기에 입력되는 데이터의 순서가 x 11, x 11, x 11, x 21, x 21, x 21, x 31, x 31, x 31, ... , 순서로 3번씩 반복되도록 입력 특징 맵(300)의 데이터를 매핑할 수 있다. Referring again to FIG. 3A, x of the data of the input feature map 300 is filtered as the filter 310 is straddled by 1 in the first direction (horizontal direction) and the second direction (vertical direction) on the input feature map 300. 22 , x 23 , x 32 , x 33 , x 42 , and x 43 can be multiplied three times in total. According to an exemplary embodiment of the present disclosure, a systolic arrangement is repeated by overlapping data of the input feature map 300 by the number of times input and reused among the data of the input feature map 300 by multiplication and addition operations. Data of the input feature map 300 may be mapped to be input to the calculator. In one embodiment, the number of iterations of data input to the systolic array operator may be determined by the size of the filter 310. For example, when the size of the filter 310 is n × n, the data of the input feature map 300 may be mapped to be repeated n times and input to the systolic array operator. For example, according to the sequential clock, the order of data input to the multiplication and addition operators in the systolic array operator is x 11 , x 11 , x 11 , x 21 , x 21 , x 21 , x 31 , x 31 , x The data of the input feature map 300 may be mapped to be repeated three times in the order of 31 , ...,.
또한, 도 3c에 도시된 실시예를 참조하면, 매핑된 입력 특징 맵(300)의 데이터가 각 클럭에 따라 반복적으로 입력되고, 입력된 데이터와 필터의 웨이트 값을 곱셈 및 덧셈 연산하여 출력된 값들을 선택적으로 누적 합산하여 출력 특징 맵을 생성할 수 있다. In addition, referring to the embodiment illustrated in FIG. 3C, data of the mapped input feature map 300 is repeatedly input according to each clock, and a value output by multiplying and adding a weight value of the input data and a filter and outputting the same. These cumulative sums may be selectively generated to generate an output feature map.
따라서, 도 3b 및 도 3c에 도시된 실시예에 따르면 입력 특징 맵(300) 중 동일한 값을 갖는 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되므로, 기존 방식의 컨볼루션 연산에 비하여 메모리에 액세스하는 양과 버스 데이터 토글(toggle) 양이 현저하게 줄어드는바, 프로세서 또는 칩 내부에서 소모되는 전력량을 감소시킬 수 있다. Therefore, according to the exemplary embodiment shown in FIGS. 3B and 3C, since the data having the same value among the input feature maps 300 is repeatedly input to the systolic array operator, the amount of accessing the memory as compared to the conventional convolution operation is determined. The amount of bus data toggles is significantly reduced, which can reduce the amount of power consumed inside the processor or chip.
도 4는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 딥 러닝 연산을 수행하는 방법을 나타내는 흐름도이다. 도 4에 도시된 각 단계(S410 내지 S430)는 컨볼루션 뉴럴 네트워크 기반의 딥 러닝 연산을 수행하는 프로세서(processor) 또는 칩(chip)을 포함하는 컴퓨팅 장치 또는 애플리케이션 프로세서(Application Processor, AP)를 포함하는 모바일 장치에 의해 수행될 수 있다. 이하에서는, 컴퓨팅 장치 및 모바일 장치를 포괄하는 '전자 장치'라는 용어를 사용하기로 한다.4 is a flowchart illustrating a method of performing a deep learning operation using a systolic array according to an embodiment of the present disclosure. Each step S410 to S430 illustrated in FIG. 4 includes a computing device or an application processor (AP) including a processor or a chip that performs a deep learning operation based on a convolutional neural network. May be performed by a mobile device. Hereinafter, the term 'electronic device' encompassing computing devices and mobile devices will be used.
단계 S410에서, 전자 장치는 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)한다. 전자 장치는 일정한 레이턴시(latency)를 갖는 클럭(clock)에 따라 순차적으로 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑할 수 있다. 일 실시예에서, 전자 장치는 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되는 입력 데이터가 적어도 2번 이상 반복되어 입력되도록 시스톨릭 배열 내에서의 입력 특징 맵의 데이터의 입력 순서를 변경할 수 있다. 일 실시예에서, 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되는 데이터의 반복 회수는 필터의 크기에 의해 결정될 수 있다. 예를 들어, 필터의 크기가 n×n인 경우, 전자 장치는 입력 특징 맵의 데이터가 n번 반복되어 시스톨릭 배열 연산기에 입력되도록 입력 특징 맵의 데이터를 매핑될 수 있다.In operation S410, the electronic device maps the data of the input feature map into the systolic array so that data having the same value is repeated a predetermined number of times and inputted to the multiplication addition operator in the systolic array operator. The electronic device may map data of the input feature map into a systolic array so as to be sequentially input to the multiplication adder according to a clock having a constant latency. According to an embodiment, the electronic device may change an input order of data of an input feature map in the systolic array so that input data input to the multiplication addition operator in the systolic array operator is repeatedly input at least two times. In one embodiment, the number of iterations of data input to the multiplication addition operator in the systolic array operator may be determined by the size of the filter. For example, when the size of the filter is n × n, the electronic device may map the data of the input feature map such that the data of the input feature map is repeated n times and input to the systolic array operator.
단계 S420에서, 전자 장치는 매핑된 입력 특징 맵 데이터 및 필터의 웨이트 값을 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행한다. 일 실시예에서, 전자 장치는 순차적인 클럭에 따라 입력 특징 맵의 데이터가 기설정된 회수만큼 반복적으로 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력시키고, 각 클럭에 따라 필터의 웨이트 값이 곱셈 덧셈 연산기에 입력시키면서 컨볼루션 연산을 수행할 수 있다. In operation S420, the electronic device inputs the weighted values of the mapped input feature map data and the filter to the systolic array operator to perform a convolution operation. In one embodiment, the electronic device repeatedly inputs the data of the input feature map to the multiplication adder in the systolic array operator according to the sequential clocks, and the weight value of the filter according to each clock is supplied to the multiplication adder. You can perform convolution operations as you type.
단계 S430에서, 전자 장치는 컨볼루션 연산된 출력 값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성한다. 일 실시예에서, 전자 장치는 시스톨릭 배열 연산기 내의 복수의 곱셈 덧셈 연산기 각각에 의해 계산된 입력 특징 맵 데이터와 필터의 웨이트 곱을 누적하여 합산함으로써, 출력 데이터를 생성할 수 있다. 전자 장치는 입력 특징 맵 상에서 필터의 이동(stride)을 참조하여, 복수의 곱셈 덧셈 연산기에서 계산된 복수의 출력 데이터들을 선택적으로 누적 합산할 수 있다. 일 실시예에서, 전자 장치는 스트라이드의 값에 따른 입력 특징 맵의 데이터와 필터의 웨이트 간의 조합에 기초하여 복수의 출력 값들을 선택하고, 선택된 출력 값들을 누적 합산하여 출력 특징 맵을 생성할 수 있다. In operation S430, the electronic device accumulates the convolutionally calculated output values to generate an output feature map. According to an embodiment, the electronic device may generate output data by accumulating and adding the input feature map data calculated by each of the plurality of multiplication addition operators in the systolic array operator and the weight product of the filter. The electronic device may selectively accumulate the plurality of output data calculated by the plurality of multiplication adders by referring to the movement of the filter on the input feature map. According to an embodiment of the present disclosure, the electronic device may select a plurality of output values based on a combination of data of the input feature map according to the value of the stride and the weight of the filter, and accumulate and sum the selected output values to generate an output feature map. .
도 5a는 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이다. 5A is a diagram illustrating a method of performing a deep learning based convolution operation.
도 5a를 참조하면, 입력 특징 맵(500) 상에서 스트라이드 1 만큼 이동하면서 입력 특징 맵(500)의 데이터 값과 곱셈 및 덧셈 연산되는 3×3 크기의 필터(510)가 도시되어 있다.Referring to FIG. 5A, there is shown a 3 × 3 filter 510 that is multiplied and added to the data values of the input feature map 500 while moving by stride 1 on the input feature map 500.
도 5a에 도시된 실시예에서, 입력 특징 맵(500)의 좌측 상단 제1 영역(501) 상에 3×3, 즉 제1 방향으로 3개의 데이터와 제2 방향으로 3개의 데이터를 포함한 총 9개의 데이터(x 11 내지 x 33)는 각각 필터(510)의 웨이트 값(weight)(w 11 내지 w 33)과 곱하는 연산이 수행된다. 곱셈 연산의 출력 값, 즉 x 11*w 11, x 12*w 12, x 13*w 13, x 21*w 21, x 22*w 22, x 23*w 23, x 31*w 31, x 32*w 32, x 33*w 33을 모두 누적하여 합산하면 출력 특징 맵(520)의 제1-1 출력 데이터(y 11)가 생성된다. In the embodiment illustrated in FIG. 5A, a total of 9 including 3 × 3 data, 3 data in the first direction and 3 data in the second direction, on the upper left first area 501 of the input feature map 500. The data x 11 to x 33 are multiplied by the weights w 11 to w 33 of the filter 510, respectively. Output value of the multiplication operation: x 11 * w 11 , x 12 * w 12 , x 13 * w 13 , x 21 * w 21 , x 22 * w 22 , x 23 * w 23 , x 31 * w 31 , x When 32 * w 32 and x 33 * w 33 are accumulated and summed together, first-first output data y 11 of the output feature map 520 is generated.
이후, 입력 특징 맵(500)의 제1 영역(501)에서 제2 영역(502)으로 1만큼 스트라이드하고, 제2 영역(502)에 포함된 총 9개의 입력 데이터(x 12 내지 x 34)를 필터(510)의 웨이트 값(w 11 내지 w 33)과 곱하는 연산이 수행되면, 곱셈 연산의 출력 값인 x 12*w 11, x 13*w 12, x 14*w 13, x 22*w 21, x 23*w 22, x 24*w 23, x 32*w 31, x 33*w 32, x 34*w 33이 누적 합산되어 출력 특징 맵(520)의 제1-2 출력 데이터(y 12)가 생성된다. Subsequently, the first region 501 of the input feature map 500 strides from the first region 501 to the second region 502 by a total of nine input data (x 12 to x 34 ) included in the second region 502. When a multiplication operation is performed with the weight values w 11 to w 33 of the filter 510, the output values of the multiplication operation x 12 * w 11 , x 13 * w 12 , x 14 * w 13 , x 22 * w 21 , x 23 * w 22 , x 24 * w 23 , x 32 * w 31 , x 33 * w 32 , x 34 * w 33 are cumulatively summed to form the 1-2 output data (y 12 ) of the output feature map 520. Is generated.
상기 설명한 실시예에서, 스트라이드의 크기가 1인 경우, 제1 영역(501)과 제2 영역(502) 사이에서 입력 특징 맵(500)의 데이터 중 중복되어 연산에 사용되는 데이터는 x 12, x 13, x 22, x 23, x 32, x 33을 포함하는 총 6개의 데이터이다. 즉, 제1 영역(501)에 관한 곱셈 및 덧셈 연산과 제2 영역(502)에 관한 곱셈 및 덧셈 연산이 순차적으로 계산되면서, 입력 특징 맵(500)의 데이터 중 x 12, x 13, x 22, x 23, x 32, x 33는 각각 두번씩 사용되게 된다. 여기서, '사용된다'는 의미는 프로세서 또는 칩 내부에서 입력 데이터(500)의 각 값을 클럭(clock)에 따라 순차적으로 판독(read)하는 것을 의미할 수 있다. 각 클럭에 따라 데이터의 값이 변경되는바, 프로세서 또는 칩 내부에서는 순차적인 각 클럭 마다 버스 데이터를 토글(toggle)해야 하므로, 처리량이 많고, 따라서 전력이 많이 소모될 수 있다. In the above-described embodiment, when the size of the stride is 1, among the data of the input feature map 500 overlapped between the first region 501 and the second region 502, the data used for the calculation is x 12 , x A total of six data including 13 , x 22 , x 23 , x 32 , and x 33 . That is, while the multiplication and addition operations for the first region 501 and the multiplication and addition operations for the second region 502 are sequentially calculated, x 12 , x 13 , and x 22 of the data of the input feature map 500 are calculated. , x 23 , x 32 and x 33 will be used twice each. Here, the term 'used' may mean that each value of the input data 500 is sequentially read in a processor or chip according to a clock. Since the value of the data changes according to each clock, the bus data must be toggled for each sequential clock in the processor or the chip, and thus the throughput is high, and thus, power may be consumed.
도 5b는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 입력 특징 맵의 데이터와 필터의 웨이트를 컨볼루션 연산하는 방법을 도식화한 도면이다.FIG. 5B is a diagram illustrating a method of convolutional operation of data of an input feature map and a weight of a filter using a systolic arrangement according to an embodiment of the present disclosure.
도 5b를 참조하면, 입력 특징 맵(500)은 순차적인 클럭(clock)에 따라 데이터들이 시스톨릭 연산기(530)에 입력되는 시스톨릭 배열로 매핑될 수 있다. 일 실시예에서, 입력 특징 맵(500)의 데이터들은 클럭에 따라 동일한 값을 갖는 데이터가 두번씩 반복되어 시스톨릭 연산기(530) 내에 입력되도록 매핑될 수 있다. 예를 들어, 시스톨릭 배열로 매핑된 입력 특징 맵(500)의 제1 행에서 입력 데이터는 x 11, x 12, x 12, x 13, x 13, x 14,... , 순서로 시스톨릭 연산기(530)에 입력될 수 있다. 제1 행에서 입력 데이터 x 12(500-1)는 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다. 예를 들어, 제2 클럭에서 x 12가 시스톨릭 연산기(530)에 입력되고, 제3 클럭에서도 x 12가 시스톨릭 연산기(530)에 입력될 수 있다. 마찬가지로, 제1 행에서 입력 데이터 x 13(500-2) 역시 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다. 예를 들어, 제4 클럭에서 x 13이 시스톨릭 연산기(530)에 입력되고, 제5 클럭에서도 x 13이 시스톨릭 연산기(530)에 입력될 수 있다. Referring to FIG. 5B, the input feature map 500 may be mapped to a systolic array in which data are input to the systolic operator 530 according to a sequential clock. In one embodiment, the data of the input feature map 500 may be mapped such that data having the same value is repeated twice and input into the systolic operator 530 according to the clock. For example, in a first row of input feature map 500 mapped to a systolic array, the input data is systolic in the order x 11 , x 12 , x 12 , x 13 , x 13 , x 14 , ..., It may be input to the calculator 530. In the first row, the input data x 12 (500-1) may be repeated twice and input to the systolic operator 530. For example, the input and the second clock from the systolic x 12 computing unit 530, the a x 12 in three clocks can be input to a systolic arithmetic unit 530. Similarly, the input data x 13 (500-2) in the first row may also be repeated twice and input to the systolic operator 530. For example, a 4 is input to clock the systolic operator 530 x 13 in the fifth clock may also be a 13 input x to a systolic arithmetic unit 530.
시스톨릭 배열로 매핑된 입력 특징 맵(500)의 제2 행에서도 입력 데이터가 순차적인 클럭에 따라 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다. 예를 들어, 시스톨릭 배열의 제2 행에서 입력 특징 맵(500)의 데이터는 x 13, x 14, x 14, x 15, x 15, x 16, ... , 순서로 시스톨릭 연산기(530)에 입력될 수 있다. 제1 행과 마찬가지로, 제2 행에서도 입력 데이터 중 x 14(500-3)는 두번씩 반복되어 시스톨릭 연산기(530)에 입력되고, x 15(500-4)도 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다.In the second row of the input feature map 500 mapped to the systolic array, the input data may be repeatedly input twice to the systolic operator 530 according to a sequential clock. For example, in the second row of the systolic array, the data of the input feature map 500 is a systolic operator 530 in the order of x 13 , x 14 , x 14 , x 15 , x 15 , x 16 , ...,. ) Can be entered. Similar to the first row, in the second row, x 14 (500-3) of the input data is repeated twice and input to the systolic operator 530, and x 15 (500-4) is also repeated twice and the systolic operator It may be input to 530.
도 5b에 도시된 입력 특징 맵(500)의 각 데이터들은 순차적인 클럭에 따라 시스톨릭 연산기(530)에 입력되는 필터(510)와 곱셈 및 덧셈 연산될 수 있다. 필터(510)의 웨이트 값은 순차적인 클럭에 따라 두번씩 중복되어 시스톨릭 연산기(530)에 입력될 수 있다. Each data of the input feature map 500 illustrated in FIG. 5B may be multiplied and added to the filter 510 input to the systolic operator 530 according to the sequential clock. The weight value of the filter 510 may be inputted to the systolic operator 530 by overlapping twice according to the sequential clock.
도 5b에 도시된 실시예에서, 입력 특징 맵(500)은 동일한 값을 갖는 데이터가 두번씩 반복되어 시스톨릭 연산기(530)에 입력되도록 시스톨릭 배열로 매핑될 수 있다. 도 5b의 실시예에 따르면, 순차적인 클럭에 따라 시스톨릭 연산기(530)에 입력되는 데이터의 값이 두번씩 중복되는바, 종래 모든 클럭에 따라 시스톨릭 연산기(530)에 입력되는 데이터가 변경되는 경우에 비하여 버스 데이터(bus data)의 토글(toggle) 회수가 현저하게 줄어들 수 있다. 따라서, 시스톨릭 연산기(530)를 통해 곱셈 및 덧셈 연산을 수행하는 프로세서 또는 칩 내부의 전력 소모를 감소시킬 수 있다. In the embodiment shown in FIG. 5B, the input feature map 500 may be mapped to a systolic arrangement such that data having the same value is repeated twice and input to the systolic operator 530. According to the exemplary embodiment of FIG. 5B, data values input to the systolic operator 530 are duplicated twice according to the sequential clocks. Thus, data input to the systolic operator 530 is changed according to all conventional clocks. In comparison, the number of toggles of bus data can be significantly reduced. Accordingly, power consumption in the processor or chip performing multiplication and addition operations may be reduced through the systolic operator 530.
도 6은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 전자 장치(600)의 구성 요소를 도시한 블록도이다.FIG. 6 is a block diagram illustrating components of an electronic device 600 that performs a convolution operation using a systolic arrangement, according to an embodiment of the present disclosure.
도 6을 참조하면, 전자 장치(600)는 프로세서(610)를 포함할 수 있다. 여기서, 전자 장치(600)는 컨볼루션 뉴럴 네트워크 기반의 딥 러닝 연산을 수행하는 컴퓨팅 장치 또는 모바일 장치일 수 있다. Referring to FIG. 6, the electronic device 600 may include a processor 610. Here, the electronic device 600 may be a computing device or a mobile device that performs a deep learning operation based on a convolutional neural network.
프로세서(610)는 곱셈 및 덧셈 연산을 수행하는 PE(Processing Element)를 포함할 수 있다. 프로세서(610)는 중앙 처리 장치(Central Processing Unit), 마이크로 프로세서(microprocessor) 및 그래픽 프로세서(Graphic Processing Unit) 중 적어도 하나로 구성될 수 있으나, 이에 제한되는 것은 아니다. 일 실시예에서, 전자 장치(600)가 스마트 폰, 태블릿 PC 등과 같은 모바일 디바이스인 경우, 프로세서(610)는 애플리케이션을 실행시키는 애플리케이션 프로세서(Application Processor, AP)일 수 있다. The processor 610 may include a processing element (PE) that performs multiplication and addition operations. The processor 610 may be configured with at least one of a central processing unit, a microprocessor, and a graphic processing unit, but is not limited thereto. In an embodiment, when the electronic device 600 is a mobile device such as a smart phone, a tablet PC, or the like, the processor 610 may be an application processor (AP) for executing an application.
일 실시예에서, 프로세서(610)는 연산에 필요한 데이터를 읽어오고, 연산 결과를 다시 저장하기 위하여 메모리에 접근할 수 있다. 예를 들어, 프로세서(610)는 메모리로부터 데이터를 읽는 로드 명령어(Load Instruction) 및 메모리에 데이터를 저장하는 저장 명령어(Store Instruction)을 실행할 수 있다.In one embodiment, the processor 610 may access the memory to read data needed for the operation and to store the result of the operation again. For example, the processor 610 may execute a load instruction that reads data from the memory and a store instruction that stores the data in the memory.
프로세서(610)는 매퍼(611), 시스톨릭 연산기(612), 및 누산기(adder)(613)를 포함할 수 있다.The processor 610 may include a mapper 611, a systolic operator 612, and an adder 613.
매퍼(611)는 입력 특징 맵의 데이터 또는 필터의 웨이트 값에 대하여, 순차적인 클럭에 따라 동일한 값을 갖는 데이터가 반복되어 시스톨릭 연산기(612)에 입력되도록 입력 특징 맵의 데이터 또는 필터의 웨이트 값의 입력 순서(sequence)를 변경하는 매핑(mapping)을 수행할 수 있다. 일 실시예에서, 매퍼(611)는 입력 특징 맵의 데이터가 필터의 크기(N)와 동일한 회수만큼 반복적으로 시스톨릭 연산기(611) 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 입력 순서(sequence)를 변경할 수 있다. 예를 들어, 필터의 크기가 3×3인 경우, 매퍼(611)는 곱셈 덧셈 연산기에 x 11, x 12, x 13,..., 각각의 입력 데이터가 3번씩 반복하여 입력되도록 입력 특징 맵을 시스톨릭 배열로 매핑할 수 있다. 그러나, 이에 한정되는 것은 아니고, 매퍼(611)는 입력 특징 맵의 데이터를 2번씩 반복되어 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵을 매핑할 수 있다.The mapper 611 stores the data of the input feature map or the weight of the filter such that data having the same value is repeatedly input to the systolic operator 612 with respect to the data of the input feature map or the weight of the filter. Mapping may be performed to change the input sequence of the. In one embodiment, the mapper 611 inputs the order of the data of the input feature map such that the data of the input feature map is repeatedly input to the multiplication addition operator in the systolic operator 611 by the same number of times as the size N of the filter. sequence) can be changed. For example, if the size of the filter is 3 × 3, the mapper 611 inputs the input feature map such that x 11 , x 12 , x 13 ,..., Each input data is repeatedly input three times to the multiplication adder. Can be mapped to a systolic array. However, the present invention is not limited thereto, and the mapper 611 may map the input feature map such that the data of the input feature map is repeated twice and input to the multiplication addition calculator.
시스톨릭 연산기(612)는 복수의 곱셈 덧셈 연산기(Processing Elements)를 포함할 수 있다. 복수의 곱셈 덧셈 연산기 각각은 플립-플롭 회로(flip-flop)로 구성될 수 있다. 복수의 곱셈 덧셈 연산기 각각은 일정한 레이턴시(latency)를 갖는 순차적인 클럭에 따라 입력되는 입력 데이터와 필터의 웨이트 값을 각각 곱하고, 곱해진 값을 더하는 연산을 수행할 수 있다. The systolic operator 612 may include a plurality of multiplication addition operators. Each of the plurality of multiplication addition operators may be configured as a flip-flop circuit. Each of the plurality of multiplication addition operators may multiply the input data and the weight value of the filter according to a sequential clock having a constant latency, and perform an operation of adding the multiplied values.
누산기(adder)(613)는 입력 특징 맵의 데이터와 필터의 웨이트 값을 곱하여 얻어진 출력 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성할 수 있다. 누산기(613)는 필터가 입력 특징 맵 상에서 스트라이드(stride) 됨에 따라 변경되는 입력 특징 맵의 데이터와 필터의 웨이트 값의 조합에 기초하여 시스톨릭 배열 연산기(612)의 복수의 곱셈 덧셈 연산기 각각에 의해 계산된 출력 값을 선택할 수 있다. 누산기(613)는 선택한 출력 값들을 누적 합산하여 출력 특징 맵을 생성할 수 있다. An adder 613 may accumulate output values obtained by multiplying the data of the input feature map by the weight value of the filter to generate an output feature map. The accumulator 613 is configured by each of the plurality of multiplication addition operators of the systolic array operator 612 based on a combination of the data of the input feature map and the weight value of the filter, which changes as the filter is strided on the input feature map. You can select the calculated output value. The accumulator 613 may accumulate and sum the selected output values to generate an output feature map.
도 7a 및 도 7b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터의 입력 순서를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면들이다.7A and 7B are diagrams illustrating a method of changing an input order of data of an input feature map and mapping the systolic array according to an embodiment of the present disclosure.
도 7a를 참조하면, 입력 특징 맵(700)의 데이터들은 순차적인 클럭(clock)에 따라 데이터들이 입력되는 시스톨릭 배열로 매핑될 수 있다. 입력 특징 맵(700)은 0값을 갖는 데이터가 포함될 수 있다. 예를 들어, 입력 특징 맵(700)이 딥 러닝을 통한 학습의 대상이 되는 이미지인 경우, 검은 색의 픽셀은 픽셀 값이 0일 수 있다. 도 7a에 도시된 실시예에서, 입력 특징 맵(700)의 데이터 중 x 22 및 x 33은 픽셀 값이 0일 수 있다. Referring to FIG. 7A, data of the input feature map 700 may be mapped to a systolic array into which data is input according to a sequential clock. The input feature map 700 may include data having a value of zero. For example, when the input feature map 700 is an image to be learned through deep learning, the black pixel may have a pixel value of zero. In the embodiment illustrated in FIG. 7A, x 22 and x 33 of the data of the input feature map 700 may have a pixel value of zero.
입력 특징 맵(700)의 데이터 중 픽셀 값이 0인 경우, 필터의 웨이트와 곱하는 연산을 수행하더라도, 출력 값이 0이기 때문에 연산을 수행할 필요가 없다. 따라서, 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터를 식별하고, 식별된 0 데이터의 위치를 참조하여 곱셈 및 덧셈 연산을 수행하지 않는 방식을 제로 스킵핑(zero-skipping)이라고 한다.If the pixel value of the data of the input feature map 700 is 0, even if the operation to multiply the weight of the filter, the output value is 0, it is not necessary to perform the operation. Accordingly, a method of identifying data having a zero value among the data of the input feature map 700 and not performing multiplication and addition operations with reference to the identified position of the zero data is called zero-skipping.
도 7a에 도시된 실시예에서는, 제3 클럭에서 0값을 갖는 x 22가 시스톨릭 배열 연산기(710) 내의 곱셈 덧셈 연산기에 입력되고, 제5 클럭에서 0값을 갖는 x 22가 곱셈 덧셈 연산기에 입력될 수 있다. 마찬가지로, 제7 클럭 및 제9 클럭에서 0값을 갖는 x 33이 시스톨릭 배열 연산기(710) 내의 곱셈 덧셈 연산기에 입력될 수 있다. 시스톨릭 배열로 매핑된 입력 특징 맵(700)의 제1 행(①)에서 제4 클럭에서는 0이 아닌 값을 갖는 x 12가 입력되지만, 제5 클럭에서는 0값을 갖는 x 22가 시스톨릭 배열 연산기(710)에 입력된다. 이후, 제1 행(①)에서 제6 클럭에 따라 다시 0이 아닌 값을 갖는 x 32가 시스톨릭 배열 연산기(710)에 입력될 수 있다. 제2 행(②)에서도 순차적인 클럭에 따라 0값을 갖는 데이터 x 22 및 x 33가 0이 아닌 값을 갖는 데이터들과 교대로 시스톨릭 배열 연산기에 입력된다. In the embodiment shown in FIG. 7A, x 22 having a zero value at the third clock is input to the multiplication addition operator in the systolic array operator 710, and x 22 having a zero value at the fifth clock is input to the multiplication addition calculator. Can be entered. Similarly, x 33 with zero values in the seventh and ninth clocks may be input to the multiplication addition operator in the systolic array operator 710. Cis first row (①) from the fourth clock that although x 12 is input with a value other than zero, and the fifth clock the x 22 is a systolic array having a zero value of the input feature map 700 maps to the Systolic Array It is input to the calculator 710. Thereafter, x 32 having a non-zero value again may be input to the systolic array operator 710 according to the sixth clock in the first row ①. A second line (②) in is input to a systolic array computing unit to the data x 22 and x 33 are data of which has a value other than 0 and shifts having a value of zero in accordance with the sequential clock.
순차적인 클럭에 따라 0값을 갖는 데이터, 0이 아닌 값을 갖는 데이터가 교대로 입력되는 경우, 모든 클럭에 대하여 버스 데이터(bus data)의 토글(toggle)이 일어나게 되어 프로세서 또는 칩이 메모리에 액세스하는 양이 늘어나고, 따라서 전력 소모량이 많아질 수 있다. When data having a zero value and data having a non-zero value are alternately input according to the sequential clocks, a toggle of bus data occurs for all clocks so that the processor or chip accesses the memory. The amount is increased, so the power consumption can be increased.
도 7b는 본 개시의 일 실시예에 따라 입력 특징 맵(700)의 데이터의 입력 순서(sequence)를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면이다.FIG. 7B is a diagram illustrating a method of changing an input sequence of data of the input feature map 700 and mapping to a systolic array according to an embodiment of the present disclosure.
도 7b를 참조하면, 입력 특징 맵(700)의 데이터들은 순차적인 클럭(clock)에 따라 데이터들이 입력되는 시스톨릭 배열로 매핑되고, 입력 특징 맵(700)의 동일한 값을 갖는 데이터가 반복되어 시스톨릭 배열 연산기(710) 내의 각 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵(700)의 데이터의 순서를 변경될 수 있다. 또한, 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터(x 22 및 x 33)는 반복적으로 시스톨릭 연산기(710)에 입력되도록 그룹핑(grouping)할 수 있다. 예를 들어, 0값을 갖는 데이터인 x 22는 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기(710)에 입력되도록 제1 그룹(701)으로 그룹핑될 수 있다. 마찬가지로, 0값을 갖는 데이터인 x 33도 x 22가 반복된 회수와 동일한 회수만큼 반복되어 시스톨릭 배열 연산기(710)에 입력되도록 제2 그룹(702)으로 그룹핑될 수 있다.Referring to FIG. 7B, data of the input feature map 700 is mapped to a systolic array into which data is input according to a sequential clock, and data having the same value of the input feature map 700 is repeated. The order of the data in the input feature map 700 may be changed to be input to each multiplication addition operator in the tonal array operator 710. In addition, data (x 22 and x 33 ) having zero values among the data of the input feature map 700 may be grouped to be repeatedly input to the systolic operator 710. For example, x 22 , which has zero value, may be grouped into the first group 701 to be repeated a predetermined number of times and input to the systolic array operator 710. Similarly, data of 33 x has a value of 0 can be grouped into a second group 702 so that x 22 is repeated as many times as the repetition number of times with the same input on a systolic array computing unit 710.
일 실시예에서, 0값을 갖는 데이터가 반복되는 회수는 필터의 크기에 의해서 결정될 수 있다. 예를 들어, 필터의 크기가 n×n인 경우, 0값을 n번 반복되어 시스톨릭 연산기(710)에 입력되도록 매핑될 수 있다. 도 7b에 도시된 실시예에서, 필터는 3×3의 크기를 갖는바, 0값을 갖는 데이터 x 22, x 33이 총 3번 반복되어 시스톨릭 연산기(710)에 입력되도록 매핑될 수 있다.In one embodiment, the number of times data having zero value is repeated may be determined by the size of the filter. For example, when the size of the filter is n × n, the value 0 may be mapped n times to be input to the systolic operator 710. In the embodiment illustrated in FIG. 7B, the filter has a size of 3 × 3, and may be mapped such that data x 22 and x 33 having a value of 0 are repeated three times and input to the systolic operator 710.
도 7a를 참조하면, 종래의 시스톨릭 배열을 이용한 컨볼루션 연산 방법은 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터가 산발적으로 흩어져 있어서, 입력 데이터에 대한 메모리 출력에서 컨볼루션 연산에 관한 누적 합산을 조합하는 것이 복잡한 구조로 되어 있었다. 그러나, 본 개시의 도 7b에 도시된 실시예에 따른 컨볼루션 연산 방법은 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터(x 22, x 33)가 소정의 회수만큼 반복되어 시스톨릭 연산기(710)에 입력되도록 매핑되는바, 한번에 적어도 두개 이상 복수개의 입력 데이터의 곱셈 및 덧셈 연산을 생략(skip)할 수 있어, 메모리 액세스 및 프로세서의 전력 소모를 감소시킬 수 있다. 0값을 갖는 입력 데이터의 그룹핑으로 인한 메모리 액세스의 감소 방법은 도 9a, b, 도 10a, b에서 상세하게 설명하기로 한다. Referring to FIG. 7A, in the conventional convolution calculation method using a systolic array, data having a zero value among the data of the input feature map 700 is scattered scattered, so that a convolution operation is performed in a memory output for the input data. Combining the cumulative sum was a complicated structure. However, in the convolution calculation method according to the embodiment shown in FIG. 7B of the present disclosure, the data (x 22 , x 33 ) having a zero value among the data of the input feature map 700 is repeated a predetermined number of times so that the systolic operator As it is mapped to be input to 710, multiplication and addition operations of at least two or more input data at a time may be skipped, thereby reducing memory access and power consumption of a processor. A method of reducing memory access due to grouping of input data having a zero value will be described in detail with reference to FIGS. 9A, b, 10A, and b.
도 8은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 전자 장치(800)의 구성 요소를 도시한 블록도이다. 도 8에 도시된 시스톨릭 연산기(812), 및 누산기(813)는 도 6에 도시된 시스톨릭 연산기(612), 및 누산기(613) 각각과 동일한 기능 및 동작을 수행하는 구성 요소인바, 중복되는 설명은 생략한다.8 is a block diagram illustrating components of an electronic device 800 that performs a convolution operation using a systolic arrangement according to an embodiment of the present disclosure. The systolic operator 812 and the accumulator 813 illustrated in FIG. 8 are components that perform the same functions and operations as the systolic operator 612 and the accumulator 613 illustrated in FIG. 6. Description is omitted.
도 8을 참조하면, 전자 장치(800)는 프로세서(810) 및 언매퍼(820)를 포함할 수 있다. 일 실시예에서, 프로세서(810)는 곱셈 및 덧셈 연산을 수행하는 PE (Processing Elements)를 포함하는 중앙 처리 장치(CPU), 마이크로 프로세서(microprocessor), 그래픽 프로세서(Graphic Processing Unit), 및 애플리케이션 프로세서(AP) 중 적어도 하나로 구성될 수 있으나, 이에 제한되는 것은 아니다. Referring to FIG. 8, the electronic device 800 may include a processor 810 and an unmapper 820. In one embodiment, the processor 810 includes a central processing unit (CPU), a microprocessor, a graphics processing unit, and an application processor (PE) including processing elements (PEs) that perform multiplication and addition operations. At least one of AP) may be configured, but is not limited thereto.
매퍼(811)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. 매퍼(811)는 또한, 식별된 0값을 갖는 데이터가 반복적으로 시스톨릭 연산기(812)에 입력되도록 0값을 갖는 데이터끼리 그룹핑(grouping)할 수 있다. The mapper 811 may identify data having a zero value among the data of the input feature map. The mapper 811 may also group data having zero values so that data having identified zero values are repeatedly input to the systolic operator 812.
매퍼(811)는 식별된 0값을 갖는 데이터가 소정의 회수만큼 시스톨릭 연산기(812)에 입력되도록 0값의 입력 순서(sequence)를 변경할 수 있다. 상기 소정의 회수는 필터의 크기에 의해 결정될 수 있다. 일 실시예에서, 매퍼(811)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터가 필터의 크기(N)와 동일한 회수만큼 반복적으로 시스톨릭 연산기(812)에 입력되도록 입력 특징 맵의 데이터를 매핑할 수 있다. 예를 들어, 필터의 크기가 3×3인 경우, 매퍼(811)는 곱셈 덧셈 연산기에 0값을 갖는 데이터가 3번씩 반복하여 입력되도록 입력 특징 맵을 시스톨릭 배열로 매핑할 수 있다. The mapper 811 may change the input sequence of the zero values so that the data having the identified zero values are input to the systolic operator 812 a predetermined number of times. The predetermined number of times may be determined by the size of the filter. In one embodiment, the mapper 811 maps the data of the input feature map such that data having zero value among the data of the input feature map is repeatedly input to the systolic operator 812 as many times as the size N of the filter. can do. For example, when the size of the filter is 3 × 3, the mapper 811 may map the input feature map into a systolic array such that data having zero values is repeatedly input three times to the multiplication addition operator.
시스톨릭 연산기(812)는 복수의 곱셈 덧셈 연산기(Processing Elements)를 포함할 수 있다. 시스톨릭 연산기(812) 내에 포함되는 복수의 곱셈 덧셈 연산기 각각은 일정한 레이턴시(latency)를 갖는 순차적인 클럭에 따라 입력되는 입력 데이터와 필터의 웨이트 값을 각각 곱하고, 곱해진 값을 더하는 연산을 수행할 수 있다. 시스톨릭 연산기(812)는 0값을 갖는 데이터가 입력되는 경우 곱셈 및 덧셈 연산을 생략(skip)할 수 있다.The systolic operator 812 may include a plurality of multiplication addition operators. Each of the multiplication addition operators included in the systolic operator 812 may multiply the input data and the weight value of the filter according to a sequential clock having a constant latency, and perform an operation of adding the multiplied values. Can be. The systolic operator 812 may skip multiplication and addition operations when data having a zero value is input.
누산기(adder)(813)는 입력 특징 맵의 데이터와 필터의 웨이트 값을 곱하여 얻어진 출력 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성할 수 있다. 누산기(813)는 언매퍼(820)의 누산기 제어부(822)의 제어를 받아, 입력 데이터 중 0값을 갖는 데이터의 위치 정보(address)를 수신하고, 이를 참조하여 출력 값을 선택적으로 누적 합산할 수 있다. An adder 813 may accumulate output values obtained by multiplying the data of the input feature map by the weight value of the filter to generate an output feature map. Under the control of the accumulator controller 822 of the unmapper 820, the accumulator 813 receives position information of data having a zero value among input data and selectively accumulates the output values with reference to the accumulator 813. Can be.
언매퍼(820)는 매퍼(811)에 의해 매핑된 입력 특징 맵의 데이터 각각의 위치 정보를 저장하고, 위치 정보를 기초로 입력 특징 맵의 데이터들을 매핑 전의 배열로 언매핑(unmapping)할 수 있다. 매퍼(811)와 언매퍼(820)의 관계는 인코더(encoder)와 디코더(decoder)의 관계와 유사하다. 매퍼(811)는 입력 특징 맵의 데이터들이 시스톨릭 연산기(812)에 기설정된 회수만큼 반복되어 입력되도록 입력 순서(sequence)를 변경하는 매핑을 수행하고, 언매퍼(820)는 매핑된 입력 특징 맵을 매핑 전의 배열로 다시 복구하는 동작을 수행한다. The unmapper 820 may store location information of each of the data of the input feature map mapped by the mapper 811, and unmap the data of the input feature map into an array before mapping based on the location information. . The relationship between the mapper 811 and the unmapper 820 is similar to the relationship between an encoder and a decoder. The mapper 811 performs mapping to change the input sequence so that data of the input feature map is repeatedly input to the systolic operator 812 by a predetermined number of times, and the unmapper 820 maps the mapped input feature map. Restores to the array before mapping.
언매퍼(820)는 메모리(821) 및 누산기 제어부(822)를 포함할 수 있다. The unmapper 820 may include a memory 821 and an accumulator controller 822.
메모리(821)는 입력 특징 맵의 데이터 중 매퍼(811)에 의해 식별된 0값을 갖는 데이터들의 위치 정보를 저장하는 LUT(Look-Up table)를 저장할 수 있다. 메모리(821)는 예를 들어, DRAM(Dynamic RAM), SRAM(Static RAM), 및 SDRAM(Synchronous Dynamic RAM) 등) 중 적어도 하나로 구성될 수 있으나, 이에 한정되지 않는다. 일 실시예에서, 메모리(821)는 입력 데이터와 필터의 웨이트 값들의 곱셈 및 덧셈 연산으로 인한 출력 값들 중 필터의 크기(n×n) 내에서 누적 합산하여야 하는 데이터의 위치에 관한 정보를 저장할 수 있다. 즉, 메모리(821)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터의 로(Row) 및 컬럼(Column) 단위의 위치 정보를 저장할 수 있다. The memory 821 may store a look-up table (LUT) that stores location information of data having a zero value identified by the mapper 811 among data of the input feature map. The memory 821 may be configured of, for example, at least one of a dynamic RAM (DRAM), a static RAM (SRAM), and a synchronous dynamic RAM (SDRAM), but is not limited thereto. In one embodiment, the memory 821 may store information about a position of data to be cumulatively summed within the size (n × n) of the filter among output values resulting from the multiplication and addition operation of the input data and the weight values of the filter. have. That is, the memory 821 may store location information in units of rows and columns of data having a zero value among data of the input feature map.
누산기 제어부(adder-tree controller)(822)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터의 위치 정보를 참조하여, 출력 값들을 누적 합산함으로써 출력 특징 맵을 생성하도록 누산기(813)를 제어할 수 있다. 일 실시예에서, 누산기 제어부(822)는 메모리(821)에 저장된 입력 특징 맵의 데이터 중 0값으로 식별된 데이터의 로(Row) 및 컬럼(Column) 단위의 위치 정보를 판독(read)하여 제로 스킵(zero-skip)된 개수 정보를 참조할 수 있다. An adder-tree controller 822 may control the accumulator 813 to generate an output feature map by accumulating the sum of the output values by referring to position information of data having a zero value among the data of the input feature map. have. In one embodiment, the accumulator controller 822 reads the position information of the row and column units of the data identified by the zero value among the data of the input feature map stored in the memory 821 to zero. Reference may be made to the skipped number information.
다른 실시예에서, 누산기 제어부(822)는 시스톨릭 연산기(812)에 입력되는 입력 특징 맵 데이터 중 0값을 갖는 데이터가 몇 사이클(cycle) 이후에 연산되는지에 관한 정보를 실시간으로 매퍼(811)로부터 수신하고, 수신된 정보를 참조하여 출력 값들을 누적 합산하도록 누산기(813)를 제어할 수 있다. 이는, 시스톨릭 배열(Systolic Array)을 이용한 컨볼루션 연산에서 0값을 갖는 데이터의 연산을 생략(skip)하는 경우, 0값 데이터가 스킵된 회수 만큼 출력 값이 상위로 시프트(shift)된다는 점에 착안한 것이다. 즉, 누산기 제어부(822)는 0값을 갖는 데이터가 곱셈 및 덧셈 연산에서 생략(skip)된 회수에 따른 출력 값들의 시프트(shift) 정보를 참조하여, 출력 값들을 누적 합산하고, 이를 통해 출력 특징 맵을 생성할 수 있다. In another embodiment, the accumulator control unit 822 may map in real time information about how many cycles of data having zero value among the input feature map data input to the systolic operator 812 is calculated. Can be controlled to accumulate and sum output values with reference to the received information. This is because, in the convolution operation using a systolic array, if the operation of data having a zero value is skipped, the output value is shifted upward by the number of times the zero value data is skipped. I was thinking. That is, the accumulator controller 822 accumulates and sums output values by referring to shift information of output values according to the number of times data having zero values is skipped in multiplication and addition operations. You can create a map.
도 9a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼(buffer)에 저장된 데이터를 도식화한 도면이고, 도 9b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다.FIG. 9A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure, and FIG. 9B is a convolution using a systolic arrangement according to an embodiment of the present disclosure. A flowchart showing how to perform an operation.
도 9a에서 메모리(900)에 총 4개의 버퍼(901 내지 904)가 있다고 가정하면, 제1 버퍼(901), 제3 버퍼(903), 및 제4 버퍼(904)에는 0이 아닌 입력 데이터가 저장되고, 제2 버퍼(902)에는 0값을 갖는 데이터가 저장될 수 있다. In FIG. 9A, if there are four buffers 901 to 904 in the memory 900, input data other than zero is included in the first buffer 901, the third buffer 903, and the fourth buffer 904. The data having zero value may be stored in the second buffer 902.
본 개시의 일 실시예에서, 0값을 갖는 데이터는 메모리(900)의 버퍼에 저장하지 않을 수 있다. 도 9a에 도시된 실시예에서, 0값을 갖는 데이터를 메모리(900)에 저장하지 않는다면, 종래 제3 버퍼(903)에 저장되었던 입력 데이터인 x 32와 제4 버퍼(904)에 저장되었던 입력 데이터인 x 33은 각각 제2 버퍼(902) 및 제3 버퍼(903)로 시프트(shift)되어 저장될 수 있다. In one embodiment of the present disclosure, data having a value of zero may not be stored in a buffer of the memory 900. In the embodiment shown in FIG. 9A, if data having a value of zero is not stored in the memory 900, inputs that have been stored in the fourth buffer 904 and x 32 , which are input data previously stored in the third buffer 903. The data x 33 may be shifted and stored in the second buffer 902 and the third buffer 903, respectively.
도 9b를 참조하면, 단계 S910에서, 전자 장치는 입력 특징 맵의 데이터 중 0값(zero)을 갖는 데이터를 식별한다. 일 실시예에서, 프로세서 내의 매퍼는 시스톨릭 배열 연산기에 입력되는 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. Referring to FIG. 9B, in operation S910, the electronic device identifies data having a zero value among data of the input feature map. In one embodiment, the mapper in the processor may identify data having a zero value among the data of the input feature map input to the systolic array operator.
단계 S920에서, 전자 장치는 0값을 갖는 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되도록 0값을 갖는 데이터끼리 그룹핑(grouping)한다. 일 실시예에서, 매퍼는 일정한 레이턴시(latency)를 갖는 순차적인 클럭에 따라 0값을 갖는 입력 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되도록, 입력 특징 맵 내에서 식별된 0값을 갖는 데이터들끼리 그룹핑할 수 있다. In operation S920, the electronic device groups the data having the zero value so that the data having the zero value is repeatedly input to the systolic array operator. In one embodiment, the mapper is configured to compare data with zero values identified in an input feature map such that input data with zero values is repeatedly input to the systolic array operator according to a sequential clock with a constant latency. Can be grouped
단계 S930에서, 전자 장치는 0값을 갖는 데이터의 로(row) 및 컬럼(column) 위치를 메모리에 저장한다. 일 실시예에서, 전자 장치는 입력 특징 맵 상에서 식별된 0값을 갖는 데이터의 로 및 컬럼 위치 정보를 저장하는 메모리를 포함할 수 있다. 일 실시예에서, 메모리는 0값을 갖는 입력 데이터의 로 및 컬럼 위치를 룩 업 테이블(LUT) 형태로 저장할 수 있다. 이때, 메모리는 0값을 갖는 입력 데이터를 버퍼에 저장하지 않을 수 있다. In operation S930, the electronic device stores the row and column positions of the data having the zero value in the memory. In an embodiment, the electronic device may include a memory that stores row and column location information of data having a zero value identified on an input feature map. In one embodiment, the memory may store the row and column positions of the input data having zero values in the form of a look up table (LUT). In this case, the memory may not store input data having a zero value in the buffer.
단계 S940에서, 전자 장치는 저장된 위치 정보를 메모리로부터 판독(read)하고, 판독한 위치 정보를 참조하여 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)한다. In operation S940, the electronic device reads the stored position information from the memory and skips multiplication and addition operations on data having a zero value with reference to the read position information.
도 9a 및 도 9b에 도시된 실시예는, 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 메모리(900)의 버퍼 내에 저장하지 않고, 컨볼루션 연산 시 0값 데이터의 로(row) 및 컬럼(column) 위치 정보를 참조하게 함으로써, 메모리의 저장 공간 확보를 더 많이 확보할 수 있다. 또한, 메모리 액세스를 줄임으로써, 전자 장치 내의 프로세서 또는 칩에서 소모되는 전력량을 감소시킬 수 있다. 9A and 9B do not store data having a zero value among data of an input feature map in a buffer of the memory 900, and use a row and a column of zero value data in a convolution operation. column) By referring to the location information, more storage space can be secured. In addition, by reducing the memory access, it is possible to reduce the amount of power consumed by the processor or chip in the electronic device.
도 10a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼에 저장된 데이터를 도식화한 도면이고, 도 10b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다.FIG. 10A is a diagram illustrating data stored in a buffer of a memory that is a component of an apparatus according to an embodiment of the present disclosure, and FIG. 10B is used to perform a convolution operation using a systolic array according to an embodiment of the present disclosure. It is a flowchart showing how to do it.
도 10a를 참조하면, 메모리(1000)의 총 4개의 버퍼(1001 내지 1004) 중 제1 버퍼(1001) 내지 제3 버퍼(1003)에는 0값을 갖는 데이터가 저장되고, 제4 버퍼(1004)에는 0값을 갖는 데이터인 x 33이 저장될 수 있다. 도 9a에 도시된 실시예와는 달리, 도 10a에 도시된 실시예는 0값을 갖는 데이터도 메모리(1000)의 버퍼에 저장된다. 그러나, 0값 데이터가 메모리(1000)에 저장되더라도 곱셈 및 덧셈 연산을 수행하는 경우 0값 데이터의 위치 정보를 통해 연산이 생략(skip)될 수 있다. 이에 대해서는 도 10b의 흐름도를 참조하여 설명한다.Referring to FIG. 10A, data having a zero value is stored in the first buffer 1001 to the third buffer 1003 among the four buffers 1001 to 1004 of the memory 1000, and the fourth buffer 1004. X 33, which is data having a value of zero, may be stored. Unlike the embodiment illustrated in FIG. 9A, the embodiment illustrated in FIG. 10A also stores data having a zero value in a buffer of the memory 1000. However, even when the zero value data is stored in the memory 1000, the multiplication and addition operations may be skipped through the position information of the zero value data. This will be described with reference to the flowchart of FIG. 10B.
도 10b를 참조하면, 단계 S1010에서, 전자 장치는 입력 특징 맵의 데이터 중 0값(zero)을 갖는 데이터를 식별한다. 일 실시예에서, 프로세서 내의 매퍼는 시스톨릭 배열 연산기에 입력되는 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. Referring to FIG. 10B, in step S1010, the electronic device identifies data having a zero value among data of an input feature map. In one embodiment, the mapper in the processor may identify data having a zero value among the data of the input feature map input to the systolic array operator.
단계 S1020에서, 전자 장치는 0값을 갖는 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되도록 0값을 갖는 데이터끼리 그룹핑(grouping)한다. In operation S1020, the electronic device groups the data having the zero value so that the data having the zero value is repeatedly input to the systolic array operator.
단계 S1030에서, 전자 장치는 0값 데이터가 입력됨에 따라, 시스톨릭 배열 상에서의 0값 데이터의 위치 정보를 획득한다. 일 실시예에서, 전자 장치에 포함되는 구성 요소인 언매퍼(도 8의 820 참조)는 시스톨릭 연산기에 입력되는 입력 특징 맵 데이터 중 0값 데이터가 몇 사이클(cycle) 이후에 연산되는지에 관한 정보를 실시간으로 매퍼(도 8의 811 참조)로부터 수신하고, 수신된 정보를 참조하여 출력 값들을 누적 합산하도록 누산기(도 8의 813 참조)를 제어할 수 있다. 언매퍼는 시스톨릭 연산기에 0값 데이터가 입력되는 경우 시스톨릭 배열 상에서 0값을 갖는 데이터의 위치 정보를 매퍼로부터 실시간으로 수신할 수 있다. In operation S1030, as zero value data is input, the electronic device acquires position information of zero value data on the systolic arrangement. In an embodiment, the unmapper (see 820 of FIG. 8), which is a component included in the electronic device, may provide information on how many cycles zero-value data of the input feature map data input to the systolic calculator is calculated. May be received in real time from the mapper (see 811 of FIG. 8), and the accumulator (see 813 of FIG. 8) may be controlled to accumulate and sum output values with reference to the received information. When zero value data is input to the systolic operator, the unmapper may receive location information of data having zero value on the systolic array from the mapper in real time.
단계 S1040에서, 전자 장치는 0값 데이터의 위치 정보에 기초하여 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하는 누산기(adder-tree)를 제어한다. 일 실시예에서, 전자 장치는 시스톨릭 배열로 매핑된 입력 특징 맵에서 식별된 0값 데이터의 위치 정보를 매퍼(도 8의 811)로부터 실시간으로 획득하고, 획득된 0값 데이터의 위치 정보에 기초하여 시스톨릭 연산기에 의해 곱셈 및 덧셈 연산된 출력 값들을 선택적으로 누적 합산하도록 누산기(도 8의 813 참조)를 제어하는 누산기 제어부(도 8의 822)를 포함할 수 있다. In operation S1040, the electronic device controls an adder-tree that accumulatively sums output values for each region of the input feature map based on the position information of the zero value data. In an embodiment, the electronic device obtains, in real time, the position information of the zero value data identified in the input feature map mapped to the systolic array from the mapper 811 of FIG. 8, and based on the obtained position information of the zero value data. An accumulator controller 822 of FIG. 8 may be configured to control an accumulator (see 813 of FIG. 8) to selectively accumulate and sum output values multiplied and added by the systolic operator.
도 10a 및 도 10b에 도시된 실시예는, 시스톨릭 배열(Systolic Array)을 이용한 컨볼루션 연산에서 0값을 갖는 데이터의 연산을 생략(skip)하는 방법과 관련된 것으로서, 0값 데이터가 스킵된 회수만큼 출력 값이 상위로 시프트(shift)되는 것에 착안한 방법이다. 즉, 0값 데이터가 버퍼(도 10a의 1001 내지 1003 참조)에 저장되어 있더라도 전자 장치 내의 프로세서가 메모리(1000) 내의 0값 데이터가 저장된 버퍼(1001 내지 1003)를 판독(read)하지 않는바, 곱셈 및 덧셈 연산으로 인한 컨볼루션 연산 값이 변경되게 된다. 본 개시의 실시예는, 0값 데이터로 인하여 출력 값이 변경되지 않게 하기 위하여, 시스톨릭 연산기를 통한 곱셈 및 덧셈 연산에서 0값 데이터가 입력됨에 따라 실시간으로 입력된 0값 데이터의 위치 정보를 획득하고, 획득한 0값 데이터의 위치 정보에 기초하여 출력 값을 누적 합산한다. 또한, 메모리(1000)의 버퍼(1001 내지 1003)에 0값 데이터가 저장되더라도 프로세서가 0값 데이터를 액세스하지 않는바, 메모리 액세스로 인한 전력 소모량을 줄일 수 있다. 10A and 10B relate to a method of skipping operation of data having a zero value in a convolution operation using a systolic array, wherein the number of times zero value data is skipped. This method focuses on shifting the output value upward. That is, even if the zero value data is stored in the buffer (see 1001 to 1003 of FIG. 10A), the processor in the electronic device does not read the buffers 1001 to 1003 in which the zero value data is stored in the memory 1000. Convolution operation values due to multiplication and addition operations are changed. According to an embodiment of the present disclosure, in order to prevent the output value from being changed due to the zero value data, the position information of the zero value data input in real time is obtained as the zero value data is input in the multiplication and addition operation through the systolic operator. The output values are cumulatively summed based on the obtained position information of the zero value data. In addition, even though zero value data is stored in the buffers 1001 to 1003 of the memory 1000, the processor does not access the zero value data, thereby reducing power consumption due to memory access.
도 11a는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 연산 회로를 도식화한 도면이고, 도 11b는 입력 특징 맵과 필터의 컨볼루션 연산에 따라 생성된 출력 특징 맵을 도식화한 도면이다.11A is a diagram illustrating an operation circuit for performing a convolution operation using a systolic array according to an embodiment of the present disclosure, and FIG. 11B is an output feature map generated according to a convolution operation of an input feature map and a filter. Is a diagram illustrating.
도 11a를 참조하면, 시스톨릭 연산기(1110)는 다섯 개의 플립-플롭 회로(flip-flop)(1110-1 내지 1110-5), 곱셈 연산기(1120), 두개의 덧셈 연산기(1130-1, 1130-2), 및 두개의 클럭 게이트(clock gate) 회로(1140-1, 1140-2)를 포함할 수 있다. 다만, 이는 예시적인 것이고, 시스톨릭 연산기(1110)에 포함되는 플립-플롭 회로(1110-1 내지 1110-5), 덧셈 연산기(1130-1, 1130-2), 및 클럭 게이트 회로(1140-1, 1140-2)의 개수가 도 11a에 도시된 바로 한정되는 것은 아니다.Referring to FIG. 11A, the systolic operator 1110 includes five flip-flop 1110-1 through 1110-5, a multiplication operator 1120, and two addition operators 1130-1 and 1130. -2) and two clock gate circuits 1140-1 and 1140-2. However, this is exemplary and flip-flop circuits 1110-1 to 1110-5 included in the systolic operator 1110, the addition operators 1130-1 and 1130-2, and the clock gate circuit 1140-1. , 1140-2) is not limited to the number shown in FIG. 11A.
제1 클럭 게이트 회로(1140-1) 및 제2 클럭 게이트 회로(1140-2)에서는 일정한 레이턴시(latency)를 갖는 순차적인 클럭(clock)을 생성할 수 있다. 순차적인 클럭에 따라 제1 플립 플롭 회로(1110-1)에는 필터의 웨이트 값이 입력되고, 제2 플립 플롭 회로(1110-2)에는 입력 특징 맵의 데이터가 입력될 수 있다. 일 실시예에서, 필터의 웨이트 값은 순차적인 클럭에 따라 두번씩 반복되어 제1 플립 플롭 회로(1110-1)에 입력될 수 있다. 또한, 입력 특징 맵의 데이터는 순차적인 클럭에 따라 두번씩 반복되어 제2 플립 플롭 회로(1110-2)에 입력되도록 시스톨릭 배열로 매핑될 수 있다. The first clock gate circuit 1140-1 and the second clock gate circuit 1140-2 may generate sequential clocks having a constant latency. According to the sequential clock, a weight value of a filter may be input to the first flip-flop circuit 1110-1, and data of an input feature map may be input to the second flip-flop circuit 1110-2. In one embodiment, the weight value of the filter may be repeated twice and input to the first flip-flop circuit 1110-1 according to the sequential clock. In addition, the data of the input feature map may be mapped in a systolic arrangement so as to be repeatedly input twice to the second flip-flop circuit 1110-2 according to a sequential clock.
제1 플립 플롭 회로(1110-1)에 입력된 웨이트 값과 제2 플립 플롭 회로(1110-2)에 입력된 데이터는 곱셈 연산기(1120)를 통해 곱해질 수 있다. 순차적인 클럭에 따라 곱셈 연산기(1120)에서 출력된 입력 데이터와 웨이트 값의 곱은 제1 덧셈 연산기(1130-1) 및 제2 덧셈 연산기(1130-2)로 전달된다. 이 때, 제3 플립 플롭 회로(1110-3)는 클럭 게이트 회로(1140-1, 1140-2)에 의해 2진 카운터(Binary Count) 기능을 수행할 수 있다. 즉, 제3 플립 플롭 회로(1110-3)가 하이(high)인 경우 입력 데이터와 웨이트 값의 곱이 제1 덧셈 연산기(1130-1)에 전달되고, 제3 플립 플롭 회로(1110-3)가 로우(low)인 경우 입력 데이터와 웨이트 값의 곱이 제2 덧셈 연산기(1130-2)에 전달될 수 있다. 제4 플립 플롭 회로(1110-4)는 제1 덧셈 연산기(1130-1)에 전달된 입력 데이터와 웨이트 값의 곱을 더한 값을 전달받고, 제5 플립 플롭 회로(1110-5)는 제2 덧셈 연산기(1130-2)에 전달된 입력 데이터와 웨이트 값의 곱을 더한 값을 전달받을 수 있다. 예를 들어, 제4 플립 플롭 회로(1110-4)에서는 제1 클럭에서 S11(x 11*w 11)를 출력하고, 제3 클럭에서 S13(x 12*w 12)를 출력할 수 있다. 또한, 제5 플립 플롭 회로(1110-5)에서는 제2 클럭에서 S12(x 12*w 11)을 출력하고, 제4 클럭에서는 S14(x 13*w 12)를 출력할 수 있다. 전술한 방식으로 순차적인 클럭에 따라 계산된 출력 값을 누적 합산하는 경우 출력 특징 맵의 데이터를 획득할 수 있다. The weight value input to the first flip flop circuit 1110-1 and the data input to the second flip flop circuit 1110-2 may be multiplied by the multiplication operator 1120. The product of the input data and the weight value output from the multiplication operator 1120 according to the sequential clocks is transferred to the first addition operator 1130-1 and the second addition operator 1130-2. In this case, the third flip-flop circuit 1110-3 may perform a binary counter function by the clock gate circuits 1140-1 and 1140-2. That is, when the third flip flop circuit 1110-3 is high, the product of the input data and the weight value is transferred to the first addition operator 1130-1, and the third flip flop circuit 1110-3 is performed. In the case of low, the product of the input data and the weight value may be transferred to the second addition operator 1130-2. The fourth flip flop circuit 1110-4 receives a value obtained by adding the product of the input data and the weight value transferred to the first addition operator 1130-1, and the fifth flip flop circuit 1110-5 receives the second addition. The input data delivered to the calculator 1130-2 and the weight value added together may be received. For example, the fourth flip flop circuit 1110-4 may output S11 (x 11 * w 11 ) at the first clock and S13 (x 12 * w 12 ) at the third clock. In addition, the fifth flip-flop circuit 1110-5 may output S12 (x 12 * w 11 ) at the second clock and S14 (x 13 * w 12 ) at the fourth clock. When accumulating and summing output values calculated according to sequential clocks in the above-described manner, data of an output feature map may be obtained.
도 11a에 도시된 실시예는 종래의 시스톨릭 배열 연산 회로에 비하여 덧셈 연산기 및 플립 플롭 회로의 조합이 하나 더 필요하다. 그러나, 본 개시의 실시예에서 늘어난 덧셈 연산기 및 플립 플롭 회로에 의해 프로세서의 연산량이 두배로 증가하지는 않는데, 이는 제3 플립 플롭 회로(1110-3)가 2진 카운트 기능을 수행하기 때문이다. The embodiment shown in FIG. 11A requires one more combination of an add operator and a flip flop circuit compared to a conventional systolic array operation circuit. However, in the embodiment of the present disclosure, the amount of computation of the processor is not doubled by the increased addition operator and the flip flop circuit, because the third flip flop circuit 1110-3 performs a binary count function.
도 11b를 참조하면, 입력 특징 맵(FMap 1) 상의 제1 영역(P1)에서 입력 특징 맵(100)의 데이터 x 11, x 12, x 13은 필터(110)의 w 11, w 12, w 13과 각각 곱셈 연산되고, 곱한 결과 값이 누적 합산되어 출력 특징 맵(120)의 제1-1 출력 데이터(x 11*w 11+x 12*w 12+x 13*w 13)가 생성된다. 또한, 입력 특징 맵(FMap 1) 상의 제2 영역(P2)에서 입력 특징 맵(100)의 데이터 x 12, x 13, x 14은 필터(110)의 w 11, w 12, w 13과 각각 곱셈 연산되고, 곱한 결과 값이 누적 합산되어 출력 특징 맵(120)의 제1-2 출력 데이터(x 12*w 11+x 13*w 12+x 14*w 13)가 생성된다. 이는 도 11a에 도시된 시스톨릭 연산기(1110)에 의해 출력된 결과값과 동일하다. 즉, 도 11a에서 S 11, S 13, S 15를 누적 합산하면, 도 11b의 제1-1 출력 데이터 x 11*w 11+x 12*w 12+x 13*w 13가 획득된다. 마찬가지로, 도 11a에서 S 12, S 14, S 16를 누적 합산하면, 도 11b의 제1-2 출력 데이터 x 12*w 11+x 13*w 12+x 14*w 13가 획득된다.Referring to FIG. 11B, the data x 11 , x 12 , and x 13 of the input feature map 100 in the first region P1 on the input feature map FMap 1 are w 11 , w 12 , w of the filter 110. The multiplication operation is performed with 13, and the multiplication result is cumulatively summed to generate the 1-1 st output data x 11 * w 11 + x 12 * w 12 + x 13 * w 13 of the output feature map 120. Further, in the second area P2 on the input feature map FMap 1, the data x 12 , x 13 , and x 14 of the input feature map 100 are multiplied by w 11 , w 12 , and w 13 of the filter 110, respectively. The calculated result is multiplied and accumulated to generate the 1-2 output data x 12 * w 11 + x 13 * w 12 + x 14 * w 13 of the output feature map 120. This is the same as the result value output by the systolic operator 1110 shown in FIG. 11A. That is, when S 11 , S 13 , and S 15 are cumulatively summed in FIG. 11A, the 1-1st output data x 11 * w 11 + x 12 * w 12 + x 13 * w 13 of FIG. 11B is obtained. Similarly, when S 12 , S 14 , and S 16 are cumulatively summed in FIG. 11A, the 1-2 output data x 12 * w 11 + x 13 * w 12 + x 14 * w 13 of FIG. 11B is obtained.
전술한 실시예들에 따른 전자 장치는 프로세서, 프로그램 데이터를 저장하고 실행하는 메모리, 디스크 드라이브와 같은 영구 저장부(permanent storage), 외부 장치와 통신하는 통신 포트, 터치 패널, 키(key), 버튼 등과 같은 사용자 인터페이스 장치 등을 포함할 수 있다. 소프트웨어 모듈 또는 알고리즘으로 구현되는 방법들은 상기 프로세서상에서 실행 가능한 컴퓨터가 읽을 수 있는 코드들 또는 프로그램 명령들로서 컴퓨터가 읽을 수 있는 기록 매체 상에 저장될 수 있다. 여기서 컴퓨터가 읽을 수 있는 기록 매체로 마그네틱 저장 매체(예컨대, ROM(read-only memory), RAM(random-access memory), 플로피 디스크, 하드 디스크 등) 및 광학적 판독 매체(예컨대, 시디롬(CD-ROM), 디브이디(DVD: Digital Versatile Disc)) 등이 있다. 컴퓨터가 읽을 수 있는 기록 매체는 네트워크로 연결된 컴퓨터 시스템들에 분산되어, 분산 방식으로 컴퓨터가 판독 가능한 코드가 저장되고 실행될 수 있다. 매체는 컴퓨터에 의해 판독가능하며, 메모리에 저장되고, 프로세서에서 실행될 수 있다. The electronic device according to the embodiments described above includes a processor, a memory for storing and executing program data, a permanent storage such as a disk drive, a communication port for communicating with an external device, a touch panel, a key, a button. And a user interface device such as the like. Methods implemented by software modules or algorithms may be stored on a computer readable recording medium as computer readable codes or program instructions executable on the processor. The computer-readable recording medium may be a magnetic storage medium (eg, read-only memory (ROM), random-access memory (RAM), floppy disk, hard disk, etc.) and an optical reading medium (eg, CD-ROM). ) And DVD (Digital Versatile Disc). The computer readable recording medium can be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion. The medium is readable by the computer, stored in the memory, and can be executed by the processor.
본 개시의 실시예들은 기능적인 블록 구성들 및 다양한 처리 단계들로 나타내어질 수 있다. 이러한 기능 블록들은 특정 기능들을 실행하는 다양한 개수의 하드웨어 또는/및 소프트웨어 구성들로 구현될 수 있다. 예를 들어, 실시예는 하나 이상의 마이크로프로세서들의 제어 또는 다른 제어 장치들에 의해서 다양한 기능들을 실행할 수 있는, 메모리, 프로세싱, 로직(logic), 룩 업 테이블(look-up table) 등과 같은 직접 회로 구성들을 채용할 수 있다. 구성 요소들이 소프트웨어 프로그래밍 또는 소프트웨어 요소들로 실행될 수 있는 것과 유사하게, 본 실시 예는 데이터 구조, 프로세스들, 루틴들 또는 다른 프로그래밍 구성들의 조합으로 구현되는 다양한 알고리즘을 포함하여, C, C++, 자바(Java), 어셈블러(assembler) 등과 같은 프로그래밍 또는 스크립팅 언어로 구현될 수 있다. 기능적인 측면들은 하나 이상의 프로세서들에서 실행되는 알고리즘으로 구현될 수 있다. 또한, 본 실시 예는 전자적인 환경 설정, 신호 처리, 및/또는 데이터 처리 등을 위하여 종래 기술을 채용할 수 있다. "매커니즘", "요소", "수단", "구성"과 같은 용어는 넓게 사용될 수 있으며, 기계적이고 물리적인 구성들로서 한정되는 것은 아니다. 상기 용어는 프로세서 등과 연계하여 소프트웨어의 일련의 처리들(routines)의 의미를 포함할 수 있다.Embodiments of the present disclosure may be represented by functional block configurations and various processing steps. Such functional blocks may be implemented in various numbers of hardware or / and software configurations that perform particular functions. For example, an embodiment may be an integrated circuit configuration such as memory, processing, logic, look-up table, etc., capable of executing various functions by the control of one or more microprocessors or other control devices. You can employ them. Similar to the components that may be implemented as software programming or software elements, the present embodiment includes various algorithms implemented in C, C ++, Java (data structures, processes, routines or other combinations of programming constructs). It may be implemented in a programming or scripting language such as Java), an assembler, or the like. The functional aspects may be implemented with an algorithm running on one or more processors. In addition, the present embodiment may employ the prior art for electronic configuration, signal processing, and / or data processing. Terms such as "mechanism", "element", "means", "configuration" can be used widely and are not limited to mechanical and physical configurations. The term may include the meaning of a series of routines of software in conjunction with a processor or the like.

Claims (15)

  1. 시스톨릭 배열(systolic array)을 이용하여 딥 러닝(deep learning) 연산을 수행하는 방법에 있어서,In the method for performing a deep learning operation using a systolic array,
    순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)하는 단계; The data of the input feature map is systolic by changing the order of the data of the input feature map such that data having the same value is repeated a predetermined number of times according to a sequential clock and inputted to a multiplication adder in the systolic array operator. Mapping to an array;
    매핑된 상기 입력 특징 맵의 데이터 및 필터의 웨이트 값을 상기 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행하는 단계; 및Performing a convolution operation by inputting data of the mapped input feature map and a weight value of a filter to the systolic array operator; And
    상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 단계;Accumulating the convolutionally calculated output values to generate an output feature map;
    를 포함하는, 방법. Including, the method.
  2. 제1 항에 있어서,According to claim 1,
    상기 매핑 단계는, 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경하는, 방법. And the mapping step alters the input order of the input data such that two identical input data values of the input feature map are repeated and input to the systolic array operator.
  3. 제1 항에 있어서,According to claim 1,
    상기 필터는 N by N (NXN) 크기를 갖고, The filter has a size of N by N (NXN),
    상기 매핑 단계는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경하는, 방법. And the mapping step changes the input order of data of the input feature map such that data of the input feature map is repeatedly input to the systolic array operator the same number of times as the size N of the filter.
  4. 제1 항에 있어서,According to claim 1,
    상기 출력 특징 맵을 생성하는 단계는, Generating the output feature map,
    상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하는 단계; 및 Selecting the convolutionally calculated output values in consideration of the stride value of the filter and the data of the input feature map overlapping in the first and second directions due to the stride; And
    선택된 출력값들을 누적 합산하여 상기 입력 특징 맵과 상기 필터의 조합으로 인한 출력 특징 맵을 생성하는 단계;Cumulatively adding the selected output values to generate an output feature map resulting from the combination of the input feature map and the filter;
    를 포함하는, 방법. Including, the method.
  5. 제1 항에 있어서,According to claim 1,
    상기 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별하는 단계; 를 더 포함하는, 방법. Identifying data having a zero value among data of the input feature map; Further comprising, the method.
  6. 제5 항에 있어서,The method of claim 5,
    상기 매핑 단계는, 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)하는, 방법.And the mapping step groups the data having zero values so that data having zero values is repeatedly input to the systolic operator.
  7. 제1 항에 있어서,According to claim 1,
    상기 0값으로 식별된 데이터가 입력되는 경우, 식별된 0값 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 단계; 를 더 포함하고,When the data identified by the zero value is input, obtaining positional information on the systolic arrangement of the identified zero value data; More,
    상기 출력 특징 맵을 생성하는 단계는, 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하는, 방법. The generating of the output feature map may include accumulating and summing output values for each area of the input feature map based on the acquired position information of the zero value data.
  8. 딥 러닝 연산을 수행하는 전자 장치(electronic device)에 있어서, In an electronic device performing a deep learning operation,
    시스톨릭 배열을 이용하여 입력 특징 맵의 데이터와 필터의 웨이트 값의 컨볼루션 연산을 수행하는 프로세서를 포함하고, A processor for performing a convolution operation on data of an input feature map and a weight value of a filter using a systolic array,
    상기 프로세서는, The processor,
    순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑하는 매퍼(mapper); The data of the input feature map is mapped to a systolic array by changing the order of the data of the input feature map such that data having the same value is repeated a predetermined number of times according to a sequential clock and inputted to a multiplication adder. Mapper;
    매핑된 상기 입력 특징 맵 데이터 또는 상기 필터의 웨이트 값에 대하여 컨볼루션 연산을 수행하는 복수의 곱셈 덧셈 연산기를 포함하는 시스톨릭 배열 연산기; 및 A systolic array operator including a plurality of multiplication addition operators for performing a convolution operation on the mapped input feature map data or the weight value of the filter; And
    상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 누산기(adder);An adder for accumulating the convolutionally calculated output values to generate an output feature map;
    를 포함하는, 전자 장치. Including, the electronic device.
  9. 제8 항에 있어서,The method of claim 8,
    상기 매퍼는, 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경하는, 전자 장치. And the mapper changes the order of input of the input data such that two identical input data values of the input feature map are repeated and input to the systolic array operator.
  10. 제8 항에 있어서,The method of claim 8,
    상기 필터는 N by N (NXN) 크기를 갖고, The filter has a size of N by N (NXN),
    상기 매퍼는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기 내의 상기 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경하는, 전자 장치. The mapper alters an input order of data of the input feature map such that data of the input feature map is repeatedly input to the multiplication addition operator in the systolic array operator by the same number of times as the size N of the filter; Device.
  11. 제8 항에 있어서,The method of claim 8,
    상기 누산기는, 상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하고, 상기 선택된 출력값들을 누적 합산하여 상기 입력 특징 맵의 각 영역에 대한 출력 특징 맵을 생성하는, 전자 장치. The accumulator selects the convolutionally calculated output values in consideration of a stride value of the filter and data of the input feature map overlapping in a first direction and a second direction due to the stride, and selects the selected output values. And accumulatively add to generate an output feature map for each region of the input feature map.
  12. 제8 항에 있어서,The method of claim 8,
    상기 매퍼는, 상기 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별하는, 전자 장치. The mapper identifies data having a zero value among data of the input feature map.
  13. 제12 항에 있어서,The method of claim 12,
    상기 매퍼는, 상기 식별된 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)하는, 전자 장치.And the mapper groups the data having the zero value so that the data having the identified zero value is repeatedly input to the systolic operator.
  14. 제8 항에 있어서,The method of claim 8,
    상기 매퍼에 의해 시스톨릭 배열로 매핑된 상기 입력 특징 맵의 데이터 중 0값으로 식별된 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 언매퍼(unmapper); 를 더 포함하고, An unmapper for acquiring positional information on the systolic arrangement of data identified by a zero value among data of the input feature map mapped by the mapper to a systolic arrangement; More,
    상기 언매퍼는 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하도록 상기 누산기를 제어하는 애더 트리 제어 회로(adder-tree control circuit)를 포함하는, 전자 장치. The unmapper includes an adder-tree control circuit for controlling the accumulator to cumulatively sum output values for each region of the input feature map based on the acquired position information of the zero-value data; Electronic devices.
  15. 제1 항의 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체. A computer-readable recording medium having recorded thereon a program for executing the method of claim 1 on a computer.
PCT/KR2019/002029 2018-02-20 2019-02-20 Method and device for performing deep learning calculation by using systolic array WO2019164237A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2018-0020015 2018-02-20
KR1020180020015A KR102487535B1 (en) 2018-02-20 2018-02-20 Method and apparatus for operating deep learning by using the systolic array

Publications (1)

Publication Number Publication Date
WO2019164237A1 true WO2019164237A1 (en) 2019-08-29

Family

ID=67687842

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2019/002029 WO2019164237A1 (en) 2018-02-20 2019-02-20 Method and device for performing deep learning calculation by using systolic array

Country Status (2)

Country Link
KR (1) KR102487535B1 (en)
WO (1) WO2019164237A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826710A (en) * 2019-10-18 2020-02-21 南京大学 Hardware acceleration implementation system and method of RNN forward propagation model based on transverse pulse array
CN111008697A (en) * 2019-11-06 2020-04-14 北京中科胜芯科技有限公司 Convolutional neural network accelerator implementation architecture
CN112784973A (en) * 2019-11-04 2021-05-11 北京希姆计算科技有限公司 Convolution operation circuit, device and method

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102272518B1 (en) * 2020-03-13 2021-07-05 인천대학교 산학협력단 Systolic Arrays Apparatus
KR20220015680A (en) 2020-07-31 2022-02-08 삼성전자주식회사 Method and apparatus for performing deep learning operations
KR20220028899A (en) 2020-08-31 2022-03-08 삼성전자주식회사 Accelerator, method for operating the same, and electronic device including the same
KR102594484B1 (en) * 2021-01-12 2023-10-27 성균관대학교산학협력단 Method and device for operating depthwise convolution by using the systolic array
KR102561205B1 (en) * 2021-04-16 2023-07-28 포항공과대학교 산학협력단 Mobilenet hardware accelator with distributed sram architecture and channel stationary data flow desigh method thereof
KR102582419B1 (en) * 2021-08-04 2023-09-26 한국과학기술원 Method for performing convolutional neural network operation by using in-memory computing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050076847A (en) * 2004-01-24 2005-07-28 학교법인 포항공과대학교 Device for blind source separation and hardware apparatus having plurality of the same coupled in parallel configuration
KR20110098817A (en) * 2009-01-27 2011-09-01 자일링크스 인코포레이티드 Digital signal processing block with preadder stage
KR20160069834A (en) * 2014-12-09 2016-06-17 삼성전자주식회사 Apparatus and method for training convolutional neural network for approximation of convolutional neural network
KR20170133364A (en) * 2015-05-21 2017-12-05 구글 엘엘씨 Batch processing in a neural network processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050076847A (en) * 2004-01-24 2005-07-28 학교법인 포항공과대학교 Device for blind source separation and hardware apparatus having plurality of the same coupled in parallel configuration
KR20110098817A (en) * 2009-01-27 2011-09-01 자일링크스 인코포레이티드 Digital signal processing block with preadder stage
KR20160069834A (en) * 2014-12-09 2016-06-17 삼성전자주식회사 Apparatus and method for training convolutional neural network for approximation of convolutional neural network
KR20170133364A (en) * 2015-05-21 2017-12-05 구글 엘엘씨 Batch processing in a neural network processor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
XUECHAO WEI ET AL.: "Automated Systolic Array Architecture Synthesis for High Throughput CNN Inference on FPGAs", 2017 54TH ACM/EDAC/ IEEE DESIGN AUTOMATION CONFERENCE (DAC, 18 June 2017 (2017-06-18) - 22 June 2017 (2017-06-22), pages 1 - 6, XP058367794 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826710A (en) * 2019-10-18 2020-02-21 南京大学 Hardware acceleration implementation system and method of RNN forward propagation model based on transverse pulse array
CN112784973A (en) * 2019-11-04 2021-05-11 北京希姆计算科技有限公司 Convolution operation circuit, device and method
CN111008697A (en) * 2019-11-06 2020-04-14 北京中科胜芯科技有限公司 Convolutional neural network accelerator implementation architecture

Also Published As

Publication number Publication date
KR20190099931A (en) 2019-08-28
KR102487535B1 (en) 2023-01-12

Similar Documents

Publication Publication Date Title
WO2019164237A1 (en) Method and device for performing deep learning calculation by using systolic array
CN107832843B (en) Information processing method and related product
WO2019098538A1 (en) Device and method for processing convolution operation using kernel
WO2019098414A1 (en) Method and device for hierarchical learning of neural network, based on weakly supervised learning
WO2021054706A1 (en) Teaching gan (generative adversarial networks) to generate per-pixel annotation
WO2018217019A1 (en) Device for detecting variant malicious code on basis of neural network learning, method therefor, and computer-readable recording medium in which program for executing same method is recorded
WO2018230832A1 (en) Image processing apparatus and method using multi-channel feature map
WO2019164251A1 (en) Method of performing learning of deep neural network and apparatus thereof
WO2019172546A1 (en) Electronic apparatus and control method thereof
WO2019164250A1 (en) Method and device for controlling data input and output of fully connected network
WO2020116768A1 (en) Image processing device and method for operating same
EP3942481A1 (en) Method of performing, by electronic device, convolution operation at certain layer in neural network, and electronic device therefor
WO2019155910A1 (en) Neural electronic circuit
WO2020222378A1 (en) Convolution streaming engine for deep neural networks
WO2020055181A1 (en) Image processing apparatus and operation method thereof
WO2018212584A2 (en) Method and apparatus for classifying class, to which sentence belongs, using deep neural network
EP3871158A1 (en) Image processing apparatus and operating method of the same
WO2020141720A1 (en) Apparatus and method for managing application program
WO2019198900A1 (en) Electronic apparatus and control method thereof
WO2023210914A1 (en) Method for knowledge distillation and model generation
WO2023096011A1 (en) Device and method for zero-shot semantic segmentation
CN116049691A (en) Model conversion method, device, electronic equipment and storage medium
WO2021020848A2 (en) Matrix operator and matrix operation method for artificial neural network
WO2022108008A1 (en) Electronic apparatus and controlling method thereof
WO2022004970A1 (en) Neural network-based key point training apparatus and method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19757992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19757992

Country of ref document: EP

Kind code of ref document: A1