WO2022080758A1 - 전자 장치 및 전자 장치의 제어 방법 - Google Patents

전자 장치 및 전자 장치의 제어 방법 Download PDF

Info

Publication number
WO2022080758A1
WO2022080758A1 PCT/KR2021/013802 KR2021013802W WO2022080758A1 WO 2022080758 A1 WO2022080758 A1 WO 2022080758A1 KR 2021013802 W KR2021013802 W KR 2021013802W WO 2022080758 A1 WO2022080758 A1 WO 2022080758A1
Authority
WO
WIPO (PCT)
Prior art keywords
input
kernel
values
electronic device
multiplication
Prior art date
Application number
PCT/KR2021/013802
Other languages
English (en)
French (fr)
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
Priority claimed from KR1020210005465A external-priority patent/KR20220050013A/ko
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to CN202180070522.7A priority Critical patent/CN116368496A/zh
Priority to EP21880405.2A priority patent/EP4191477A4/en
Publication of WO2022080758A1 publication Critical patent/WO2022080758A1/ko
Priority to US18/120,241 priority patent/US20230214445A1/en

Links

Images

Classifications

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

Definitions

  • the present disclosure relates to an electronic device and a method for controlling the electronic device, and more particularly, to an electronic device capable of efficiently performing a convolution operation and a method for controlling the electronic device.
  • the present disclosure is to overcome the above-described problems, and an object of the present disclosure is to provide an electronic device capable of efficiently performing a convolution operation by utilizing a parallel hardware structure of a neural network accelerator and a control method of the electronic device. there is.
  • the electronic device includes three-dimensional input data including input values classified according to a plurality of channels, and a kernel ( kernel) and a plurality of multiplication modules corresponding to the plurality of channels and a memory for storing converted second kernel information such that the weights for each of the plurality of channels are arranged in the direction of the plurality of channels, , a processor for performing a convolution operation based on the input values and the weights through the plurality of multiplication modules, wherein the processor is configured to: When the convolution operation is a depthwise convolution operation, control an input selection module such that a plurality of input values corresponding to a first channel among the plurality of channels are input to all two or more multiplication modules among the plurality of multiplication modules, and based on the second kernel information, the first channel A plurality of weights corresponding to are input to the two or more multiplication modules one by one, and a multiplication operation is performed with each of the plurality of weights for each of the plurality
  • each of the plurality of input values corresponding to the first channel is input to the input selection module at every preset cycle, and the input selection module converts each of the input values input for each preset cycle to both of the two or more multiplication modules. can be sent to
  • the two or more channels include the first channel and at least one channel adjacent to the first channel, and the number of the two or more multiplication modules corresponds to the number of weights included in the first kernel.
  • the kernel is a two-dimensional kernel
  • the processor further includes a buffer for storing intermediate values corresponding to the kernel row among the plurality of intermediate values, and is stored in the buffer through the first intermediate value accumulation module.
  • the plurality of output values may be obtained by summing intermediate values corresponding to the respective positions of the kernel among the stored intermediate values.
  • the processor may obtain the plurality of output values by performing the convolution operation using two or more multiplication modules corresponding to the number of the plurality of weights included in the kernel in parallel.
  • the processor controls the input selection module to bypass the input values input to the input selection module to the plurality of multiplication modules, and based on the first kernel information, A plurality of corresponding weights may be input to the plurality of multiplication modules.
  • the processor may further include a second intermediate value accumulation module for summing intermediate values for a plurality of channels respectively obtained through the plurality of multiplication modules.
  • the electronic device divides the plurality of channels according to the plurality of multiplication modules corresponding to the plurality of channels.
  • the three-dimensional input data including input values that become A convolution operation is performed based on second kernel information, and the control method of the electronic device corresponds to a first channel among the plurality of channels when the convolution operation is a depthwise convolution operation.
  • an input selection module to input a plurality of input values to all of two or more multiplication modules among the plurality of multiplication modules; inputting one by one into one or more multiplication modules, performing a multiplication operation with each of the plurality of weights for each of the plurality of input values through the two or more multiplication modules to obtain a plurality of intermediate values according to each of the results of the multiplication operation and summing the intermediate values corresponding to each of the positions of the kernel among the plurality of intermediate values through a first intermediate value accumulation module to obtain a plurality of output values according to the summing results, respectively.
  • each of the plurality of input values corresponding to the first channel is input to the input selection module at every preset cycle, and the input selection module converts each of the input values input for each preset cycle to both of the two or more multiplication modules. can be sent to
  • the two or more channels include the first channel and at least one channel adjacent to the first channel, and the number of the two or more multiplication modules corresponds to the number of weights included in the first kernel.
  • the kernel is a two-dimensional kernel
  • the electronic device further includes a buffer for storing intermediate values corresponding to a row of the kernel among the plurality of intermediate values.
  • the method may further include acquiring the plurality of output values by summing intermediate values corresponding to respective positions of the kernel among the intermediate values stored in the buffer through an intermediate value accumulation module.
  • the method of controlling the electronic device includes: obtaining the plurality of output values by performing the convolution operation using two or more multiplication modules corresponding to the number of the plurality of weights included in the kernel in parallel may further include.
  • the input selection module controls the input selection module to bypass input values input to the input selection module to the plurality of multiplication modules
  • the method may further include inputting a plurality of weights corresponding to each of the plurality of multiplication modules to the plurality of multiplication modules based on the step and the first kernel information.
  • the electronic device may further include a second intermediate value accumulation module for summing intermediate values for a plurality of channels respectively obtained through the plurality of multiplication modules.
  • the electronic device is configured to correspond to a plurality of channels.
  • a plurality of multiplication modules three-dimensional input data including input values classified according to the plurality of channels, first kernel information for a kernel including weights for each of the plurality of channels, and the plurality of channels
  • a convolution operation is performed based on the converted second kernel information so that the star weights are arranged in the direction of the plurality of channels
  • the control method of the electronic device is configured such that the convolution operation is a depthwise convolution
  • controlling the input selection module so that a plurality of input values corresponding to a first channel among the plurality of channels are input to all two or more multiplication modules among the plurality of multiplication modules, based on the second kernel information inputting a plurality of weights corresponding to the first channel one by one into the two or more multiplication modules, performing
  • FIG. 1 is a block diagram illustrating a configuration of an electronic device according to an embodiment of the present disclosure
  • FIG. 2 is a block diagram illustrating a plurality of modules and input/output data for a plurality of modules according to an embodiment of the present disclosure
  • 3 to 4B are diagrams illustrating a part of a depth-wise convolution operation process according to an embodiment of the present disclosure
  • FIG. 5 is a block diagram illustrating a plurality of modules for performing a two-dimensional convolution operation according to the present disclosure
  • 6 to 8 are views illustrating a part of a two-dimensional convolution operation process according to various embodiments of the present disclosure
  • FIG. 9 is a block diagram illustrating a plurality of modules for performing a 3D convolution operation according to the present disclosure
  • FIGS. 10 and 11 are diagrams illustrating a part of a 3D convolution operation process according to various embodiments of the present disclosure
  • FIG. 12 is a flowchart illustrating a method of controlling an electronic device according to an embodiment of the present disclosure.
  • expressions such as “have,” “may have,” “include,” or “may include” indicate the presence of a corresponding characteristic (eg, a numerical value, function, operation, or component such as a part). and does not exclude the presence of additional features.
  • expressions such as “A or B,” “at least one of A and/and B,” or “one or more of A or/and B” may include all possible combinations of the items listed together.
  • “A or B,” “at least one of A and B,” or “at least one of A or B” means (1) includes at least one A, (2) includes at least one B; Or (3) it may refer to all cases including both at least one A and at least one B.
  • a component eg, a first component
  • another component eg, a second component
  • the certain element may be directly connected to the other element or may be connected through another element (eg, a third element).
  • a component eg, a first component
  • another component eg, a second component
  • the expression “a device configured to” may mean that the device is “capable of” with other devices or parts.
  • a processor configured (or configured to perform) A, B, and C refers to a dedicated processor (eg, an embedded processor) for performing the corresponding operations, or by executing one or more software programs stored in a memory device.
  • a generic-purpose processor eg, a CPU or an application processor
  • a 'module' or 'unit' performs at least one function or operation, and may be implemented as hardware or software, or a combination of hardware and software.
  • a plurality of 'modules' or a plurality of 'units' may be integrated into at least one module and implemented with at least one processor, except for 'modules' or 'units' that need to be implemented with specific hardware.
  • FIG. 1 is a block diagram illustrating a configuration of an electronic device according to an embodiment of the present disclosure
  • FIG. 2 is a block diagram illustrating a plurality of modules and input/output data for the plurality of modules according to an embodiment of the present disclosure
  • 3 to 4B are diagrams illustrating a part of a depth-wise convolution operation process according to an embodiment of the present disclosure.
  • the 'electronic device 100' refers to a device configured to perform a convolution operation. Specifically, the electronic device 100 may obtain output data by performing a convolution operation based on input values included in the input data and weights for each kernel. There is no particular limitation on the specific type of the electronic device 100 according to the present disclosure.
  • the 'input data' may be three-dimensional data including input values classified according to a plurality of channels.
  • the input data may be a three-dimensional matrix including a plurality of input values classified according to rows, columns, and depths, and may be divided into a plurality of channels corresponding to respective depths.
  • the term 'input data' may be replaced with a term such as 'input feature map', and the term 'input value' may be replaced with a term such as 'input activation value' can be
  • the 'kernel' may be a matrix including a plurality of weights for performing a multiplication operation with input values.
  • the kernel may be constructed in the form of a one-dimensional, two-dimensional, or three-dimensional matrix according to the type of convolution operation to be performed.
  • the size of the kernel may be determined according to the horizontal length (ie, the number of columns), the vertical length (ie, the number of rows), and the depth (ie, the depth) of the kernel, and a plurality of weights included in the kernel corresponds to the depth of the kernel. It may be classified according to a plurality of channels to be used. Meanwhile, the term 'kernel' may be replaced with terms such as 'filter' or 'mask'.
  • the 'convolution operation' refers to an operation in which input values included in input data are multiplied by weights included in the kernel, and then each multiplication result is summed.
  • the convolution operation may include a 3-dimensional (3D) convolution operation and a depthwise convolution operation.
  • the 3D convolution operation refers to a convolution operation that obtains three-dimensional output data using three-dimensional input data and a three-dimensional kernel
  • the depth-wise convolution operation refers to three-dimensional input data and one-dimensional or two-dimensional input data. It refers to a convolution operation that obtains three-dimensional output data using a three-dimensional kernel.
  • the convolution operation may be performed through a neural network model such as a convolutional neural network (CNN), but there is no particular limitation on the kind of neural network model to which the present disclosure can be applied.
  • CNN convolutional neural network
  • the 'output data' may be a three-dimensional matrix including a plurality of output values classified according to rows, columns, and depths, and may be divided into a plurality of channels corresponding to respective depths.
  • the row, column, and depth of the output data do not correspond to the row, column, and depth of the input data.
  • the term 'output data' may be replaced with a term such as 'output feature map', and the term 'output value' may be replaced with a term such as 'output activation value' can be
  • the electronic device 100 may include a memory 110 and a processor 120 .
  • the configurations shown in FIG. 1 are merely exemplary, and it goes without saying that a new configuration may be added or some configurations may be omitted in addition to the configuration shown in FIG. 1 .
  • At least one instruction related to the electronic device 100 may be stored in the memory 110 .
  • an operating system (O/S) for driving the electronic device 100 may be stored in the memory 110 .
  • various software programs or applications for operating the electronic device 100 according to various embodiments of the present disclosure may be stored in the memory 110 .
  • the memory 110 may include a semiconductor memory such as a flash memory or a magnetic storage medium such as a hard disk.
  • various software modules for operating the electronic device 100 may be stored in the memory 110 according to various embodiments of the present disclosure, and the processor 120 executes various software modules stored in the memory 110 .
  • the operation of the electronic device 100 may be controlled. That is, the memory 110 is accessed by the processor 120 , and reading/writing/modification/deletion/update of data by the processor 120 may be performed.
  • the memory 110 may include a non-volatile memory 110 capable of maintaining stored information even when power supply is interrupted, and a volatile memory 110 requiring continuous power supply to maintain the stored information.
  • the nonvolatile memory 110 may include at least one of one time programmable ROM (OTPROM), programmable ROM (PROM), erasable and programmable ROM (EPROM), electrically erasable and programmable ROM (EEPROM), mask ROM, and flash ROM.
  • OTPROM time programmable ROM
  • PROM programmable ROM
  • EPROM erasable and programmable ROM
  • EEPROM electrically erasable and programmable ROM
  • mask ROM mask ROM
  • flash ROM flash ROM
  • the volatile memory 110 may be implemented as at least one of dynamic RAM (DRAM), static RAM (SRAM), or synchronous dynamic RAM (SDRAM).
  • DRAM dynamic RAM
  • SRAM static RAM
  • SDRAM synchronous dynamic RAM
  • the term memory 110 refers to the memory 110 , a ROM (not shown) in the processor 120 , a RAM (not shown), or a memory card (not shown) mounted in the electronic device 100 (eg, For example, it may be used in the meaning of including a micro SD card, a memory stick).
  • the memory 110 may store input data, output data, weight information, and the like, according to the present disclosure. 2 shows that information on weights can be simply stored. Specifically, information on weights may be stored in the memory 110 in the form of first kernel information and second kernel information.
  • 'first kernel information' refers to information about a kernel including a weight for each of a plurality of channels.
  • the first kernel information may be information about a kernel including a weight of a 3*3 (horizontal*vertical) matrix for each of a plurality of channels.
  • the 'second kernel information' refers to information about a kernel in which weights for a plurality of channels of the first kernel information are converted to be arranged in a direction of the plurality of channels.
  • the second kernel information is a kernel generated by converting weights configured in the form of a 3*1 (horizontal*vertical) matrix for a plurality of channels into a multi-channel form of 1*1*3 (horizontal*vertical*depth). may be information about
  • the first kernel information is a term to refer to information about a kernel in a conventional form used for convolution operation, that is, information about a kernel composed of a matrix for each channel
  • the second kernel information is used in the present disclosure. Accordingly, in order to perform depth-wise convolution operation in parallel among convolution operations, it is a term to refer to information about a kernel generated by converting information about a kernel composed of a plurality of channel-specific matrices into a multi-channel type kernel. .
  • various information necessary within the scope for achieving the object of the present disclosure may be stored in the memory 110, and the information stored in the memory 110 may be updated as received from an external device or input by a user. .
  • the processor 120 controls the overall operation of the electronic device 100 .
  • the processor 120 is connected to the configuration of the electronic device 100 including the memory 110 as described above, and by executing at least one instruction stored in the memory 110 as described above, the electronic device The operation of (100) can be controlled as a whole.
  • the processor 120 may be implemented in various ways.
  • the processor 120 may include an application specific integrated circuit (ASIC), an embedded processor, a microprocessor, hardware control logic, a hardware finite state machine (FSM), and a digital signal processor (Digital Signal). Processor, DSP).
  • ASIC application specific integrated circuit
  • FSM hardware finite state machine
  • DSP digital signal processor
  • the term processor 120 may be used to include a central processing unit (CPU), a graphic processing unit (GPU), a main processing unit (MPU), and the like.
  • the processor 120 may load data necessary for performing various operations from the non-volatile memory 110 to the volatile memory 110 .
  • Loading refers to an operation of loading and storing data stored in the non-volatile memory 110 into the volatile memory 110 so that the processor 120 can access it.
  • the volatile memory 110 may be implemented in a form included in the processor 120 as a component of the processor 120 , but this is only an example, and is implemented as a component separate from the processor 120 . can be
  • the processor 120 may include a neural network accelerator for efficiently controlling the computation process of the convolutional neural network model, and a central processing unit (CPU) for controlling operations of various configurations including the neural network accelerator.
  • the neural network accelerator may include a plurality of Micro Processor Units (MPUs), etc., and the plurality of MPUs may include a plurality of modules for implementing various embodiments according to the present disclosure.
  • MPUs Micro Processor Units
  • the plurality of modules includes an input selection module 121 , a plurality of multiplication modules 122 , and an intermediate value accumulation module 123 , etc. may include
  • the plurality of modules according to the present disclosure may be implemented as a hardware module included in the processor 120, and may also be implemented as a software module according to an embodiment.
  • the 'input selection module 121' refers to a module that transmits input values to the plurality of multiplication modules 122 in different ways according to the type of convolution operation. Specifically, when an input value included in input data is received, the input selection module 121 may transmit the input values to the plurality of multiplication modules 122 based on the type of the convolution operation.
  • the input selection module 121 may be implemented as a hardware module included in the processor 120 as well as a software module. However, hereinafter, for convenience of description, it is assumed that the input selection module 121 is implemented as a hardware module included in the processor 120 .
  • the 'multiplication module 122' refers to a module that performs a multiplication operation between an input value and a weight. Specifically, when an input value is received from the input selection module 121 and a weight is received by the processor 120 , the plurality of multiplication modules 122 multiplies the received input value and the weight, and the intermediate value that is the result of the multiplication The value may be transmitted to the intermediate value accumulation module 123 .
  • the 'intermediate value accumulation module 123' refers to a module that acquires an output value by summing intermediate values obtained in a convolution operation process. Specifically, when a plurality of intermediate values are received from the plurality of multiplication modules 122 , the intermediate value accumulation module 123 may obtain and output output values based on the plurality of intermediate values. Meanwhile, the intermediate value accumulation module 123 includes a first intermediate value accumulation module 123-1 used in the depthwise convolution process and a second intermediate value accumulation module 123-2 used in the 3D convolution process. can do.
  • the intermediate value accumulation module 123 may include at least one register and at least one buffer. Among them, an embodiment related to the buffer will be described in detail with reference to FIGS. 5 to 8 .
  • the processor 120 identifies the type of convolution operation to be performed, and controls the plurality of modules in different ways depending on whether the convolution operation to be performed is a 3D convolution operation or a depth-wise convolution operation. .
  • the processor 120 may use first kernel information when performing a 3D convolution operation, and may use second kernel information when performing a depth-wise convolution operation.
  • FIGS. 3 to 4B an embodiment related to a depth-wise convolution operation will be described with reference to FIGS. 3 to 4B .
  • FIG. 3 is a diagram illustrating a process of obtaining an output value based on an input value and a weight at time points T 0 to T 4 when a one-dimensional convolution operation is performed among depth-wise convolution operations
  • FIGS. 4A and FIG. 4B is a diagram illustrating an operation of a circuit including a plurality of modules according to the present disclosure when the same operation as in FIG. 3 is performed.
  • FIGS. 3 to 4B a case in which a plurality of weights corresponding to the first channel is three will be described as an example.
  • the processor 120 may input input values having the same row and column and different depths among the input values included in the input data to the plurality of MPUs for each preset cycle.
  • a process of adding up intermediate values of input values of different channels is not required to obtain one output value. Therefore, in describing an embodiment of the depthwise convolution operation, the operation process for input values corresponding to the first channel among the plurality of channels will be mainly described for convenience of description.
  • the processor 120 inputs a plurality of input values corresponding to the first channel among the plurality of channels to all of the two or more multiplication modules 122 among the plurality of multiplication modules 122 .
  • the input selection module 121 may be controlled so as to be possible.
  • the number of two or more multiplication modules 122 may correspond to the number of weights included in the kernel.
  • the term 'two or more multiplication modules 122' means to specify the multiplication modules 122 used in the depth-wise convolution operation according to the present disclosure among the plurality of multiplication modules 122. is used as
  • the processor 120 performs the first Whenever each of the plurality of inputs corresponding to the channel is input to the input selection module 121, the input selection module 121 so that the input value is input to all of the multiplication modules 122 as many as the number of the plurality of weights included in the kernel. ) can be controlled.
  • the processor 120 controls the F It is possible to control the input selection module 121 so that 2 is input not only to the multiplication module 122 corresponding to the first channel but also to the multiplication module 122 corresponding to each of the second and third channels adjacent to the first channel. there is.
  • the processor 120 may input a plurality of weights corresponding to the first channel to two or more multiplication modules 122 one by one based on the second kernel information.
  • the processor 120 in contrast to inputting a plurality of weights corresponding to the first channel only to the multiplication module 122 corresponding to the first channel in the depth-wise convolution operation according to the prior art, provides multiple A plurality of weights corresponding to the first channel may be input to two or more multiplication modules 122 one by one based on the second kernel information converted into the channel-type kernel.
  • the processor 120 assigns each of a plurality of weights W 0 , W 1 and W 2 corresponding to the first channel to the first channel and the second channel.
  • One input may be provided to each of the three multiplication modules 122 corresponding to the second channel and the third channel, respectively. That is, the processor 120 inputs the weight W 0 to the multiplication module 122 corresponding to the first channel, inputs the weight W 1 to the multiplication module 122 corresponding to the second channel, and outputs the weight W 2 . It can be input to the multiplication module 122 corresponding to 3 channels.
  • a plurality of weights W 0 , W 1 , and W 2 may be constructed in a multi-channel form of 1*1*3 (width*length*depth) and stored in the memory 110 as second kernel information.
  • the processor 120 when a plurality of input values and a plurality of weights are input to the plurality of multiplication modules 122 , the processor 120 performs a relationship with each of the plurality of weights for each of the plurality of input values through the plurality of multiplication modules 122 .
  • a plurality of intermediate values may be obtained according to each result of the multiplication operation.
  • the input value F 2 is input to all three multiplication modules 122 corresponding to each of the first channel, the second channel, and the third channel. and one weight W 0 , W 1 , and W 2 are input to each of the three multiplication modules 122 , the multiplication module 122 corresponding to the first channel performs a multiplication operation between F 2 and W 0 to F 2 Obtaining an intermediate value of *W 0 , the multiplication module 122 corresponding to the second channel performs a multiplication operation with F 2 and W 1 to obtain an intermediate value of F 2 *W 1 , corresponding to the third channel The multiplication module 122 may obtain an intermediate value of F 2 *W 2 by performing a multiplication operation between F 2 and W 2 .
  • the three multiplication modules 122 corresponding to each of the first channel, the second channel, and the third channel are T following the time T 2 .
  • 3 to F 3 *W 0 , F 3 *W 1 , and F 3 *W 2 can obtain a plurality of intermediate values according to the respective operation results, and from T 4 to F 4 *W 0 , F following time T 3 .
  • a plurality of intermediate values may be obtained according to respective calculation results of 4 *W 1 and F 4 *W 2 .
  • the processor 120 adds up the intermediate values corresponding to each of the positions of the kernel among the plurality of intermediate values through the intermediate value accumulation module 123, and according to each of the summation results, A plurality of output values may be obtained. Specifically, the processor 120 may obtain a plurality of output values according to the summing results of the intermediate values by using the first intermediate value accumulation module 123 - 1 among the intermediate value accumulation module 123 .
  • 'intermediate values corresponding to each position of the kernel' means a plurality of weights included in the kernel and a plurality of input values corresponding thereto while sequentially moving the kernel according to a preset interval (ie, stride) on the matrix of input data.
  • a preset interval ie, stride
  • the processor 120 F 2 *W 0 , F 3 *W 1 and F 4 which are intermediate values when the kernel location corresponds to the input values F 2 , F 3 and F 4 through the first intermediate value accumulation module 123-1.
  • an output value O 2 may be obtained.
  • the intermediate value F 2 *W 0 obtained at time T 2 the intermediate value F 3 *W 1 obtained at time T 3 , and the intermediate value F 4 *W 2 obtained at time T 4 are Although the case of obtaining the output values O 2 by summing has been described, the output values O 0 and O 1 may also be obtained in the same manner.
  • the output value O 0 can be obtained by summing the intermediate values F 0 *W 0 , F 1 *W 1 and F 2 *W 2 at time T 3 , and the intermediate values F 1 *W 0 , F 2 *W 1 at time T 3 . and F 3 *W 2 may be summed to obtain an output value O 1 .
  • the intermediate values obtained through the plurality of multiplication modules 122 may be temporarily stored in a register included in the intermediate value accumulation module 123 , and the intermediate values stored in the register may be used to obtain a final output value.
  • can 4A and 4B respectively show registers in which intermediate values obtained through the multiplication module 122 corresponding to the first channel and the multiplication module 122 corresponding to the second channel are stored, and C in FIG. 4A is An output value according to the result of summing the intermediate value stored in the register A and the intermediate value stored in the register B with the intermediate value obtained through the multiplication module 122 corresponding to the third channel is shown.
  • registers included in the accumulation module such as A and B, may be referred to as so-called Partial Sum Registers (PSR), and the first intermediate value accumulation module 123- Among the components included in 1), the component shown with a “+” sign is a summer included in the intermediate value module and may be referred to as a so-called Partial Sum Adder (PSA).
  • PSR Partial Sum Registers
  • PSA Partial Sum Adder
  • the processor 120 may obtain not only the intermediate values F 0 *W 0 at time T 0 , but also the intermediate values F 0 *W 1 and F 0 *W 2 at time T 1 , the intermediate values F 1 *W 0 at time T 1 . and F 1 *W 1 as well as intermediate values F 1 *W 2 may be obtained, but the intermediate values F 0 *W 1 , F 0 *W 2 and F 1 *W 2 are intermediate values corresponding to the location of the kernel. There is no need to acquire it because it does not apply.
  • the calculation process for input values corresponding to the first channel among the plurality of channels has been mainly described, but channels other than the first channel among the plurality of channels have been described above.
  • the calculation process according to the same embodiment may be applied similarly, and accordingly, the electronic device 100 may obtain output data including output values for all input data.
  • the processor 120 converts the weights of a plurality of channels of the first kernel information in the direction of the plurality of channels and inputs them to the plurality of multiplication modules 122 , , a depthwise convolution operation may be performed accordingly.
  • the electronic device 100 can efficiently perform a convolution operation by utilizing the parallel hardware structure of the neural network accelerator.
  • the electronic device 100 when performing the depth-wise convolution operation, arranges the kernels arranged in the horizontal direction in the channel direction in the 3D convolution operation to simultaneously use one input value through the plurality of multiplication modules 122 .
  • the electronic device 100 By multiplying by each of the plurality of weight values, it is possible to obtain an output value for every cycle from time T 2 corresponding to the third cycle. Accordingly, it is possible to achieve a three-fold improvement in arithmetic efficiency compared to the prior art, which requires three cycles of an arithmetic process whenever each output value is obtained.
  • FIGS. 3 to 4B relates to a one-dimensional convolution operation among depth-wise convolution operations, even when the present disclosure performs a two-dimensional convolution operation among depth-wise convolution operations. Of course, it can be applied. An embodiment of a case in which a two-dimensional convolution operation is performed will be described in detail with reference to FIGS. 5 to 8 .
  • the electronic device 100 may perform not only a depth-wise convolution operation but also a 3D convolution operation, and thus a 3D convolution operation under the architecture according to the present disclosure as shown in FIGS. 4A and 4B .
  • a detailed process for performing the ? will be described in detail with reference to FIGS. 9 to 11 .
  • FIG. 5 is a block diagram illustrating a plurality of modules for performing a two-dimensional convolution operation according to the present disclosure.
  • FIGS. 6 to 8 are diagrams illustrating a part of a two-dimensional convolution operation process according to various embodiments of the present disclosure.
  • the plurality of modules may include an input selection module 121 , a plurality of multiplication modules 122 and an intermediate value accumulation module 123 , and in particular, an intermediate value accumulation module ( 123 may include a buffer 123-3 (buffer).
  • an intermediate value accumulation module 123 may include a buffer 123-3 (buffer).
  • the 'buffer 123-3' refers to a configuration that stores intermediate values corresponding to rows of a two-dimensional kernel among intermediate values obtained in the process of performing a two-dimensional convolution operation.
  • intermediate values may be stored in registers included in the intermediate value accumulation module 123, but a two-dimensional convolution operation is performed.
  • the buffer 123-3 for storing intermediate values corresponding to rows of the kernel may be required separately from the registers.
  • the processor 120 may further include a buffer 123-3, and the buffer 123-3 is used to store some of the intermediate values obtained for each row of the kernel.
  • the buffer 123-3 is illustrated as a component included in the intermediate value accumulation module 123 , but the buffer 123-3 may be implemented as a configuration separate from the intermediate value accumulation module 123 . Of course it could be.
  • FIG. 6 is a view for explaining a method of sequentially processing a one-dimensional convolution operation for each row to obtain a result according to a two-dimensional convolution operation
  • FIG. 7 is a case in which the same operation as in FIG. 6 is performed. It is a diagram showing the operation of a circuit including a plurality of modules according to.
  • FIG. 8 is a diagram for explaining a method of obtaining a result according to a two-dimensional convolution operation using a plurality of multiplication modules 122 corresponding to the number of a plurality of weights included in a two-dimensional kernel.
  • FIGS. 6 to 8 a case in which the kernel has a size of 3*3 and thus a plurality of weights corresponding to the first channel is 9 will be described as an example. Since the description of FIGS. 6 to 8 is also a description of the depthwise convolution operation, for convenience of description, the operation process for input values corresponding to the first channel among the plurality of channels will be mainly described.
  • a set of input values corresponding to each row among a plurality of input values is shown as F 0 , F 1 , F 2 , and F 3 for convenience of explanation, and corresponds to each row among the plurality of weights.
  • a set of weights to be used is denoted as K 0 , K 1 , and K 2 .
  • the processor 120 performs a first intermediate according to the operation result of the input value F 0 of the first row and the weight K 0 of the first row through the plurality of multiplication modules 122 .
  • a value may be obtained, and the obtained first intermediate value may be stored in the buffer 123 - 3 .
  • the processor 120 obtains a second intermediate value according to the operation result of the input value F 1 in the second row and the weight K 1 in the second row through the plurality of multiplication modules 122,
  • the second intermediate value may be summed with the first intermediate value stored in the buffer 123-3 through the first intermediate value accumulation module 123-1, and the summed value may be stored in the buffer 123-3.
  • the processor 120 obtains a third intermediate value according to the operation result of the input value F 2 of the third row and the weight K 2 of the third row through the plurality of multiplication modules 122,
  • One output value O 0 may be obtained by adding the 3 intermediate values to the sum of the first and second intermediate values stored in the buffer 123 - 3 .
  • 'one output value' refers to one output value among output values corresponding to each case in which the two-dimensional kernel is located on the matrix of input data.
  • the processor 120 performs the first intermediate value accumulation module 123-1 with the input value F 1 of the second row and the first row.
  • the median value according to the calculation result of the weight (K 0 ), the intermediate value according to the calculation result of the input value (F 2 ) in the third row and the weight (K 1 ) in the second row, and the input value (F 3 ) in the fourth row ) and an intermediate value according to the calculation result of the weight (K 2 ) of the third row another output value ( O 1 ) may be obtained.
  • FIG. 7 is a view for explaining in more detail a process of obtaining an output value (O 0 ) among the operations of FIG. 6 , a first row (Line 0), a second row (Line 1), and a third row (Line 2) ) represents a sequential operation for each.
  • the calculation performed for each line is the same as that shown in FIGS. 4A to 4B , but in this example, it is necessary to accumulate up to the calculation with the weight of the third row Line2. Accordingly, the buffer 123-3 is used to store the intermediate value obtained in order to add the intermediate value obtained by the operation of each row with the operation result of the other row.
  • sets of input values corresponding to each row among the plurality of input values are indicated as F 0 , F 1 , and F 2 for convenience of explanation, and a set of weights corresponding to each row among the plurality of weights are denoted as W 0,0 , W 0,1 , W 0,2 , W 1,0 , W 1,1 , W 1,2 , W 2,0 , W 2,1 and W 2,2 .
  • W m,n m is a serial number indicating which row of the kernel the weight is, and n is a serial number indicating the weight of the kernel column.
  • weights of W 0,0 , W 0,1 and W 0,2 weights of W 1,0 , W 1,1 and W 1,2 and W 2,0 , W 2,1 and W 2
  • the weights of , 2 may be constructed in a multi-channel form and stored in the memory 110 as second kernel information.
  • the processor 120 when the input value F 0 of the first row among the plurality of input values corresponding to the first channel is input to the input selection module 121, the processor 120 performs the multiplication module ( 122) as well as the input selection module 121 to be input to the multiplication module 122 corresponding to each of the second and third channels adjacent to the first channel. Then, the processor 120 divides each of a plurality of weights W 0,0 , W 0,1 and W 0,2 corresponding to the first row into three channels corresponding to the first channel, the second channel, and the third channel, respectively. Each of the multiplication modules 122 may be input one by one.
  • the input value F0 is input to all three multiplication modules 122 corresponding to the first channel, the second channel, and the third channel, respectively, and the weights W 0,0 , W 0,1 to each of the three multiplication modules 122 . and W 0,2 are input one by one, the processor 120 performs a multiplication operation between F 0 and W 0,0 through the multiplication module 122 corresponding to the first channel to obtain an intermediate value of F 0 *W 0,0 A value is obtained, and an intermediate value of F 0 *W 0,1 is obtained by performing a multiplication operation between F 0 and W 0,1 through the multiplication module 122 corresponding to the second channel, and corresponding to the third channel An intermediate value of F 0 *W 0,2 may be obtained by performing a multiplication operation between F 0 and W 0,2 through the multiplication module 122 .
  • the processor 120 may obtain an output value corresponding to the input value F 0 of the first row by summing the intermediate values through the first intermediate value accumulation module 123-1, and the first row An intermediate value of the output value O 0 corresponding to the input value F 0 of may be stored in the buffer 123-3.
  • the processor 120 Similar to the process of obtaining an output value corresponding to the input value F 0 of the first row, when an output value corresponding to the input value F 1 of the second row is obtained, the processor 120 generates a first intermediate value The output value corresponding to the input value F 1 of the second row is summed with the intermediate value stored in the buffer 123-3 through the accumulation module 123-1, and the summed value is stored in the buffer 123-3.
  • the processor 120 stores the output value corresponding to the input value F 2 of the third row in the buffer 123 through the first intermediate value accumulation module 123 - 1 . By summing with the summation value stored in -3), one output value (O 0 ) can be obtained.
  • the electronic device 100 may perform a one-dimensional convolution operation by using a plurality of multiplication modules 122 in parallel, and each one-dimensional By adding the results of the convolution operation of , a result according to the two-dimensional convolution operation can be obtained. Accordingly, the electronic device 100 can perform a two-dimensional convolution operation in an efficient manner. As in the above-described example, when the number of weights included in the two-dimensional kernel is nine and an output value is obtained by accumulating one-dimensional convolution operations for three weights, the electronic device 100 increases three times An improvement in arithmetic efficiency can be achieved.
  • the electronic device 100 can perform a two-dimensional convolution operation only by adding one buffer 123-3 for cumulatively storing each result of the one-dimensional convolution operation.
  • FIG. 8 is a diagram for explaining a method of performing a two-dimensional convolution operation by using a plurality of multiplication modules 122 corresponding to the number of weights included in a two-dimensional kernel in parallel. Unlike the method in which calculations are sequentially performed from the first row to the third row of weights in FIG. 7, in FIG. 8, calculations are simultaneously performed from the first row to the third row of weights for the input of the same row, resulting in different outputs The intermediate values of the values (O 0 , O 1 , O 2 ) can be obtained simultaneously.
  • FIG. 8 as in the case of FIG.
  • a set of weights corresponding to each row among the plurality of weights is set to W 0,0 , W 0,1 , W 0,2 , W 1,0 , W 1,1 , W 1,2 , W 2,0 , W 2,1 and W 2,2 .
  • the weights of W 0,0 , W 0,1 , W 0,2 , W 1,0 , W 1,1 , W 1,2 , W 2,0 , W 2,1 and W 2,2 are 1
  • *1*9 horizontal*vertical*depth
  • the processor 12 may perform a multiplication operation with the weight (K 0 ) of the first row,
  • the intermediate value according to the result of the operation may be stored in the buffer 123 - 3 to be calculated and accumulated with input values and weights of other rows.
  • This operation may be performed in the multiplication module of three channels (Kernel Line 0) shown as (1) of FIG. 8, and an intermediate value according to the operation result may be stored in the buffer 123-3.
  • the processor 12 performs a second operation in the operation unit shown in (2) of FIG. 8 .
  • An intermediate value for the output value (O 0 ) may be obtained by summing the output value obtained by calculating the weight (K 1 ) of the row with the previously stored buffer value (F 0 *K 0 ).
  • the processor 120 calculates the same input value F 1 with the weight K 0 of the first row as shown in (4) of FIG. 6 to obtain an intermediate value for the output value O 1 .
  • the operation circuits (1) and (2) of FIG. 8 may operate simultaneously.
  • the buffer 123-3 storing the output value corresponding to the weight K 1 of the second row is stored with the buffer 123-3 storing the output value corresponding to the weight K 0 of the first row, and may be different.
  • the processor 120 pre-stores the result obtained by calculating with the weights K 2 of the third row as shown in (3) of FIG. 6 .
  • An output value (O 0 ) can be obtained by summing it with one buffer value.
  • This calculating part corresponds to (3) of FIG.
  • (2) and (1) of FIG. 8 are obtained by calculating different output values O 1 and O 2 , respectively, with the second row weight K 1 and the first row weight K 0 .
  • One intermediate value result may be stored in the buffer 123-3.
  • the processor 120 obtains intermediate values corresponding to rows of the kernel, stores them in the buffer 123-3, and accumulates the intermediate values obtained for each row in the column direction to perform a two-dimensional convolution operation.
  • the processor 120 obtains intermediate values corresponding to columns of the kernel, stores them in the buffer 123-3, and accumulates intermediate values obtained for each column in the row direction.
  • a two-dimensional convolution operation can also be performed.
  • the electronic device 100 performs a two-dimensional convolution operation process by using the multiplication modules 122 as many as the number of weights included in the two-dimensional kernel in parallel. be able to do it efficiently. Specifically, when the number of weights included in the two-dimensional kernel is nine as in the above-described example, the electronic device 100 may achieve a nine-fold improvement in arithmetic efficiency.
  • FIG. 9 is a block diagram illustrating a plurality of modules for performing a 3D convolution operation according to the present disclosure.
  • 10 and 11 are diagrams illustrating a part of a 3D convolution operation process according to various embodiments of the present disclosure.
  • the plurality of modules may include an input selection module 121 , a plurality of multiplication modules 122 and an intermediate value accumulation module 123 , and in particular, an intermediate value accumulation module ( 123 may include a first intermediate value accumulation module 123 - 1 and a second intermediate value accumulation module 123 - 2 .
  • the 'first intermediate value accumulation module 123-1' refers to a module that acquires an output value by summing intermediate values obtained in the depthwise convolution operation process as described above with reference to FIGS. 1 to 8.
  • 'second intermediate value accumulation module 123-2' refers to a module for obtaining an output value by summing intermediate values obtained in a 3D convolution operation process.
  • the second intermediate value accumulation module 123 - 2 according to the present disclosure may be referred to as a so-called Adder Tree. That is, the configuration indicated by the Adder Tree of FIG. 10 represents the second intermediate value accumulation module 123 - 2 according to the present disclosure.
  • the 3D convolution operation since an operation is performed between the input values included in the 3D input data and the weights included in the 3D kernel, a plurality of multiplication modules 122 corresponding to each of the plurality of channels are all used. . Specifically, in the 3D convolution operation, between a set of input values having the same row and column and different depths among input values included in input data and a set of weights having the same row and column and different depths among weights included in the kernel. A convolution operation is performed. Accordingly, in the 3D convolution operation, when the weights are input to the plurality of multiplication modules 122 , the first kernel information may be used instead of the second kernel information converted into the multi-channel form.
  • FIG. 10 is a diagram illustrating a process of obtaining an output value based on an input value and a weight at time points T 0 to T 5 when a 3D convolution operation is performed
  • FIG. 11 is a diagram showing the same operation as in FIG. It is a diagram showing the operation of a circuit including a plurality of modules according to the present disclosure.
  • a case in which a three-dimensional kernel has a size of 3*1*64 (width*length*depth) will be described as an example.
  • sets of input values having the same row and column and different depths among input values included in the input data are indicated as F 0 , F 1 , F 2 and F 3 , respectively, and included in the kernel.
  • sets of weights having the same row and column and different depths are denoted as W 0 , W 1 , and W 2 , respectively.
  • the processor 120 may control the input selection module 121 so that input values included in F 0 are input to the multiplication module 122 of a channel corresponding to each input value. That is, in the processor 120 , an input value corresponding to the first channel among the input values included in F 0 is input to the multiplication module 122 corresponding to the first channel, and the input value corresponding to the second channel is input to the second channel. As input to the multiplication module 122 corresponding to a channel, the input selection module 121 may be controlled to input a plurality of input values for each channel to the multiplication module 122 of the corresponding channel.
  • the processor 120 may input the weights included in W 0 to the multiplication module 122 of a channel corresponding to each weight. For example, the processor 120 inputs a weight corresponding to the first channel from among the weights included in W 0 to the multiplication module 122 corresponding to the first channel, and adds the weight corresponding to the second channel to the second channel. As input to the multiplication module 122 corresponding to a channel, weights for a plurality of channels may be input to the multiplication module 122 of the corresponding channel.
  • the processor 120 controls the first channel included in F 0 through the multiplication module 122 corresponding to the first channel.
  • a first intermediate value is obtained according to the product operation result of the input value of channel 1 (F 0 (0)) and the weight of the first channel included in W 0 (W 0 (0)), and the first intermediate value corresponding to the second channel is obtained.
  • the multiplication module 122 the second channel input value (F 0 (1)) included in F 0 and the weight (W 0 (1)) of the second channel included in W 0 are multiplied 2 intermediate values are obtained, and intermediate values corresponding to each of the third to 64th channels may be obtained in the same way.
  • the processor 120 sums the intermediate values corresponding to each of the first to 64th channels through the second intermediate value module, and according to the summation result A first summed value (O 0 (1)) may be obtained.
  • the processor 120 obtains the second sum value O 0 (2), similar to the process of obtaining the first output value O 0 (1), and obtains the first sum value O 0 (1)) and the second summed value O 0 (2)) may be summed to obtain a summed value O 0 (1 to 2) according to the summation result.
  • the processor 120 performs the process of obtaining the first summed value O 0 (1) and the second summed value O 0 (2), as in the process of obtaining the third summed value O 0 (3). ), and summing the first summed value (O 0 (1)), the second summed value (O 0 (2)), and the third summed value (O 0 (3)), one An output value (O 0 ) can be obtained.
  • one output value refers to one output value among output values corresponding to each case in which the three-dimensional kernel is located on the matrix of input data.
  • the electronic device 100 can not only efficiently perform a depth-wise convolution operation under one hardware structure, but also perform a 3D convolution operation.
  • FIG. 12 is a flowchart illustrating a method of controlling an electronic device according to an embodiment of the present disclosure.
  • the electronic device 100 may perform a convolution operation based on input values included in input data and weights included in the kernel.
  • the electronic device 100 performs depthwise convolution operation and 3D convolution using the input selection module 121 , the multiplication module 122 , and the intermediate value accumulation module 123 according to the present disclosure. operation can be performed.
  • the electronic device 100 may identify whether a convolution operation to be performed is a depth-wise convolution operation ( S1210 ).
  • the electronic device 100 determines that a plurality of input values corresponding to a first channel among a plurality of channels dividing input data is a plurality of multiplication modules. It is possible to control the input selection module 121 to be input to all of two or more multiplication modules 122 in ( S1220 ). In other words, unlike inputting input values corresponding to the first channel only to the multiplication module 122 corresponding to the first channel in the depth-wise convolution operation according to the prior art, the electronic device 100 according to the present disclosure Whenever each of a plurality of inputs corresponding to one channel is input to the input selection module 121, the input selection module ( 121) can be controlled.
  • the electronic device 100 may input a plurality of weights corresponding to the first channel to two or more multiplication modules 122 one by one (S1230).
  • the electronic device 100 unlike inputting a plurality of weights corresponding to the first channel only to the multiplication module 122 corresponding to the first channel, the electronic device 100 according to the present disclosure Based on the second kernel information in the multi-channel form, a plurality of weights corresponding to the first channel may be input to two or more multiplication modules 122 one by one.
  • the electronic device 100 may perform a multiplication operation with each of a plurality of weights for each of a plurality of input values through two or more multiplication modules 122 to obtain a plurality of intermediate values according to each result of the multiplication operation (S1240). ). Then, the electronic device 100 sums up the intermediate values corresponding to the respective positions of the kernel among the plurality of intermediate values through the first intermediate value accumulation module 123 - 1 to obtain a plurality of output values according to the summation results, respectively. It can be done (S1250).
  • control method of the electronic device 100 may be implemented as a program and provided to the electronic device 100 .
  • a program including a control method of the electronic device 100 may be stored and provided in a non-transitory computer readable medium.
  • the convolution operation is a depthwise convolution operation.
  • the input selection module ( 121) inputting each of the plurality of weights corresponding to the first channel to the plurality of multiplication modules 122, each of the plurality of weights for each of the plurality of input values through the plurality of multiplication modules 122, and obtaining a plurality of intermediate values according to each product result by performing a multiplication operation of The method may include summing, and obtaining a plurality of output values according to each of the summing results.
  • the non-transitory readable medium refers to a medium that stores data semi-permanently, rather than a medium that stores data for a short moment, such as a register, cache, memory 110, and the like, and can be read by a device.
  • a non-transitory readable medium such as a CD, DVD, hard disk, Blu-ray disk, USB, memory 110 card, ROM, and the like.
  • control method of the electronic device 100 and the computer-readable recording medium including a program for executing the control method of the electronic device 100 have been briefly described, but this is only for omitting redundant description, and Of course, various embodiments of the device 100 may be applied to a computer-readable recording medium including a control method of the electronic device 100 and a program for executing the control method of the electronic device 100 .
  • the electronic device can efficiently perform a depth-wise convolution operation.
  • the functions related to the neural network model and the convolution operation process as described above may be performed through the memory 110 and the processor 120 .
  • the processor 120 may include one or a plurality of processors 120 .
  • one or more processors 120 may be general-purpose processors 120 such as CPUs and APs, graphics-only processors 120 such as GPUs and VPUs, or artificial intelligence-only processors 120 such as NPUs and MPUs.
  • One or a plurality of processors 120 controls to process input data according to a predefined operation rule or artificial intelligence model stored in the non-volatile memory 110 and the volatile memory 110 .
  • the predefined action rule or artificial intelligence model is characterized in that it is created through learning.
  • a predefined operation rule or artificial intelligence model of a desired characteristic is created by applying a learning algorithm to a plurality of learning data.
  • Such learning may be performed in the device itself on which artificial intelligence according to the present disclosure is performed, or may be performed through a separate server/system.
  • the artificial intelligence model may be composed of a plurality of neural network layers. Each layer has a plurality of weight values, and the layer operation is performed through the operation of the previous layer and the operation of the plurality of weights.
  • Examples of neural networks include Convolutional Neural Network (CNN), Deep Neural Network (DNN), Recurrent Neural Network (RNN), Restricted Boltzmann Machine (RBM), Deep Belief Network (DBN), Bidirectional Recurrent Deep Neural Network (BRDNN), GAN.
  • CNN Convolutional Neural Network
  • DNN Deep Neural Network
  • RNN Restricted Boltzmann Machine
  • DBN Deep Belief Network
  • BBN Bidirectional Recurrent Deep Neural Network
  • GAN GAN
  • the learning algorithm is a method of training a predetermined target device (eg, a robot) using a plurality of learning data so that the predetermined target device can make a decision or make a prediction by itself.
  • Examples of the learning algorithm include supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, and the learning algorithm in the present disclosure is specified when It is not limited to the above example except for.
  • the device-readable storage medium may be provided in the form of a non-transitory storage medium.
  • 'non-transitory storage medium' is a tangible device and only means that it does not contain a signal (eg, electromagnetic wave). It does not distinguish the case where it is stored as
  • the 'non-transitory storage medium' may include a buffer 123-3 in which data is temporarily stored.
  • the method according to various embodiments disclosed in this document may be provided by being included in a computer program product.
  • Computer program products may be traded between sellers and buyers as commodities.
  • the computer program product is distributed in the form of a device-readable storage medium (eg compact disc read only memory (CD-ROM)), or through an application store (eg Play StoreTM) or on two user devices (eg, It can be distributed (eg downloaded or uploaded) directly or online between smartphones (eg: smartphones).
  • a portion of the computer program product eg, a downloadable app
  • device-readable storage such as the manufacturer's server, the server of an application store, or the memory 110 of a relay server. At least temporarily stored in the medium, or may be temporarily created.
  • each of the components may be composed of a singular or a plurality of entities, and some of the above-described corresponding sub-components are omitted. Alternatively, other sub-components may be further included in various embodiments. Alternatively or additionally, some components (eg, a module or a program) may be integrated into a single entity to perform the same or similar functions performed by each corresponding component prior to integration.
  • operations performed by a module, program, or other component may be sequentially, parallel, repetitively or heuristically executed, or at least some operations may be executed in a different order, omitted, or other operations may be added.
  • unit or “module” used in the present disclosure includes a unit composed of hardware, software, or firmware, and may be used interchangeably with terms such as, for example, logic, logic block, part, or circuit.
  • a “unit” or “module” may be an integrally formed component or a minimum unit or a part of performing one or more functions.
  • the module may be configured as an application-specific integrated circuit (ASIC).
  • ASIC application-specific integrated circuit
  • Various embodiments of the present disclosure may be implemented as software including instructions stored in a machine-readable storage medium readable by a machine (eg, a computer).
  • the device calls the stored instructions from the storage medium. and, as a device capable of operating according to the called command, the electronic device 100 (eg, the electronic device 100) according to the disclosed embodiments may be included.
  • the processor may perform a function corresponding to the instruction by using other components directly or under the control of the processor.
  • Instructions may include code generated or executed by a compiler or interpreter.

Landscapes

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

Abstract

입력 데이터에 포함된 입력 값들 및 커널에 포함된 가중치들을 바탕으로 컨볼루션(convolution) 연산을 수행하는 전자 장치 및 전자 장치의 제어 방법이 개시된다. 구체적으로, 본 개시의 일 실시 예에 따른 전자 장치의 제어 방법은 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 복수의 곱셈 모듈 중 두 개 이상의 곱셈 모듈 모두에 입력되도록 입력 선택 모듈을 제어하는 단계, 제2 커널 정보를 바탕으로 제1 채널에 대응되는 복수의 가중치를 두 개 이상의 곱셈 모듈에 하나씩 입력하는 단계, 두 개 이상의 곱셈 모듈을 통해 복수의 입력 값 마다 복수의 가중치 각각과의 곱 연산을 수행하여, 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하는 단계 및 제1 중간 값 누적 모듈을 통해 복수의 중간 값 중 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 합산 결과 각각에 따른 복수의 출력 값을 획득하는 단계를 포함한다.

Description

전자 장치 및 전자 장치의 제어 방법
본 개시는 전자 장치 및 전자 장치의 제어 방법에 관한 것으로서, 구체적으로는 컨볼루션 연산을 효율적으로 수행할 수 있는 전자 장치 및 전자 장치의 제어 방법에 관한 것이다.
근래에는 인공 지능 분야에 대한 발전에 따라, 인공 지능의 기능을 효율적으로 구현하고 실행하기 위한 신경망 가속기(neural network accelerator) 내지는 인공신경망 칩셋(deep learning chipsets)에 대한 발전이 가속화되고 있다.
특히, 컨볼루션(convolution) 연산 과정을 수행하기 위한 신경망 가속기의 경우, 단일의 신경망 가속기가 3D 컨볼루션 연산과 뎁스와이즈(depthwise) 컨볼루션 연산 모두를 효율적으로 처리하기 위한 기술에 대한 필요성이 부각되고 있다.
그런데, 종래 기술에 따라 입력 채널 방향으로 병렬 처리를 하는 하드웨어 구조를 갖는 신경망 가속기의 경우, 3D 컨볼루션 연산을 수행하는 경우에는 모든 연산기를 활용하여 연산을 수행할 수 있는 반면, 뎁스와이즈 컨볼루션을 수행하는 경우에는 3D 컨볼루션 연산을 수행하는 경우에 비해 상대적으로 적은 연산량을 요구함에도 불구하고, 연산기를 효율적으로 활용하지 못한다는 문제가 있다.
본 개시는 상술한 바와 같은 문제점을 극복하기 위한 것으로서, 본 개시의 목적은 신경망 가속기의 병렬적인 하드웨어 구조를 활용하여 컨볼루션 연산을 효율적으로 수행할 수 있는 전자 장치 및 전자 장치의 제어 방법을 제공함에 있다.
상술한 바와 같은 목적을 달성하기 위한 본 개시의 일 실시 예에 따르면, 전자 장치는 복수의 채널에 따라 구분되는 입력 값들을 포함하는 3 차원의 입력 데이터, 상기 복수의 채널 별 가중치들을 포함하는 커널(kernel)에 대한 제1 커널 정보 및 상기 복수의 채널 별 가중치들이 상기 복수의 채널의 방향으로 배치되도록 변환된 제2 커널 정보를 저장하는 메모리 및 상기 복수의 채널에 대응되는 복수의 곱셈 모듈을 포함하고, 상기 복수의 곱셈 모듈을 통해 상기 입력 값들 및 상기 가중치들을 바탕으로 컨볼루션(convolution) 연산을 수행하는 프로세서를 포함하고, 상기 프로세서는 상기 컨볼루션 연산이 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 상기 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 상기 복수의 곱셈 모듈 중 두 개 이상의 곱셈 모듈 모두에 입력되도록 입력 선택 모듈을 제어하고, 상기 제2 커널 정보를 바탕으로 상기 제1 채널에 대응되는 복수의 가중치를 상기 두 개 이상의 곱셈 모듈에 하나씩 입력하며, 상기 두 개 이상의 곱셈 모듈을 통해 상기 복수의 입력 값 마다 상기 복수의 가중치 각각과의 곱 연산을 수행하여, 상기 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하고, 제1 중간 값 누적 모듈을 통해 상기 복수의 중간 값 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 합산 결과 각각에 따른 복수의 출력 값을 획득한다.
여기서, 상기 제1 채널에 대응되는 복수의 입력 값 각각은 기 설정된 사이클마다 상기 입력 선택 모듈에 입력되고, 상기 입력 선택 모듈은 상기 기 설정된 사이클마다 입력되는 입력 값 각각을 상기 두 개 이상의 곱셈 모듈 모두에 전송할 수 있다.
한편, 상기 두 개 이상의 채널은 상기 제1 채널 및 상기 제1 채널에 인접한 적어도 하나의 채널을 포함하며, 상기 두 개 이상의 곱셈 모듈의 개수는 상기 제1 커널에 포함된 복수의 가중치의 개수에 대응될 수 있다.
한편, 상기 커널은 2 차원의 커널이고, 상기 프로세서는 상기 복수의 중간 값들 중 상기 커널의 행에 대응되는 중간 값들을 저장하는 버퍼를 더 포함하며, 상기 제1 중간 값 누적 모듈을 통해 상기 버퍼에 저장된 중간 값들 중 상기 커널의 위치 각각에 대응되는 중간값 들을 합산하여, 상기 복수의 출력 값을 획득할 수 있다.
여기서, 상기 프로세서는 상기 커널에 포함된 복수의 가중치의 개수에 대응되는 두 개 이상의 곱셈 모듈을 병렬적으로 이용하여 상기 컨볼루션 연산을 수행함으로써, 상기 복수의 출력 값을 획득할 수 있다.
한편, 상기 프로세서는 상기 입력 선택 모듈에 입력되는 입력 값들을 상기 복수의 곱셈 모듈로 바이패스(bypass)하도록 상기 입력 선택 모듈을 제어하고, 상기 제1 커널 정보를 바탕으로 상기 복수의 곱셈 모듈 각각에 대응되는 복수의 가중치를 상기 복수의 곱셈 모듈에 입력할 수 있다.
여기서, 상기 프로세서는 상기 복수의 곱셈 모듈을 통해 각각 획득된 복수의 채널 별 중간 값들을 합산하는 제2 중간 값 누적 모듈을 더 포함할 수 있다.
상술한 바와 같은 목적을 달성하기 위한 본 개시의 일 실시 예에 따르면, 전자 장치의 제어 방법에 있어서, 상기 전자 장치는 복수의 채널에 대응되는 복수의 곱셈 모듈을 통해, 상기 복수의 채널에 따라 구분되는 입력 값들을 포함하는 3 차원의 입력 데이터, 상기 복수의 채널 별 가중치들을 포함하는 커널(kernel)에 대한 제1 커널 정보 및 상기 복수의 채널 별 가중치들이 상기 복수의 채널의 방향으로 배치되도록 변환된 제2 커널 정보를 바탕으로 컨볼루션(convolution) 연산을 수행하고, 상기 전자 장치의 제어 방법은 상기 컨볼루션 연산이 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 상기 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 상기 복수의 곱셈 모듈 중 두 개 이상의 곱셈 모듈 모두에 입력되도록 입력 선택 모듈을 제어하는 단계, 상기 커널에 대한 정보를 바탕으로 상기 제1 채널에 대응되는 복수의 가중치를 상기 두 개 이상의 곱셈 모듈에 하나씩 입력하는 단계, 상기 두 개 이상의 곱셈 모듈을 통해 상기 복수의 입력 값 마다 상기 복수의 가중치 각각과의 곱 연산을 수행하여, 상기 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하는 단계 및 제1 중간 값 누적 모듈을 통해 상기 복수의 중간 값 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 합산 결과 각각에 따른 복수의 출력 값을 획득하는 단계를 포함한다.
여기서, 상기 제1 채널에 대응되는 복수의 입력 값 각각은 기 설정된 사이클마다 상기 입력 선택 모듈에 입력되고, 상기 입력 선택 모듈은 상기 기 설정된 사이클마다 입력되는 입력 값 각각을 상기 두 개 이상의 곱셈 모듈 모두에 전송할 수 있다.
한편, 상기 두 개 이상의 채널은 상기 제1 채널 및 상기 제1 채널에 인접한 적어도 하나의 채널을 포함하며, 상기 두 개 이상의 곱셈 모듈의 개수는 상기 제1 커널에 포함된 복수의 가중치의 개수에 대응될 수 있다.
한편, 상기 커널은 2 차원의 커널이고, 상기 전자 장치는 상기 복수의 중간 값들 중 상기 커널의 행에 대응되는 중간 값들을 저장하는 버퍼를 더 포함하며, 상기 전자 장치의 제어 방법은, 상기 제1 중간 값 누적 모듈을 통해 상기 버퍼에 저장된 중간 값들 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 복수의 출력 값을 획득하는 단계를 더 포함할 수 있다.
여기서, 상기 전자 장치의 제어 방법은 상기 커널에 포함된 복수의 가중치의 개수에 대응되는 두 개 이상의 곱셈 모듈을 병렬적으로 이용하여 상기 컨볼루션 연산을 수행함으로써, 상기 복수의 출력 값을 획득하는 단계를 더 포함할 수 있다.
한편, 상기 전자 장치의 제어 방법은 상기 컨볼루션 연산이 3D 컨볼루션 연산인 경우, 상기 입력 선택 모듈에 입력되는 입력 값들을 상기 복수의 곱셈 모듈로 바이패스(bypass)하도록 상기 입력 선택 모듈을 제어하는 단계 및 상기 제1 커널 정보를 바탕으로 상기 복수의 곱셈 모듈 각각에 대응되는 복수의 가중치를 상기 복수의 곱셈 모듈에 입력하는 단계를 더 포함할 수 있다.
여기서, 상기 전자 장치는 상기 복수의 곱셈 모듈을 통해 각각 획득된 복수의 채널 별 중간 값들을 합산하는 제2 중간 값 누적 모듈을 더 포함할 수 있다.
상술한 바와 같은 목적을 달성하기 위한 본 개시의 일 실시 예에 따르면, 전자 장치의 제어 방법을 실행하는 프로그램을 포함하는 비일시적 컴퓨터 판독 가능 기록매체에 있어서, 상기 전자 장치는 복수의 채널에 대응되는 복수의 곱셈 모듈을 통해, 상기 복수의 채널에 따라 구분되는 입력 값들을 포함하는 3 차원의 입력 데이터, 상기 복수의 채널 별 가중치들을 포함하는 커널(kernel)에 대한 제1 커널 정보 및 상기 복수의 채널 별 가중치들이 상기 복수의 채널의 방향으로 배치되도록 변환된 제2 커널 정보를 바탕으로 컨볼루션(convolution) 연산을 수행하고, 상기 전자 장치의 제어 방법은 상기 컨볼루션 연산이 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 상기 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 상기 복수의 곱셈 모듈 중 두 개 이상의 곱셈 모듈 모두에 입력되도록 입력 선택 모듈을 제어하는 단계, 상기 제2 커널 정보를 바탕으로 상기 제1 채널에 대응되는 복수의 가중치를 상기 두 개 이상의 곱셈 모듈에 하나씩 입력하는 단계, 상기 두 개 이상의 곱셈 모듈을 통해 상기 복수의 입력 값 마다 상기 복수의 가중치 각각과의 곱 연산을 수행하여, 상기 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하는 단계 및 제1 중간 값 누적 모듈을 통해 상기 복수의 중간 값 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 합산 결과 각각에 따른 복수의 출력 값을 획득하는 단계를 포함한다.
도 1은 본 개시의 일 실시 예에 따른 전자 장치의 구성을 나타내는 블록도,
도 2는 본 개시의 일 실시 예에 따른 복수의 모듈 및 복수의 모듈에 대한 입출력 데이터를 나타내는 블록도,
도 3 내지 도 4b는 본 개시의 일 실시 예에 따른 뎁스와이즈 컨볼루션 연산 과정의 일부를 나타내는 도면,
도 5는 본 개시에 따른 2 차원의 컨볼루션 연산을 수행하기 위한 복수의 모듈을 나타내는 블록도,
도 6 내지 도 8은 본 개시의 다양한 실시 예에 따른 2 차원의 컨볼루션 연산 과정의 일부를 나타내는 도면,
도 9는 본 개시에 따른 3D 컨볼루션 연산을 수행하기 위한 복수의 모듈을 나타내는 블록도,
도 10 및 도 11은 본 개시의 다양한 실시 예에 따른 3D 컨볼루션 연산 과정의 일부를 나타내는 도면, 그리고,
도 12는 본 개시의 일 실시 예에 따른 전자 장치의 제어 방법을 나타내는 흐름도이다.
본 실시 예들은 다양한 변환을 가할 수 있고 여러 가지 실시 예를 가질 수 있는바, 특정 실시 예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나 이는 특정한 실시 형태에 대해 범위를 한정하려는 것이 아니며, 본 개시의 실시 예의 다양한 변경(modifications), 균등물(equivalents), 및/또는 대체물(alternatives)을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다.
본 개시를 설명함에 있어서, 관련된 공지 기능 혹은 구성에 대한 구체적인 설명이 본 개시의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그에 대한 상세한 설명은 생략한다.
덧붙여, 하기 실시 예는 여러 가지 다른 형태로 변형될 수 있으며, 본 개시의 기술적 사상의 범위가 하기 실시 예에 한정되는 것은 아니다. 오히려, 이들 실시 예는 본 개시를 더욱 충실하고 완전하게 하고, 당업자에게 본 개시의 기술적 사상을 완전하게 전달하기 위하여 제공되는 것이다.
본 개시에서 사용한 용어는 단지 특정한 실시 예를 설명하기 위해 사용된 것으로, 권리범위를 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다.
본 개시에서, "가진다," "가질 수 있다," "포함한다," 또는 "포함할 수 있다" 등의 표현은 해당 특징(예: 수치, 기능, 동작, 또는 부품 등의 구성요소)의 존재를 가리키며, 추가적인 특징의 존재를 배제하지 않는다.
본 개시에서, "A 또는 B," "A 또는/및 B 중 적어도 하나," 또는 "A 또는/및 B 중 하나 또는 그 이상"등의 표현은 함께 나열된 항목들의 모든 가능한 조합을 포함할 수 있다. 예를 들면, "A 또는 B," "A 및 B 중 적어도 하나," 또는 "A 또는 B 중 적어도 하나"는, (1) 적어도 하나의 A를 포함, (2) 적어도 하나의 B를 포함, 또는 (3) 적어도 하나의 A 및 적어도 하나의 B 모두를 포함하는 경우를 모두 지칭할 수 있다.
본 개시에서 사용된 "제1," "제2," "첫째," 또는 "둘째,"등의 표현들은 다양한 구성요소들을, 순서 및/또는 중요도에 상관없이 수식할 수 있고, 한 구성요소를 다른 구성요소와 구분하기 위해 사용될 뿐 해당 구성요소들을 한정하지 않는다.
어떤 구성요소(예: 제1 구성요소)가 다른 구성요소(예: 제2 구성요소)에 "(기능적으로 또는 통신적으로) 연결되어((operatively or communicatively) coupled with/to)" 있다거나 "접속되어(connected to)" 있다고 언급된 때에는, 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로 연결되거나, 다른 구성요소(예: 제3 구성요소)를 통하여 연결될 수 있다고 이해되어야 할 것이다.
반면에, 어떤 구성요소(예: 제1 구성요소)가 다른 구성요소(예: 제2 구성요소)에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 상기 어떤 구성요소와 상기 다른 구성요소 사이에 다른 구성요소(예: 제3 구성요소)가 존재하지 않는 것으로 이해될 수 있다.
본 개시에서 사용된 표현 "~하도록 구성된(또는 설정된)(configured to)"은 상황에 따라, 예를 들면, "~에 적합한(suitable for)," "~하는 능력을 가지는(having the capacity to)," "~하도록 설계된(designed to)," "~하도록 변경된(adapted to)," "~하도록 만들어진(made to)," 또는 "~를 할 수 있는(capable of)"과 바꾸어 사용될 수 있다. 용어 "~하도록 구성된(또는 설정된)"은 하드웨어적으로 "특별히 설계된(specifically designed to)" 것만을 반드시 의미하지 않을 수 있다.
대신, 어떤 상황에서는, "~하도록 구성된 장치"라는 표현은, 그 장치가 다른 장치 또는 부품들과 함께 "~할 수 있는" 것을 의미할 수 있다. 예를 들면, 문구 "A, B, 및 C를 수행하도록 구성된(또는 설정된) 프로세서"는 해당 동작을 수행하기 위한 전용 프로세서(예: 임베디드 프로세서), 또는 메모리 장치에 저장된 하나 이상의 소프트웨어 프로그램들을 실행함으로써, 해당 동작들을 수행할 수 있는 범용 프로세서(generic-purpose processor)(예: CPU 또는 application processor)를 의미할 수 있다.
실시 예에 있어서 '모듈' 혹은 '부'는 적어도 하나의 기능이나 동작을 수행하며, 하드웨어 또는 소프트웨어로 구현되거나 하드웨어와 소프트웨어의 결합으로 구현될 수 있다. 또한, 복수의 '모듈' 혹은 복수의 '부'는 특정한 하드웨어로 구현될 필요가 있는 '모듈' 혹은 '부'를 제외하고는 적어도 하나의 모듈로 일체화되어 적어도 하나의 프로세서로 구현될 수 있다.
한편, 도면에서의 다양한 요소와 영역은 개략적으로 그려진 것이다. 따라서, 본 발명의 기술적 사상은 첨부한 도면에 그려진 상대적인 크기나 간격에 의해 제한되지 않는다.
이하에서는 첨부한 도면을 참고하여 본 개시에 따른 실시 예에 대하여 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다.
도 1은 본 개시의 일 실시 예에 따른 전자 장치의 구성을 나타내는 블록도이고, 도 2는 본 개시의 일 실시 예에 따른 복수의 모듈 및 복수의 모듈에 대한 입출력 데이터를 나타내는 블록도이다. 그리고, 도 3 내지 도 4b는 본 개시의 일 실시 예에 따른 뎁스와이즈 컨볼루션 연산 과정의 일부를 나타내는 도면이다.
이하에서는 먼저 본 개시를 설명하기 위한 주요 용어에 대해 설명한 후, 도 1 내지 도 4b를 함께 참조하여 본 개시의 실시 예에 대해 설명한다.
본 개시에 따른 '전자 장치(100)'는 컨볼루션(convolution) 연산을 수행할 수 있도록 구성된 장치를 말한다. 구체적으로, 전자 장치(100)는 입력 데이터에 포함된 입력 값들 및 커널(kernel) 별 가중치(wight)들을 바탕으로 컨볼루션 연산을 수행하여 출력 데이터를 획득할 수 있다. 본 개시에 따른 전자 장치(100)의 구체적인 유형에 특별한 제한이 따르는 것은 아니다.
'입력 데이터'는 입력 데이터는 복수의 채널에 따라 구분되는 입력 값들을 포함하는 3 차원의 데이터일 수 있다. 구체적으로, 입력 데이터는 행, 열 및 뎁스(depth)에 따라 구분되는 복수의 입력 값을 포함하는 3 차원의 매트릭스일 수 있으며, 각각의 뎁스에 대응되는 복수의 채널로 구분될 수 있다. 한편, '입력 데이터'라는 용어는 '입력 특징 맵(input feature map)' 등과 같은 용어로 대체될 수 있으며, '입력 값'이라는 용어는 '입력 활성화 값(input activation value)'과 같은 용어로 대체될 수 있다.
'커널'은 입력 값들과의 곱 연산을 수행하기 위한 복수의 가중치를 포함하는 매트릭스일 수 있다. 구체적으로, 커널은 수행하고자 하는 컨볼루션 연산의 종류에 따라 1 차원, 2 차원 또는 3 차원의 매트릭스의 형태로 구축될 수 있다. 커널의 크기는 커널의 가로 길이(즉, 열의 개수), 세로 길이(즉, 행의 개수), 뎁스(즉, 깊이)에 따라 결정될 수 있으며, 커널에 포함된 복수의 가중치는 커널의 뎁스에 대응되는 복수의 채널에 따라 구분될 수 있다. 한편, '커널'이라는 용어는 '필터(filter)' 또는 '마스크(mask)' 등의 용어로 대체될 수 있다.
'컨볼루션 연산'은 입력 데이터에 포함된 입력 값들과 커널에 포함된 가중치들을 각각 곱한 후에 그 곱셈 결과 각각을 합산하는 방식의 연산을 말한다. 특히, 컨볼루션 연산은 3D(3-dimensional) 컨볼루션 연산 및 뎁스와이즈(depthwise) 컨볼루션 연산을 포함할 수 있다. 여기서, 3D 컨볼루션 연산이란 3 차원의 입력 데이터와 3 차원의 커널을 이용하여 3 차원의 출력 데이터를 획득하는 컨볼루션 연산을 말하며, 뎁스와이즈 컨볼루션 연산이란 3 차원의 입력 데이터와 1 차원 또는 2 차원의 커널을 이용하여 3 차원의 출력 데이터를 획득하는 컨볼루션 연산을 말한다. 컨볼루션 연산의 종류 각각에 따른 구체적인 연산 과정에 대해서는 본 개시에 따른 실시 예에 대한 설명과 함께 후술한다. 한편, 컨볼루션 연산은 컨볼루션 신경망(convolutional neural network, CNN)과 같은 신경망 모델을 통해 수행될 수 있으며, 다만, 본 개시가 적용될 수 있는 신경망 모델의 종류에 특별한 제한이 따르는 것은 아니다.
'출력 데이터'는 행, 열 및 뎁스에 따라 구분되는 복수의 출력 값을 포함하는 3 차원의 매트릭스일 수 있으며, 각각의 뎁스에 대응되는 복수의 채널로 구분될 수 있다. 출력 데이터의 행, 열 및 뎁스가 입력 데이터의 행, 열 및 뎁스에 대응되는 것은 아니며, 출력 데이터의 행, 열 및 뎁스는 컨볼루션 연산에 이용되는 커널의 크기, 스트라이드(stride)와 패딩(padding) 등에 따라 달라질 수 있다. 한편, '출력 데이터'라는 용어는 '출력 특징 맵(output feature map)' 등과 같은 용어로 대체될 수 있으며, '출력 값'이라는 용어는 '출력 활성화 값(output activation value)'과 같은 용어로 대체될 수 있다.
도 1에 도시된 바와 같이, 본 개시에 따른 전자 장치(100)는 메모리(110) 및 프로세서(120)를 포함할 수 있다. 다만, 도 1에 도시된 바와 같은 구성들은 예시적인 것에 불과하며, 도 1에 도시된 바와 같은 구성에 더하여 새로운 구성이 추가되거나 일부 구성이 생략될 수 있음은 물론이다.
메모리(110)에는 전자 장치(100)에 관한 적어도 하나의 인스트럭션(instruction)이 저장될 수 있다. 그리고, 메모리(110)에는 전자 장치(100)를 구동시키기 위한 O/S(Operating System)가 저장될 수 있다. 또한, 메모리(110)에는 본 개시의 다양한 실시 예들에 따라 전자 장치(100)가 동작하기 위한 각종 소프트웨어 프로그램이나 어플리케이션이 저장될 수도 있다. 그리고, 메모리(110)는 플래시 메모리(Flash Memory) 등과 같은 반도체 메모리나 하드디스크(Hard Disk) 등과 같은 자기 저장 매체 등을 포함할 수 있다.
구체적으로, 메모리(110)에는 본 개시의 다양한 실시 예에 따라 전자 장치(100)가 동작하기 위한 각종 소프트웨어 모듈이 저장될 수 있으며, 프로세서(120)는 메모리(110)에 저장된 각종 소프트웨어 모듈을 실행하여 전자 장치(100)의 동작을 제어할 수 있다. 즉, 메모리(110)는 프로세서(120)에 의해 액세스되며, 프로세서(120)에 의한 데이터의 독취/기록/수정/삭제/갱신 등이 수행될 수 있다.
그리고, 메모리(110)는 전력 공급이 중단되더라도 저장된 정보를 유지할 수 있는 비휘발성 메모리(110) 및 저장된 정보를 유지하기 위해서는 지속적인 전력 공급이 필요한 휘발성 메모리(110)를 포함할 수 있다. 예를 들어, 비휘발성 메모리(110)는 OTPROM(one time programmable ROM), PROM(programmable ROM), EPROM(erasable and programmable ROM), EEPROM(electrically erasable and programmable ROM), mask ROM, flash ROM 중 적어도 하나로 구현될 수 있고, 휘발성 메모리(110)는 DRAM(dynamic RAM), SRAM(static RAM), 또는 SDRAM(synchronous dynamic RAM) 중 적어도 하나로 구현될 수 있다. 한편, 본 개시에서 메모리(110)라는 용어는 메모리(110), 프로세서(120) 내 롬(미도시), 램(미도시) 또는 전자 장치(100)에 장착되는 메모리 카드(미도시)(예를 들어, micro SD 카드, 메모리 스틱)를 포함하는 의미로 사용될 수 있다.
특히, 본 개시에 따른 다양한 실시 예에 있어서, 메모리(110)에는 본 개시에 따른 입력 데이터, 출력 데이터, 가중치에 대한 정보 등이 저장될 수 있다. 도 2에서는 단순히 가중치에 대한 정보가 저장될 수 있는 것으로 나타냈으나, 구체적으로, 가중치에 대한 정보는 제1 커널 정보 및 제2 커널 정보의 형태로 메모리(110)에 저장될 수 있다.
여기서, '제1 커널 정보'는 복수의 채널 별 가중치를 포함하는 커널에 대한 정보를 말한다. 예를 들어, 제1 커널 정보는 복수의 채널 별로 3*3(가로*세로) 매트릭스의 가중치를 포함하는 커널에 대한 정보일 수 있다. 그리고, '제2 커널 정보'는 제1 커널 정보의 복수의 채널 별 가중치들이 복수의 채널의 방향으로 배치되도록 변환된 커널에 대한 정보를 말한다. 예를 들어, 제2 커널 정보는 복수의 채널 별로 3*1(가로*세로) 매트릭스의 형태로 구성된 가중치들을 1*1*3(가로*세로*뎁스)의 다중 채널 형태로 변환함으로써 생성된 커널에 대한 정보일 수 있다.
다시 말해, 제1 커널 정보는 컨볼루션 연산에 이용되는 통상적인 형태의 커널에 대한 정보, 즉 복수의 채널 별 매트릭스로 구성된 커널에 대한 정보를 지칭하기 위한 용어이며, 제2 커널 정보는 본 개시에 따라 컨볼루션 연산 중에서 뎁스와이즈 컨볼루션 연산을 병렬적으로 수행하기 위해, 복수의 채널 별 매트릭스로 구성된 커널에 대한 정보를 다중 채널 형태의 커널로 변환함으로써 생성된 커널에 대한 정보를 지칭하기 위한 용어이다.
그 밖에도 본 개시의 목적을 달성하기 위한 범위 내에서 필요한 다양한 정보가 메모리(110)에 저장될 수 있으며, 메모리(110)에 저장된 정보는 외부 장치로부터 수신되거나 사용자에 의해 입력됨에 따라 갱신될 수도 있다.
프로세서(120)는 전자 장치(100)의 전반적인 동작을 제어한다. 구체적으로, 프로세서(120)는 상술한 바와 같은 메모리(110)를 포함하는 전자 장치(100)의 구성과 연결되며, 상술한 바와 같은 메모리(110)에 저장된 적어도 하나의 인스트럭션을 실행함으로써, 전자 장치(100)의 동작을 전반적으로 제어할 수 있다.
프로세서(120)는 다양한 방식으로 구현될 수 있다. 예를 들어, 프로세서(120)는 주문형 집적 회로(Application Specific Integrated Circuit, ASIC), 임베디드 프로세서, 마이크로 프로세서, 하드웨어 컨트롤 로직, 하드웨어 유한 상태 기계(hardware Finite State Machine, FSM), 디지털 신호 프로세서(Digital Signal Processor, DSP) 중 적어도 하나로 구현될 수 있다. 한편, 본 개시에서 프로세서(120)라는 용어는 CPU(Central Processing Unit), GPU(Graphic Processing Unit) 및 MPU(Main Processing Unit)등을 포함하는 의미로 사용될 수 있다.
한편, 프로세서(120)는 각종 동작을 수행하기 위해 필요한 데이터를 비휘발성 메모리(110)에서 휘발성 메모리(110)로 로딩(loading)할 수 있다. 로딩이란 프로세서(120)가 액세스할 수 있도록 비휘발성 메모리(110)에 저장된 데이터를 휘발성 메모리(110)에 불러들여 저장하는 동작을 의미한다. 그리고, 휘발성 메모리(110)는 프로세서(120)의 일 구성 요소로서 프로세서(120)에 포함된 형태로 구현될 수 있으나, 이는 일 실시예에 불과하며, 프로세서(120)와 별개의 구성 요소로 구현될 수 있다.
특히, 본 개시에 따른 프로세서(120)는 하나 또는 복수 개로 구현될 수 있다. 구체적으로, 프로세서(120)는 컨볼루션 신경망 모델의 연산 과정을 효율적으로 제어하기 위한 신경망 가속기, 그리고 신경망 가속기를 비롯한 다양한 구성의 동작을 제어하기 위한 CPU(Central Processing Unit) 등을 포함할 수 있다. 그리고, 신경망 가속기는 복수의 MPU(Micro Processor Unit) 등을 포함할 수 있으며, 복수의 MPU는 본 개시에 따른 다양한 실시 예를 구현하기 위한 복수의 모듈을 포함할 수 있다.
도 2에 도시된 바와 같이, 복수의 모듈은 입력 선택 모듈 (input selection module)(121), 복수의 곱셈 모듈 (multiplication module)(122) 및 중간 값 누적 모듈 (intermediate value accumulation module)(123) 등을 포함할 수 있다. 본 개시에 따른 복수의 모듈은 프로세서(120)에 포함된 하드웨어 모듈로 구현될 수 있을 뿐만 아니라, 실시 예에 따라서는 소프트웨어 모듈로 구현될 수도 있다.
'입력 선택 모듈(121)'은 입력 값들을 컨볼루션 연산의 종류에 따라 상이한 방식으로 복수의 곱셈 모듈(122)로 전송하는 모듈을 말한다. 구체적으로, 입력 데이터에 포함된 입력 값이 수신되면, 입력 선택 모듈(121)은 컨볼루션 연산의 종류에 기초하여 입력 값들을 복수의 곱셈 모듈 (122)로 전송할 수 있다. 특히, 입력 선택 모듈(121)은 프로세서(120)에 포함된 하드웨어 모듈로 구현될 수 있을 뿐만 아니라 소프트웨어 모듈로 구현될 수도 있다. 다만, 이하에서는 설명의 편의를 위해 입력 선택 모듈(121)이 프로세서(120)에 포함된 하드웨어 모듈로 구현되는 경우를 전제로 설명한다.
'복수의 곱셈 모듈(122)'은 입력 값과 가중치 사이의 곱 연산을 수행하는 모듈을 말한다. 구체적으로, 입력 선택 모듈(121)로부터 입력 값이 수신되고, 프로세서(120)에 의해 가중치가 수신되면, 복수의 곱셈 모듈(122)은 수신된 입력 값 및 가중치를 곱하여, 그 곱셈의 결과 값인 중간 값을 중간 값 누적 모듈(123)로 전송할 수 있다.
'중간 값 누적 모듈(123)'은 컨볼루션 연산 과정에서 획득되는 중간 값들을 합산하여 출력 값을 획득하는 모듈을 말한다. 구체적으로, 복수의 곱셈 모듈(122)로부터 복수의 중간 값이 수신되면, 중간 값 누적 모듈(123)은 복수의 중간 값을 바탕으로 출력 값을 획득하여 출력할 수 있다. 한편, 중간 값 누적 모듈(123)은 뎁스와이즈 컨볼루션 과정에서 이용되는 제1 중간 값 누적 모듈(123-1) 및 3D 컨볼루션 과정에서 이용되는 제2 중간 값 누적 모듈(123-2)을 포함할 수 있다.
이하에서는 먼저 제1 중간 값 누적 모듈(123-1)을 이용한 뎁스와이즈 컨볼루션 과정에 대해 설명하고, 제2 중간 값 누적 모듈(123-2)을 이용한 3D 컨볼루션 과정에 대해서는 도 9 내지 도 11을 참조하여 설명한다. 한편, 중간 값 누적 모듈(123)은 적어도 하나의 레지스터 및 적어도 하나의 버퍼를 포함할 수 있다. 이 중 버퍼에 관련된 실시 예에 대해서는 도 5 내지 도 8을 참조하여 상술한다.
프로세서(120)는 수행하고자 하는 컨볼루션 연산의 종류를 식별하고, 수행하고자 하는 컨볼루션 연산이 3D 컨볼루션 연산인지, 아니면 뎁스와이즈 컨볼루션 연산인지에 따라 상이한 방법으로 복수의 모듈을 제어할 수 있다. 특히, 본 개시에 따른 프로세서(120)는 3D 컨볼루션 연산을 수행하는 경우에는 제1 커널 정보를 이용하고, 뎁스와이즈 컨볼루션 연산을 수행하는 경우에는 제2 커널 정보를 이용할 수 있다. 이하에서는 먼저, 도 3 내지 도 4b를 참조하여, 뎁스와이즈 컨볼루션 연산에 관련된 실시 예에 대해 설명한다.
구체적으로, 도 3은 뎁스와이즈 컨볼루션 연산 중에서도 1 차원의 컨볼루션 연산을 수행하는 경우 T0 내지 T4 시점에서 입력 값 및 가중치를 바탕으로 출력 값을 획득하는 과정을 나타내는 도면이고, 도 4a 및 도 4b는 도 3과 같은 연산을 수행하는 경우 본 개시에 따른 복수의 모듈을 포함하는 회로의 동작을 나타내는 도면이다. 특히, 도 3 내지 도 4b에 대한 설명에서는 제1 채널에 대응되는 복수의 가중치가 3 개인 경우를 예로 들어 설명한다.
프로세서(120)는 입력 데이터에 포함된 입력 값들 중 행과 열이 동일하고 뎁스가 상이한 입력 값들을 기 설정된 사이클(cycle)마다 복수의 MPU에 입력할 수 있다. 그런데, 뎁스와이즈 컨볼루션 연산의 경우, 후술하는 바와 같은 3D 컨볼루션 연산과는 달리, 하나의 출력 값을 획득하기 위해 서로 다른 채널의 입력 값들에 대한 중간 값들을 합산하는 과정은 필요하지 않다. 따라서, 이하 뎁스와이즈 컨볼루션 연산에 대한 실시 예를 설명함에 있어서는, 설명의 편의 상 복수의 채널 중 제1 채널에 대응되는 입력 값들에 대한 연산 과정을 중심으로 설명한다.
뎁스와이즈 컨볼루션 연산을 수행하기 위한 경우, 프로세서(120)는 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 복수의 곱셈 모듈(122) 중 두 개 이상의 곱셈 모듈(122) 모두에 입력되도록 입력 선택 모듈(121)을 제어할 수 있다. 특히, 두 개 이상의 곱셈 모듈(122)의 개수는 커널에 포함된 복수의 가중치의 개수에 대응될 수 있다. 본 개시를 설명함에 있어서, '두 개 이상의 곱셈 모듈(122)'이라는 용어는 복수의 곱셈 모듈(122) 중 본 개시에 따른 뎁스와이즈 컨볼루션 연산에 이용되는 곱셈 모듈(122)들을 특정하기 위한 의미로 사용된다.
다시 말해, 종래 기술에 따른 뎁스와이즈 컨볼루션 연산에서 제1 채널에 대응되는 입력 값들을 제1 채널에 대응되는 곱셈 모듈(122)에만 입력하는 것과는 달리, 본 개시에 따른 프로세서(120)는 제1 채널에 대응되는 복수의 입력 각각이 입력 선택 모듈(121)에 입력될 때마다, 그 입력 값이 커널에 포함된 복수의 가중치의 개수만큼의 곱셈 모듈(122) 모두에 입력되도록 입력 선택 모듈(121)을 제어할 수 있다.
예를 들어, 도 3 및 도 4a의 시간 T2에서의 연산 과정과 같이, 제1 채널에 대응되는 복수의 입력 값 중 F2가 입력 선택 모듈(121)에 입력되면, 프로세서(120)는 F2가 제1 채널에 대응되는 곱셈 모듈(122)뿐만 아니라, 제1 채널에 인접한 제2 채널 및 제3 채널 각각에 대응되는 곱셈 모듈(122)에도 입력되도록 입력 선택 모듈(121)을 제어할 수 있다.
한편, 뎁스와이즈 컨볼루션 연산을 수행하기 위한 경우, 프로세서(120)는 제2 커널 정보를 바탕으로 제1 채널에 대응되는 복수의 가중치를 두 개 이상의 곱셈 모듈(122)에 하나씩 입력할 수 있다.
다시 말해, 종래 기술에 따른 뎁스와이즈 컨볼루션 연산에서 제1 채널에 대응되는 복수의 가중치를 제1 채널에 대응되는 곱셈 모듈(122)에만 입력하는 것과 달리, 본 개시에 따른 프로세서(120)는 다중 채널 형태의 커널로 변환된 제2 커널 정보를 바탕으로 제1 채널에 대응되는 복수의 가중치를 두 개 이상의 곱셈 모듈(122)에 하나씩 입력할 수 있다.
예를 들어, 도 3 및 도 4a의 시간 T2에서의 연산 과정과 같이, 프로세서(120)는 제1 채널에 대응되는 복수의 가중치인 W0, W1 및 W2 각각을 제1 채널, 제2 채널 및 제3 채널 각각에 대응되는 세 개의 곱셈 모듈(122) 각각에 하나씩 입력할 수 있다. 즉, 프로세서(120)는 가중치 W0를 제1 채널에 대응되는 곱셈 모듈(122)에 입력하고, 가중치 W1를 제2 채널에 대응되는 곱셈 모듈(122)에 입력하며, 가중치 W2를 제3 채널에 대응되는 곱셈 모듈(122)에 입력할 수 있다. 이를 위해, 복수의 가중치 W0, W1 및 W2는 1*1*3(가로*세로*뎁스)의 다중 채널 형태로 구축되어, 제2 커널 정보로서 메모리(110)에 저장될 수 있다.
상술한 바와 같이 복수의 입력 값 및 복수의 가중치가 복수의 곱셈 모듈(122)에 입력되면, 프로세서(120)는 복수의 곱셈 모듈(122)을 통해, 복수의 입력 값 마다 복수의 가중치 각각과의 곱 연산을 수행하여, 곱 연산 결과 각각에 따른 복수의 중간 값을 획득할 수 있다.
예를 들어, 도 3및 도 4a의 시간 T2에서의 연산 과정과 같이, 제1 채널, 제2 채널 및 제3 채널 각각에 대응되는 세 개의 곱셈 모듈(122) 모두에 입력 값 F2가 입력되고, 세 개의 곱셈 모듈(122) 각각에 가중치 W0, W1 및 W2가 하나씩 입력되면, 제1 채널에 대응되는 곱셈 모듈(122)은 F2와 W0와의 곱 연산을 수행하여 F2*W0라는 중간 값을 획득하고, 제2 채널에 대응되는 곱셈 모듈(122)은 F2와 W1와의 곱 연산을 수행하여 F2*W1라는 중간 값을 획득하며, 제3 채널에 대응되는 곱셈 모듈(122)은 F2와 W2와의 곱 연산을 수행하여 F2*W2라는 중간 값을 획득할 수 있다.
*도 3과 함께 도 4b를 참조하면, 시간 T2에서의 연산 과정과 마찬가지로, 제1 채널, 제2 채널 및 제3 채널 각각에 대응되는 세 개의 곱셈 모듈(122)은 시간 T2에 이어지는 T3에서 F3*W0, F3*W1 및 F3*W2각각의 연산 결과에 따른 복수의 중간 값을 획득할 수 있으며, 시간 T3에 이어지는 T4에서 F4*W0, F4*W1 및 F4*W2라는 각각의 연산 결과에 따른 복수의 중간 값을 획득할 수 있다.
상술한 바와 같이, 복수의 중간 값이 획득되면, 프로세서(120)는 중간 값 누적 모듈(123)을 통해 복수의 중간 값 중 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 합산 결과 각각에 따른 복수의 출력 값을 획득할 수 있다. 구체적으로, 프로세서(120)는 중간 값 누적 모듈(123) 중에서도 제1 중간 값 누적 모듈(123-1)을 이용하여 중간 값들의 합산 결과 각각에 따른 복수의 출력 값을 획득할 수 있다. 여기서, '커널의 위치 각각에 대응되는 중간 값들'이란 커널을 입력 데이터의 매트릭스 상에서 기 설정된 간격(즉, 스트라이드)에 따라 순차적으로 이동시키면서 커널에 포함된 복수의 가중치와 그에 대응되는 복수의 입력 값을 각각 곱한다고 가정할 때, 그 곱셈 결과 각각에 따라 획득되는 중간 값들을 말한다.
예를 들어, 상술한 바와 같은 도 3 및 도 4a의 시간 T2에서의 연산 과정이 수행된 후 순차적으로 도 3 및 도 4b의 T3 및 T4의 연산 과정이 수행된 경우, 프로세서(120)는 제1 중간 값 누적 모듈(123-1)을 통해 커널의 위치가 입력 값 F2, F3 및 F4에 대응되는 경우의 중간 값들인 F2*W0, F3*W1 및 F4*W2들을 합산하여, 출력 값 O2를 획득할 수 있다.
이상에서는 T4의 시점에서, 시간 T2에서 획득된 중간 값 F2*W0, 시간 T3에 획득된 중간 값 F3*W1 및 시간 T4에서 획득된 중간 값 F4*W2을 합산하여 출력 값 O2를 획득하는 경우에 대해 설명하였으나, 출력 값 O0 및 O1의 경우에도 마찬가지 방법으로 획득될 수 있다. 즉, 복수의 곱셈 모듈(122)을 통해 시간 T0에 중간 값 F0*W0가 획득되고, 시간 T1에 중간 값 F1*W0 및 F1*W1이 획득되면, 시간 T2에 중간 값 F0*W0, F1*W1 및 F2*W2들을 합산하여 출력 값 O0를 획득할 수 있으며, 시간 T3에 중간 값 F1*W0, F2*W1 및 F3*W2들을 합산하여 출력 값 O1을 획득할 수 있다.
한편, 복수의 곱셈 모듈(122)를 통해 획득된 중간 값들은 중간 값 누적 모듈(123)에 포함된 레지스터에 일시적으로 저장될 수 있으며, 레지스터에 저장된 중간 값들은 최종적인 출력 값을 획득되는데 이용될 수 있다. 도 4a의 A 및 B는 각각 제1 채널에 대응되는 곱셈 모듈(122) 및 제2 채널에 대응되는 곱셈 모듈(122)를 통해 획득된 중간 값이 저장되는 레지스터를 나타낸 것이며, 도 4a의 C는 레지스터 A에 저장된 중간 값과 레지스터 B에 저장된 중간 값을 제3 채널에 대응되는 곱셈 모듈(122)를 통해 획득된 중간 값과 합산한 결과에 따른 출력 값을 나타낸 것이다.
제1 중간 값 누적 모듈(123-1)에 포함된 구성 중 A 및 B와 같이 누적 모듈에 포함된 레지스터들은 소위 Partial Sum Register(PSR)라고 지칭될 수 있으며, 제1 중간 값 누적 모듈(123-1)에 포함된 구성 중 "+"기호로 도시된 구성은 중간 값 모듈에 포함된 합산기로서 소위 Partial Sum Adder(PSA)라고 지칭될 수 있다.
한편, 프로세서(120)는 시간 T0에 중간 값 F0*W0 뿐만 아니라 중간 값 F0*W1 및 F0*W2 또한 획득할 수 있으며, 시간 T1에 중간 값 F1*W0 및 F1*W1뿐만 아니라 중간 값 F1*W2 또한 획득할 수도 있으나, 중간 값 F0*W1, F0*W2 및 F1*W2는 커널의 위치에 대응되는 중간 값들에 해당하지 않기 때문에 획득할 필요가 없다.
한편, 이상에서는 전술한 바와 같이 설명의 편의를 위해 복수의 채널 중 제1 채널에 대응되는 입력 값들에 대한 연산 과정을 중심으로 설명하였으나, 복수의 채널 전체 중 제1 채널이 아닌 다른 채널에 대해서도 상술한 바와 같은 실시 예에 따른 연산 과정이 마찬가지로 적용될 수 있으며, 이에 따라 전자 장치(100)는 입력 데이터 전체에 대한 출력 값들을 포함하는 출력 데이터를 획득할 수 있다.
한편, 이상에서는 3D 컨볼루션 연산에 이용되는 제1 커널 정보 및 뎁스와이즈 컨볼루션 연산에 이용되는 제2 커널 정보가 각각 기 구축되어 메모리(110)에 저장된 상태임을 전제로 설명하였으나, 실시 예에 따라서는 제1 커널 정보만이 메모리(110)에 저장된 상태에서, 프로세서(120)가 제1 커널 정보의 복수의 채널 별 가중치들을 복수의 채널의 방향으로 변환하여 복수의 곱셈 모듈(122)에 입력하고, 그에 따라 뎁스와이즈 컨볼루션 연산을 수행할 수도 있다.
도 1 내지 도 4를 참조하여 상술한 실시 예에 따르면, 전자 장치(100)는 신경망 가속기의 병렬적인 하드웨어 구조를 활용하여 컨볼루션 연산을 효율적으로 수행할 수 있게 된다.
구체적으로, 뎁스와이즈 컨볼루션 연산을 수행하는 경우, 전자 장치(100)는 3D 컨볼루션 연산에서 가로 방향으로 배치되는 커널을 채널 방향으로 배치하여 복수의 곱셈 모듈(122)을 통해 동시에 하나의 입력 값을 복수의 가중치 값 각각과 곱함으로써, 세번째 사이클에 해당하는 시간 T2부터 매 사이클마다 출력 값을 획득할 수 있게 된다. 이에 따라, 각각의 출력 값을 획득할 때마다 세 사이클의 연산 과정이 필요한 종래 기술에 비하여 세 배에 달하는 연산 효율의 향상을 달성할 수 있게 된다.
한편, 도 3 내지 도 4b에 도시된 바와 같은 예시는 뎁스와이즈 컨볼루션 연산 중 1 차원의 컨볼루션 연산에 관한 것이지만, 본 개시가 뎁스와이즈 컨볼루션 연산 중 2 차원의 컨볼루션 연산을 수행하는 경우에도 적용될 수 있음은 물론이다. 2 차원의 컨볼루션 연산을 수행하는 경우에 대한 실시 예에 대해서는 도 5 내지 도 8을 참조하여 상술한다.
한편, 본 개시에 따른 전자 장치(100)는 뎁스와이즈 컨볼루션 연산뿐만 아니라 3D 컨볼루션 연산을 수행할 수도 있는바, 도 4a 및 도 4b에 도시된 바와 같은 본 개시에 따른 아키텍처 하에서 3D 컨볼루션 연산을 수행하는 구체적인 과정에 대해서는 도 9 내지 도 11을 참조하여 상술한다.
도 5는 본 개시에 따른 2 차원의 컨볼루션 연산을 수행하기 위한 복수의 모듈을 나타내는 블록도이다. 그리고, 도 6 내지 도 8은 본 개시의 다양한 실시 예에 따른 2 차원의 컨볼루션 연산 과정의 일부를 나타내는 도면이다.
도 5에 도시된 바와 같이, 본 개시에 따른 복수의 모듈은 입력 선택 모듈(121), 복수의 곱셈 모듈(122) 및 중간 값 누적 모듈(123)을 포함할 수 있으며, 특히 중간 값 누적 모듈(123)은 버퍼(123-3)(buffer)를 포함할 수 있다. 여기서, '버퍼(123-3)'는 2 차원의 컨볼루션 연산을 수행하는 과정에서 획득되는 중간 값들 중 2 차원 커널의 행에 대응되는 중간 값들을 저장하는 구성을 말한다.
구체적으로, 도 1 내지 도 4를 참조하여 1 차원의 컨볼루션 연산을 수행하는 경우에는 중간 값 누적 모듈(123)에 포함된 레지스터들에 중간 값들이 저장될 수 있지만, 2 차원의 컨볼루션 연산을 수행하는 경우에는 커널의 행에 대응되는 중간 값들을 저장하는 버퍼(123-3)가 레지스터들과는 별도로 필요할 수 있다. 따라서, 본 개시의 일 실시 예에 따른 프로세서(120)는 버퍼(123-3)를 더 포함할 수 있으며, 버퍼(123-3)는 커널의 행 별로 획득되는 중간 값들 중 일부를 저장하는 용도로 사용될 수 있다. 한편, 도 5에서는 버퍼(123-3)가 중간 값 누적 모듈(123)에 포함된 일 구성인 것으로 도시하였으나, 버퍼(123-3)가 중간 값 누적 모듈(123)과 별개의 구성으로 구현될 수도 있음은 물론이다.
도 6은 1 차원의 컨볼루션 연산을 행 별로 순차적으로 처리하여 2 차원의 컨볼루션 연산에 따른 결과를 획득하는 방법을 설명하기 위한 도면이고, 도 7은 도 6과 같은 연산을 수행하는 경우 본 개시에 따른 복수의 모듈을 포함하는 회로의 동작을 나타내는 도면이다. 한편, 도 8은 2 차원의 커널에 포함된 복수의 가중치의 개수에 대응되는 복수의 곱셈 모듈(122)을 이용하여 2 차원의 컨볼루션 연산에 따른 결과를 획득하는 방법을 설명하기 위한 도면이다.
이하, 도 6 내지 도 8에 대한 설명에서는 커널이 3*3의 크기를 가지며, 따라서 제1 채널에 대응되는 복수의 가중치가 9 개인 경우를 예로 들어 설명한다. 도 6 내지 도 8에 대한 설명 또한 뎁스와이즈 컨볼루션 연산에 대한 설명이므로, 설명의 편의 상 복수의 채널 중 제1 채널에 대응되는 입력 값들에 대한 연산 과정을 중심으로 설명한다.
특히, 도 6에서는 설명의 편의를 위해 복수의 입력 값 중 각각의 행에 대응되는 입력 값들의 집합을 F0, F1, F2 및 F3으로 나타냈으며, 복수의 가중치 중 각각의 행에 대응되는 가중치들의 집합을 K0, K1 및 K2로 나타냈다.
도 6에 도시된 바와 같이, 프로세서(120)는 복수의 곱셈 모듈(122)을 통해 제1 행의 입력 값(F0)과 제1 행의 가중치(K0)의 연산 결과에 따른 제1 중간 값을 획득하고, 획득된 제1 중간 값을 버퍼(123-3)에 저장할 수 있다. 그리고, 프로세서(120)는 복수의 곱셈 모듈(122)을 통해 제2 행의 입력 값(F1)과 제2 행의 가중치(K1)의 연산 결과에 따른 제2 중간 값을 획득하고, 제1 중간 값 누적 모듈(123-1)을 통해 제2 중간 값을 버퍼(123-3)에 저장된 제1 중간 값과 합산하여 그 합산 값을 버퍼(123-3)에 저장할 수 있다. 나아가, 프로세서(120)는 복수의 곱셈 모듈(122)을 통해 제3 행의 입력 값(F2)과 제3 행의 가중치(K2)의 연산 결과에 따른 제3 중간 값을 획득하고, 제3 중간 값을 버퍼(123-3)에 저장된 제1 중간 값과 제2 중간 값의 합산 값과 합산하여 하나의 출력 값(O0)을 획득할 수 있다. 여기서, '하나의 출력 값'이란 2 차원의 커널이 입력 데이터의 매트릭스 상에서 위치하는 각각의 경우에 대응되는 출력 값들 중 하나의 출력 값을 말한다.
제1 행의 출력 값(O0)을 획득하는 과정과 마찬가지로, 프로세서(120)는 제1 중간 값 누적 모듈(123-1)을 통해 제2 행의 입력 값(F1)과 제1 행의 가중치(K0)의 연산 결과에 따른 중간 값, 제3 행의 입력 값(F2)과 제2 행의 가중치(K1)의 연산 결과에 따른 중간 값 및 제4 행의 입력 값(F3)과 제3 행의 가중치(K2)의 연산 결과에 따른 중간 값을 더함으로써, 다른 하나의 출력 값(O1)을 획득할 수 있다.
도 7은 도 6의 연산 중에서도 출력 값(O0)를 획득하는 과정을 보다 상세하게 설명하기 위한 도면으로서, 제1 행(Line 0), 제2 행(Line 1) 및 제3 행(Line 2) 각각에 대한 순차적인 연산을 나타낸다. 각 line별로 수행하는 연산은 도 4a 내지 도 4b에 도시된 바와 동일하나 이 예에서는 제3 행(Line2)의 가중치와의 연산까지 누적해야 한다. 따라서, 각 행의 연산으로 획득하는 중간 값을 다른 행의 연산 결과와 합산하기 위해서 획득한 중간 값을 저장하기 위한 용도로 버퍼(123-3)를 사용한다.
도 7에서는 설명의 편의를 위해 복수의 입력 값 중 각각의 행에 대응되는 입력 값들의 집합을 F0, F1, 및 F2로 나타냈으며, 복수의 가중치 중 각각의 행에 대응되는 가중치들의 집합을 W0,0, W0,1, W0,2, W1,0, W1,1, W1,2, W2,0, W2,1 및 W2,2로 나타냈다. Wm,n의 기호에서 m은 커널의 몇 번째 행의 가중치인지를 나타내는 일련 번호이며, n은 커널의 몇 번째 열의 가중치인지를 나타내는 일련 번호이다. 여기서, W0,0, W0,1 및 W0,2의 가중치들, W1,0, W1,1 및 W1,2의 가중치들 및 W2,0, W2,1 및 W2,2의 가중치들은 각각 다중 채널 형태로 구축되어 제2 커널 정보로서 메모리(110)에 저장될 수 있다.
구체적으로, 제1 채널에 대응되는 복수의 입력 값 중 제1 행의 입력 값 F0가 입력 선택 모듈(121)에 입력되면, 프로세서(120)는 F0가 제1 채널에 대응되는 곱셈 모듈(122)뿐만 아니라, 제1 채널에 인접한 제2 채널 및 제3 채널 각각에 대응되는 곱셈 모듈(122)에도 입력되도록 입력 선택 모듈(121)을 제어할 수 있다. 그리고, 프로세서(120)는 제1 행에 대응되는 복수의 가중치인 W0,0, W0,1 및 W0,2 각각을 제1 채널, 제2 채널 및 제3 채널 각각에 대응되는 세 개의 곱셈 모듈(122) 각각에 하나씩 입력할 수 있다.
제1 채널, 제2 채널 및 제3 채널 각각에 대응되는 세 개의 곱셈 모듈(122) 모두에 입력 값 F0가 입력되고, 세 개의 곱셈 모듈(122) 각각에 가중치 W0,0, W0,1 및 W0,2 가 하나씩 입력되면, 프로세서(120)는 제1 채널에 대응되는 곱셈 모듈(122)을 통해 F0 및 W0,0 간 곱 연산을 수행하여 F0*W0,0라는 중간 값을 획득하고, 제2 채널에 대응되는 곱셈 모듈(122)을 통해 F0 및 W0,1 간 곱 연산을 수행하여 F0*W0,1라는 중간 값을 획득하며, 제3 채널에 대응되는 곱셈 모듈(122)을 통해 F0 및 W0,2 간 곱 연산을 수행하여 F0*W0,2라는 중간 값을 획득할 수 있다. 그리고, 프로세서(120)는 제1 중간 값 누적 모듈(123-1)을 통해 중간 값들을 합산함으로써, 제1 행의 입력 값(F0)에 대응되는 출력 값을 획득할 수 있으며, 제1 행의 입력 값(F0)에 대응되는 출력 값(O0)의 중간 값을 버퍼(123-3)에 저장할 수 있다.
제1 행의 입력 값(F0)에 대응되는 출력 값을 획득하는 과정과 마찬가지로, 제2 행의 입력 값(F1)에 대응되는 출력 값이 획득되면, 프로세서(120)는 제1 중간 값 누적 모듈(123-1)을 통해 제2 행의 입력 값(F1)에 대응되는 출력 값을 버퍼(123-3)에 저장된 중간 값과 합산하여 그 합산 값을 버퍼(123-3)에 저장할 수 있다.
나아가, 제1 행의 입력 값(F0)에 대응되는 출력 값을 획득하는 과정 및 제2 행의 입력 값(F1)에 대응되는 출력 값을 획득하는 과정과 마찬가지로, 제3 행의 입력 값(F2)에 대응되는 출력 값이 획득되면, 프로세서(120)는 제1 중간 값 누적 모듈(123-1)을 통해 제3 행의 입력 값(F2)에 대응되는 출력 값을 버퍼(123-3)에 저장된 합산 값과 합산함으로써, 하나의 출력 값(O0)을 획득할 수 있다.
도 6 및 도 7을 참조하여 상술한 실시 예에 따르면, 전자 장치(100)는 복수의 곱셈 모듈(122)을 병렬적으로 이용하여 1 차원의 컨볼루션 연산을 수행할 수 있으며, 각각의 1 차원의 컨볼루션 연산의 결과를 더함으로써 2 차원의 컨볼루션 연산에 따른 결과를 획득할 수 있다. 이에 따라, 전자 장치(100)는 효율적인 방법으로 2 차원의 컨볼루션 연산을 수행할 수 있게 된다. 상술한 예와 같이 2 차원의 커널에 포함된 가중치의 개수가 9 개이고, 3 개의 가중치에 대한 1 차원의 컨볼루션 연산을 누적하여 출력 값을 획득하는 경우, 전자 장치(100)는 3 배에 달하는 연산 효율의 향상을 달성할 수 있다.
이 때, 전자 장치(100)는 1 차원의 컨볼루션 연산의 결과 각각을 누적적으로 저장하기 위한 하나의 버퍼(123-3)를 추가하는 것만으로도 2 차원의 컨볼루션 연산을 수행할 수 있다는 점에서, 후술하는 도 8의 실시 예에 비해 효율적인 하드웨어 면적을 이용하여 2 차원의 컨볼루션 연산을 수행할 수 있게 된다.
도 8은 2 차원의 커널에 포함된 복수의 가중치의 개수에 대응되는 복수의 곱셈 모듈(122)을 병렬적으로 이용하여, 2 차원의 컨볼루션 연산을 수행하는 방법을 설명하기 위한 도면이다. 도 7에서 가중치 제1 행부터 제3 행까지 순차적으로 연산을 수행하던 방법과는 다르게, 도 8에서는 동일 행의 입력에 대해 가중치의 제1 행부터 제3 행까지 동시에 연산을 수행해서 서로 다른 출력 값(O0, O1, O2)의 중간 값을 동시에 획득할 수 있다. 도 8에서도 도 7의 경우와 마찬가지로, 복수의 가중치 중 각각의 행에 대응되는 가중치들의 집합을 W0,0, W0,1, W0,2, W1,0, W1,1, W1,2, W2,0, W2,1 및 W2,2로 나타냈다. 여기서, W0,0, W0,1, W0,2, W1,0, W1,1, W1,2, W2,0, W2,1 및 W2,2의 가중치들은 1*1*9(가로*세로*뎁스)의 다중 채널 형태로 구축되어, 제2 커널 정보로서 메모리(110)에 저장될 수 있다.
도 6의 (1)에 도시된 바와 같이, 복수의 제1 행 입력 값(F0)이 입력되면, 프로세서(12)는 제1 행의 가중치(K0)와 곱 연산을 수행할 수 있으며, 그 연산 결과에 따른 중간 값은 다른 행의 입력 값 및 가중치와의 연산과 누적하기 위해 버퍼(123-3)에 저장될 수 있다. 이 연산이 도 8의 (1)로 도시된 3개의 채널(Kernel Line 0)의 곱셈 모듈에서 수행될 수 있으며, 연산 결과에 따른 중간 값은 버퍼(123-3)에 저장될 수 있다.
그 다음으로, 도 6의 (2)에서 도시된 바와 같이, 복수의 제2 행의 입력 값(F1)이 입력되면, 프로세서(12)는 도 8의 (2)로 도시된 연산부에서 제2 행의 가중치(K1)와 연산하여 획득한 출력 값을 기 저장한 버퍼 값(F0*K0)과 합산하여 출력 값(O0)을 위한 중간 값을 획득할 수 있다. 이와 동시에, 프로세서(120)는 동일한 입력 값(F1)을 도 6의 (4)와 같이 제1 행의 가중치(K0)와 연산하여 출력 값(O1)을 위한 중간 값을 획득할 수 있다. 즉, 도 8의 (1) 및 (2) 연산회로가 동시에 동작할 수 있다. 여기서, 제2 행의 가중치(K1)에 대응되는 출력 값이 저장되는 버퍼(123-3)는 제1 행의 가중치(K0)에 대응되는 출력 값이 저장되는 버퍼(123-3)와 상이할 수 있다.
다음으로, 복수의 제3 행의 입력 값(F2)이 입력되면, 프로세서(120)은 도 6의 (3)과 같이 제3 행의 가중치(K2)와 연산하여 획득한 결과를 기 저장한 버퍼 값과 합산하여 출력 값(O0)를 획득할 수 있다. 이 연산부가 도 8의 (3)에 해당한다. 이와 동시에 도 8의 (2) 및 (1)은 서로 다른 출력 값(O1 및 O2)을 계산하기 위해 제2 행 가중치(K1) 및 제1 행 가중치(K0)와 각각 연산하여 획득한 중간 값 결과를 버퍼(123-3)에 저장할 수 있다.
한편, 이상에서는 프로세서(120)가 커널의 행에 대응되는 중간 값들을 획득하여 버퍼(123-3)에 저장하고, 행 별로 획득된 중간 값들을 열 방향으로 누적함으로써 2 차원의 컨볼루션 연산을 수행하는 것을 전제로 설명하였으나, 다른 실시 예에 따르면, 프로세서(120)는 커널의 열에 대응되는 중간 값들을 획득하여 버퍼(123-3)에 저장하고, 열 별로 획득된 중간 값들을 행 방향으로 누적함으로써 2 차원의 컨볼루션 연산을 수행할 수도 있다.
도 8을 참조하여 상술한 실시 예에 따르면, 전자 장치(100)는 2 차원의 커널에 포함된 가중치의 개수만큼의 곱셈 모듈(122)을 병렬적으로 이용하여, 2 차원의 컨볼루션 연산 과정을 효율적으로 수행할 수 있게 된다. 구체적으로, 상술한 예와 같이 2 차원의 커널에 포함된 가중치의 개수가 9 개인 경우, 전자 장치(100)는 9 배에 달하는 연산 효율의 향상을 달성할 수 있다.
도 9는 본 개시에 따른 3D 컨볼루션 연산을 수행하기 위한 복수의 모듈을 나타내는 블록도이다. 그리고, 도 10 및 도 11은 본 개시의 다양한 실시 예에 따른 3D 컨볼루션 연산 과정의 일부를 나타내는 도면이다.
이상에서는 뎁스와이즈 컨볼루션 연산을 수행하는 경우를 전제로 본 개시의 다양한 실시 예를 설명하였으나, 전술한 바와 같이, 프로세서(120)는 본 개시에 따른 복수의 모듈을 이용하여 3D 컨볼루션 연산을 수행할 수도 있다.
도 9에 도시된 바와 같이, 본 개시에 따른 복수의 모듈은 입력 선택 모듈(121), 복수의 곱셈 모듈(122) 및 중간 값 누적 모듈(123)을 포함할 수 있으며, 특히 중간 값 누적 모듈(123)은 제1 중간 값 누적 모듈(123-1) 및 제2 중간 값 누적 모듈(123-2)을 포함할 수 있다. 여기서, '제1 중간 값 누적 모듈(123-1)'은 도 1 내지 도 8을 참조하여 상술한 바와 같은 뎁스와이즈 컨볼루션 연산 과정에서 획득되는 중간 값들을 합산하여 출력 값을 획득하는 모듈을 말하며, '제2 중간 값 누적 모듈(123-2)'은 3D 컨볼루션 연산 과정에서 획득되는 중간 값들을 합산하여 출력 값을 획득하는 모듈을 말한다. 본 개시에 따른 제2 중간 값 누적 모듈(123-2)은 소위 Adder Tree라고 지칭할 수 있다. 즉, 도 10의 Adder Tree라고 표시된 구성은 본 개시에 따른 제2 중간 값 누적 모듈(123-2)을 나타낸다.
3D 컨볼루션 연산에서는 3 차원의 입력 데이터에 포함된 입력 값들과 3 차원의 커널에 포함된 가중치들 사이의 연산을 수행하기 때문에, 복수의 채널 각각에 대응되는 복수의 곱셈 모듈(122)을 모두 이용한다. 구체적으로, 3D 컨볼루션 연산에서는 입력 데이터에 포함된 입력 값들 중 행과 열이 동일하고 뎁스가 상이한 입력 값들의 집합과 커널에 포함된 가중치들 중 행과 열이 동일하고 뎁스가 상이한 가중치들의 집합 사이에 컨볼루션 연산이 수행된다. 따라서, 3D 컨볼루션 연산에서는 가중치들을 복수의 곱셈 모듈(122)에 입력함에 있어서, 다중 채널 형태로 변환된 제2 커널 정보가 아니라, 제1 커널 정보가 이용될 수 있다.
구체적으로, 도 10은 3D 컨볼루션 연산을 수행하는 경우 T0 내지 T5 시점에서 입력 값 및 가중치를 바탕으로 출력 값을 획득하는 과정을 나타내는 도면이고, 도 11은 도 10과 같은 연산을 수행하는 경우 본 개시에 따른 복수의 모듈을 포함하는 회로의 동작을 나타내는 도면이다. 특히, 도 10 및 도 11에 대한 설명에서는 3 차원의 커널이 3*1*64(가로*세로*뎁스)의 크기를 가지는 경우를 예로 들어 설명한다. 도 10에서는 설명의 편의를 위해 입력 데이터에 포함된 입력 값들 중 행과 열이 동일하고 뎁스가 상이한 입력 값들의 집합을 각각 F0, F1, F2 및 F3로 나타냈으며, 커널에 포함된 가중치들 중 행과 열이 동일하고 뎁스가 상이한 가중치들의 집합을 각각 W0, W1 및 W2로 나타냈다.
T0 시점에, 프로세서(120)는 F0에 포함된 입력 값들이 각각의 입력 값에 대응되는 채널의 곱셈 모듈(122)에 입력되도록 입력 선택 모듈(121)을 제어할 수 있다. 즉, 프로세서(120)는 F0에 포함된 입력 값들 중 제1 채널에 대응되는 입력 값이 제1 채널에 대응되는 곱셈 모듈(122)에 입력되고, 제2 채널에 대응되는 입력 값이 제2 채널에 대응되는 곱셈 모듈(122)에 입력되는 것과 같이, 복수의 채널 별 입력 값을 그에 대응되는 채널의 곱셈 모듈(122)에 입력되도록 입력 선택 모듈(121)을 제어할 수 있다.
또한, 프로세서(120)는 W0에 포함된 가중치들을 각각의 가중치에 대응되는 채널의 곱셈 모듈(122)에 입력할 수 있다. 예를 들어, 프로세서(120)는 W0에 포함된 가중치들 중 제1 채널에 대응되는 가중치를 제1 채널에 대응되는 곱셈 모듈(122)에 입력하고, 제2 채널에 대응되는 가중치를 제2 채널에 대응되는 곱셈 모듈(122)에 입력하는 것과 같이, 복수의 채널 별 가중치를 그에 대응되는 채널의 곱셈 모듈(122)에 입력할 수 있다.
F0에 포함된 입력 값들 및 W0에 포함된 가중치들이 복수의 곱셈 모듈(122)에 입력되면, 프로세서(120)는 제1 채널에 대응되는 곱셈 모듈(122)을 통해 F0에 포함된 제1 채널의 입력 값(F0(0))과 W0에 포함된 제1 채널의 가중치(W0(0))의 곱 연산 결과에 따른 제1 중간 값을 획득하고, 제2 채널에 대응되는 곱셈 모듈(122)을 통해 F0에 포함된 제2 채널의 입력 값(F0(1))과 W0에 포함된 제2 채널의 가중치(W0(1))의 곱 연산 결과에 따른 제2 중간 값을 획득하며, 마찬가지 방법으로 제3 채널 내지 제64 채널 각각에 대응되는 중간 값들을 획득할 수 있다.
제1 채널 내지 제64 채널 각각에 대응되는 중간 값들이 획득되면, 프로세서(120)는 제2 중간 값 모듈을 통해 제1 채널 내지 제64 채널 각각에 대응되는 중간 값들을 합산하여, 합산 결과에 따른 제1 합산 값(O0(1))을 획득할 수 있다.
그리고 T1 시점에, 프로세서(120)는 제1 출력 값(O0(1))을 획득하는 과정과 마찬가지로, 제2 합산 값(O0(2))을 획득하고, 제1 합산 값(O0(1)) 및 제2 합산 값(O0(2))을 합산하여, 합산 결과에 따른 합산 값(O0(1~2)을 획득할 수 있다.
나아가 T2 시점에, 프로세서(120)는 제1 합산 값(O0(1)) 및 제2 합산 값(O0(2))을 획득하는 과정과 마찬가지로, 제3 합산 값(O0(3))을 획득하고, 제1 합산 값(O0(1)), 제2 합산 값(O0(2)) 및 제3 합산 값(O0(3))을 합산하여, 합산 결과에 따른 하나의 출력 값(O0)을 획득할 수 있다. 여기서, 하나의 출력 값이란 3 차원의 커널이 입력 데이터의 매트릭스 상에서 위치하는 각각의 경우에 대응되는 출력 값들 중 하나의 출력 값을 말한다.
도 9 내지 도 11을 참조하여 상술한 실시 예에 따르면, 전자 장치(100)는 하나의 하드웨어 구조 하에서, 효율적으로 뎁스와이즈 컨볼루션 연산을 수행할 수 있을 뿐만 아니라, 3D 컨볼루션 연산 또한 수행할 수 있게 된다.
도 12는 본 개시의 일 실시 예에 따른 전자 장치의 제어 방법을 나타내는 흐름도이다.
전술한 바와 같이, 전자 장치(100)는 입력 데이터에 포함된 입력 값들 및 커널에 포함된 가중치들을 바탕으로 컨볼루션(convolution) 연산을 수행할 수 있다. 특히, 전자 장치(100)는 본 개시에 따른 입력 선택 모듈(121), 복수의 곱셈 모듈(122) 및 중간 값 누적 모듈(123)을 이용하여, 뎁스와이즈(depthwise) 컨볼루션 연산 및 3D 컨볼루션 연산을 수행할 수 있다.
도 12를 참조하면, 전자 장치(100)는 수행하고자 하는 컨볼루션 연산이 뎁스와이즈 컨볼루션 연산인지 여부를 식별할 수 있다(S1210).
수행하고자 하는 컨볼루션 연산이 뎁스와이즈 컨볼루션 연산인 경우(S1210-Y), 전자 장치(100)는 입력 데이터를 구분하는 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 복수의 곱셈 모듈(122) 중 두 개 이상의 곱셈 모듈(122) 모두에 입력되도록 입력 선택 모듈(121)을 제어할 수 있다(S1220). 다시 말해, 종래 기술에 따른 뎁스와이즈 컨볼루션 연산에서 제1 채널에 대응되는 입력 값들을 제1 채널에 대응되는 곱셈 모듈(122)에만 입력하는 것과는 달리, 본 개시에 따른 전자 장치(100)는 제1 채널에 대응되는 복수의 입력 각각이 입력 선택 모듈(121)에 입력될 때마다, 그 입력 값이 커널에 포함된 복수의 가중치의 개수만큼의 곱셈 모듈(122) 모두에 입력되도록 입력 선택 모듈(121)을 제어할 수 있다.
전자 장치(100)는 제1 채널에 대응되는 복수의 가중치를 두 개 이상의 곱셈 모듈(122)에 하나씩 입력할 수 있다(S1230). 다시 말해, 종래 기술에 따른 뎁스와이즈 컨볼루션 연산에서는 제1 채널에 대응되는 복수의 가중치를 제1 채널에 대응되는 곱셈 모듈(122)에만 입력하는 것과 달리, 본 개시에 따른 전자 장치(100)는 다중 채널 형태의 제2 커널 정보를 바탕으로 제1 채널에 대응되는 복수의 가중치를 두 개 이상의 곱셈 모듈(122)에 하나씩 입력할 수 있다.
전자 장치(100)는 두 개 이상의 곱셈 모듈(122)을 통해 복수의 입력 값 마다 복수의 가중치 각각과의 곱 연산을 수행하여, 곱 연산 결과 각각에 따른 복수의 중간 값을 획득할 수 있다(S1240). 그리고, 전자 장치(100)는 제1 중간 값 누적 모듈(123-1)을 통해 복수의 중간 값 중 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 합산 결과 각각에 따른 복수의 출력 값을 획득할 수 있다(S1250).
이상에서는 본 개시에 따른 전자 장치(100)의 제어 방법의 각 단계에 대해 간략하게 설명하였으나, 이는 동일한 내용에 대한 중복 설명을 생략하기 위한 것일 뿐, 프로세서(120)에 의한 제어 과정에 관련된 다양한 실시 예들은 전자 장치(100)의 제어 방법에 대해서도 마찬가지로 적용될 수 있음은 물론이다.
한편, 상술한 실시 예에 따른 전자 장치(100)의 제어 방법은 프로그램으로 구현되어 전자 장치(100)에 제공될 수 있다. 특히, 전자 장치(100)의 제어 방법을 포함하는 프로그램은 비일시적 판독 가능 매체(non-transitory computer readable medium)에 저장되어 제공될 수 있다.
구체적으로, 전자 장치(100)의 제어 방법을 실행하는 프로그램을 포함하는 비일시적 컴퓨터 판독 가능 기록매체에 있어서, 전자 장치(100)의 제어 방법은 컨볼루션 연산이 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 입력 데이터를 구분하는 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값 각각이 복수의 채널 중 두 개 이상의 채널 각각에 대응되는 복수의 곱셈 모듈(122) 모두에 입력되도록 입력 선택 모듈(121)을 제어하는 단계, 제1 채널에 대응되는 복수의 가중치 각각을 복수의 곱셈 모듈(122)에 하나씩 입력하는 단계, 복수의 곱셈 모듈(122)을 통해 복수의 입력 값 마다 복수의 가중치 각각과의 곱 연산을 수행하여, 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하는 단계 및 제1 중간 값 누적 모듈(123-1)을 통해 복수의 중간 값 중 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 합산 결과 각각에 따른 복수의 출력 값을 획득하는 단계를 포함할 수 있다.
여기서, 비일시적 판독 가능 매체란 레지스터, 캐쉬, 메모리(110) 등과 같이 짧은 순간 동안 데이터를 저장하는 매체가 아니라 반영구적으로 데이터를 저장하며, 기기에 의해 판독(reading)이 가능한 매체를 의미한다. 구체적으로는, 상술한 다양한 어플리케이션 또는 프로그램들은 CD, DVD, 하드 디스크, 블루레이 디스크, USB, 메모리(110)카드, ROM 등과 같은 비일시적 판독 가능 매체에 저장되어 제공될 수 있다.
이상에서 전자 장치(100)의 제어 방법, 그리고 전자 장치(100)의 제어 방법을 실행하는 프로그램을 포함하는 컴퓨터 판독 가능 기록매체에 대해 간략하게 설명하였으나, 이는 중복 설명을 생략하기 위한 것일 뿐이며, 전자 장치(100)에 대한 다양한 실시 예는 전자 장치(100)의 제어 방법, 그리고 전자 장치(100)의 제어 방법을 실행하는 프로그램을 포함하는 컴퓨터 판독 가능 기록매체에 대해서도 적용될 수 있음은 물론이다.
상술한 바와 같은 본 개시의 다양한 실시 예에 따르면, 전자 장치는 특히 뎁스와이즈 컨볼루션 연산의 과정을 효율적으로 수행할 수 있게 된다.
한편, 이상에서 상술한 바와 같은 신경망 모델 및 컨볼루션 연산 과정에 관련된 기능은 메모리(110) 및 프로세서(120)를 통해 수행될 수 있다.
프로세서(120)는 하나 또는 복수의 프로세서(120)로 구성될 수 있다. 이때, 하나 또는 복수의 프로세서(120)는 CPU, AP 등과 같은 범용 프로세서(120), GPU, VPU 등과 같은 그래픽 전용 프로세서(120) 또는 NPU, MPU 등과 같은 인공 지능 전용 프로세서(120)일 수 있다.
하나 또는 복수의 프로세서(120)는, 비휘발성 메모리(110) 및 휘발성 메모리(110)에 저장된 기 정의된 동작 규칙 또는 인공 지능 모델에 따라, 입력 데이터를 처리하도록 제어한다. 기 정의된 동작 규칙 또는 인공 지능 모델은 학습을 통해 만들어진 것을 특징으로 한다.
여기서, 학습을 통해 만들어진다는 것은, 다수의 학습 데이터들에 학습 알고리즘을 적용함으로써, 원하는 특성의 기 정의된 동작 규칙 또는 인공 지능 모델이 만들어짐을 의미한다. 이러한 학습은 본 개시에 따른 인공 지능이 수행되는 기기 자체에서 이루어질 수도 있고, 별도의 서버/시스템을 통해 이루어 질 수도 있다.
인공 지능 모델은, 복수의 신경망 레이어들로 구성될 수 있다. 각 레이어는 복수의 가중치(weight values)을 갖고 있으며, 이전(previous) 레이어의 연산 결과와 복수의 가중치의 연산을 통해 레이어의 연산을 수행한다. 신경망의 예로는, CNN (Convolutional Neural Network), DNN (Deep Neural Network), RNN (Recurrent Neural Network), RBM (Restricted Boltzmann Machine), DBN (Deep Belief Network), BRDNN(Bidirectional Recurrent Deep Neural Network), GAN(Generative Adversarial Networks) 및 심층 Q-네트워크 (Deep Q-Networks)이 있으며, 본 개시에서의 신경망은 명시한 경우를 제외하고 전술한 예에 한정되지 않는다.
학습 알고리즘은, 다수의 학습 데이터들을 이용하여 소정의 대상 기기(예컨대, 로봇)을 훈련시켜 소정의 대상 기기 스스로 결정을 내리거나 예측을 할 수 있도록 하는 방법이다. 학습 알고리즘의 예로는, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)이 있으며, 본 개시에서의 학습 알고리즘은 명시한 경우를 제외하고 전술한 예에 한정되지 않는다.
기기로 읽을 수 있는 저장매체는, 비일시적(non-transitory) 저장매체의 형태로 제공될 수 있다. 여기서, '비일시적 저장매체'는 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다. 예로, '비일시적 저장매체'는 데이터가 임시적으로 저장되는 버퍼(123-3)를 포함할 수 있다.
일 실시 예에 따르면, 본 문서에 개시된 다양한 실시 예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory (CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 또는 두개의 사용자 장치들(예: 스마트폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품(예: 다운로더블 앱(downloadable app))의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리(110)와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.
이상에서 상술한 바와 같은 본 개시의 다양한 실시 예들에 따른 구성 요소(예: 모듈 또는 프로그램) 각각은 단수 또는 복수의 개체로 구성될 수 있으며, 전술한 해당 서브 구성 요소들 중 일부 서브 구성 요소가 생략되거나, 또는 다른 서브 구성 요소가 다양한 실시 예에 더 포함될 수 있다. 대체적으로 또는 추가적으로, 일부 구성 요소들(예: 모듈 또는 프로그램)은 하나의 개체로 통합되어, 통합되기 이전의 각각의 해당 구성 요소에 의해 수행되는 기능을 동일 또는 유사하게 수행할 수 있다.
다양한 실시 예들에 따른, 모듈, 프로그램 또는 다른 구성 요소에 의해 수행되는 동작들은 순차적, 병렬적, 반복적 또는 휴리스틱하게 실행되거나, 적어도 일부 동작이 다른 순서로 실행되거나, 생략되거나, 또는 다른 동작이 추가될 수 있다.
한편, 본 개시에서 사용된 용어 "부" 또는 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구성된 유닛을 포함하며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로 등의 용어와 상호 호환적으로 사용될 수 있다. "부" 또는 "모듈"은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 모듈은 ASIC(application-specific integrated circuit)으로 구성될 수 있다.
본 개시의 다양한 실시 예들은 기기(machine)(예: 컴퓨터)로 읽을 수 있는 저장 매체(machine-readable storage media에 저장된 명령어를 포함하는 소프트웨어로 구현될 수 있다. 기기는 저장 매체로부터 저장된 명령어를 호출하고, 호출된 명령어에 따라 동작이 가능한 장치로서, 개시된 실시 예들에 따른 전자 장치(100)(예: 전자 장치(100))를 포함할 수 있다.
상기 명령이 프로세서에 의해 실행될 경우, 프로세서가 직접 또는 상기 프로세서의 제어 하에 다른 구성요소들을 이용하여 상기 명령에 해당하는 기능을 수행할 수 있다. 명령은 컴파일러 또는 인터프리터에 의해 생성 또는 실행되는 코드를 포함할 수 있다.
이상에서는 본 개시의 바람직한 실시 예에 대하여 도시하고 설명하였지만, 본 개시는 상술한 특정의 실시 예에 한정되지 아니하며, 청구범위에서 청구하는 본 개시의 요지를 벗어남이 없이 당해 개시가 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형실시들은 본 개시의 기술적 사상이나 전망으로부터 개별적으로 이해되어서는 안 될 것이다.

Claims (15)

  1. 전자 장치에 있어서,
    복수의 채널에 따라 구분되는 입력 값들을 포함하는 3 차원의 입력 데이터, 상기 복수의 채널 별 가중치들을 포함하는 커널(kernel)에 대한 제1 커널 정보 및 상기 복수의 채널 별 가중치들이 상기 복수의 채널의 방향으로 배치되도록 변환된 제2 커널 정보를 저장하는 메모리; 및
    상기 복수의 채널에 대응되는 복수의 곱셈 모듈을 포함하고, 상기 복수의 곱셈 모듈을 통해 상기 입력 값들 및 상기 가중치들을 바탕으로 컨볼루션(convolution) 연산을 수행하는 프로세서; 를 포함하고,
    상기 프로세서는,
    상기 컨볼루션 연산이 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 상기 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 상기 복수의 곱셈 모듈 중 두 개 이상의 곱셈 모듈 모두에 입력되도록 입력 선택 모듈을 제어하고,
    상기 제2 커널 정보를 바탕으로 상기 제1 채널에 대응되는 복수의 가중치를 상기 두 개 이상의 곱셈 모듈에 하나씩 입력하며,
    상기 두 개 이상의 곱셈 모듈을 통해 상기 복수의 입력 값 마다 상기 복수의 가중치 각각과의 곱 연산을 수행하여, 상기 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하고,
    제1 중간 값 누적 모듈을 통해 상기 복수의 중간 값 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 합산 결과 각각에 따른 복수의 출력 값을 획득하는 전자 장치.
  2. 제1 항에 있어서,
    상기 제1 채널에 대응되는 복수의 입력 값 각각은 기 설정된 사이클마다 상기 입력 선택 모듈에 입력되고,
    상기 입력 선택 모듈은 상기 기 설정된 사이클마다 입력되는 입력 값 각각을 상기 두 개 이상의 곱셈 모듈 모두에 전송하는 전자 장치.
  3. 제1 항에 있어서,
    상기 두 개 이상의 채널은 상기 제1 채널 및 상기 제1 채널에 인접한 적어도 하나의 채널을 포함하며,
    상기 두 개 이상의 곱셈 모듈의 개수는 상기 제1 커널에 포함된 복수의 가중치의 개수에 대응되는 전자 장치.
  4. 제1 항에 있어서,
    상기 커널은 2 차원의 커널이고,
    상기 프로세서는,
    상기 복수의 중간 값들 중 상기 커널의 행에 대응되는 중간 값들을 저장하는 버퍼를 더 포함하며,
    상기 제1 중간 값 누적 모듈을 통해 상기 버퍼에 저장된 중간 값들 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 복수의 출력 값을 획득하는 전자 장치.
  5. 제4 항에 있어서,
    상기 프로세서는,
    상기 커널에 포함된 복수의 가중치의 개수에 대응되는 두 개 이상의 곱셈 모듈을 병렬적으로 이용하여 상기 컨볼루션 연산을 수행함으로써, 상기 복수의 출력 값을 획득하는 전자 장치.
  6. 제2 항에 있어서,
    상기 프로세서는,
    상기 컨볼루션 연산이 3D 컨볼루션 연산인 경우, 상기 입력 선택 모듈에 입력되는 입력 값들을 상기 복수의 곱셈 모듈로 바이패스(bypass)하도록 상기 입력 선택 모듈을 제어하고,
    상기 제1 커널 정보를 바탕으로 상기 복수의 곱셈 모듈 각각에 대응되는 복수의 가중치를 상기 복수의 곱셈 모듈에 입력하는 전자 장치.
  7. 제6 항에 있어서,
    상기 프로세서는,
    상기 복수의 곱셈 모듈을 통해 각각 획득된 복수의 채널 별 중간 값들을 합산하는 제2 중간 값 누적 모듈을 더 포함하는 전자 장치.
  8. 전자 장치의 제어 방법에 있어서,
    상기 전자 장치는,
    복수의 채널에 대응되는 복수의 곱셈 모듈을 통해, 상기 복수의 채널에 따라 구분되는 입력 값들을 포함하는 3 차원의 입력 데이터, 상기 복수의 채널 별 가중치들을 포함하는 커널(kernel)에 대한 제1 커널 정보 및 상기 복수의 채널 별 가중치들이 상기 복수의 채널의 방향으로 배치되도록 변환된 제2 커널 정보를 바탕으로 컨볼루션(convolution) 연산을 수행하고,
    상기 전자 장치의 제어 방법은,
    상기 컨볼루션 연산이 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 상기 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 상기 복수의 곱셈 모듈 중 두 개 이상의 곱셈 모듈 모두에 입력되도록 입력 선택 모듈을 제어하는 단계;
    상기 커널에 대한 정보를 바탕으로 상기 제1 채널에 대응되는 복수의 가중치를 상기 두 개 이상의 곱셈 모듈에 하나씩 입력하는 단계;
    상기 두 개 이상의 곱셈 모듈을 통해 상기 복수의 입력 값 마다 상기 복수의 가중치 각각과의 곱 연산을 수행하여, 상기 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하는 단계; 및
    제1 중간 값 누적 모듈을 통해 상기 복수의 중간 값 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 합산 결과 각각에 따른 복수의 출력 값을 획득하는 단계; 를 포함하는 전자 장치의 제어 방법.
  9. 제8 항에 있어서,
    상기 제1 채널에 대응되는 복수의 입력 값 각각은 기 설정된 사이클마다 상기 입력 선택 모듈에 입력되고,
    상기 입력 선택 모듈은 상기 기 설정된 사이클마다 입력되는 입력 값 각각을 상기 두 개 이상의 곱셈 모듈 모두에 전송하는 전자 장치의 제어 방법.
  10. 제8 항에 있어서,
    상기 두 개 이상의 채널은 상기 제1 채널 및 상기 제1 채널에 인접한 적어도 하나의 채널을 포함하며,
    상기 두 개 이상의 곱셈 모듈의 개수는 상기 제1 커널에 포함된 복수의 가중치의 개수에 대응되는 전자 장치의 제어 방법.
  11. 제8 항에 있어서,
    상기 커널은 2 차원의 커널이고,
    상기 전자 장치는 상기 복수의 중간 값들 중 상기 커널의 행에 대응되는 중간 값들을 저장하는 버퍼를 더 포함하며,
    상기 전자 장치의 제어 방법은,
    상기 제1 중간 값 누적 모듈을 통해 상기 버퍼에 저장된 중간 값들 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 복수의 출력 값을 획득하는 단계; 를 더 포함하는 전자 장치의 제어 방법.
  12. 제11 항에 있어서,
    상기 전자 장치의 제어 방법은,
    상기 커널에 포함된 복수의 가중치의 개수에 대응되는 두 개 이상의 곱셈 모듈을 병렬적으로 이용하여 상기 컨볼루션 연산을 수행함으로써, 상기 복수의 출력 값을 획득하는 단계; 를 더 포함하는 전자 장치의 제어 방법.
  13. 제9 항에 있어서,
    상기 전자 장치의 제어 방법은,
    상기 컨볼루션 연산이 3D 컨볼루션 연산인 경우, 상기 입력 선택 모듈에 입력되는 입력 값들을 상기 복수의 곱셈 모듈로 바이패스(bypass)하도록 상기 입력 선택 모듈을 제어하는 단계; 및
    상기 제1 커널 정보를 바탕으로 상기 복수의 곱셈 모듈 각각에 대응되는 복수의 가중치를 상기 복수의 곱셈 모듈에 입력하는 단계; 를 더 포함하는 전자 장치의 제어 방법.
  14. 제13 항에 있어서,
    상기 전자 장치는,
    상기 복수의 곱셈 모듈을 통해 각각 획득된 복수의 채널 별 중간 값들을 합산하는 제2 중간 값 누적 모듈을 더 포함하는 전자 장치의 제어 방법.
  15. 전자 장치의 제어 방법을 실행하는 프로그램을 포함하는 비일시적 컴퓨터 판독 가능 기록매체에 있어서,
    상기 전자 장치는,
    복수의 채널에 대응되는 복수의 곱셈 모듈을 통해, 상기 복수의 채널에 따라 구분되는 입력 값들을 포함하는 3 차원의 입력 데이터, 상기 복수의 채널 별 가중치들을 포함하는 커널(kernel)에 대한 제1 커널 정보 및 상기 복수의 채널 별 가중치들이 상기 복수의 채널의 방향으로 배치되도록 변환된 제2 커널 정보를 바탕으로 컨볼루션(convolution) 연산을 수행하고,
    상기 전자 장치의 제어 방법은,
    상기 컨볼루션 연산이 뎁스와이즈(depthwise) 컨볼루션 연산인 경우, 상기 복수의 채널 중 제1 채널에 대응되는 복수의 입력 값이 상기 복수의 곱셈 모듈 중 두 개 이상의 곱셈 모듈 모두에 입력되도록 입력 선택 모듈을 제어하는 단계;
    상기 제2 커널 정보를 바탕으로 상기 제1 채널에 대응되는 복수의 가중치를 상기 두 개 이상의 곱셈 모듈에 하나씩 입력하는 단계;
    상기 두 개 이상의 곱셈 모듈을 통해 상기 복수의 입력 값 마다 상기 복수의 가중치 각각과의 곱 연산을 수행하여, 상기 곱 연산 결과 각각에 따른 복수의 중간 값을 획득하는 단계; 및
    제1 중간 값 누적 모듈을 통해 상기 복수의 중간 값 중 상기 커널의 위치 각각에 대응되는 중간 값들을 합산하여, 상기 합산 결과 각각에 따른 복수의 출력 값을 획득하는 단계; 를 포함하는 컴퓨터 판독 가능 기록매체.
PCT/KR2021/013802 2020-10-15 2021-10-07 전자 장치 및 전자 장치의 제어 방법 WO2022080758A1 (ko)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202180070522.7A CN116368496A (zh) 2020-10-15 2021-10-07 电子设备和电子设备的控制方法
EP21880405.2A EP4191477A4 (en) 2020-10-15 2021-10-07 ELECTRONIC DEVICE AND CONTROL METHOD FOR ELECTRONIC DEVICE
US18/120,241 US20230214445A1 (en) 2020-10-15 2023-03-10 Electronic device and control method for electronic device

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR20200133509 2020-10-15
KR10-2020-0133509 2020-10-15
KR1020210005465A KR20220050013A (ko) 2020-10-15 2021-01-14 전자 장치 및 전자 장치의 제어 방법
KR10-2021-0005465 2021-01-14

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/120,241 Continuation US20230214445A1 (en) 2020-10-15 2023-03-10 Electronic device and control method for electronic device

Publications (1)

Publication Number Publication Date
WO2022080758A1 true WO2022080758A1 (ko) 2022-04-21

Family

ID=81208458

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2021/013802 WO2022080758A1 (ko) 2020-10-15 2021-10-07 전자 장치 및 전자 장치의 제어 방법

Country Status (4)

Country Link
US (1) US20230214445A1 (ko)
EP (1) EP4191477A4 (ko)
CN (1) CN116368496A (ko)
WO (1) WO2022080758A1 (ko)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170128080A (ko) * 2016-05-13 2017-11-22 삼성전자주식회사 신경 네트워크를 구현하는 방법 및 장치
US20190347537A1 (en) * 2016-11-15 2019-11-14 Google Llc Efficient Convolutional Neural Networks and Techniques to Reduce Associated Computational Costs
KR20200072666A (ko) * 2018-12-13 2020-06-23 서울대학교산학협력단 합성곱 계층의 선택적 데이터 처리 방법 및 이를 이용한 뉴럴 프로세서
KR20200091623A (ko) * 2019-01-23 2020-07-31 삼성전자주식회사 위노그라드 변환에 기반한 뉴럴 네트워크의 컨볼루션 연산을 수행하는 방법 및 장치

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170128080A (ko) * 2016-05-13 2017-11-22 삼성전자주식회사 신경 네트워크를 구현하는 방법 및 장치
US20190347537A1 (en) * 2016-11-15 2019-11-14 Google Llc Efficient Convolutional Neural Networks and Techniques to Reduce Associated Computational Costs
KR20200072666A (ko) * 2018-12-13 2020-06-23 서울대학교산학협력단 합성곱 계층의 선택적 데이터 처리 방법 및 이를 이용한 뉴럴 프로세서
KR20200091623A (ko) * 2019-01-23 2020-07-31 삼성전자주식회사 위노그라드 변환에 기반한 뉴럴 네트워크의 컨볼루션 연산을 수행하는 방법 및 장치

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HAASE DANIEL; AMTHOR MANUEL: "Rethinking Depthwise Separable Convolutions: How Intra-Kernel Correlations Lead to Improved MobileNets", 2020 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR), 13 June 2020 (2020-06-13), pages 14588 - 14597, XP033805317, DOI: 10.1109/CVPR42600.2020.01461 *
See also references of EP4191477A4 *

Also Published As

Publication number Publication date
EP4191477A1 (en) 2023-06-07
US20230214445A1 (en) 2023-07-06
EP4191477A9 (en) 2024-01-24
EP4191477A4 (en) 2024-01-24
CN116368496A (zh) 2023-06-30

Similar Documents

Publication Publication Date Title
WO2019098538A1 (en) Device and method for processing convolution operation using kernel
WO2019164251A1 (en) Method of performing learning of deep neural network and apparatus thereof
WO2019164237A1 (ko) 시스톨릭 배열을 이용하여 딥 러닝 연산을 수행하는 방법 및 장치
WO2020050478A1 (en) Computing apparatus using convolutional neural network and method of operating the same
WO2020180084A1 (ko) 타겟 이미지의 채색 완성 방법, 장치 및 컴퓨터 프로그램
WO2019216513A1 (ko) 행 단위 연산 뉴럴 프로세서 및 이를 이용한 데이터 처리 방법
CN108681773B (zh) 数据运算的加速方法、装置、终端及可读存储介质
WO2020231035A1 (en) Image processing apparatus and operating method of the same
WO2020055181A1 (ko) 영상 처리 장치 및 그 동작방법
WO2022085958A1 (ko) 전자 장치 및 그 동작방법
WO2022005157A1 (en) Electronic device and controlling method of electronic device
WO2022080758A1 (ko) 전자 장치 및 전자 장치의 제어 방법
WO2019074185A1 (en) ELECTRONIC APPARATUS AND CONTROL METHOD THEREOF
WO2024014706A1 (ko) 화질 개선을 수행하는 신경망 모델을 학습시키는 전자 장치 및 그 제어 방법
WO2021221256A1 (ko) 전자 장치 및 그의 제어 방법
WO2018101607A1 (ko) 벡터 프로세서 및 그 제어 방법
WO2023177108A1 (en) Method and system for learning to share weights across transformer backbones in vision and language tasks
WO2019198900A1 (en) Electronic apparatus and control method thereof
WO2023022321A1 (ko) 분산 학습용 서버 및 분산 학습 방법
WO2022177091A1 (ko) 전자 장치 및 이의 제어 방법
WO2021177617A1 (en) Electronic apparatus and method for controlling thereof
WO2023008797A1 (ko) 전자 장치 및 전자 장치의 제어 방법
WO2023013817A1 (ko) 브로드캐스팅 멀티플라이 최적화 방법 및 이를 이용한 하드웨어 가속기, 이를 이용한 컴퓨팅 장치
WO2022186499A1 (ko) 영상 처리 장치 및 그 동작방법
WO2015080440A1 (en) Method and processor for executing instructions, method and apparatus for encoding instructions, and recording medium therefor

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: 21880405

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021880405

Country of ref document: EP

Effective date: 20230228

NENP Non-entry into the national phase

Ref country code: DE