WO2023042989A1 - Add operation method considering data scale, hardware accelerator therefor, and computing device using same - Google Patents

Add operation method considering data scale, hardware accelerator therefor, and computing device using same Download PDF

Info

Publication number
WO2023042989A1
WO2023042989A1 PCT/KR2022/006216 KR2022006216W WO2023042989A1 WO 2023042989 A1 WO2023042989 A1 WO 2023042989A1 KR 2022006216 W KR2022006216 W KR 2022006216W WO 2023042989 A1 WO2023042989 A1 WO 2023042989A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
convolution
input
output
scale
Prior art date
Application number
PCT/KR2022/006216
Other languages
French (fr)
Korean (ko)
Inventor
정태영
Original Assignee
오픈엣지테크놀로지 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 오픈엣지테크놀로지 주식회사 filed Critical 오픈엣지테크놀로지 주식회사
Publication of WO2023042989A1 publication Critical patent/WO2023042989A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/50Adding; Subtracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/544Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/22Microcontrol or microprogram arrangements
    • G06F9/28Enhancement of operational speed, e.g. by using several microcontrol devices operating in parallel
    • 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 invention relates to a technique for performing an operation in a computing device, and more particularly, to an addition operation technique considering the scale of a number.
  • Signal processing technology used to implement artificial intelligence such as neural networks may be implemented as software or as a hardware accelerator for fast processing.
  • a neural network used for machine learning there are many layers that perform various calculations, and a lot of data can be calculated in each layer.
  • a problem may occur due to an environment in which the size of an internal memory or an internal buffer provided inside the hardware accelerator is limited. That is, if the size of one set of data to be operated is smaller than the size of the internal memory or internal buffer, the data of one set is divided into two subsets, each is calculated separately, sub result values are calculated, and then the sub results are calculated. It is necessary to go through the process of combining the resulting values again.
  • the sub-result values go through a process of being stored in an internal memory or an internal buffer and then read again, and in this process, there is a problem that unwanted quantization errors of data may occur.
  • This quantization error may be an error that does not occur unless one set of data is divided into two subsets and separately calculated.
  • Prior art related to quantization of data in neural network technology includes Korean Patent Application Nos. 1020217011986, 1020200110330, 1020170150707, 1020200082108, and 1020207038081.
  • FIGS. 1 to 5 These contents are prior knowledge known to the inventor of the present invention, and at least some of them may be contents that have not been disclosed to unspecified persons at the time of filing the present patent application.
  • the present invention uses the concept of a scale of numbers or data used by a computing device.
  • Computing devices express numbers in the form of N-bit numbers using binary numbers.
  • the N-bit number includes a most significant bit (MSB) and a least significant bit (LSB).
  • MSB most significant bit
  • LSB least significant bit
  • the scale of the N-bit number may be defined as the size of a number represented by the LSB of the N-bit number. It can be defined by the minimum value other than 0 (zero) that can be represented by the N-bit number.
  • two decimal numbers '128' and '1' each represented by 2 bits may be considered.
  • the decimal number '128' may be expressed as '01' according to the binary notation
  • the decimal number '1' may be expressed as '01' according to the binary notation.
  • the first scale which is a scale of a 2-bit number representing the decimal number '128'
  • the second scale which is a scale of a 2-bit number representing the decimal number '1'
  • the first scale is 128 times larger than the second scale.
  • FIG. 1A illustrates a configuration of an input activation 710, which is one of objects for mathematical operations according to the present invention.
  • input activation may also be referred to as first input data.
  • the input activation 710 may be a three-dimensional array consisting of a first dimension, a second dimension, and a third dimension.
  • the first dimension, the second dimension, and the third dimension of the input activation 710 may be referred to as an input channel dimension, a height dimension, and a width dimension, respectively.
  • the input activation 710 shown in FIG. 1A is an example in which the size ci of the first dimension, the size h of the second dimension, and the size w of the third dimension are 3, 2, and 4, respectively.
  • the data size of the input activation 710 shown in FIG. 1A is proportional to ci*h*w.
  • sc_ai1 may be the decimal number 1 or the decimal number 128.
  • 1B shows the configuration of a weight 740, which is another one of the objects of mathematical operation according to the present invention.
  • the weight 740 may also be referred to as second input data.
  • the weight 740 may be a 4-dimensional array consisting of a first dimension, a second dimension, a third dimension, and a fourth dimension.
  • the first dimension, the second dimension, the third dimension, and the fourth dimension of the weight 740 may be referred to as an output channel dimension, an input channel dimension, a height dimension, and a width dimension, respectively.
  • the weight 740 shown in FIG. 1B is 2, 3, 2, and 2 in the first dimension co, the second dimension ci, the third dimension r, and the fourth dimension s, respectively. Yes.
  • the data size of the weight 740 presented in FIG. 1B is proportional to co*ci*r*s.
  • the first scale sc_w1 and the second scale sc_w2 are values that can be set independently of each other.
  • the first scale sc_w1 may be proportional to the decimal number 1
  • the second scale sc_w2 may be proportional to the decimal number 128.
  • 1C shows an example in which the input activation 710 includes six input channels 711 to 716.
  • FIG. 1D shows an example in which the weight 740 is composed of two output channels 741 and 742, and each output channel is composed of 6 input channels (ex: 7411 to 7416).
  • 2A to 2C are conceptual diagrams illustrating a convolution operation between the input activation 710 and the weight 740 .
  • the circular symbol surrounding the letter 'x' includes a first mathematical operation object disposed to the left of the symbol and a second mathematical operation object disposed to the right of the symbol. It is a symbol representing the convolution operation between
  • an output activation 750 may be generated by performing a convolution operation on the input activation 710 and the weight 740 .
  • output activation may also be referred to as output data.
  • the output activation 750 may be a three-dimensional array consisting of a first dimension, a second dimension, and a third dimension.
  • the first dimension, the second dimension, and the third dimension of the output activation 750 may be referred to as an output channel dimension, a height dimension, and a width dimension, respectively.
  • the output activation 750 shown in FIGS. 2A to 2C is an example in which the size co of the first dimension, the size ho of the second dimension, and the size wo of the third dimension are 2, 2, and 3, respectively.
  • the data size of the output activation 750 shown in FIGS. 2A to 2C is proportional to co*ho*wo.
  • 3A shows the main structure of some of the computing devices used in an embodiment of the present invention.
  • the computing device 1 includes a dynamic random access memory (DRAM) 130, a hardware accelerator 110, a bus 700 connecting the DRAM 130 and the hardware accelerator 110, and other devices connected to the bus 700.
  • DRAM dynamic random access memory
  • the DRAM 130 may be referred to as a memory 130 .
  • the computing device 1 may further include a power supply unit, a communication unit, a user interface, a storage unit 170, and peripheral units not shown.
  • the bus 700 may be shared by the hardware accelerator 110, other hardware 99, and the main processor 160.
  • the hardware accelerator 110 includes a DMA unit (Direct Memory Access part) 20, a control unit 40, an internal memory 30, an input buffer 650, a data operation unit 610, and an output buffer 640 can do.
  • DMA unit Direct Memory Access part
  • Some or all of data temporarily stored in the internal memory 30 may be provided from the DRAM 130 through the bus 700 .
  • the controller 40 and the DMA unit 20 may control the internal memory 30 and the DRAM 130 to move data stored in the DRAM 130 to the internal memory 30 .
  • Data stored in the internal memory 30 may be provided to the data calculator 610 through the input buffer 650 .
  • Output values generated by the operation of the data calculator 610 may be stored in the internal memory 30 via the output buffer 640 .
  • the output values stored in the internal memory 30 may be written to the DRAM 130 under the control of the control unit 40 and the DMA unit 20 .
  • the control unit 40 may collectively control the operations of the DMA unit 20, the internal memory 30, and the data operation unit 610.
  • the data calculator 610 may perform a first calculation function during a first time period and a second calculation function during a second time period.
  • one data calculation unit 610 is presented within the hardware accelerator 110 .
  • a plurality of data calculation units 610 shown in FIG. 3A may be provided in the hardware accelerator 110 to perform operations requested by the control unit 40 in parallel, respectively. there is.
  • the data operation unit 610 may sequentially output the output data according to a given order according to time rather than outputting them all at once.
  • the buffer may be part of the internal memory 30 shown in FIG. 3A.
  • a first storage space allocated for the input activation 710 may be defined, and a second storage space allocated for a weight may be defined.
  • the sizes of the first storage space and the second storage space may be limited.
  • the input activations 710 may be split for each input channel, and only the input activations 711 and 712, for example, may be stored in the first storage space and used.
  • the weight 740 is split for each input channel, so that, for example, the input activations 7411 and 7412 of the first output channel and the input activations 7421 and 7421 of the second output channel 7422) can be stored and used in the second storage space.
  • FIG. 5 illustrates a method of calculating the output activation 750 shown in FIG. 2(b) using the split data.
  • An object of the present invention is to provide a technique for reducing quantization errors generated in the process of processing or dividing data into two or more groups when calculating or processing data in a hardware accelerator.
  • An operation method provided according to an aspect of the present invention relates to a specific method of element-by-element addition operation (P101, P102) to improve the above-described quantization error.
  • a computing device performs a convolution on first input data 710 and second input data 740 for each input channel to obtain a set of convolutional data (7012, 7034). , 7056 or 7511 to 7513);
  • the computing device sets scales (sc_co_ci1,2, sc_co_ci3,4, and sc_co_ci5,6 representing each convolution data based on statistical values of values constituting each convolution data of the set of convolution data).
  • the computing device performs an addition operation on first convolution data 7012 represented by a first scale and second convolution data 7034 represented by a second scale among the set of convolution data, generating intermediate data 750p; And the computing device, after generating the intermediate data, performs an addition operation on third convolution data 7056 expressed in a third scale among the set of convolution data and the intermediate data, , calculating the output data 750; may include.
  • the third scale may not be smaller than the first scale, and the third scale may not be smaller than the second scale.
  • the step of generating the one set of convolution data includes outputting one set of first split data 711 to 716 obtained by splitting the first input data for each input channel and one set of the second input data.
  • generating the set of convolutional data by convolving a set of second split data (7411 to 7416) obtained by splitting the channel 741 for each input channel; and calculating the output data may include performing an addition operation on the third convolution data 7056 and the intermediate data to calculate output data corresponding to the set of output channels of the second input data. steps may be included.
  • the set of output channels is any one specific output channel among a plurality of output channels constituting the second input data
  • the output data corresponding to the set of output channels of the second input data is the specific output channel. It may be output data corresponding to an output channel.
  • the step of performing convolution for each input channel to generate a set of convolution data includes performing convolution on the first split data set and the second split data set for each input channel to correspond to each input channel. generating a set of input channel convolution data (7501 to 7506, or 7511 to 7516) consisting of input channel convolution data of and generating the one set of convolution data by grouping the one set of input channel convolution data.
  • each of the convolution data is the same as one input channel convolution data among the set of input channel convolution data, or two or more input channels among the set of input channel convolution data. It may be calculated by performing an element-by-element addition operation on the convolution data.
  • the calculation method may include, in order to determine the group, the computing device calculates a range of values of elements constituting each of the second split data and determines a set of ranges (rg_w_co_ci1 to rg_w_co_ci6) ; and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges.
  • the calculation method may include, in order to determine the group, the computing device calculates a range of values of elements constituting each of the input channel convolution data and determines a set of ranges (rg_co_ci1 to rg_co_ci6) step; and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges.
  • the step of generating the one set of convolution data may include convolution of the first split data of the one set and the second split data of the one set for each input channel to obtain an input channel convolution corresponding to each input channel. and generating a set of input channel convolution data consisting of data, wherein each convolution data is identical to one input channel convolution data among the set of input channel convolution data.
  • the computing device includes the step of generating the set of convolution data, the step of determining, the step of generating the intermediate data, and the step of calculating the set of convolution data for all output channels included in the second input data.
  • the computing device may be configured to combine output data for each channel generated for each output channel included in the second input data to generate output data including all the output channels.
  • the first input data is an input activation
  • the second input data is a weight
  • the output data is an output activation
  • a dimension of the weight may be greater than a dimension of the input activation
  • the input activation includes a plurality of first input channel data, each of the first input channel data is a two-dimensional array, the weight includes a plurality of output channel data, and each of the output channel data is It includes a plurality of second input channel data, and each of the second input channel data may be a two-dimensional array.
  • a computing device having a hardware accelerator 110 provided according to one aspect of the present invention, wherein the hardware accelerator is adapted to obtain first input data and second input data, the first input data and the second input data
  • a set of convolution data is generated by convolving data for each input channel, and each convolution data is expressed based on a statistical value of values constituting each convolution data of the set convolution data.
  • output data may be designed to produce
  • the third scale may not be smaller than the first scale
  • the third scale may not be smaller than the second scale.
  • the step of generating the one set of convolution data includes the first split data obtained by splitting the first input data for each input channel and the one set of output channels of the second input data for each input channel.
  • generating a set of convolution data by convolving a set of second split data obtained by splitting for each input channel;
  • the calculating of the output data may include calculating output data corresponding to the set of output channels of the second input data by performing an addition operation on the third convolution data and the intermediate data;
  • the hardware accelerator 110 includes an internal memory 30, the size of the internal memory is smaller than the data size of all the second input data, and one set of output channels of the second input data may be greater than the size of split data obtained by splitting for each input channel.
  • the present invention when calculating or processing data in a hardware accelerator, it is possible to provide a technique for reducing quantization errors occurring in the process of dividing data into two or more groups and processing them.
  • FIG 1A shows the configuration of input activation, which is one of the subjects of mathematical operation according to the present invention.
  • 1B shows the configuration of a weight, which is another one of the objects of mathematical operation according to the present invention.
  • 1C shows an example in which input activation consists of 6 input channels.
  • 1D shows an example in which weights are composed of two output channels and each output channel is composed of six input channels.
  • 2A to 2C are conceptual diagrams illustrating a convolution operation between the input activation and the weight.
  • Figure 3a shows the main structure of some of the computing devices used in an embodiment of the present invention
  • Figures 3b to 3e is the size of the storage space for storing a mathematical operation target for convolution operation and the mathematical operation target size comparison.
  • FIG. 5 illustrates a method of calculating the output activation shown in FIG. 2(b) using the split data.
  • 6A to 6C are flowcharts illustrating a method of calculating output activations by performing a convolution operation on input activations and weights according to an embodiment of the present invention.
  • FIG. 7A to 7C illustrate a method of calculating output activation by performing a convolution operation on an input activation and a weight according to an embodiment of the present invention.
  • FIG. 8 is a flowchart illustrating a method of generating output data by performing an operation on two input data according to an embodiment of the present invention.
  • 9A illustrates a convolution operation process between an input activation composed of 6 input channels and a first output channel of a weight composed of 2 output channels.
  • 9B illustrates a convolution operation process between the input activation and the second output channel.
  • FIG. 10 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 9A.
  • FIG. 11 shows another embodiment of a specific method of determining input channels belonging to a specific group shown in FIG. 9A.
  • FIG. 13 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 12 .
  • FIG. 14 shows another embodiment of a specific method for determining input channels belonging to a specific group shown in FIG. 12 .
  • 15 is a flowchart illustrating a calculation method provided according to an embodiment of the present invention.
  • FIGS. 6a, 6b, and 6c may collectively be referred to as FIG. 6 .
  • 7a, 7b, and 7c may collectively be referred to as FIG. 7 .
  • FIG. 6 is a flowchart illustrating a method of calculating output activations by performing a convolution operation on input activations and weights according to an embodiment of the present invention.
  • the input activation may be 3D data having the same structure as the input activation 710 illustrated in FIG. 1A
  • the weight may be 4D data having the same structure as the weight 740 illustrated in FIG. 1 .
  • FIG. 7 illustrates a method of calculating output activations by performing a convolution operation on input activations and weights according to an embodiment of the present invention.
  • FIGS. 6A, 6B, and 6C correspond to those presented in FIGS. 7A, 7B, and 7C, respectively.
  • step S110 a set of first split data 711, 712, and 713 obtained by splitting the input activation 710 for each input channel may be obtained.
  • the first output channel 741 of the weight 740 is split for each input channel to obtain a set of second split data 7411, 7412, and 7413.
  • the set of first split data 711, 712, and 713 and the set of second split data 7411, 7412, and 7413 are convoluted for each input channel to obtain a set of convolution data 7511, 7512, 7513) can be created.
  • a scale representing each convolution data may be determined based on statistical values of values constituting each convolution data of the set of convolution data 7511, 7512, and 7513. .
  • the scale sc_co1_ci1 to be applied for the representation of the convolution data 7511 can be determined based on the distribution of values of 6 elements constituting the convolution data 7511 .
  • the scale sc_co1_ci2 to be applied for the representation of the convolutional data 7512 can be determined based on the distribution of the six elements constituting the convolutional data 7512 .
  • the scales applied to the convolution data 7511, the convolution data 7512, and the convolution data 7513 may be determined as sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3, respectively.
  • sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3 are values that can be independently determined. Accordingly, sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3 may be the same or different.
  • step S130 specific expression values of the set of convolution data 7511, 7512, and 7513 may be determined according to the determined scales sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3.
  • step S140 among the set of convolution data 7511, 7512, and 7513, first convolution data 7511 expressed as 'first scale (sc_co1_ci1)' and 'second scale (sc_co1_ci2)' Intermediate data 751p may be generated by performing an addition operation on the second convolutional data 7512 represented by .
  • step S150 the third convolution data 7513 expressed as 'third scale (sc_co1_ci3)' among the set of convolution data 7511, 7512, and 7513 and the intermediate data 751p
  • FIG 7A shows an example in which the third scale (sc_co1_ci3) is not smaller than the first scale (sc_co1_ci1) and the third scale (sc_co1_ci3) is not smaller than the second scale (sc_co1_ci2).
  • step S140 may be performed before step S150.
  • step S210 a set of first split data 711, 712, 713 obtained by splitting the input activation 710 for each input channel and the second output channel 742 of the weight 740 are converted into input channels.
  • a set of second split data 7421 , 7422 , and 7423 obtained by splitting each may be convoluted for each input channel to generate a set of convolutional data 7521 , 7522 , and 7523 .
  • a scale representing each convolution data may be determined based on statistical values of values constituting each convolution data of the set of convolution data 7521, 7522, and 7523. .
  • the scale sc_co2_ci1 to be applied for the representation of the convolution data 7521 can be determined based on the distribution of 6 elements constituting the convolution data 7521 .
  • the scale sc_co2_ci2 to be applied for the representation of the convolutional data 7522 can be determined based on the distribution of the six elements constituting the convolutional data 7522 .
  • the scales applied to the convolution data 7521, the convolution data 7522, and the convolution data 7523 may be determined as sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3, respectively.
  • sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3 are values that can be independently determined. Accordingly, sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3 may be the same or different.
  • step S230 specific expression values of the set of convolution data 7521, 7522, and 7523 may be determined according to the determined scales sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3.
  • Intermediate data 752p may be generated by performing an addition operation on the second convolutional data 7522 represented by .
  • step S250 the third convolution data 7523 expressed as 'third scale (sc_co2_ci3)' among the set of convolution data 7521, 7522, and 7523 and the intermediate data 752p
  • FIG 7B shows an example in which the third scale (sc_co2_ci3) is not smaller than the first scale (sc_co2_ci1) and the third scale (sc_co2_ci3) is not smaller than the second scale (sc_co2_ci2).
  • step S240 may be performed before step S250.
  • the first process provided according to an embodiment of the present invention may include steps S110, S120, S130, S140, and S150.
  • the second process provided according to an embodiment of the present invention may include steps S210, S220, S230, S240, and S250.
  • the third process provided according to an embodiment of the present invention may include the step S310.
  • the first process and the second process may be performed in parallel or sequentially with a precedence relationship.
  • the third process may be executed after both the first process and the second process are completed.
  • the above-described first process, second process, and third process may be executed by the main processing unit of the computing device.
  • the computing device reads command codes for execution of the first process, the second process, and the third process from storage and stores them in a volatile memory, and the main processing unit executes the command codes to execute the first process , the second process, and the third process can be executed.
  • the above-described buffer may be provided in a part of internal memory or volatile memory inside the main processing unit according to the command code.
  • the input activation 710 and the weight 740 may be stored in an internal memory of the main processing unit or a part of a volatile memory.
  • the above-described first process, second process, and third process may be executed by a dedicated hardware accelerator included in the computing device.
  • the computing device reads the instruction codes for execution of the first process, the second process, and the third process from storage and stores them in a volatile memory, and the main processing unit executes the instruction codes, so that the hardware
  • the accelerator may acquire the input activation 710 and the weight 740 from volatile memory or non-volatile memory.
  • the buffer may exist inside the hardware accelerator.
  • FIG. 8 is a flowchart illustrating a method of generating output data by performing an operation on two input data according to an embodiment of the present invention.
  • the method may include step S100 and step S200.
  • step S100 the computing device performs a predefined calculation process P10 for each output channel of the second input data having M output channels to generate output data for each channel for each output channel.
  • step S200 the computing device may generate output data by combining the M pieces of output data for each channel.
  • the calculation process (P10) may include step (S10), step (S20), step (S30), step (S40), and step (S50).
  • the computing device includes a set of first split data obtained by splitting the first input data for each input channel and a set of split data obtained by splitting a specific output channel of the second input data for each input channel.
  • a set of convolution data may be generated by convolving the second split data for each input channel.
  • the computing device may determine a scale representing each convolution data based on a statistical value of values constituting each convolution data of the set of convolution data.
  • step S30 the computing device may determine an expression value of each convolution data according to the determined scale.
  • step S40 the computing device performs an addition operation on first convolution data expressed in a first scale and second convolution data expressed in a second scale among the set of convolution data, Intermediate data can be generated.
  • step S50 the computing device performs an addition operation on third convolution data expressed in a third scale among the set of convolution data and the intermediate data to obtain the specific output channel of the weight.
  • Output data for a specific output channel corresponding to can be calculated.
  • the third scale is not smaller than the first scale, and the third scale is not smaller than the second scale.
  • step S40 necessarily precedes step 250.
  • the first input data may be, for example, the input activation 710 described in FIG. 7 .
  • the second input data may be, for example, the weight 740 described in FIG. 7 .
  • FIG 7A shows an example in which one partial output activation is determined by one input channel.
  • FIGS. 9A and 9B show an example in which one partial output activation is determined by a plurality of input channels, that is, one input channel group.
  • FIGS. 9A and 9B can be usefully used when the number of input channels is large.
  • 9A illustrates a convolution operation process between an input activation 710 composed of six input channels and a first output channel of a weight composed of two output channels.
  • the example shown in FIG. 9A is different from the example shown in FIG. 7A in that the number of input channels constituting the input activation 710 is six. In FIG. 7A, the number of input channels is three.
  • the input channels constituting the input activation 710 are grouped.
  • each group may consist of one to a plurality of input channels.
  • Steps S110, S120, S130, S140, and S150 shown in FIG. 9A are steps S110, S120, S130, and S150 shown in FIG. 7A. (S140), and the same as step (S150).
  • step S110 a set of first split data 711 to 716 obtained by splitting the input activation 710 for each input channel may be obtained.
  • a set of second split data 7411 to 7416 may be obtained by splitting the first output channel 741 of the weight 740 for each input channel. Then, the set of first split data 711 to 716 and the set of second split data 7411 to 7416 are convolved for each input channel to obtain a set of input channel convolution data 7511 to 7516.
  • Input channel convolution data generated from input activation belonging to the xth group Gx is also considered to belong to the xth group Gx.
  • the input channel convolution data 7511 generated from the input activation 711 belonging to the first group G1 is also regarded as belonging to the first group G1.
  • step S115 convolutional data of a specific group is generated by performing an element-by-element addition operation on the plurality of input channel convolution data belonging to the specific group.
  • an element-by-element addition operation is performed on the plurality of input channel convolution data 7511 and 7512 belonging to the first group G1 to generate the first group convolution data 7112.
  • the second group of convolutional data 7134 and the third group of convolutional data 7156 are generated for the second group G2 and the third group G3, respectively.
  • the convolution data 7112 of the first group, the convolution data 7134 of the second group, and the convolution data 7156 of the third group may be respectively referred to as group-specific convolution data.
  • step S120 the convolution data 7112, 7134, and 7156 are expressed based on statistical values of values constituting the set of group-specific convolution data 7112, 7134, and 7156, respectively. scale can be determined.
  • the scale sc_co1_ci1,2 to be applied for the expression of the convolution data 7112 can be determined based on the distribution of values of the six elements constituting the first group of convolution data 7112. there is.
  • the scales applied to the first group of convolution data 7112, the second group of convolution data 7134, and the third group of convolution data 7156 are sc_co1_ci1,2, sc_co1_ci3,4, and It can be determined as sc_co1_ci5,6.
  • sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6 are values that can be independently determined. Accordingly, sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6 may be the same or different.
  • step S130 specific expression values of the set of convolution data 7112, 7134, and 7156 for each group may be determined according to the determined scales sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6.
  • step S140 the first group of convolution data 7112 represented by the 'first scale (sc_co1_ci1,2)' and the 'th Intermediate data 751p may be generated by performing an addition operation on the convolutional data 7134 of the second group expressed as '2 scale(sc_co1_ci3,4)'.
  • the third scale (sc_co1_ci5,6) is not smaller than the first scale (sc_co1_ci1,2), and the third scale (sc_co1_ci5,6) is not smaller than the second scale (sc_co1_ci3,4). It shows an example that is not.
  • FIG. 9A shows a modified example by applying the concept of grouping input channels to the method described in FIG. 7A.
  • 9B illustrates a convolution operation process between the input activation 710 and the second output channel.
  • Steps indicated by reference numerals S210, S215, S220, S230, S240, and S250 in FIG. 9B correspond to steps indicated by reference numerals S110, S115, S120, S130, S140, and S150 in FIG. 9A, respectively.
  • Components indicated by reference numerals 7421 to 7426, 7521 to 7526, 7212, 7234, 7256, 752p, and 752 in FIG. 9B are reference numerals 7411 to 7416, 7511 to 7516, 7112, 7134, 7156, 751p, and components indicated by 751.
  • Components indicated by reference numerals sc_co2_ci1,2, sc_co2_ci3,4, and sc_co2_ci5,6 in FIG. 9B correspond to components indicated by reference numerals sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6 in FIG. 9A, respectively.
  • FIG. 10 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 9A.
  • the computing device may calculate statistical values of elements constituting the corresponding input channel convolution data.
  • the first range (rg_co1_ci1) of the first input channel convolution data 7511 may be determined based on the minimum and maximum values of the six elements constituting the first input channel convolution data 7511 . For example, if the minimum value of the first input channel convolution data 7511 is 1 and the maximum value is 5, the first range rg_co1_ci1 is 4, which is the difference between the maximum value and minimum value, or 1, which is the minimum value, or the first range rg_co1_ci1. It can be a maximum of 5.
  • a second range (rg_co1_ci2), a third range (rg_co1_ci3), a fourth range (rg_co1_ci4), a fifth range (rg_co1_ci5), and a sixth range (rg_co1_ci6) may be determined. .
  • the computing device includes a set of input channel convolution data 7511 to 7516 based on the values of the ranges rg_co1_ci1 to rg_co1_ci6 or input channels 711 to 716 constituting the input activation 710 can be grouped.
  • the first range (rg_co1_ci1), the second range (rg_co1_ci2), the third range (rg_co1_ci3), and the fourth range (rg_co1_ci4) are 4, 5, 400, and 500, respectively
  • the second range (rg_co1_ci2) may be grouped into the first group, and the third range (rg_co1_ci3) and the fourth range (rg_co1_ci4) may be grouped into the second group.
  • the first group G1, the second group G2, and the third group G3 shown in FIG. 9 may be determined through this process.
  • FIG. 11 shows another embodiment of a specific method of determining input channels belonging to a specific group shown in FIG. 9A.
  • FIG. 11 is a modified embodiment from FIG. 10, and instead of a set of input channel convolution data 7511 to 7516 as a criterion for calculating the statistical value, a set of split data 7411 to 7416 presented in FIG. 9A is used.
  • a range (rg_w_co1_ci3), a fourth range (rg_w_co1_ci4), a fifth range (rg_w_co1_ci5), and a sixth range (rg_w_co1_ci6) may be determined.
  • the computing device may group the split data 7411 to 7416 or the input channels 711 to 716 constituting the input activation 710 based on the values of the ranges rg_w_co1_ci1 to rg_w_co1_ci6. there is.
  • the first group G1, the second group G2, and the third group G3 shown in FIG. 9A may be determined through this process.
  • FIGS. 10 and 11 can also be applied to FIG. 9B.
  • FIGS. 9A and 9B are a method of integrating and performing the methods presented in FIGS. 9A and 9B.
  • the 12 illustrates a convolution operation process between an input activation 710 composed of six input channels 711 to 716 and a weight composed of two output channels.
  • the first output channel includes 6 input channels 7411 to 7416
  • the second output channel includes 6 input channels 7421 to 7426.
  • the input channels constituting the input activation 710 are grouped.
  • a detailed method of determining input channels belonging to a specific group is as described above.
  • Steps S310, step 315, step S320, step S330, step S340, and step S350 shown in FIG. 12 are steps S110, step S115, and step S115 shown in FIG. 9A. It corresponds to (S120), step S130, step S140, and step S150.
  • a set of first split data 711 to 716 obtained by splitting the input activation 710 for each input channel may be obtained.
  • a set of second split data 7411 to 7416 and 7421 to 7426 may be obtained by splitting the output channels 741 and 742 of the weight 740 for each input channel.
  • the set of second split data 7411 to 7416 and 7421 to 7426 include split data 7411 to 7416 corresponding to the first output channels of the weights and split data 7421 to 7426 corresponding to the second output channels of the weights. ) is composed of
  • the set of first split data 711 to 716 and the set of second split data 7411 to 7416 and 7421 to 7426 are convolved for each input channel to obtain a set of input channel convolution data ( 7501 to 7506) can be created.
  • the input channel convolution data corresponding to each input channel is composed of convolution data corresponding to a first output channel of weights and convolution data corresponding to a second output channel of weights.
  • the input channel convolution data 7501 corresponding to the first input channel is composed of convolution data 7511 corresponding to the first output channel of weights and convolution data 7521 corresponding to the second output channel of weights.
  • convolution data 7511 is calculated by a convolution operation between split data 711 and split data 7411
  • convolution data 7521 is convolution between split data 711 and split data 7421. It is calculated by calculation.
  • Input channel convolution data generated from input activation belonging to the x group (Gx) is also considered to belong to the xth group (Gx).
  • step S315 convolutional data of a specific group is generated by performing an element-by-element addition operation on the plurality of input channel convolution data belonging to the specific group.
  • the first group of convolutional data 7012 may be generated by performing an element-by-element addition operation on the plurality of input channel convolutional data 7501 and 7502 belonging to the first group G1.
  • the first output channel data 7112 is calculated by performing an element-by-element addition operation between the input channel convolutional data 7511 and the input channel convolutional data 7512.
  • the second output channel data 7212 is calculated by performing an element-by-element addition operation between the convolutional data 7521 and the convolutional data 7522.
  • a scale representing the convolution data for each group may be determined based on statistical values of values constituting the convolution data 7012, 7034, and 7056 for each group.
  • the scale sc_co_ci1,2 to be applied for the expression of the first group of convolutional data 7012 can be determined based on the distribution of values of 12 elements constituting the first group of convolutional data 7012. can be easily understood.
  • the scales applied to the first group of convolution data 7012, the second group of convolution data 7034, and the third group of convolution data 7056 are sc_co_ci1,2, sc_co_ci3,4, and It can be determined as sc_co_ci5,6.
  • sc_co_ci1,2, sc_co_ci3,4, and sc_co_ci5,6 are values that can be independently determined.
  • step S340 among the set of convolution data 7012, 7034, and 7056, first convolution data 7012 expressed as 'first scale sc_co_ci1,2' and 'second scale sc_co_ci3' ,4)' to generate the intermediate data 750p by performing an addition operation on the second convolutional data 7034 .
  • the first output channel portion 751p is calculated by adding the first output channel portion of the first convolution data 7012 and the first output channel portion of the second convolution data 7034 for each element.
  • the second output channel portion 752p of the intermediate data 750p is obtained by adding the second output channel portion of the first convolution data 7012 and the second output channel portion of the second convolution data 7034 for each element. can be derived.
  • step S350 the third convolution data 7056 expressed as 'third scale (sc_co_ci5,6)' and the intermediate data 750p among the set of convolution data 7012, 7034, and 7056
  • the output activation 750 may be calculated by performing an addition operation on .
  • the first output channel portion 751 of the output activation 750 is calculated by adding the first output channel portion 751p of the intermediate data 750p and the first output channel portion of the third convolution data 7056 for each element. It can be.
  • the second output channel portion 752 of the output activation 750 converts the second output channel portion 752p of the intermediate data 750p and the second output channel portion of the third convolution data 7056 for each element. can be calculated in addition
  • the third scale (sc_co_ci5,6) is not smaller than the first scale (sc_co_ci1,2), and the third scale (sc_co_ci5,6) is not smaller than the second scale (sc_co0_ci3,4). It shows an example that is not.
  • step S340 may be performed before step S350.
  • FIG. 13 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 12 .
  • the computing device may calculate statistical values of elements constituting the corresponding input channel convolution data. Based on the statistical value, ranges rg_co_ci1 to rg_co_ci6 may be determined for each of the input channel convolution data 7501 to 7506 .
  • the computing device includes a set of input channel convolution data 7501 to 7506 based on values of the ranges rg_co_ci1 to rg_co_ci6 or input channels 711 to 716 constituting the input activation 710 can be grouped.
  • the first group G1, the second group G2, and the third group G3 shown in FIG. 12 may be determined through this process.
  • FIG. 14 shows another embodiment of a specific method for determining input channels belonging to a specific group shown in FIG. 12 .
  • the computing device includes a set of split data 7411 to 7416 and 7421 to 7426 based on values of the ranges rg_w_co_ci1 to rg_w_co_ci6 or input channels 711 to 716 constituting the input activation 710 can be grouped.
  • the first group G1, the second group G2, and the third group G3 shown in FIG. 12 may be determined through this process.
  • 15 is a flowchart illustrating a calculation method provided according to an embodiment of the present invention.
  • step S410 the computing device may generate a set of convolution data by convolving the first input data and the second input data 740 for each input channel.
  • the computing device may determine a scale representing each convolution data based on a statistical value of values constituting each convolution data of the set of convolution data.
  • step S430 the computing device performs an addition operation on first convolution data represented by a first scale and second convolution data represented by a second scale among the set of convolution data, Intermediate data can be generated.
  • step S440 after the step of generating the intermediate data, the computing device performs an addition operation on third convolution data expressed in a third scale among the set of convolution data and the intermediate data By doing so, output data can be calculated.
  • the third scale is not smaller than the first scale, and the third scale is not smaller than the second scale.
  • the first input data is the input data 711 to 716 shown in FIG. 12
  • the second input data is the data 7411 to 7416, 7421 to 7426 shown in FIG.
  • a set of convolutional data may be data 7012, 7034, and 7056 shown in FIG. 12 .
  • the scale representing each convolution data may be the scales (sc_co_ci1,2, sc_co_ci3,4, and sc_co_ci5,6) shown in FIG. 12 .
  • the first convolution data, the second convolution data, and the intermediate data may be data 7012 , 7034 , and 750p shown in FIG. 12 , respectively.
  • the third convolution data and the output data may be data 7056 and 750 shown in FIG. 12 , respectively.
  • the first input data is the input data 711 to 716 shown in FIG. 9A
  • the second input data is the data 7411 to 7416 shown in FIG. 9A
  • the solution data may be data 7112, 7134, and 7156 shown in FIG. 9A.
  • the scale representing each of the convolution data may be the scales (sc_co1_ci1,2, sc_co1_ci3,4, and sc_c1o_ci5,6) presented in FIG. 9A.
  • the first convolution data, the second convolution data, and the intermediate data may be data 7112, 7134, and 751p shown in FIG. 7A, respectively.
  • the third convolution data and the output data may be data 7156 and 751 presented in FIG. 9A, respectively.
  • the first input data is the input data 711 to 713 shown in FIG. 7A
  • the second input data is the data 7411 to 7413 shown in FIG. 7A
  • the solution data may be data 7511 to 7513 presented in FIG. 7A.
  • the scale representing each convolution data may be the scale (sc_co1_ci1 to sc_co1_ci3) presented in FIG. 7A.
  • the first convolution data, the second convolution data, and the intermediate data may be data 7511, 7512, and 751p presented in FIG. 7A, respectively.
  • the third convolution data and the output data may be data 7513 and 751 presented in FIG. 7A, respectively.
  • the calculating of the output data may include calculating output data corresponding to the output channel of the one set of the second input data by performing an addition operation on the third convolution data and the intermediate data ( S412) may be included.
  • the first split data set, the second split data set, and the output data corresponding to the output channel set of the second input data are respectively shown in FIG. 12. It may be data 711 to 716 , data 7411 to 7416 , 7421 to 7426 , and data 750 .
  • the first split data set, the second split data set, and the output data corresponding to the output channel set of the second input data are respectively shown in FIG. 9A. It may be data 711 to 716 , data 7411 to 7416 , and data 751 .
  • the first split data set, the second split data set, and the output data corresponding to the output channel set of the second input data are respectively shown in FIG. 7A. It may be data 711 to 713 , data 7411 to 7413 , and data 751 .
  • the set of output channels is any one specific output channel among a plurality of output channels constituting the second input data
  • the output data corresponding to the set of output channels of the second input data is the specific output channel. It may be output data corresponding to an output channel.
  • the first split data of the one set and the second split data of the one set are convolved for each input channel to obtain a set of input channel convolution data corresponding to each input channel.
  • the set of input channel convolution data may be data 7501 to 7506 shown in FIG. 12 .
  • the set of input channel convolution data may be data 7511 to 7516 shown in FIG. 9A.
  • each of the convolution data is the same as one input channel convolution data among the set of input channel convolution data, or two or more input channels among the set of input channel convolution data. It may be calculated by performing an element-by-element addition operation on the convolution data.
  • the group calculating, by the computing device, a range of values of elements constituting each of the second split data to determine a set of ranges (rg_w_co_ci1 to rg_w_co_ci6); and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges.
  • the set of ranges may be the ranges (rg_w_co1_ci1 to rg_w_co1_ci6) shown in FIG. 11 or the ranges (rg_w_co_ci1 to rg_w_co_ci6) shown in FIG. 14 .
  • determining a set of ranges (rg_co_ci1 to rg_co_ci6) by calculating, by the computing device, a range of values of elements constituting each of the input channel convolution data to determine the group; and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges.
  • the set of ranges may be the ranges (rg_co1_ci1 to rg_co1_ci6) shown in FIG. 10 or the ranges (rg_co_ci1 to rg_co_ci6) shown in FIG. 13 .
  • the step of generating the one set of convolution data may include convolution of the first split data of the one set and the second split data of the one set for each input channel to obtain an input channel convolution corresponding to each input channel. It may include generating a set of input channel convolution data consisting of data. Further, each of the convolution data may be the same as one input channel convolution data among the set of input channel convolution data.
  • the computing device includes the step of generating the set of convolution data, the step of determining, the step of generating the intermediate data, and the step of calculating the set of convolution data for all output channels included in the second input data.
  • the computing device may be configured to combine output data for each channel generated for each output channel included in the second input data to generate output data including all the output channels.
  • the first input data is an input activation
  • the second input data is a weight
  • the output data is an output activation
  • a dimension of the weight may be greater than a dimension of the input activation
  • the input activation includes a plurality of first input channel data, each of the first input channel data is a two-dimensional array, the weight includes a plurality of output channel data, and each of the output channel data is It includes a plurality of second input channel data, and each of the second input channel data may be a two-dimensional array.
  • the present invention is a combination of next-generation intelligent semiconductor technology development (design)-artificial intelligence processor business, which is a research project supported by Open Edge Technology Co., Ltd. (project performing organization) and the Ministry of Science and ICT and the National Research Foundation of Korea Information and Communication Planning and Evaluation Institute. It was developed in the process of carrying out the research project development of a sensory-based context predictive mobile artificial intelligence processor (task number 2020001310, task number 2020-0-01310, research period 2020.04.01 ⁇ 2024.12.31).

Abstract

Disclosed is an operation method comprising the steps of: generating one set of pieces of convolution data by convoluting, for each input channel, one set of first split data obtained by splitting first input data for each input channel and one set of second split data obtained by splitting a particular output channel of second input data for each input channel; determining a scale representing each piece of convolution data on the basis of a statistical value of values configuring each piece of convolution data of the one set of pieces of convolution data; generating intermediate data by performing an add operation of first convolution data represented in a first scale and second convolution data represented in a second scale among the one set of pieces of convolution data; and after the step of generating the intermediate data, performing, by a computing device, an add operation of the intermediate data and third convolution data represented in a third scale among the one set of pieces of convolution data to calculate channel-specific output data for a particular output channel corresponding to the particular output channel of the second input data. The third scale is not smaller than the first scale, and the third scale is not smaller than the second scale.

Description

데이터 스케일을 고려한 덧셈 연산 방법 및 이를 위한 하드웨어 가속기, 이를 이용한 컴퓨팅 장치Addition operation method considering data scale, hardware accelerator for the same, and computing device using the same
본 발명은 컴퓨팅 장치에서 연산을 수행하는 기술에 관한 것이며, 특히 숫자(number)의 스케일을 고려한 덧셈 연산 기술에 관한 것이다.The present invention relates to a technique for performing an operation in a computing device, and more particularly, to an addition operation technique considering the scale of a number.
신경망 등 인공지능의 구현을 위해 이용되는 신호처리기술은 소프트웨어로 구현되거나 또는 빠른 처리를 위해 하드웨어 가속기로서 구현될 수 있다. 머신러닝을 위해 이용되는 신경망에서는 각종 연산을 수행하는 레이어들이 다수 존재하며, 각 레이어에서는 많은 데이터들이 연산될 수 있다. 이러한 데이터 연산이 하드웨어 가속기에 의해 이루어지는 경우, 하드웨어 가속기 내부에 제공되는 내부 메모리 또는 내부 버퍼의 크기가 제한된다는 환경 때문에 문제가 발생할 수 있다. 즉, 연산의 대상이 되는 한 세트의 데이터의 크기가 내부 메모리 또는 내부 버퍼의 크기보다 작다면, 한 세트의 데이터를 2개의 서브세트로 나누어 각각 따로 계산하여 서브 결과값들을 산출한 다음, 그 서브 결과값들을 다시 결합하는 과정을 거쳐야 한다. 이때, 상기 서브 결과값들이 내부 메모리 또는 내부 버퍼에 저장되었다가 다시 읽히는 과정을 거치는데, 이 과정에서 원하지 않는 데이터의 양자화 오차가 발생할 수 있다는 문제가 있다. 이러한 양자화 오차는 한 세트의 데이터를 2개의 서브세트로 나누어 따로 계산하지 않았더라면 발생하지 않는 오차일 수 있다.Signal processing technology used to implement artificial intelligence such as neural networks may be implemented as software or as a hardware accelerator for fast processing. In a neural network used for machine learning, there are many layers that perform various calculations, and a lot of data can be calculated in each layer. When these data operations are performed by a hardware accelerator, a problem may occur due to an environment in which the size of an internal memory or an internal buffer provided inside the hardware accelerator is limited. That is, if the size of one set of data to be operated is smaller than the size of the internal memory or internal buffer, the data of one set is divided into two subsets, each is calculated separately, sub result values are calculated, and then the sub results are calculated. It is necessary to go through the process of combining the resulting values again. At this time, the sub-result values go through a process of being stored in an internal memory or an internal buffer and then read again, and in this process, there is a problem that unwanted quantization errors of data may occur. This quantization error may be an error that does not occur unless one set of data is divided into two subsets and separately calculated.
신경망 기술에서 데이터의 양자화에 관련된 선행기술로는 대한민국 특허출원번호 1020217011986, 1020200110330, 1020170150707, 1020200082108, 및 1020207038081 등이 있다. Prior art related to quantization of data in neural network technology includes Korean Patent Application Nos. 1020217011986, 1020200110330, 1020170150707, 1020200082108, and 1020207038081.
이하, 도 1 내지 도 5를 이용하여 본 발명의 이해를 위해 알아두어야 할 기술 내용을 간단히 설명한다. 이 내용들은 본 발명의 발명자가 알고 있는 사전지식으로서, 이 중 적어도 일부는 본 특허출원 시에 불특정인에게 공개되지 않은 내용일 수 있다. Hereinafter, technical contents that should be known for the understanding of the present invention will be briefly described using FIGS. 1 to 5. These contents are prior knowledge known to the inventor of the present invention, and at least some of them may be contents that have not been disclosed to unspecified persons at the time of filing the present patent application.
본 발명은 컴퓨팅 장치가 사용하는 숫자 또는 데이터의 스케일이라는 개념을 이용한다. 컴퓨팅 장치는 이진수(binary number)를 이용한 N비트 숫자(N-bit number)의 형태로 숫자를 표현한다. 이때 상기 N비트 숫자는 MSB(Most Significant Bit) 및 LSB(Least Significant Bit)를 포함한다. 여기서 상기 N비트 숫자의 스케일은 상기 N비트 숫자의 LSB가 표현하는 수의 크기로 정의될 수 있다. 죽, 상기 N비트 숫자가 표현할 수 있는 0(영)이 아닌 최소값에 의해 정의될 수 있다. 상기 스케일이라는 개념의 이해를 돕기 위해, 예컨대 각각 2비트로 표현되는 두 개의 수인 '128' 및 '1'이라는 십진수들을 고려해 볼 수 있다. 여기서 상기 십진수 '128'은 이진수 표기법에 따라 '01'로 표현되고 상기 십진수 '1'은 이진수 표기법에 따라 '01'로 표현될 수 있다. 이때, 상기 십진수 '128'을 나타내는 2비트 숫자의 스케일인 제1스케일은 십진수 128에 비례하는 값이고, 상기 십진수 '1'을 나타내는 2비트 숫자의 스케일인 제2스케일은 십진수 1에 비례하는 값이다. 즉, 상기 제1스케일은 상기 제2스케일에 비하여 128배 만큼 크다.The present invention uses the concept of a scale of numbers or data used by a computing device. Computing devices express numbers in the form of N-bit numbers using binary numbers. In this case, the N-bit number includes a most significant bit (MSB) and a least significant bit (LSB). Here, the scale of the N-bit number may be defined as the size of a number represented by the LSB of the N-bit number. It can be defined by the minimum value other than 0 (zero) that can be represented by the N-bit number. To help understand the concept of the scale, for example, two decimal numbers '128' and '1' each represented by 2 bits may be considered. Here, the decimal number '128' may be expressed as '01' according to the binary notation, and the decimal number '1' may be expressed as '01' according to the binary notation. At this time, the first scale, which is a scale of a 2-bit number representing the decimal number '128', is a value proportional to the decimal number 128, and the second scale, which is a scale of a 2-bit number representing the decimal number '1', is a value proportional to the decimal number 1. am. That is, the first scale is 128 times larger than the second scale.
도 1a는 본 발명에 따른 수학연산의 대상(object for mathematical operation) 중 하나인 입력 액티베이션(710)의 구성을 나타낸 것이다. 본 명세서에서 입력 액티베이션은 제1입력 데이터로 지칭될 수도 있다.1A illustrates a configuration of an input activation 710, which is one of objects for mathematical operations according to the present invention. In this specification, input activation may also be referred to as first input data.
상기 입력 액티베이션(710)은 제1차원(a first dimension), 제2차원, 및 제3차원으로 이루어진 3차원 어레이일 수 있다. 상기 입력 액티베이션(710)의 상기 제1차원, 상기 제2차원, 및 상기 제3차원은 각각 입력채널 차원, 높이 차원, 및 폭 차원으로 지칭될 수 있다. 도 1a에 제시한 상기 입력 액티베이션(710)은 제1차원의 크기 ci, 제2차원의 크기 h, 및 제3차원의 크기 w가 각각 3, 2, 및 4인 예이다. 도 1a에 제시한 상기 입력 액티베이션(710)의 데이터 크기는 ci*h*w에 비례한다.The input activation 710 may be a three-dimensional array consisting of a first dimension, a second dimension, and a third dimension. The first dimension, the second dimension, and the third dimension of the input activation 710 may be referred to as an input channel dimension, a height dimension, and a width dimension, respectively. The input activation 710 shown in FIG. 1A is an example in which the size ci of the first dimension, the size h of the second dimension, and the size w of the third dimension are 3, 2, and 4, respectively. The data size of the input activation 710 shown in FIG. 1A is proportional to ci*h*w.
본 명세서에서 상기 입력 액티베이션(710) 중 상기 입력채널의 인덱스가 k인 부분은 '입력 액티베이션[ci]=k'라고 표현할 수 있다. 도 1a에서 입력 액티베이션[ci]=1은 참조번호 711로 나타내고, 입력 액티베이션[ci]=2은 참조번호 712로 나타내고, 그리고 입력 액티베이션[ci]=3은 참조번호 713으로 나타낸다.In this specification, the portion of the input activation 710 where the index of the input channel is k can be expressed as 'input activation [ci]=k '. In FIG. 1A , input activation [ci] = 1 is indicated by reference numeral 711 , input activation [ci] = 2 is indicated by reference numeral 712 , and input activation [ci] = 3 is indicated by reference numeral 713 .
상기 입력 액티베이션[ci]=1(711), 상기 입력 액티베이션[ci]=2(712), 및 상기 입력 액티베이션[ci]=3(713)의 스케일은 서로 동일하다. 즉, 상기 입력 액티베이션(710)을 구성하는 모든 숫자들의 스케일은 서로 동일하며, 상기 스케일은 'sc_ai1'으로 표현될 수 있다. 예컨대 sc_ai1은 십진수 1일 수도 있고 십진수 128일 수도 있다. Scales of the input activation [ci] = 1 (711), the input activation [ci] = 2 (712), and the input activation [ci] = 3 (713) are the same. That is, the scales of all numbers constituting the input activation 710 are the same, and the scales can be expressed as 'sc_ai1'. For example, sc_ai1 may be the decimal number 1 or the decimal number 128.
도 1b는 본 발명에 따른 수학연산의 대상 중 다른 하나인 가중치(740)의 구성을 나타낸 것이다. 1B shows the configuration of a weight 740, which is another one of the objects of mathematical operation according to the present invention.
본 명세서에서 상기 가중치(740)는 제2입력 데이터로 지칭될 수도 있다.In this specification, the weight 740 may also be referred to as second input data.
상기 가중치(740)는 제1차원(a first dimension), 제2차원, 제3차원, 및 제4차원으로 이루어진 4차원 어레이일 수 있다. 상기 가중치(740)의 상기 제1차원, 상기 제2차원, 상기 제3차원, 및 상기 제4차원은 각각 출력채널 차원, 입력채널 차원, 높이 차원, 및 폭 차원으로 지칭될 수 있다. 도 1b에 제시한 상기 가중치(740)는 제1차원의 크기 co, 제2차원의 크기 ci, 제3차원의 크기 r, 및 제4차원의 크기 s가 각각 2, 3, 2, 및 2인 예이다. 도 1b에 제시한 상기 가중치(740)의 데이터 크기는 co*ci*r*s에 비례한다.The weight 740 may be a 4-dimensional array consisting of a first dimension, a second dimension, a third dimension, and a fourth dimension. The first dimension, the second dimension, the third dimension, and the fourth dimension of the weight 740 may be referred to as an output channel dimension, an input channel dimension, a height dimension, and a width dimension, respectively. The weight 740 shown in FIG. 1B is 2, 3, 2, and 2 in the first dimension co, the second dimension ci, the third dimension r, and the fourth dimension s, respectively. Yes. The data size of the weight 740 presented in FIG. 1B is proportional to co*ci*r*s.
본 명세서에서 상기 가중치(740) 중 상기 출력채널의 인덱스가 k인 부분은 '가중치[co]=k'라고 표현할 수 있다. 도 1b에서 가중치[co]=1은 참조번호 741로 나타내고, 가중치[co]=2은 참조번호 742로 나타낸다.In this specification, the portion of the weight 740 where the index of the output channel is k can be expressed as 'weight [co]=k '. In FIG. 1B, the weight [co]=1 is indicated by reference numeral 741, and the weight [co]=2 is indicated by reference numeral 742.
상기 가중치[co]=1(741)를 구성하는 모든 숫자들의 스케일인 제1스케일은 서로 동일하며, 상기 제1스케일은 'sc_w1'으로 표현될 수 있다.The first scale, which is the scale of all numbers constituting the weight [co] = 1 (741), is the same, and the first scale can be expressed as 'sc_w1'.
상기 가중치[co]=2(742)를 구성하는 모든 숫자들의 스케일인 제2스케일은 서로 동일하며, 상기 제2스케일은 'sc_w2'으로 표현될 수 있다.The second scale, which is the scale of all numbers constituting the weight [co] = 2 (742), is the same, and the second scale can be expressed as 'sc_w2'.
상기 제1스케일 sc_w1과 상기 제2스케일 sc_w2는 서로 독립적으로 설정(set)될 수 있는 값이다. The first scale sc_w1 and the second scale sc_w2 are values that can be set independently of each other.
예컨대 상기 제1스케일 sc_w1은 십진수 1에 비례하고, 상기 제2스케일 sc_w2는 십진수 128에 비례할 수 있다.For example, the first scale sc_w1 may be proportional to the decimal number 1, and the second scale sc_w2 may be proportional to the decimal number 128.
도 1c는 입력 액티베이션(710)이 6개의 입력채널들(711~716)로 이루어진 예를 나타낸 것이다.1C shows an example in which the input activation 710 includes six input channels 711 to 716.
도 1d는 가중치(740)이 2개의 출력채널들(741, 742)로 이루어지고, 각 출력채널은 6개의 입력채널(ex: 7411~7416)로 이루어진 예를 나타낸 것이다.FIG. 1D shows an example in which the weight 740 is composed of two output channels 741 and 742, and each output channel is composed of 6 input channels (ex: 7411 to 7416).
도 2a 내지 도 2c는 상기 입력 액티베이션(710)과 상기 가중치(740) 간의 콘볼루션 연산을 설명하는 개념도이다.2A to 2C are conceptual diagrams illustrating a convolution operation between the input activation 710 and the weight 740 .
도 2a 내지 도 2c 및 본 명세서에 제시된 기호로서, 문자 'x'를 감싸고 있는 원형의 기호는, 상기 기호의 왼쪽에 배치된 제1수학연산 대상과 상기 기호의 오른쪽에 배치된 제2수학연산 대상 간의 콘볼루션 연산을 나타내는 기호이다.As the symbols presented in FIGS. 2A to 2C and in this specification, the circular symbol surrounding the letter 'x' includes a first mathematical operation object disposed to the left of the symbol and a second mathematical operation object disposed to the right of the symbol. It is a symbol representing the convolution operation between
도 2a에 제시된 것과 같이, 상기 입력 액티베이션(710)과 상기 가중치(740)에 관한 콘볼루션 연산을 수행하면 출력 액티베이션(750)이 생성될 수 있다. 본 명세서에서 출력 액티베이션은 출력 데이터로 지칭될 수도 있다.As shown in FIG. 2A , an output activation 750 may be generated by performing a convolution operation on the input activation 710 and the weight 740 . In this specification, output activation may also be referred to as output data.
상기 출력 액티베이션(750)은 제1차원, 제2차원, 및 제3차원으로 이루어진 3차원 어레이일 수 있다. 상기 출력 액티베이션(750)의 상기 제1차원, 상기 제2차원, 및 상기 제3차원은 각각 출력채널 차원, 높이 차원, 및 폭 차원으로 지칭될 수 있다. 도 2a 내지 도 2c에 제시한 상기 출력 액티베이션(750)은 제1차원의 크기 co, 제2차원의 크기 ho, 및 제3차원의 크기 wo가 각각 2, 2, 및 3인 예이다. 도 2a 내지 도 2c에 제시한 상기 출력 액티베이션(750)의 데이터 크기는 co*ho*wo에 비례한다.The output activation 750 may be a three-dimensional array consisting of a first dimension, a second dimension, and a third dimension. The first dimension, the second dimension, and the third dimension of the output activation 750 may be referred to as an output channel dimension, a height dimension, and a width dimension, respectively. The output activation 750 shown in FIGS. 2A to 2C is an example in which the size co of the first dimension, the size ho of the second dimension, and the size wo of the third dimension are 2, 2, and 3, respectively. The data size of the output activation 750 shown in FIGS. 2A to 2C is proportional to co*ho*wo.
본 명세서에서 상기 출력 액티베이션(750) 중 상기 출력채널의 인덱스가 k인 부분은 '출력 액티베이션[co]=k'라고 표현할 수 있다. 도 2a 내지 도 2c에서 출력 액티베이션[co]=1은 참조번호 751로 나타내고, 출력 액티베이션[co]=2은 참조번호 752로 나타낸다.In this specification, the part where the index of the output channel is k among the output activations 750 can be expressed as 'output activation [co]=k '. 2A to 2C, output activation [co] = 1 is indicated by reference numeral 751, and output activation [co] = 2 is indicated by reference numeral 752.
도 2b는 상기 출력 액티베이션[co]=1(751)을 생성하는 방법을 나타낸 것이다. 상기 출력 액티베이션[co]=1(751)은 상기 입력 액티베이션(710)과 상기 가중치[co]=1(741)에 대한 콘볼루션 연산에 의해 생성된다.Figure 2b shows how to generate the output activation [co] = 1 (751). The output activation [co] = 1 (751) is generated by a convolution operation of the input activation 710 and the weight [co] = 1 (741).
도 2c는 상기 출력 액티베이션[co]=2(752)를 생성하는 방법을 나타낸 것이다. 상기 출력 액티베이션[co]=2(752)은 상기 입력 액티베이션(710)과 상기 가중치[co]=2(742)에 대한 콘볼루션 연산에 의해 생성된다.Figure 2c shows how to generate the output activation [co] = 2 (752). The output activation [co] = 2 (752) is generated by a convolution operation of the input activation 710 and the weight [co] = 2 (742).
도 3a는 본 발명의 일 실시예에서 이용되는 컴퓨팅 장치 중 일부의 주요 구조를 나타낸 것이다.3A shows the main structure of some of the computing devices used in an embodiment of the present invention.
컴퓨팅 장치(1)는, DRAM(Dynamic Random Access Memory)(130), 하드웨어 가속기(110), DRAM(130)와 하드웨어 가속기(110)를 연결하는 버스(700), 및 버스(700)에 연결된 타 하드웨어들(99) 및 메인 프로세서(160)를 포함할 수 있다. 여기서 DRAM(130)은 메모리(130)로 지칭될 수 있다.The computing device 1 includes a dynamic random access memory (DRAM) 130, a hardware accelerator 110, a bus 700 connecting the DRAM 130 and the hardware accelerator 110, and other devices connected to the bus 700. hardware 99 and main processor 160 . Here, the DRAM 130 may be referred to as a memory 130 .
그 밖에 컴퓨팅 장치(1)는 도시되지 않은 전원부, 통신부, 사용자 인터페이스, 저장부(170), 및 주변 장치부들을 더 포함할 수 있다. 버스(700)는 상기 하드웨어 가속기(110)와 타 하드웨어들(99), 그리고 메인 프로세서(160)가 공유할 수도 있다.In addition, the computing device 1 may further include a power supply unit, a communication unit, a user interface, a storage unit 170, and peripheral units not shown. The bus 700 may be shared by the hardware accelerator 110, other hardware 99, and the main processor 160.
상기 하드웨어 가속기(110)는 DMA부(Direct Memory Access part)(20), 제어부(40), 내부 메모리(30), 입력버퍼(650), 데이터 연산부(610), 및 출력버퍼(640)를 포함할 수 있다. The hardware accelerator 110 includes a DMA unit (Direct Memory Access part) 20, a control unit 40, an internal memory 30, an input buffer 650, a data operation unit 610, and an output buffer 640 can do.
내부 메모리(30)에 임시 저장되는 데이터의 일부 또는 전부는 버스(700)를 통해 DRAM(130)으로부터 제공될 수 있다. 이때, DRAM(130)에 저장되어 있는 데이터를 내부 메모리(30)로 이동시키기 위하여, 제어부(40)와 DMA부(20)가 내부 메모리(30) 및 DRAM(130)을 제어할 수도 있다.Some or all of data temporarily stored in the internal memory 30 may be provided from the DRAM 130 through the bus 700 . At this time, the controller 40 and the DMA unit 20 may control the internal memory 30 and the DRAM 130 to move data stored in the DRAM 130 to the internal memory 30 .
내부 메모리(30)에 저장되어 있던 데이터는 입력버퍼(650)를 통해 데이터 연산부(610)에게 제공될 수 있다. Data stored in the internal memory 30 may be provided to the data calculator 610 through the input buffer 650 .
상기 데이터 연산부(610)가 동작하여 생성된 출력값들은 출력버퍼(640)을 거쳐 상기 내부 메모리(30)에 저장될 수 있다. 상기 내부 메모리(30)에 저장된 상기 출력값들은 제어부(40) 및 DMA부(20)의 제어에 의해 DRAM(130)에 기록될 수도 있다. Output values generated by the operation of the data calculator 610 may be stored in the internal memory 30 via the output buffer 640 . The output values stored in the internal memory 30 may be written to the DRAM 130 under the control of the control unit 40 and the DMA unit 20 .
제어부(40)는 DMA부(20), 내부 메모리(30), 및 상기 데이터 연산부(610)의 동작을 총괄하여 제어할 수 있다.The control unit 40 may collectively control the operations of the DMA unit 20, the internal memory 30, and the data operation unit 610.
일 구현예에서, 상기 데이터 연산부(610)는 제1시구간 동안에는 제1연산기능을 수행하고 제2시구간 동안에는 제2연산기능을 수행할 수 있다. In one embodiment, the data calculator 610 may perform a first calculation function during a first time period and a second calculation function during a second time period.
도 3a에는, 상기 데이터 연산부(610)는 상기 하드웨어 가속기(110) 내에 1개가 제시되어 있다. 그러나 도시하지 않은 변형된 일 실시예에서, 도 3a에 나타낸 상기 데이터 연산부(610)는 상기 하드웨어 가속기(110) 내에 복수 개 제공되어 각각 제어부(40)에 의해 요청된 연산을 병렬적으로 수행할 수도 있다.In FIG. 3A , one data calculation unit 610 is presented within the hardware accelerator 110 . However, in a modified embodiment not shown, a plurality of data calculation units 610 shown in FIG. 3A may be provided in the hardware accelerator 110 to perform operations requested by the control unit 40 in parallel, respectively. there is.
일 구현예에서, 상기 데이터 연산부(610)는 그 출력데이터를 한 번에 출력하지 않고 시간에 따라 주어진 순서에 따라 순차적으로 출력할 수 있다.In one embodiment, the data operation unit 610 may sequentially output the output data according to a given order according to time rather than outputting them all at once.
도 3b 내지 도 3e는 콘볼루션 연산을 위해 수학연산 대상을 저장하는 저장공간의 크기와 상기 수학연산 대상의 크기를 비교한 것이다. 상기 버퍼는 도 3a에 제시한 내부메모리(30)의 일부일 수 있다. 예컨대, 상기 내부메모리(30)에는 입력 액티베이션(710)을 위해 할당된 제1저장공간이 정의되어 있고, 그리고 가중치를 위해 할당된 제2저장공간이 정의되어 있을 수 있다. 상기 제1저장공간 및 상기 제2저장공간의 크기는 한정되어 있을 수 있다.3B to 3E compare the size of a storage space for storing a mathematical operation target for a convolution operation with the size of the mathematical operation target. The buffer may be part of the internal memory 30 shown in FIG. 3A. For example, in the internal memory 30, a first storage space allocated for the input activation 710 may be defined, and a second storage space allocated for a weight may be defined. The sizes of the first storage space and the second storage space may be limited.
도 3b에 나타낸 것과 같이, 상기 입력 액티베이션(710)의 크기가 상기 제1저장공간의 크기보다 크면 상기 입력 액티베이션(710) 전체가 상기 제1저장공간에 입력될 수 없다는 문제가 발생한다. 이러한 문제를 해결하기 위하여, 도 3c에 나타낸 것과 같이, 상기 입력 액티베이션(710)을 입력채널 별로 스플릿하여, 예컨대 입력 액티베이션(711, 712)만을 상기 제1저장공간에 저장하여 이용할 수 있다. As shown in FIG. 3B, when the size of the input activation 710 is greater than the size of the first storage space, a problem arises in that the entirety of the input activation 710 cannot be input to the first storage space. To solve this problem, as shown in FIG. 3C, the input activations 710 may be split for each input channel, and only the input activations 711 and 712, for example, may be stored in the first storage space and used.
마찬가지로 도 3d에 나타낸 것과 같이, 상기 가중치(740)의 크기가 상기 제2저장공간의 크기보다 크면 상기 가중치(740) 전체가 상기 제2저장공간에 입력될 수 없다는 문제가 발생한다. 이러한 문제를 해결하기 위하여, 도 3e에 나타낸 것과 같이, 상기 가중치(740)을 입력채널 별로 스플릿하여, 예컨대 제1출력채널의 입력 액티베이션(7411, 7412) 및 제2출력채널의 입력 액티베이션(7421, 7422)만을 상기 제2저장공간에 저장하여 이용할 수 있다. Likewise, as shown in FIG. 3D, when the size of the weight 740 is larger than the size of the second storage space, a problem arises in that the entire weight 740 cannot be input to the second storage space. To solve this problem, as shown in FIG. 3E, the weight 740 is split for each input channel, so that, for example, the input activations 7411 and 7412 of the first output channel and the input activations 7421 and 7421 of the second output channel 7422) can be stored and used in the second storage space.
내부메모리의 크기가 작다는 이유 때문에, 상기 입력 액티베이션(710) 및 상기 가중치(740) 중 어느 하나를 입력채널 별로 스플릿하면, 다른 하나도 입력채널 별로 스플릿해야 할 수 있다.Due to the small size of the internal memory, if one of the input activation 710 and the weight 740 is split for each input channel, the other one may also need to be split for each input channel.
도 4는 콘볼루션 연산을 위해 가중치를 입력채널 별로 스플릿 하는 개념을 나타낸 것이다.4 illustrates a concept of splitting weights for each input channel for convolution operation.
본 명세서에서 상기 가중치(740) 중 상기 출력채널 인덱스가 k이고 상기 입력채널 인덱스가 j인 부분은 '가중치[co]=k,[ci]=j'라고 표현할 수 있다. 도 4에서 가중치[co]=1,[ci]=1, 가중치[co]=1,[ci]=2, 가중치[co]=1,[ci]=3, 가중치[co]=2,[ci]=1, 가중치[co]=2,[ci]=2, 가중치[co]=2,[ci]=3은 각각 참조번호 7411, 7412, 7413, 7421, 7422, 및 7423으로 나타낸다.In this specification, a portion of the weight 740 in which the output channel index is k and the input channel index is j can be expressed as 'weight [co] = k, [ci] = j '. In FIG. 4, weight [co]=1,[ci]=1 , weight [co]=1,[ci]=2 , weight [co]=1,[ci]=3 , weight [co]=2,[ ci]=1 , weight [co]=2, [ci]=2 , weight [co]=2, [ci]=3 are denoted by reference numerals 7411, 7412, 7413, 7421, 7422, and 7423, respectively.
도 5는 상기 스플릿 데이터를 이용하여 도 2의 (b)에 제시한 상기 출력 액티베이션(750)을 산출하는 방법을 나타낸 것이다.FIG. 5 illustrates a method of calculating the output activation 750 shown in FIG. 2(b) using the split data.
도 5에 제시한 실시예에서, 상기 입력 액티베이션(710) 및 상기 가중치(740)가 입력채널 별로 스플릿 되었으므로 콘볼루션 연산에 필요한 버퍼의 크기를 충분히 큰 것으로 가정할 수 있다.In the embodiment shown in FIG. 5, since the input activation 710 and the weight 740 are split for each input channel, it can be assumed that the size of the buffer required for the convolution operation is sufficiently large.
이하 도 5를 참조하여 설명한다.It will be described with reference to FIG. 5 below.
상기 입력 액티베이션[ci]=1(711)과 상기 가중치[co]=1,[ci]=1(7411)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=1,[ci]=1(7511)을 산출할 수 있다.By performing a convolution operation on the input activation [ci] = 1 (711) and the weight [co] = 1, [ci] = 1 (7411), the output activation [co] = 1, [ci] = 1 ( 7511) can be calculated.
상기 입력 액티베이션[ci]=2(712)과 상기 가중치[co]=1,[ci]=2(7412)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=1,[ci]=2(7512)을 산출할 수 있다.By performing a convolution operation on the input activation [ci] = 2 (712) and the weight [co] = 1, [ci] = 2 (7412), the output activation [co] = 1, [ci] = 2 ( 7512) can be calculated.
상기 입력 액티베이션[ci]=3(713)과 상기 가중치[co]=1,[ci]=3(7413)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=1,[ci]=3(7513)을 산출할 수 있다.By performing a convolution operation on the input activation [ci] = 3 (713) and the weight [co] = 1, [ci] = 3 (7413), the output activation [co] = 1, [ci] = 3 ( 7513) can be calculated.
상기 입력 액티베이션[ci]=1(711)과 상기 가중치[co]=2,[ci]=1(7421)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=2,[ci]=1(7521)을 산출할 수 있다.By performing a convolution operation on the input activation [ci] = 1 (711) and the weight [co] = 2, [ci] = 1 (7421), the output activation [co] = 2, [ci] = 1 ( 7521) can be calculated.
상기 입력 액티베이션[ci]=2(712)과 상기 가중치[co]=2,[ci]=2(7422)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=2,[ci]=2(7522)을 산출할 수 있다.By performing a convolution operation on the input activation [ci] = 2 (712) and the weight [co] = 2, [ci] = 2 (7422), the output activation [co] = 2, [ci] = 2 ( 7522) can be calculated.
상기 입력 액티베이션[ci]=3(713)과 상기 가중치[co]=2,[ci]=3(7423)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=2,[ci]=3(7523)을 산출할 수 있다.By performing a convolution operation on the input activation [ci] = 3 (713) and the weight [co] = 2, [ci] = 3 (7423), the output activation [co] = 2, [ci] = 3 ( 7523) can be calculated.
이제, 상기 출력 액티베이션[co]=1,[ci]=1(7511), 상기 출력 액티베이션[co]=1,[ci]=2(7512), 및 상기 출력 액티베이션[co]=1,[ci]=3(7513)에 대하여, 엘레먼트 별 덧셈 연산(element-wise adding operation)(P101)을 수행하여 상기 출력 액티베이션[co]=1(751)을 산출할 수 있다.Now, the output activation [co] = 1, [ci] = 1 (7511), the output activation [co] = 1, [ci] = 2 (7512), and the output activation [co] = 1, [ci ] = 3 (7513), the output activation [co] = 1 (751) may be calculated by performing an element-wise adding operation (P101).
그리고 상기 출력 액티베이션[co]=2,[ci]=1(7521), 상기 출력 액티베이션[co]=2,[ci]=2(7522), 및 상기 출력 액티베이션[co]=2,[ci]=3(7523)에 대하여, 엘레먼트 별 덧셈 연산(element-wise adding operation)(P102)을 수행하여 상기 출력 액티베이션[co]=2(752)을 산출할 수 있다.and the output activation [co]=2,[ci]=1 (7521), the output activation [co]=2,[ci]=2 (7522), and the output activation [co]=2,[ci] = 3 (7523), the output activation [co] = 2 (752) may be calculated by performing an element-wise adding operation (P102).
그 다음, 상기 출력 액티베이션[co]=1(751)과 상기 출력 액티베이션[co]=2(752)를 결합하여 상기 출력 액티베이션(750)을 생성할 수 있다.Then, the output activation 750 may be generated by combining the output activation [co]=1 (751) and the output activation [co]=2 (752).
상술한 엘레먼트 별 덧셈 연산(P101, P102) 과정에서, 각 출력 액티베이션[co]=k,[ci]=j을 버퍼에 기록하는 과정이 수행될 수 있는데, 이 과정에서 데이터의 양자화 오류가 발생할 수 있다.In the process of the above-mentioned addition operation for each element (P101, P102), a process of recording each output activation [co] = k, [ci] = j in a buffer may be performed. In this process, quantization errors of data may occur. there is.
본 발명에서는 하드웨어 가속기에서 데이터를 연산하거나 처리할 때에, 데이터를 2개 그룹 이상으로 나누어 처리하는 과정에서 발생하는 양자화 오류를 감소시키는 기술을 제공하고자 한다.An object of the present invention is to provide a technique for reducing quantization errors generated in the process of processing or dividing data into two or more groups when calculating or processing data in a hardware accelerator.
본 발명의 일 양상에 따라 제공되는 연산방법은 상술한 양자화 오류를 개선하기 위한 엘레먼트 별 덧셈 연산(P101, P102)의 구체적인 방법에 관한 것이다.An operation method provided according to an aspect of the present invention relates to a specific method of element-by-element addition operation (P101, P102) to improve the above-described quantization error.
본 발명의 일 관점에 따라 제공되는 연산방법은, 컴퓨팅 장치가, 제1입력 데이터(710)와 제2입력 데이터(740)를 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들(7012, 7034, 7056 or 7511~7513)을 생성하는 단계; 상기 컴퓨팅 장치가, 상기 한 세트의 콘볼루션 데이터들의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일(sc_co_ci1,2, sc_co_ci3,4, 및 sc_co_ci5,6)을 결정하는 단계; 상기 컴퓨팅 장치가, 상기 한 세트의 콘볼루션 데이터들 중 제1스케일로 표현된 제1콘볼루션 데이터(7012)와 제2스케일로 표현된 제2콘볼루션 데이터(7034)에 대한 덧셈 연산을 수행하여 중간 데이터(750p)를 생성하는 단계; 및 상기 컴퓨팅 장치가, 상기 중간 데이터를 생성하는 단계 이후에, 상기 한 세트의 콘볼루션 데이터들 중 제3스케일로 표현된 제3콘볼루션 데이터(7056)와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 출력 데이터(750)를 산출하는 단계;를 포함할 수 있다. 이때, 상기 제3스케일은 상기 제1스케일보다 작지 않고, 상기 제3스케일은 상기 제2스케일보다 작지 않을 수 있다. In an operation method provided according to one aspect of the present invention, a computing device performs a convolution on first input data 710 and second input data 740 for each input channel to obtain a set of convolutional data (7012, 7034). , 7056 or 7511 to 7513); The computing device sets scales (sc_co_ci1,2, sc_co_ci3,4, and sc_co_ci5,6 representing each convolution data based on statistical values of values constituting each convolution data of the set of convolution data). ) determining; The computing device performs an addition operation on first convolution data 7012 represented by a first scale and second convolution data 7034 represented by a second scale among the set of convolution data, generating intermediate data 750p; And the computing device, after generating the intermediate data, performs an addition operation on third convolution data 7056 expressed in a third scale among the set of convolution data and the intermediate data, , calculating the output data 750; may include. In this case, the third scale may not be smaller than the first scale, and the third scale may not be smaller than the second scale.
이때, 상기 한 세트의 콘볼루션 데이터를 생성하는 단계는, 상기 제1입력 데이터를 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터(711~716)와 상기 제2입력 데이터의 한 세트의 출력채널(741)을 입력채널 별로 스플릿하여 얻은 한 세트의 제2스플릿 데이터(7411~7416)를, 입력채널 별로 콘볼루션하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계; 및 상기 출력 데이터를 산출하는 단계는, 상기 제3콘볼루션 데이터(7056)와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터를 산출하는 단계를 포함할 수 있다.In this case, the step of generating the one set of convolution data includes outputting one set of first split data 711 to 716 obtained by splitting the first input data for each input channel and one set of the second input data. generating the set of convolutional data by convolving a set of second split data (7411 to 7416) obtained by splitting the channel 741 for each input channel; and calculating the output data may include performing an addition operation on the third convolution data 7056 and the intermediate data to calculate output data corresponding to the set of output channels of the second input data. steps may be included.
이때, 상기 한 세트의 출력채널은 상기 제2입력 데이터를 구성하는 복수 개의 출력채널 중 어느 하나의 특정 출력채널이며, 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터는 상기 특정 출력채널에 대응하는 출력 데이터일 수 있다.At this time, the set of output channels is any one specific output channel among a plurality of output channels constituting the second input data, and the output data corresponding to the set of output channels of the second input data is the specific output channel. It may be output data corresponding to an output channel.
이때, 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들을 생성하는 단계는, 상기 한 세트의 제1스플릿 데이터와 상기 한 세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션하여, 각 입력채널에 대응하는 입력채널 콘볼루션 데이터들로 이루어진 한 세트의 입력채널 콘볼루션 데이터들(7501~7506, 또는 7511~7516))을 생성하는 단계; 및 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계를 포함할 수 있다.In this case, the step of performing convolution for each input channel to generate a set of convolution data includes performing convolution on the first split data set and the second split data set for each input channel to correspond to each input channel. generating a set of input channel convolution data (7501 to 7506, or 7511 to 7516) consisting of input channel convolution data of and generating the one set of convolution data by grouping the one set of input channel convolution data.
이때, 상기 각각의 콘볼루션 데이터는, 상기 한 세트의 입력채널 콘볼루션 데이터들 중 한 개의 입력채널 콘볼루션 데이터와 동일한 것이거나, 또는 상기 한 세트의 입력채널 콘볼루션 데이터들 중 두 개 이상의 입력채널 콘볼루션 데이터들에 대한 엘레먼트별 덧셈 연산을 수행하여 산출한 것일 수 있다.At this time, each of the convolution data is the same as one input channel convolution data among the set of input channel convolution data, or two or more input channels among the set of input channel convolution data. It may be calculated by performing an element-by-element addition operation on the convolution data.
이때, 상기 연산방법은, 상기 그룹을 결정하기 위하여, 상기 컴퓨팅 장치가, 상기 각각의 제2스플릿 데이터를 구성하는 엘레먼트들의 값들의 레인지를 산출하여 한 세트의 레인지(rg_w_co_ci1~rg_w_co_ci6)를 결정하는 단계; 및 상기 컴퓨팅 장치가, 상기 한 세트의 레인지를 기준으로 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하는 단계를 더 포함할 수 있다.At this time, the calculation method may include, in order to determine the group, the computing device calculates a range of values of elements constituting each of the second split data and determines a set of ranges (rg_w_co_ci1 to rg_w_co_ci6) ; and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges.
또는, 상기 연산방법은, 상기 그룹을 결정하기 위하여, 상기 컴퓨팅 장치가, 상기 각각의 입력채널 콘볼루션 데이터를 구성하는 엘레먼트들의 값들의 레인지를 산출하여 한 세트의 레인지(rg_co_ci1~rg_co_ci6)를 결정하는 단계; 및 상기 컴퓨팅 장치가, 상기 한 세트의 레인지를 기준으로 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하는 단계를 더 포함할 수 있다.Alternatively, the calculation method may include, in order to determine the group, the computing device calculates a range of values of elements constituting each of the input channel convolution data and determines a set of ranges (rg_co_ci1 to rg_co_ci6) step; and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges.
이때, 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계는, 상기 한 세트의 제1스플릿 데이터와 상기 한 세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션하여, 각 입력채널에 대응하는 입력채널 콘볼루션 데이터들로 이루어진 한 세트의 입력채널 콘볼루션 데이터들을 생성하는 단계;를 포함하며, 상기 각각의 콘볼루션 데이터는, 상기 한 세트의 입력채널 콘볼루션 데이터들 중 한 개의 입력채널 콘볼루션 데이터와 동일한 것일 수 있다.In this case, the step of generating the one set of convolution data may include convolution of the first split data of the one set and the second split data of the one set for each input channel to obtain an input channel convolution corresponding to each input channel. and generating a set of input channel convolution data consisting of data, wherein each convolution data is identical to one input channel convolution data among the set of input channel convolution data. can
이때, 상기 컴퓨팅 장치는, 상기 제2입력 데이터에 포함된 모든 출력채널에 대하여, 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계, 상기 결정하는 단계, 상기 중간 데이터를 생성하는 단계, 및 상기 산출하는 단계를 실행하도록 되어 있고, 상기 컴퓨팅 장치는, 상기 제2입력 데이터에 포함된 각각의 출력채널에 대하여 생성된 채널별 출력 데이터들을 결합하여 상기 모든 출력채널을 포함하는 출력 데이터를 생성하도록 되어 있을 수 있다.At this time, the computing device includes the step of generating the set of convolution data, the step of determining, the step of generating the intermediate data, and the step of calculating the set of convolution data for all output channels included in the second input data. step, the computing device may be configured to combine output data for each channel generated for each output channel included in the second input data to generate output data including all the output channels. there is.
이때, 상기 제1입력 데이터는 입력 액티베이션이고, 상기 제2입력 데이터는 가중치이며, 상기 출력 데이터는 출력 액티베이션이고, 상기 가중치의 디멘젼은 상기 입력 액티베이션의 디멘젼보다 클 수 있다.In this case, the first input data is an input activation, the second input data is a weight, the output data is an output activation, and a dimension of the weight may be greater than a dimension of the input activation.
이때, 상기 입력 액티베이션은 복수 개의 제1입력채널 데이터를 포함하며, 상기 각각의 제1입력채널 데이터는 2차원 어레이이며, 상기 가중치는 복수 개의 출력채널 데이터를 포함하며, 상기 각각의 출력채널 데이터는 복수 개의 제2입력채널 데이터를 포함하며, 상기 각각의 제2입력채널 데이터는 2차원 어레이일 수 있다.At this time, the input activation includes a plurality of first input channel data, each of the first input channel data is a two-dimensional array, the weight includes a plurality of output channel data, and each of the output channel data is It includes a plurality of second input channel data, and each of the second input channel data may be a two-dimensional array.
본 발명의 일 관점에 따라 제공되는 하드웨어 가속기(110)를 갖는 컴퓨팅 장치로서, 상기 하드웨어 가속기가, 제1입력 데이터 및 제2입력데이터를 획득하도록 되어 있고, 상기 제1입력 데이터와 상기 제2입력 데이터를 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들을 생성하도록 되어 있고, 상기 한 세트의 콘볼루션 데이터들의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일을 결정하도록 되어 있고, 상기 한 세트의 콘볼루션 데이터들 중 제1스케일로 표현된 제1콘볼루션 데이터와 제2스케일로 표현된 제2콘볼루션 데이터에 대한 덧셈 연산을 수행하여 중간 데이터를 생성하도록 되어 있고, 그리고 상기 중간 데이터를 생성하는 단계 이후에, 상기 한 세트의 콘볼루션 데이터들 중 제3스케일로 표현된 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 출력 데이터를 산출하도록 되어 있을 수 있다. 이때, 상기 제3스케일은 상기 제1스케일보다 작지 않고, 상기 제3스케일은 상기 제2스케일보다 작지 않을 수 있다.A computing device having a hardware accelerator 110 provided according to one aspect of the present invention, wherein the hardware accelerator is adapted to obtain first input data and second input data, the first input data and the second input data A set of convolution data is generated by convolving data for each input channel, and each convolution data is expressed based on a statistical value of values constituting each convolution data of the set convolution data. It is configured to determine a scale to perform an addition operation on the first convolution data represented by the first scale and the second convolution data represented by the second scale among the set of convolution data to obtain intermediate data And after the step of generating the intermediate data, by performing an addition operation on the intermediate data and third convolution data expressed in a third scale among the set of convolution data, output data may be designed to produce In this case, the third scale may not be smaller than the first scale, and the third scale may not be smaller than the second scale.
이때, 상기 한 세트의 콘볼루션 데이터를 생성하는 단계는, 상기 제1입력 데이터를 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터와 상기 제2입력 데이터의 한 세트의 출력채널을 입력채널 별로 스플릿하여 얻은 한 세트의 제2스플릿 데이터를, 입력채널 별로 콘볼루션하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계; 및 상기 출력 데이터를 산출하는 단계는, 상기 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터를 산출하는 단계;를 더 포함하며, 상기 하드웨어 가속기(110)는 내부 메모리(30)를 포함하며, 상기 내부메모리의 크기는 상기 제2입력 데이터 전체의 데이터 크기보다 작고, 상기 제2입력 데이터의 한 세트의 출력채널을 입력채널 별로 스플릿하여 얻은 스플릿 데이터의 크기보다 클 수 있다.At this time, the step of generating the one set of convolution data includes the first split data obtained by splitting the first input data for each input channel and the one set of output channels of the second input data for each input channel. generating a set of convolution data by convolving a set of second split data obtained by splitting for each input channel; And the calculating of the output data may include calculating output data corresponding to the set of output channels of the second input data by performing an addition operation on the third convolution data and the intermediate data; Further, the hardware accelerator 110 includes an internal memory 30, the size of the internal memory is smaller than the data size of all the second input data, and one set of output channels of the second input data may be greater than the size of split data obtained by splitting for each input channel.
본 발명에 따르면, 하드웨어 가속기에서 데이터를 연산하거나 처리할 때에, 데이터를 2개 그룹 이상으로 나누어 처리하는 과정에서 발생하는 양자화 오류를 감소시키는 기술을 제공할 수 있다.According to the present invention, when calculating or processing data in a hardware accelerator, it is possible to provide a technique for reducing quantization errors occurring in the process of dividing data into two or more groups and processing them.
도 1a는 본 발명에 따른 수학연산의 대상 중 하나인 입력 액티베이션의 구성을 나타낸 것이다.1A shows the configuration of input activation, which is one of the subjects of mathematical operation according to the present invention.
도 1b는 본 발명에 따른 수학연산의 대상 중 다른 하나인 가중치의 구성을 나타낸 것이다.1B shows the configuration of a weight, which is another one of the objects of mathematical operation according to the present invention.
도 1c는 입력 액티베이션이 6개의 입력채널들로 이루어진 예를 나타낸 것이다. 1C shows an example in which input activation consists of 6 input channels.
도 1d는 가중치가 2개의 출력채널들로 이루어지고, 각 출력채널은 6개의 입력채널로 이루어진 예를 나타낸 것이다.1D shows an example in which weights are composed of two output channels and each output channel is composed of six input channels.
도 2a 내지 도 2c는 상기 입력 액티베이션과 상기 가중치 간의 콘볼루션 연산을 설명하는 개념도이다.2A to 2C are conceptual diagrams illustrating a convolution operation between the input activation and the weight.
도 3a는 본 발명의 일 실시예에서 이용되는 컴퓨팅 장치 중 일부의 주요 구조를 나타낸 것이고, 도 3b 내지 도 3e는 콘볼루션 연산을 위해 수학연산 대상을 저장하는 저장공간의 크기와 상기 수학연산 대상의 크기를 비교한 것이다. Figure 3a shows the main structure of some of the computing devices used in an embodiment of the present invention, Figures 3b to 3e is the size of the storage space for storing a mathematical operation target for convolution operation and the mathematical operation target size comparison.
도 4는 콘볼루션 연산을 위해 가중치를 입력채널 별로 스플릿 하는 개념을 나타낸 것이다.4 illustrates a concept of splitting weights for each input channel for convolution operation.
도 5는 상기 스플릿 데이터를 이용하여 도 2의 (b)에 제시한 상기 출력 액티베이션을 산출하는 방법을 나타낸 것이다.FIG. 5 illustrates a method of calculating the output activation shown in FIG. 2(b) using the split data.
도 6a 내지 도 6c는 본 발명의 일 실시예에 따라 입력 액티베이션과 가중치에 대한 콘볼루션 연산을 수행하여 출력 액티베이션을 산출하는 방법을 나타낸 순서도이다.6A to 6C are flowcharts illustrating a method of calculating output activations by performing a convolution operation on input activations and weights according to an embodiment of the present invention.
도 7a 내지 도 7c는 본 발명의 일 실시예에 따라 입력 액티베이션과 가중치에 대한 콘볼루션 연산을 수행하여 출력 액티베이션을 산출하는 방법을 나타낸 것이다.7A to 7C illustrate a method of calculating output activation by performing a convolution operation on an input activation and a weight according to an embodiment of the present invention.
도 8은 본 발명의 일 실시예에 따라 두 개의 입력 데이터에 대한 연산을 수행하여 출력 데이터를 생성하는 방법을 나타낸 순서도이다.8 is a flowchart illustrating a method of generating output data by performing an operation on two input data according to an embodiment of the present invention.
도 9a는 6개의 입력채널들로 구성되는 입력 액티베이션과 2개의 출력채널들로 구성되는 가중치의 제1출력채널 간의 콘볼루션 연산과정을 나타낸 것이다. 9A illustrates a convolution operation process between an input activation composed of 6 input channels and a first output channel of a weight composed of 2 output channels.
도 9b는 상기 입력 액티베이션과 상기 제2출력채널 간의 콘볼루션 연산과정을 나타낸 것이다.9B illustrates a convolution operation process between the input activation and the second output channel.
도 10은 도 9a에 제시된 특정 그룹에 속하게 될 입력채널들을 결정하는 구체적인 방법을 나타낸 일 실시예를 나타낸 것이다. FIG. 10 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 9A.
도 11은 도 9a에 제시된 특정 그룹에 속하는 입력채널들을 결정하는 구체적인 방법을 나타낸 또 다른 실시예를 나타낸 것이다.FIG. 11 shows another embodiment of a specific method of determining input channels belonging to a specific group shown in FIG. 9A.
도 12는 본 발명의 다른 실시예에 따라 제공되는 연산방법을 나타낸 것이다.12 shows a calculation method provided according to another embodiment of the present invention.
도 13은 도 12에 제시된 특정 그룹에 속하게 될 입력채널들을 결정하는 구체적인 방법을 나타낸 일 실시예를 나타낸 것이다. FIG. 13 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 12 .
도 14는 도 12에 제시된 특정 그룹에 속하는 입력채널들을 결정하는 구체적인 방법을 나타낸 또 다른 실시예를 나타낸 것이다.FIG. 14 shows another embodiment of a specific method for determining input channels belonging to a specific group shown in FIG. 12 .
도 15는 본 발명의 일 실시예에 따라 제공되는 연산방법을 나타낸 순서도이다.15 is a flowchart illustrating a calculation method provided according to an embodiment of the present invention.
이하, 본 발명의 실시예를 첨부한 도면을 참고하여 설명한다. 그러나 본 발명은 본 명세서에서 설명하는 실시예에 한정되지 않으며 여러 가지 다른 형태로 구현될 수 있다. 본 명세서에서 사용되는 용어는 실시예의 이해를 돕기 위한 것이며, 본 발명의 범위를 한정하고자 의도된 것이 아니다. 또한, 이하에서 사용되는 단수 형태들은 문구들이 이와 명백히 반대의 의미를 나타내지 않는 한 복수 형태들도 포함한다.Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, the present invention is not limited to the embodiments described herein and may be implemented in various other forms. Terms used in this specification are intended to aid understanding of the embodiments, and are not intended to limit the scope of the present invention. Also, the singular forms used herein include the plural forms unless the phrases clearly dictate the contrary.
본 명세서에서 도 6a, 도 6b, 및 도 6c는 통칭하여 도 6이라고 지칭할 수 있다. 도 7a, 도 7b, 및 도 7c는 통칭하여 도 7이라고 지칭할 수 있다.In this specification, FIGS. 6a, 6b, and 6c may collectively be referred to as FIG. 6 . 7a, 7b, and 7c may collectively be referred to as FIG. 7 .
도 6은 본 발명의 일 실시예에 따라 입력 액티베이션과 가중치에 대한 콘볼루션 연산을 수행하여 출력 액티베이션을 산출하는 방법을 나타낸 순서도이다.6 is a flowchart illustrating a method of calculating output activations by performing a convolution operation on input activations and weights according to an embodiment of the present invention.
도 6에서 입력 액티베이션은 도 1a에 예시한 상기 입력 액티베이션(710)과 같은 구조를 갖는 3차원 데이터일 수 있고, 가중치는 도 1에 예시한 상기 가중치(740)와 같은 구조를 갖는 4차원 데이터일 수 있다.In FIG. 6 , the input activation may be 3D data having the same structure as the input activation 710 illustrated in FIG. 1A , and the weight may be 4D data having the same structure as the weight 740 illustrated in FIG. 1 . can
도 7은 본 발명의 일 실시예에 따라 입력 액티베이션과 가중치에 대한 콘볼루션 연산을 수행하여 출력 액티베이션을 산출하는 방법을 나타낸 것이다.7 illustrates a method of calculating output activations by performing a convolution operation on input activations and weights according to an embodiment of the present invention.
도 6a, 도 6b, 및 도 6c에 제시된 내용은 각각 도 7a, 도 7b, 및 도 7c에 제시된 내용과 대응된다.Contents presented in FIGS. 6A, 6B, and 6C correspond to those presented in FIGS. 7A, 7B, and 7C, respectively.
이하, 도 6a 및 도 7a를 함께 참조하여 설명한다.Hereinafter, it will be described with reference to FIGS. 6A and 7A together.
단계(S110)에서, 상기 입력 액티베이션(710)을 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터(711, 712, 713)를 얻을 수 있다. 그리고 상기 가중치(740)의 제1출력채널(741)을 입력채널 별로 스플릿하여 한 세트의 제2스플릿 데이터(7411, 7412, 7413)를 얻을 수 있다. 그리고 상기 한 세트의 제1스플릿 데이터(711, 712, 713)와 상기 한 세트의 제2스플릿 데이터(7411, 7412, 7413)를 입력채널 별로 콘볼루션하여, 한 세트의 콘볼루션 데이터들(7511, 7512, 7513)을 생성할 수 있다.In step S110, a set of first split data 711, 712, and 713 obtained by splitting the input activation 710 for each input channel may be obtained. The first output channel 741 of the weight 740 is split for each input channel to obtain a set of second split data 7411, 7412, and 7413. Further, the set of first split data 711, 712, and 713 and the set of second split data 7411, 7412, and 7413 are convoluted for each input channel to obtain a set of convolution data 7511, 7512, 7513) can be created.
단계(S120)에서, 상기 한 세트의 콘볼루션 데이터들(7511, 7512, 7513)의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일을 결정할 수 있다.In step S120, a scale representing each convolution data may be determined based on statistical values of values constituting each convolution data of the set of convolution data 7511, 7512, and 7513. .
예컨대, 콘볼루션 데이터(7511)를 구성하는 6개의 엘리먼트들의 값의 분포를 기초로 콘볼루션 데이터(7511)의 표현을 위해 적용될 스케일 sc_co1_ci1을 결정할 수 있다는 점은 쉽게 이해될 수 있다. 마찬가지로 콘볼루션 데이터(7512)를 구성하는 6개의 엘리먼트들의 분포를 기초로 콘볼루션 데이터(7512)의 표현을 위해 적용될 스케일 sc_co1_ci2을 결정할 수 있다는 점은 쉽게 이해될 수 있다.For example, it can be easily understood that the scale sc_co1_ci1 to be applied for the representation of the convolution data 7511 can be determined based on the distribution of values of 6 elements constituting the convolution data 7511 . Similarly, it can be easily understood that the scale sc_co1_ci2 to be applied for the representation of the convolutional data 7512 can be determined based on the distribution of the six elements constituting the convolutional data 7512 .
이와 같이, 콘볼루션 데이터(7511), 콘볼루션 데이터(7512), 및 콘볼루션 데이터(7513)에 적용된 스케일은 각각 sc_co1_ci1, sc_co1_ci2, 및 sc_co1_ci3으로 결정될 수 있다. 여기서 sc_co1_ci1, sc_co1_ci2, 및 sc_co1_ci3은 각각 독립적으로 결정될 수 있는 값이다. 따라서 sc_co1_ci1, sc_co1_ci2, 및 sc_co1_ci3는 서로 같을 수도 있고 서로 다를 수도 있다.As such, the scales applied to the convolution data 7511, the convolution data 7512, and the convolution data 7513 may be determined as sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3, respectively. Here, sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3 are values that can be independently determined. Accordingly, sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3 may be the same or different.
단계(S130)에서, 상기 결정된 스케일(sc_co1_ci1, sc_co1_ci2, sc_co1_ci3)에 따라 상기 한 세트의 콘볼루션 데이터들(7511, 7512, 7513)의 구체적인 표현값을 결정할 수 있다.In step S130, specific expression values of the set of convolution data 7511, 7512, and 7513 may be determined according to the determined scales sc_co1_ci1, sc_co1_ci2, and sc_co1_ci3.
단계(S140)에서, 상기 한 세트의 콘볼루션 데이터들(7511, 7512, 7513) 중 '제1스케일(sc_co1_ci1)'로 표현된 제1 콘볼루션 데이터(7511)와 '제2스케일(sc_co1_ci2)'로 표현된 제2 콘볼루션 데이터(7512)에 대한 덧셈 연산을 수행하여 중간 데이터(751p)를 생성할 수 있다. In step S140, among the set of convolution data 7511, 7512, and 7513, first convolution data 7511 expressed as 'first scale (sc_co1_ci1)' and 'second scale (sc_co1_ci2)' Intermediate data 751p may be generated by performing an addition operation on the second convolutional data 7512 represented by .
단계(S150)에서, 상기 한 세트의 콘볼루션 데이터들(7511, 7512, 7513) 중 '제3스케일(sc_co1_ci3)'로 표현된 제3 콘볼루션 데이터(7513)와 상기 중간 데이터(751p)에 대한 덧셈 연산을 수행하여, 상기 가중치(740)의 제1출력채널([co]=1)에 대응하는 제1출력채널([co]=1)에 대한 출력 액티베이션(751)을 산출할 수 있다. 즉, 상기 출력 액티베이션[co]=1(751)을 산출할 수 있다.In step S150, the third convolution data 7513 expressed as 'third scale (sc_co1_ci3)' among the set of convolution data 7511, 7512, and 7513 and the intermediate data 751p By performing an addition operation, the output activation 751 for the first output channel ([co]=1) corresponding to the first output channel ([co]=1) of the weight 740 can be calculated. That is, the output activation [co] = 1 (751) can be calculated.
이때, 도 7a는, 상기 제3스케일(sc_co1_ci3)은 상기 제1스케일(sc_co1_ci1)보다 작지 않고, 상기 제3스케일(sc_co1_ci3)은 상기 제2스케일(sc_co1_ci2)보다 작지 않은 예를 나타낸 것이다.7A shows an example in which the third scale (sc_co1_ci3) is not smaller than the first scale (sc_co1_ci1) and the third scale (sc_co1_ci3) is not smaller than the second scale (sc_co1_ci2).
여기서, 단계(S140)는 단계(S150)보다 먼저 수행될 수 있다.Here, step S140 may be performed before step S150.
이하, 도 6b 및 도 7b를 함께 참조하여 설명한다.Hereinafter, it will be described with reference to FIGS. 6B and 7B together.
단계(S210)에서, 상기 입력 액티베이션(710)을 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터(711, 712, 713)와 상기 가중치(740)의 제2출력채널(742)을 입력채널 별로 스플릿하여 얻은 한 세트의 제2스플릿 데이터(7421, 7422, 7423)를, 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들(7521, 7522, 7523)을 생성할 수 있다.In step S210, a set of first split data 711, 712, 713 obtained by splitting the input activation 710 for each input channel and the second output channel 742 of the weight 740 are converted into input channels. A set of second split data 7421 , 7422 , and 7423 obtained by splitting each may be convoluted for each input channel to generate a set of convolutional data 7521 , 7522 , and 7523 .
단계(S220)에서, 상기 한 세트의 콘볼루션 데이터들(7521, 7522, 7523)의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일을 결정할 수 있다.In step S220, a scale representing each convolution data may be determined based on statistical values of values constituting each convolution data of the set of convolution data 7521, 7522, and 7523. .
예컨대, 콘볼루션 데이터(7521)를 구성하는 6개의 엘리먼트들의 분포를 기초로 콘볼루션 데이터(7521)의 표현을 위해 적용될 스케일 sc_co2_ci1을 결정할 수 있다는 점은 쉽게 이해될 수 있다. 마찬가지로 콘볼루션 데이터(7522)를 구성하는 6개의 엘리먼트들의 분포를 기초로 콘볼루션 데이터(7522)의 표현을 위해 적용될 스케일 sc_co2_ci2를 결정할 수 있다는 점은 쉽게 이해될 수 있다.For example, it can be easily understood that the scale sc_co2_ci1 to be applied for the representation of the convolution data 7521 can be determined based on the distribution of 6 elements constituting the convolution data 7521 . Similarly, it can be easily understood that the scale sc_co2_ci2 to be applied for the representation of the convolutional data 7522 can be determined based on the distribution of the six elements constituting the convolutional data 7522 .
이와 같이, 콘볼루션 데이터(7521), 콘볼루션 데이터(7522), 및 콘볼루션 데이터(7523)에 적용된 스케일은 각각 sc_co2_ci1, sc_co2_ci2, 및 sc_co2_ci3으로 결정될 수 있다. 여기서 sc_co2_ci1, sc_co2_ci2, 및 sc_co2_ci3은 각각 독립적으로 결정될 수 있는 값이다. 따라서 sc_co2_ci1, sc_co2_ci2, 및 sc_co2_ci3는 서로 같을 수도 있고 서로 다를 수도 있다.As such, the scales applied to the convolution data 7521, the convolution data 7522, and the convolution data 7523 may be determined as sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3, respectively. Here, sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3 are values that can be independently determined. Accordingly, sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3 may be the same or different.
단계(S230)에서, 상기 결정된 스케일(sc_co2_ci1, sc_co2_ci2, sc_co2_ci3)에 따라 상기 한 세트의 콘볼루션 데이터들(7521, 7522, 7523)의 구체적인 표현값을 결정할 수 있다.In step S230, specific expression values of the set of convolution data 7521, 7522, and 7523 may be determined according to the determined scales sc_co2_ci1, sc_co2_ci2, and sc_co2_ci3.
단계(S240)에서, 상기 한 세트의 콘볼루션 데이터들(7521, 7522, 7523) 중 '제1스케일(sc_co2_ci1)'로 표현된 제1 콘볼루션 데이터(7521)와 '제2스케일(sc_co2_ci2)'로 표현된 제2 콘볼루션 데이터(7522)에 대한 덧셈 연산을 수행하여 중간 데이터(752p)를 생성할 수 있다. In step S240, among the set of convolution data 7521, 7522, and 7523, first convolution data 7521 expressed as 'first scale sc_co2_ci1' and 'second scale sc_co2_ci2' Intermediate data 752p may be generated by performing an addition operation on the second convolutional data 7522 represented by .
단계(S250)에서, 상기 한 세트의 콘볼루션 데이터들(7521, 7522, 7523) 중 '제3스케일(sc_co2_ci3)'로 표현된 제3 콘볼루션 데이터(7523)와 상기 중간 데이터(752p)에 대한 덧셈 연산을 수행하여, 상기 가중치(740)의 제2출력채널([co]=2)에 대응하는 제2출력채널([co]=2)에 대한 출력 액티베이션(752)을 산출할 수 있다. 즉, 상기 출력 액티베이션[co]=2(752)을 산출할 수 있다.In step S250, the third convolution data 7523 expressed as 'third scale (sc_co2_ci3)' among the set of convolution data 7521, 7522, and 7523 and the intermediate data 752p By performing an addition operation, the output activation 752 for the second output channel ([co]=2) corresponding to the second output channel ([co]=2) of the weight 740 can be calculated. That is, the output activation [co] = 2 (752) can be calculated.
이때, 도 7b는, 상기 제3스케일(sc_co2_ci3)은 상기 제1스케일(sc_co2_ci1)보다 작지 않고, 상기 제3스케일(sc_co2_ci3)은 상기 제2스케일(sc_co2_ci2)보다 작지 않은 예를 나타낸 것이다.7B shows an example in which the third scale (sc_co2_ci3) is not smaller than the first scale (sc_co2_ci1) and the third scale (sc_co2_ci3) is not smaller than the second scale (sc_co2_ci2).
바람직한 일 실시예에서, 단계(S240)는 단계(S250)보다 먼저 수행될 수 있다.In a preferred embodiment, step S240 may be performed before step S250.
이하, 도 6c 및 도 7c를 함께 참조하여 설명한다.Hereinafter, it will be described with reference to FIGS. 6C and 7C together.
단계(S310)에서, 산출된 상기 출력 액티베이션[co]=1(751)과 상기 출력 액티베이션[co]=2(752)을 결합하여 상기 출력 액티베이션(750)을 산출할 수 있다.In step S310, the output activation 750 may be calculated by combining the calculated output activation [co]=1 (751) and the output activation [co]=2 (752).
본 발명의 일 실시예에 따라 제공되는 제1프로세스는 상기 단계(S110), 단계(S120), 단계(S130), 단계(S140), 및 단계(S150)를 포함할 수 있다. The first process provided according to an embodiment of the present invention may include steps S110, S120, S130, S140, and S150.
본 발명의 일 실시예에 따라 제공되는 제2프로세스는 상기 단계(S210), 단계(S220), 단계(S230), 단계(S240), 및 단계(S250)를 포함할 수 있다. The second process provided according to an embodiment of the present invention may include steps S210, S220, S230, S240, and S250.
본 발명의 일 실시예에 따라 제공되는 제3프로세스는 상기 단계(S310)을 포함할 수 있다. The third process provided according to an embodiment of the present invention may include the step S310.
상기 제1프로세스와 상기 제2프로세스는 병렬적으로 수행되거나 또는 선후 관계를 가지고 차례대로 수행될 수 있다. 상기 제3프로세스는 상기 제1프로세스 및 상기 제2프로세스가 모두 완료된 후에 실행될 수 있다.The first process and the second process may be performed in parallel or sequentially with a precedence relationship. The third process may be executed after both the first process and the second process are completed.
이때, 상술한 제1프로세스, 제2프로세스, 및 제3프로세스는 컴퓨팅 장치의 주처리장치에 의해 실행될 수도 있다. 이 경우 컴퓨팅 장치는 상기 제1프로세스, 제2프로세스, 및 제3프로세스의 실행을 위한 명령코드를 저장소에서 읽어 들여 휘발성 메모리에 저장하고, 상기 주처리장치는 상기 명령코드를 실행하여 상기 제1프로세스, 제2프로세스, 및 제3프로세스를 실행할 수 있다. 상술한 버퍼는 상기 명령코드에 따라 주처리장치 내부의 내부메모리 또는 휘발성 메모리의 일부분에 마련될 수 있다. 또한 상기 입력 액티베이션(710) 및 상기 가중치(740)는 주처리장치 내부의 내부메모리 또는 휘발성 메모리의 일부분에 저장될 수 있다.In this case, the above-described first process, second process, and third process may be executed by the main processing unit of the computing device. In this case, the computing device reads command codes for execution of the first process, the second process, and the third process from storage and stores them in a volatile memory, and the main processing unit executes the command codes to execute the first process , the second process, and the third process can be executed. The above-described buffer may be provided in a part of internal memory or volatile memory inside the main processing unit according to the command code. Also, the input activation 710 and the weight 740 may be stored in an internal memory of the main processing unit or a part of a volatile memory.
또는, 상술한 제1프로세스, 제2프로세스, 및 제3프로세스는 컴퓨팅 장치에 포함된 전용의 하드웨어 가속기에 의해 실행될 수도 있다. 이 경우, 컴퓨팅 장치는 상기 제1프로세스, 제2프로세스, 및 제3프로세스의 실행을 위한 명령코드를 저장소에서 읽어 들여 휘발성 메모리에 저장하고, 상기 주처리장치는 상기 명령코드를 실행하여, 상기 하드웨어 가속기가 상기 입력 액티베이션(710) 및 상기 가중치(740)를 휘발성 메모리 또는 비휘발성 메모리로부터 획득하도록 할 수 있다. 이때, 상기 버퍼는 상기 하드웨어 가속기의 내부에 존재할 수 있다.Alternatively, the above-described first process, second process, and third process may be executed by a dedicated hardware accelerator included in the computing device. In this case, the computing device reads the instruction codes for execution of the first process, the second process, and the third process from storage and stores them in a volatile memory, and the main processing unit executes the instruction codes, so that the hardware The accelerator may acquire the input activation 710 and the weight 740 from volatile memory or non-volatile memory. In this case, the buffer may exist inside the hardware accelerator.
도 8은 본 발명의 일 실시예에 따라 두 개의 입력 데이터에 대한 연산을 수행하여 출력 데이터를 생성하는 방법을 나타낸 순서도이다.8 is a flowchart illustrating a method of generating output data by performing an operation on two input data according to an embodiment of the present invention.
상기 방법은 단계(S100) 및 단계(S200)를 포함할 수 있다.The method may include step S100 and step S200.
단계(S100)에서, 컴퓨팅 장치는 M개의 출력채널을 갖는 제2입력 데이터의 각각의 출력채널에 대하여 미리 규정된 산출 프로세스(P10)를 수행하여, 각 출력채널에 대한 채널별 출력 데이터들을 생성할 수 있다.In step S100, the computing device performs a predefined calculation process P10 for each output channel of the second input data having M output channels to generate output data for each channel for each output channel. can
단계(S200)에서, 컴퓨팅 장치는 M개의 상기 채널별 출력 데이터들을 결합하여 출력 데이터를 생성할 수 있다.In step S200, the computing device may generate output data by combining the M pieces of output data for each channel.
이때, 상기 산출 프로세스(P10)는 단계(S10), 단계(S20), 단계(S30), 단계(S40), 및 단계(S50)를 포함할 수 있다. At this time, the calculation process (P10) may include step (S10), step (S20), step (S30), step (S40), and step (S50).
단계(S10)에서, 상기 컴퓨팅 장치는, 제1입력 데이터를 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터와, 제2입력 데이터의 특정 출력채널을, 입력채널 별로 스플릿하여 얻은 한 세트의 제2스플릿 데이터를, 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들을 생성할 수 있다.In step S10, the computing device includes a set of first split data obtained by splitting the first input data for each input channel and a set of split data obtained by splitting a specific output channel of the second input data for each input channel. A set of convolution data may be generated by convolving the second split data for each input channel.
단계(S20)에서, 상기 컴퓨팅 장치는, 상기 한 세트의 콘볼루션 데이터들의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일을 결정할 수 있다. In step S20, the computing device may determine a scale representing each convolution data based on a statistical value of values constituting each convolution data of the set of convolution data.
단계(S30)에서, 상기 컴퓨팅 장치는, 상기 결정된 스케일에 따라 상기 각 콘볼루션 데이터의 표현값을 결정할 수 있다.In step S30, the computing device may determine an expression value of each convolution data according to the determined scale.
단계(S40)에서, 상기 컴퓨팅 장치는, 상기 한 세트의 콘볼루션 데이터들 중 제1스케일로 표현된 제1 콘볼루션 데이터와 제2스케일로 표현된 제2 콘볼루션 데이터에 대한 덧셈 연산을 수행하여 중간 데이터를 생성할 수 있다. In step S40, the computing device performs an addition operation on first convolution data expressed in a first scale and second convolution data expressed in a second scale among the set of convolution data, Intermediate data can be generated.
단계(S50)에서, 상기 컴퓨팅 장치는, 상기 한 세트의 콘볼루션 데이터들 중 제3스케일로 표현된 제3 콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 상기 가중치의 상기 특정 출력채널에 대응하는 특정 출력채널에 대한 출력 데이터를 산출할 수 있다.In step S50, the computing device performs an addition operation on third convolution data expressed in a third scale among the set of convolution data and the intermediate data to obtain the specific output channel of the weight. Output data for a specific output channel corresponding to can be calculated.
이때, 상기 제3스케일은 상기 제1스케일보다 작지 않고, 상기 제3스케일은 상기 제2스케일보다 작지 않다. At this time, the third scale is not smaller than the first scale, and the third scale is not smaller than the second scale.
바람직한 일 실시예에서, 단계(S40)는 단계(250)보다 반드시 먼저 수행된다.In a preferred embodiment, step S40 necessarily precedes step 250.
상기 제1입력 데이터는 예컨대 도 7에서 설명한 입력 액티베이션(710)일 수 있다.The first input data may be, for example, the input activation 710 described in FIG. 7 .
상기 제2입력 데이터는 예컨대 도 7에서 설명한 가중치(740)일 수 있다.The second input data may be, for example, the weight 740 described in FIG. 7 .
이하, 입력 액티베이션(710)과 가중치(741)의 입력채널들을 그룹화하여 처리하는 실시예를 설명한다.Hereinafter, an embodiment of grouping and processing the input channels of the input activation 710 and the weight 741 will be described.
설명의 편의를 위하여 도 7a에 제시한 상기 출력 액티베이션[co]=1,[ci]=1(7511), 출력 액티베이션[co]=1,[ci]=2(7512), 및 출력 액티베이션[co]=1,[ci]=3(7513)을 각각, 파셜 출력 액티베이션[co]=1,[ci]=1(7511), 파셜 출력 액티베이션[co]=1,[ci]=2(7512), 및 파셜 출력 액티베이션[co]=1,[ci]=3(7513)이라고 지칭할 수 있다.For convenience of description, the output activation [co] = 1, [ci] = 1 (7511), the output activation [co] = 1, [ci] = 2 (7512), and the output activation [co] shown in FIG. ]=1,[ci]=3 (7513) respectively, partial output activation [co]=1,[ci]=1 (7511), partial output activation [co]=1,[ci]=2 (7512) , and partial output activation [co]=1, [ci]=3 (7513).
도 7a에서는 한 개의 파셜 출력 액티베이션이 한 개의 입력채널에 의해 결정되는 예를 나타내었다. 7A shows an example in which one partial output activation is determined by one input channel.
이에 비하여, 도 9a 및 도 9b에서는 한 개의 파셜 출력 액티베이션이 복수 개의 입력채널, 즉, 한 개의 입력채널 그룹에 의해 결정되는 예를 나타내었다. In contrast, FIGS. 9A and 9B show an example in which one partial output activation is determined by a plurality of input channels, that is, one input channel group.
도 9a 및 도 9b에 나타낸 예는 입력채널의 개수가 많을 때에 유용하게 사용될 수 있다. The examples shown in FIGS. 9A and 9B can be usefully used when the number of input channels is large.
도 9a는 6개의 입력채널들로 구성되는 입력 액티베이션(710)과 2개의 출력채널들로 구성되는 가중치의 제1출력채널 간의 콘볼루션 연산과정을 나타낸 것이다. 9A illustrates a convolution operation process between an input activation 710 composed of six input channels and a first output channel of a weight composed of two output channels.
도 9a에 나타낸 예에서는, 입력 액티베이션(710)을 구성하는 입력채널의 개수가 6개라는 점에서 도 7a에 나타낸 예와는 다르다. 도 7a에서는 입력채널의 개수가 3개이다.The example shown in FIG. 9A is different from the example shown in FIG. 7A in that the number of input channels constituting the input activation 710 is six. In FIG. 7A, the number of input channels is three.
도 9a에 나타낸 예에서는, 입력 액티베이션(710)을 구성하는 입력채널들을 그룹화하였다. 도 9a의 예에서, 입력 액티베이션[ci]=1(711) 및 입력 액티베이션[ci]=2(712)는 제1그룹(G1)으로 분류되고, 입력 액티베이션[ci]=3(713) 및 입력 액티베이션[ci]=4(714)는 제2그룹(G2)으로 분류되고, 그리고 입력 액티베이션[ci]=5(715) 및 입력 액티베이션[ci]=6(716)은 제3그룹(G3)으로 분류된다. In the example shown in FIG. 9A , the input channels constituting the input activation 710 are grouped. In the example of FIG. 9A, input activation [ci]=1 (711) and input activation [ci]=2 (712) are classified as a first group (G1), and input activation [ci]=3 (713) and input activation [ci]=3 (713). Activation [ci] = 4 (714) is classified as a second group (G2), and input activation [ci] = 5 (715) and input activation [ci] = 6 (716) are classified as a third group (G3). are classified
특정 그룹에 속하는 입력채널들을 결정하는 구체적인 방법은 도 10 및 도 11에서 후술한다.A detailed method of determining input channels belonging to a specific group will be described later with reference to FIGS. 10 and 11 .
도 9a에서는 한 개의 그룹에 2개의 입력채널이 속하는 것으로 제시하였지만, 본 발명은 이러한 구성에 한정되지 않으며, 각 그룹은 1개 내지 복수 개의 입력채널들로 이루어질 수도 있다.9A shows that two input channels belong to one group, but the present invention is not limited to this configuration, and each group may consist of one to a plurality of input channels.
도 9a에 나타낸 단계(S110), 단계(S120), 단계(S130), 단계(S140), 및 단계(S150)은 도 7a에 나타낸 단계(S110), 단계(S120), 단계(S130), 단계(S140), 및 단계(S150)와 동일하다.Steps S110, S120, S130, S140, and S150 shown in FIG. 9A are steps S110, S120, S130, and S150 shown in FIG. 7A. (S140), and the same as step (S150).
단계(S110)에서, 상기 입력 액티베이션(710)을 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터(711~716)를 얻을 수 있다. 그리고 상기 가중치(740)의 제1출력채널(741)을 입력채널 별로 스플릿하여 한 세트의 제2스플릿 데이터(7411~7416)를 얻을 수 있다. 그리고 상기 한 세트의 제1스플릿 데이터(711~716)와 상기 한 세트의 제2스플릿 데이터(7411~7416)를 입력채널 별로 콘볼루션하여, 한 세트의 입력채널 콘볼루션 데이터들(7511~7516)을 생성할 수 있다.In step S110, a set of first split data 711 to 716 obtained by splitting the input activation 710 for each input channel may be obtained. In addition, a set of second split data 7411 to 7416 may be obtained by splitting the first output channel 741 of the weight 740 for each input channel. Then, the set of first split data 711 to 716 and the set of second split data 7411 to 7416 are convolved for each input channel to obtain a set of input channel convolution data 7511 to 7516. can create
제x그룹(Gx)에 속한 입력 액티베이션으로부터 생성된 입력채널 콘볼루션 데이터 역시 상기 제x그룹(Gx)에 속한 것으로 간주한다. 예컨대 제1그룹(G1)에 속한 입력 액티베이션(711)으로부터 생성된 입력채널 콘볼루션 데이터(7511) 역시 상기 제1그룹(G1)에 속한 것으로 간주한다.Input channel convolution data generated from input activation belonging to the xth group Gx is also considered to belong to the xth group Gx. For example, the input channel convolution data 7511 generated from the input activation 711 belonging to the first group G1 is also regarded as belonging to the first group G1.
단계(S115)에서, 특정 그룹에 속한 복수 개의 입력채널 콘볼루션 데이터들에 대하여 엘레먼트 별 덧셈 연산을 수행하여 특정 그룹의 콘볼루션 데이터를 생성한다. In step S115, convolutional data of a specific group is generated by performing an element-by-element addition operation on the plurality of input channel convolution data belonging to the specific group.
예컨대 도 9a에서 제1그룹(G1)에 속한 복수 개의 입력채널 콘볼루션 데이터들(7511, 7512)들에 대하여 엘레먼트 별 덧셈 연산을 수행하여 제1그룹의 콘볼루션 데이터(7112)를 생성한다. 그리고 제2그룹(G2) 및 제3그룹(G3)에 대하여 각각, 제2그룹의 콘볼루션 데이터(7134) 및 제3그룹의 콘볼루션 데이터(7156)를 생성한다. 여기서 상기 제1그룹의 콘볼루션 데이터(7112), 제2그룹의 콘볼루션 데이터(7134) 및 제3그룹의 콘볼루션 데이터(7156)를 각각 그룹별 콘볼루션 데이터라고 지칭할 수 있다.For example, in FIG. 9A , an element-by-element addition operation is performed on the plurality of input channel convolution data 7511 and 7512 belonging to the first group G1 to generate the first group convolution data 7112. Then, the second group of convolutional data 7134 and the third group of convolutional data 7156 are generated for the second group G2 and the third group G3, respectively. Here, the convolution data 7112 of the first group, the convolution data 7134 of the second group, and the convolution data 7156 of the third group may be respectively referred to as group-specific convolution data.
단계(S120)에서, 상기 한 세트의 그룹별 콘볼루션 데이터들(7112, 7134, 7156)을 각각 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터(7112, 7134, 7156)를 표현하는 스케일을 결정할 수 있다.In step S120, the convolution data 7112, 7134, and 7156 are expressed based on statistical values of values constituting the set of group- specific convolution data 7112, 7134, and 7156, respectively. scale can be determined.
예컨대, 제1그룹의 콘볼루션 데이터(7112)를 구성하는 6개의 엘리먼트들의 값의 분포를 기초로 콘볼루션 데이터(7112)의 표현을 위해 적용될 스케일 sc_co1_ci1,2을 결정할 수 있다는 점은 쉽게 이해될 수 있다. For example, it can be easily understood that the scale sc_co1_ci1,2 to be applied for the expression of the convolution data 7112 can be determined based on the distribution of values of the six elements constituting the first group of convolution data 7112. there is.
이와 같이, 제1그룹의 콘볼루션 데이터(7112), 제2그룹의 콘볼루션 데이터(7134), 및 제3그룹의 콘볼루션 데이터(7156)에 적용된 스케일은 각각 sc_co1_ci1,2, sc_co1_ci3,4, 및 sc_co1_ci5,6으로 결정될 수 있다. 여기서 sc_co1_ci1,2, sc_co1_ci3,4, 및 sc_co1_ci5,6은 각각 독립적으로 결정될 수 있는 값이다. 따라서 sc_co1_ci1,2, sc_co1_ci3,4, 및 sc_co1_ci5,6는 서로 같을 수도 있고 서로 다를 수도 있다.As such, the scales applied to the first group of convolution data 7112, the second group of convolution data 7134, and the third group of convolution data 7156 are sc_co1_ci1,2, sc_co1_ci3,4, and It can be determined as sc_co1_ci5,6. Here, sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6 are values that can be independently determined. Accordingly, sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6 may be the same or different.
단계(S130)에서, 상기 결정된 스케일(sc_co1_ci1,2, sc_co1_ci3,4, sc_co1_ci5,6)에 따라 상기 한 세트의 그룹별 콘볼루션 데이터들(7112, 7134, 7156)의 구체적인 표현값을 결정할 수 있다.In step S130, specific expression values of the set of convolution data 7112, 7134, and 7156 for each group may be determined according to the determined scales sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6.
단계(S140)에서, 상기 한 세트의 그룹별 콘볼루션 데이터들(7112, 7134, 7156)중 '제1스케일(sc_co1_ci1,2)'로 표현된 제1그룹의 콘볼루션 데이터(7112)와 '제2스케일(sc_co1_ci3,4)'로 표현된 제2그룹의 콘볼루션 데이터(7134)에 대한 덧셈 연산을 수행하여 중간 데이터(751p)를 생성할 수 있다. In step S140, the first group of convolution data 7112 represented by the 'first scale (sc_co1_ci1,2)' and the 'th Intermediate data 751p may be generated by performing an addition operation on the convolutional data 7134 of the second group expressed as '2 scale(sc_co1_ci3,4)'.
단계(S150)에서, 상기 한 세트의 그룹별 콘볼루션 데이터들(7112, 7134, 7156) 중 '제3스케일(sc_co1_ci5,6)'로 표현된 제3그룹의 콘볼루션 데이터(7156)와 상기 중간 데이터(751p)에 대한 덧셈 연산을 수행하여, 상기 가중치(740)의 제1출력채널([co]=1)에 대응하는 제1출력채널([co]=1)에 대한 출력 액티베이션(751)을 산출할 수 있다. 즉, 상기 출력 액티베이션[co]=1(751)을 산출할 수 있다.In step S150, the third group of convolution data 7156 represented by 'third scale (sc_co1_ci5,6)' among the set of group-by- group convolution data 7112, 7134, and 7156 and the intermediate Output activation 751 for the first output channel ([co] = 1) corresponding to the first output channel ([co] = 1) of the weight 740 by performing an addition operation on the data 751p can be calculated. That is, the output activation [co] = 1 (751) can be calculated.
이때, 도 7a는, 상기 제3스케일(sc_co1_ci5,6)은 상기 제1스케일(sc_co1_ci1,2)보다 작지 않고, 상기 제3스케일(sc_co1_ci5,6)은 상기 제2스케일(sc_co1_ci3,4)보다 작지 않은 예를 나타낸 것이다.7A, the third scale (sc_co1_ci5,6) is not smaller than the first scale (sc_co1_ci1,2), and the third scale (sc_co1_ci5,6) is not smaller than the second scale (sc_co1_ci3,4). It shows an example that is not.
상술한 바와 같이 도 9a는 입력채널을 그룹화하는 개념을 도 7a가 설명하는 방법에 적용하여 변형한 예를 나타낸다. As described above, FIG. 9A shows a modified example by applying the concept of grouping input channels to the method described in FIG. 7A.
도 9b는 상기 입력 액티베이션(710)과 상기 제2출력채널 간의 콘볼루션 연산과정을 나타낸 것이다.9B illustrates a convolution operation process between the input activation 710 and the second output channel.
도 9b에 참조번호 S210, S215, S220, S230, S240, 및 S250로 나타낸 단계들은 각각 도 9a에 참조번호 S110, S115, S120, S130, S140, 및 S150로 나타낸 단계들에 대응한다.Steps indicated by reference numerals S210, S215, S220, S230, S240, and S250 in FIG. 9B correspond to steps indicated by reference numerals S110, S115, S120, S130, S140, and S150 in FIG. 9A, respectively.
도 9b에 참조번호 7421~7426, 7521~7526, 7212, 7234, 7256, 752p, 및 752로 나타낸 구성요소들은 각각 도 9a에 참조번호 7411~7416, 7511~7516, 7112, 7134, 7156, 751p, 및 751로 나타낸 구성요소들에 대응한다.Components indicated by reference numerals 7421 to 7426, 7521 to 7526, 7212, 7234, 7256, 752p, and 752 in FIG. 9B are reference numerals 7411 to 7416, 7511 to 7516, 7112, 7134, 7156, 751p, and components indicated by 751.
도 9b에 참조부호 sc_co2_ci1,2, sc_co2_ci3,4, 및 sc_co2_ci5,6으로 나타낸 구성요소들은 각각 도 9a에 참조부호 sc_co1_ci1,2, sc_co1_ci3,4, 및 sc_co1_ci5,6로 나타낸 구성요소들에 대응한다.Components indicated by reference numerals sc_co2_ci1,2, sc_co2_ci3,4, and sc_co2_ci5,6 in FIG. 9B correspond to components indicated by reference numerals sc_co1_ci1,2, sc_co1_ci3,4, and sc_co1_ci5,6 in FIG. 9A, respectively.
도 9a 및 도 9b에 각각 제시된 상기 출력 액티베이션[co]=1(751)과 상기 출력 액티베이션[co]=2(752)을 결합하여 출력 액티베이션(750)을 생성할 수 있다. Output activation 750 may be generated by combining the output activation [co]=1 (751) and the output activation [co]=2 (752) shown in FIGS. 9A and 9B, respectively.
도 10은 도 9a에 제시된 특정 그룹에 속하게 될 입력채널들을 결정하는 구체적인 방법을 나타낸 일 실시예를 나타낸 것이다. FIG. 10 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 9A.
도 9a에서 제시된 한 세트의 입력채널 콘볼루션 데이터들(7511~7516) 각각에 대하여, 컴퓨팅 장치는, 해당 입력채널 콘볼루션 데이터를 구성하는 엘레먼트들의 통계값을 산출할 수 있다.For each of the set of input channel convolution data 7511 to 7516 presented in FIG. 9A , the computing device may calculate statistical values of elements constituting the corresponding input channel convolution data.
예컨대 제1입력채널 콘볼루션 데이터(7511)를 구성하는 6개의 엘레먼트들 중 최소값과 최대값을 기준으로 제1입력채널 콘볼루션 데이터(7511)의 제1레인지(rg_co1_ci1)를 결정할 수 있다. 예컨대 제1입력채널 콘볼루션 데이터(7511)의 최소값이 1이고 최대값이 5라면, 제1레인지(rg_co1_ci1)는 상기 최대값과 최소값이 차이값인 4이거나, 또는 상기 최소값인 1이거나, 또는 상기 최대값인 5일 수 있다.For example, the first range (rg_co1_ci1) of the first input channel convolution data 7511 may be determined based on the minimum and maximum values of the six elements constituting the first input channel convolution data 7511 . For example, if the minimum value of the first input channel convolution data 7511 is 1 and the maximum value is 5, the first range rg_co1_ci1 is 4, which is the difference between the maximum value and minimum value, or 1, which is the minimum value, or the first range rg_co1_ci1. It can be a maximum of 5.
마찬가지로, 제2입력채널 콘볼루션 데이터(7512), 제3입력채널 콘볼루션 데이터(7513), 제4입력채널 콘볼루션 데이터(7514), 제5입력채널 콘볼루션 데이터(7515), 및 제6입력채널 콘볼루션 데이터(7516)에 대하여 각각, 제2레인지(rg_co1_ci2), 제3레인지(rg_co1_ci3), 제4레인지(rg_co1_ci4), 제5레인지(rg_co1_ci5), 및 제6레인지(rg_co1_ci6)를 결정할 수 있다.Similarly, the second input channel convolution data 7512, the third input channel convolution data 7513, the fourth input channel convolution data 7514, the fifth input channel convolution data 7515, and the sixth input For the channel convolution data 7516, a second range (rg_co1_ci2), a third range (rg_co1_ci3), a fourth range (rg_co1_ci4), a fifth range (rg_co1_ci5), and a sixth range (rg_co1_ci6) may be determined. .
위에는 제1입력채널 콘볼루션 데이터(7511)를 구성하는 6개의 엘레먼트들 중 최소값과 최대값을 기준으로 삼는 예를 제시하였으나, 상기 제1레이지를 결정하기 위하여 상기 6개의 엘레먼트들로부터 얻을 수 있는 다양한 다른 통계적 파라미터들을 이용할 수 있다. Above, an example of using the minimum and maximum values among the 6 elements constituting the first input channel convolution data 7511 as a standard has been presented, but in order to determine the first rate, various information obtained from the 6 elements can be obtained. Other statistical parameters may be used.
상기 컴퓨팅 장치는, 상기 레인지들(rg_co1_ci1~ rg_co1_ci6)의 값을 기준으로 한 세트의 입력채널 콘볼루션 데이터들(7511~7516) 또는 상기 입력 액티베이션(710)을 구성하는 입력채널들(711~716)을 그룹화 할 수 있다.The computing device includes a set of input channel convolution data 7511 to 7516 based on the values of the ranges rg_co1_ci1 to rg_co1_ci6 or input channels 711 to 716 constituting the input activation 710 can be grouped.
예컨대 제1레인지(rg_co1_ci1), 제2레인지(rg_co1_ci2), 제3레인지(rg_co1_ci3), 및 제4레인지(rg_co1_ci4)가 각각 4, 5, 400, 및 500인 경우, 제1레인지(rg_co1_ci1)과, 제2레인지(rg_co1_ci2)를 제1그룹으로 묶고, 제3레인지(rg_co1_ci3) 및 제4레인지(rg_co1_ci4)를 제2그룹으로 묶을 수 있다. 도 9에 제시된 제1그룹(G1), 제2그룹(G2), 및 제3그룹(G3)은 이러한 과정을 통해 결정된 것일 수 있다.For example, when the first range (rg_co1_ci1), the second range (rg_co1_ci2), the third range (rg_co1_ci3), and the fourth range (rg_co1_ci4) are 4, 5, 400, and 500, respectively, the first range (rg_co1_ci1); The second range (rg_co1_ci2) may be grouped into the first group, and the third range (rg_co1_ci3) and the fourth range (rg_co1_ci4) may be grouped into the second group. The first group G1, the second group G2, and the third group G3 shown in FIG. 9 may be determined through this process.
도 11은 도 9a에 제시된 특정 그룹에 속하는 입력채널들을 결정하는 구체적인 방법을 나타낸 또 다른 실시예를 나타낸 것이다.FIG. 11 shows another embodiment of a specific method of determining input channels belonging to a specific group shown in FIG. 9A.
도 11은 도 10으로부터 변형된 실시예로서, 상기 통계값을 산출하는 기준으로 한 세트의 입력채널 콘볼루션 데이터들(7511~7516) 대신 도 9a에서 제시된 한 세트의 스플릿 데이터(7411~7416)를 이용한다. FIG. 11 is a modified embodiment from FIG. 10, and instead of a set of input channel convolution data 7511 to 7516 as a criterion for calculating the statistical value, a set of split data 7411 to 7416 presented in FIG. 9A is used. use
예컨대 스플릿 데이터(7411~7416) 각각을 구성하는 4개의 엘레먼트들 중 최소값과 최대값을 기준으로 스플릿 데이터(7411~7416) 각각에 대한 제1레인지(rg_w_co1_ci1), 제2레인지(rg_w_co1_ci2), 제3레인지(rg_w_co1_ci3), 제4레인지(rg_w_co1_ci4), 제5레인지(rg_w_co1_ci5), 및 제6레인지(rg_w_co1_ci6)를 결정할 수 있다.For example, the first range (rg_w_co1_ci1), the second range (rg_w_co1_ci2), and the third range (rg_w_co1_ci2) for each of the split data (7411 to 7416) based on the minimum and maximum values of the four elements constituting each of the split data (7411 to 7416). A range (rg_w_co1_ci3), a fourth range (rg_w_co1_ci4), a fifth range (rg_w_co1_ci5), and a sixth range (rg_w_co1_ci6) may be determined.
상기 컴퓨팅 장치는, 상기 레인지들(rg_w_co1_ci1~ rg_w_co1_ci6)의 값을 기준으로 한 세트의 스플릿 데이터(7411~7416) 또는 상기 입력 액티베이션(710)을 구성하는 입력채널들(711~716)을 그룹화 할 수 있다. 도 9a에 제시된 제1그룹(G1), 제2그룹(G2), 및 제3그룹(G3)은 이러한 과정을 통해 결정된 것일 수 있다.The computing device may group the split data 7411 to 7416 or the input channels 711 to 716 constituting the input activation 710 based on the values of the ranges rg_w_co1_ci1 to rg_w_co1_ci6. there is. The first group G1, the second group G2, and the third group G3 shown in FIG. 9A may be determined through this process.
도 10 및 도 11에 제시된 방법은 도 9b에도 적용될 수 있다.The method presented in FIGS. 10 and 11 can also be applied to FIG. 9B.
도 12는 본 발명의 다른 실시예에 따라 제공되는 연산방법을 나타낸 것이다.12 shows a calculation method provided according to another embodiment of the present invention.
도 12는 도 9a 및 도9b에 제시한 방법을 통합하여 수행하는 방법이다. 12 is a method of integrating and performing the methods presented in FIGS. 9A and 9B.
도 12는 6개의 입력채널들(711~716)로 구성되는 입력 액티베이션(710)과 2개의 출력채널들로 구성되는 가중치 간의 콘볼루션 연산과정을 나타낸 것이다. 제1출력채널은 6개의 입력채널들(7411~7416)로 이루어져 있고, 제2출력채널은 6개의 입력채널들(7421~7426)로 이루어져 있다.12 illustrates a convolution operation process between an input activation 710 composed of six input channels 711 to 716 and a weight composed of two output channels. The first output channel includes 6 input channels 7411 to 7416, and the second output channel includes 6 input channels 7421 to 7426.
도 12에 나타낸 예에서는, 입력 액티베이션(710)을 구성하는 입력채널들을 그룹화하였다. 도 12의 예에서, 입력 액티베이션[ci]=1(711) 및 입력 액티베이션[ci]=2(712)는 제1그룹(G1)으로 분류되고, 입력 액티베이션[ci]=3(713) 및 입력 액티베이션[ci]=4(714)는 제2그룹(G2)으로 분류되고, 그리고 입력 액티베이션[ci]=5(715) 및 입력 액티베이션[ci]=6(716)은 제3그룹(G3)으로 분류된다. In the example shown in FIG. 12, the input channels constituting the input activation 710 are grouped. In the example of FIG. 12, input activation [ci]=1 (711) and input activation [ci]=2 (712) are classified as a first group (G1), and input activation [ci]=3 (713) and input activation [ci]=3 (713). Activation [ci] = 4 (714) is classified as a second group (G2), and input activation [ci] = 5 (715) and input activation [ci] = 6 (716) are classified as a third group (G3). are classified
특정 그룹에 속하는 입력채널들을 결정하는 구체적인 방법은 상술한 바와 같다.A detailed method of determining input channels belonging to a specific group is as described above.
도 12에 나타낸 단계(S310), 단계(315), 단계(S320), 단계(S330), 단계(S340), 및 단계(S350)은 도 9a에 나타낸 단계(S110), 단계(S115), 단계(S120), 단계(S130), 단계(S140), 및 단계(S150)에 대응한다.Steps S310, step 315, step S320, step S330, step S340, and step S350 shown in FIG. 12 are steps S110, step S115, and step S115 shown in FIG. 9A. It corresponds to (S120), step S130, step S140, and step S150.
단계(S310)에서, 상기 입력 액티베이션(710)을 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터(711~716)를 얻을 수 있다. 그리고 상기 가중치(740)의 출력채널들(741, 742)을 입력채널 별로 스플릿하여 한 세트의 제2스플릿 데이터(7411~7416, 7421~7426)를 얻을 수 있다. 상기 한 세트의 제2스플릿 데이터(7411~7416, 7421~7426)는 가중치의 제1출력채널에 대응하는 스플릿 데이터(7411~7416)와 가중치의 제2출력채널에 대응하는 스플릿 데이터(7421~7426)로 구성된다. In step S310, a set of first split data 711 to 716 obtained by splitting the input activation 710 for each input channel may be obtained. In addition, a set of second split data 7411 to 7416 and 7421 to 7426 may be obtained by splitting the output channels 741 and 742 of the weight 740 for each input channel. The set of second split data 7411 to 7416 and 7421 to 7426 include split data 7411 to 7416 corresponding to the first output channels of the weights and split data 7421 to 7426 corresponding to the second output channels of the weights. ) is composed of
그리고 상기 한 세트의 제1스플릿 데이터(711~716)와 상기 한 세트의 제2스플릿 데이터(7411~7416, 7421~7426)를 입력채널 별로 콘볼루션하여, 한 세트의 입력채널 콘볼루션 데이터들(7501~7506)을 생성할 수 있다.In addition, the set of first split data 711 to 716 and the set of second split data 7411 to 7416 and 7421 to 7426 are convolved for each input channel to obtain a set of input channel convolution data ( 7501 to 7506) can be created.
각각의 입력채널에 대응하는 상기 입력채널 콘볼루션 데이터는, 가중치의 제1출력채널에 대응하는 콘볼루션 데이터와 가중치의 제2출력채널에 대응하는 콘볼루션 데이터로 구성된다. 예컨대 제1입력채널에 대응하는 입력채널 콘볼루션 데이터(7501)는 가중치의 제1출력채널에 대응하는 콘볼루션 데이터(7511)와 가중치의 제2출력채널에 대응하는 콘볼루션 데이터(7521)로 구성된다. 여기서 콘볼루션 데이터(7511)는 스플릿 데이터(711)와 스플릿 데이터(7411) 간의 콘볼루션 연산에 의해 산출된 것이고, 콘볼루션 데이터(7521)는 스플릿 데이터(711)와 스플릿 데이터(7421) 간의 콘볼루션 연산에 의해 산출된 것이다. The input channel convolution data corresponding to each input channel is composed of convolution data corresponding to a first output channel of weights and convolution data corresponding to a second output channel of weights. For example, the input channel convolution data 7501 corresponding to the first input channel is composed of convolution data 7511 corresponding to the first output channel of weights and convolution data 7521 corresponding to the second output channel of weights. do. Here, convolution data 7511 is calculated by a convolution operation between split data 711 and split data 7411, and convolution data 7521 is convolution between split data 711 and split data 7421. It is calculated by calculation.
x그룹(Gx)에 속한 입력 액티베이션으로부터 생성된 입력채널 콘볼루션 데이터 역시 상기 제x그룹(Gx)에 속한 것으로 간주한다. Input channel convolution data generated from input activation belonging to the x group (Gx) is also considered to belong to the xth group (Gx).
단계(S315)에서, 특정 그룹에 속한 복수 개의 입력채널 콘볼루션 데이터들에 대하여 엘레먼트 별 덧셈 연산을 수행하여 특정 그룹의 콘볼루션 데이터를 생성한다. In step S315, convolutional data of a specific group is generated by performing an element-by-element addition operation on the plurality of input channel convolution data belonging to the specific group.
예컨대 도 12에서 제1그룹(G1)에 속한 복수 개의 입력채널 콘볼루션 데이터(7501, 7502)들에 대하여 엘레먼트 별 덧셈 연산을 수행하여 제1그룹의 콘볼루션 데이터(7012)를 생성할 수 있다. 여기서 제1그룹의 콘볼루션 데이터(7012) 중 제1출력채널 데이터(7112)는 입력채널 콘볼루션 데이터(7511)와 입력채널 콘볼루션 데이터(7512) 간의 엘레먼트 별 덧셈 연산에 의해 산출된 것이다. 그리고 제1그룹의 콘볼루션 데이터(7012) 중 제2출력채널 데이터(7212)는 콘볼루션 데이터(7521)와 콘볼루션 데이터(7522) 간의 엘레먼트 별 덧셈 연산에 의해 산출된 것이다.For example, in FIG. 12 , the first group of convolutional data 7012 may be generated by performing an element-by-element addition operation on the plurality of input channel convolutional data 7501 and 7502 belonging to the first group G1. Here, among the first group of convolutional data 7012, the first output channel data 7112 is calculated by performing an element-by-element addition operation between the input channel convolutional data 7511 and the input channel convolutional data 7512. Among the first group of convolutional data 7012, the second output channel data 7212 is calculated by performing an element-by-element addition operation between the convolutional data 7521 and the convolutional data 7522.
단계(S320)에서, 각각의 상기 그룹별 콘볼루션 데이터들(7012, 7034, 7056)을 구성하는 값들의 통계값을 기초로, 상기 각각의 그룹별 콘볼루션 데이터를 표현하는 스케일을 결정할 수 있다.In step S320, a scale representing the convolution data for each group may be determined based on statistical values of values constituting the convolution data 7012, 7034, and 7056 for each group.
예컨대, 제1그룹의 콘볼루션 데이터(7012)를 구성하는 12개의 엘리먼트들의 값의 분포를 기초로 제1그룹의 콘볼루션 데이터(7012)의 표현을 위해 적용될 스케일 sc_co_ci1,2을 결정할 수 있다는 점은 쉽게 이해될 수 있다. For example, the scale sc_co_ci1,2 to be applied for the expression of the first group of convolutional data 7012 can be determined based on the distribution of values of 12 elements constituting the first group of convolutional data 7012. can be easily understood.
이와 같이, 제1그룹의 콘볼루션 데이터(7012), 제2그룹의 콘볼루션 데이터(7034), 및 제3그룹의 콘볼루션 데이터(7056)에 적용된 스케일은 각각 sc_co_ci1,2, sc_co_ci3,4, 및 sc_co_ci5,6으로 결정될 수 있다. 여기서 sc_co_ci1,2, sc_co_ci3,4, 및 sc_co_ci5,6은 각각 독립적으로 결정될 수 있는 값이다.As such, the scales applied to the first group of convolution data 7012, the second group of convolution data 7034, and the third group of convolution data 7056 are sc_co_ci1,2, sc_co_ci3,4, and It can be determined as sc_co_ci5,6. Here, sc_co_ci1,2, sc_co_ci3,4, and sc_co_ci5,6 are values that can be independently determined.
단계(S340)에서, 상기 한 세트의 콘볼루션 데이터들(7012, 7034, 7056) 중 '제1스케일(sc_co_ci1,2)'로 표현된 제1콘볼루션 데이터(7012)와 '제2스케일(sc_co_ci3,4)'로 표현된 제2콘볼루션 데이터(7034)에 대한 덧셈 연산을 수행하여 중간 데이터(750p)를 생성할 수 있다. In step S340, among the set of convolution data 7012, 7034, and 7056, first convolution data 7012 expressed as 'first scale sc_co_ci1,2' and 'second scale sc_co_ci3' ,4)' to generate the intermediate data 750p by performing an addition operation on the second convolutional data 7034 .
중간 데이터(750p) 중 제1출력채널 부분(751p)은 제1콘볼루션 데이터(7012)의 제1출력채널 부분과 제2콘볼루션 데이터(7034)의 제1출력채널 부분을 엘레멘트 별로 더하여 산출될 수 있다. 마찬가지로, 중간 데이터(750p) 중 제2출력채널 부분(752p)은 제1콘볼루션 데이터(7012)의 제2출력채널 부분과 제2콘볼루션 데이터(7034)의 제2출력채널 부분을 엘레멘트 별로 더하여 산출될 수 있다. Among the intermediate data 750p, the first output channel portion 751p is calculated by adding the first output channel portion of the first convolution data 7012 and the first output channel portion of the second convolution data 7034 for each element. can Similarly, the second output channel portion 752p of the intermediate data 750p is obtained by adding the second output channel portion of the first convolution data 7012 and the second output channel portion of the second convolution data 7034 for each element. can be derived.
단계(S350)에서, 상기 한 세트의 콘볼루션 데이터들(7012, 7034, 7056) 중 '제3스케일(sc_co_ci5,6)'로 표현된 제3콘볼루션 데이터(7056)와 상기 중간 데이터(750p)에 대한 덧셈 연산을 수행하여, 상기 출력 액티베이션(750)을 산출할 수 있다. In step S350, the third convolution data 7056 expressed as 'third scale (sc_co_ci5,6)' and the intermediate data 750p among the set of convolution data 7012, 7034, and 7056 The output activation 750 may be calculated by performing an addition operation on .
상기 출력 액티베이션(750) 중 제1출력채널 부분(751)은 중간 데이터(750p) 중 제1출력채널 부분(751p)과 제3콘볼루션 데이터(7056)의 제1출력채널 부분을 엘레멘트 별로 더하여 산출될 수 있다. 마찬가지로, 상기 출력 액티베이션(750) 중 제2출력채널 부분(752)은 중간 데이터(750p) 중 제2출력채널 부분(752p)과 제3콘볼루션 데이터(7056)의 제2출력채널 부분을 엘레멘트 별로 더하여 산출될 수 있다The first output channel portion 751 of the output activation 750 is calculated by adding the first output channel portion 751p of the intermediate data 750p and the first output channel portion of the third convolution data 7056 for each element. It can be. Similarly, the second output channel portion 752 of the output activation 750 converts the second output channel portion 752p of the intermediate data 750p and the second output channel portion of the third convolution data 7056 for each element. can be calculated in addition
이때, 도 12는, 상기 제3스케일(sc_co_ci5,6)은 상기 제1스케일(sc_co_ci1,2)보다 작지 않고, 상기 제3스케일(sc_co_ci5,6)은 상기 제2스케일(sc_co0_ci3,4)보다 작지 않은 예를 나타낸 것이다.12, the third scale (sc_co_ci5,6) is not smaller than the first scale (sc_co_ci1,2), and the third scale (sc_co_ci5,6) is not smaller than the second scale (sc_co0_ci3,4). It shows an example that is not.
바람직한 일 실시예에서, 단계(S340)는 단계(S350)보다 먼저 수행될 수 있다.In a preferred embodiment, step S340 may be performed before step S350.
도 13은 도 12에 제시된 특정 그룹에 속하게 될 입력채널들을 결정하는 구체적인 방법을 나타낸 일 실시예를 나타낸 것이다. FIG. 13 illustrates an embodiment of a specific method for determining input channels to belong to a specific group shown in FIG. 12 .
도 13에서 제시된 한 세트의 입력채널 콘볼루션 데이터들(7501~7506) 각각에 대하여, 컴퓨팅 장치는, 해당 입력채널 콘볼루션 데이터를 구성하는 엘레먼트들의 통계값을 산출할 수 있다. 상기 통계값을 기초로, 입력채널 콘볼루션 데이터들(7501~7506) 각각에 대하여 각각, 레인지들(rg_co_ci1~rg_co_ci6)을 결정할 수 있다.For each of the set of input channel convolution data 7501 to 7506 presented in FIG. 13 , the computing device may calculate statistical values of elements constituting the corresponding input channel convolution data. Based on the statistical value, ranges rg_co_ci1 to rg_co_ci6 may be determined for each of the input channel convolution data 7501 to 7506 .
상기 컴퓨팅 장치는, 상기 레인지들(rg_co_ci1~rg_co_ci6)의 값을 기준으로 한 세트의 입력채널 콘볼루션 데이터들(7501~7506) 또는 상기 입력 액티베이션(710)을 구성하는 입력채널들(711~716)을 그룹화 할 수 있다. 도 12에 제시된 제1그룹(G1), 제2그룹(G2), 및 제3그룹(G3)은 이러한 과정을 통해 결정된 것일 수 있다.The computing device includes a set of input channel convolution data 7501 to 7506 based on values of the ranges rg_co_ci1 to rg_co_ci6 or input channels 711 to 716 constituting the input activation 710 can be grouped. The first group G1, the second group G2, and the third group G3 shown in FIG. 12 may be determined through this process.
도 14는 도 12에 제시된 특정 그룹에 속하는 입력채널들을 결정하는 구체적인 방법을 나타낸 또 다른 실시예를 나타낸 것이다.FIG. 14 shows another embodiment of a specific method for determining input channels belonging to a specific group shown in FIG. 12 .
도 14는 도 13으로부터 변형된 실시예로서, 상기 통계값을 산출하는 기준으로 한 세트의 입력채널 콘볼루션 데이터들(7501~7506) 대신 도 12에서 제시된 한 세트의 스플릿 데이터(7411~7416, 7421~7426)를 이용하여, 스플릿 데이터 각각에 대한 레인지들(rg_w_co_ci1~rg_w_co_ci6)을 결정할 수 있다.14 is a modified embodiment from FIG. 13, and instead of a set of input channel convolution data (7501 to 7506) as a criterion for calculating the statistical value, a set of split data (7411 to 7416, 7421 shown in FIG. 12) ~ 7426), it is possible to determine ranges (rg_w_co_ci1 to rg_w_co_ci6) for each split data.
상기 컴퓨팅 장치는, 상기 레인지들(rg_w_co_ci1~rg_w_co_ci6)의 값을 기준으로 한 세트의 스플릿 데이터(7411~7416, 7421~7426) 또는 상기 입력 액티베이션(710)을 구성하는 입력채널들(711~716)을 그룹화 할 수 있다. 도 12에 제시된 제1그룹(G1), 제2그룹(G2), 및 제3그룹(G3)은 이러한 과정을 통해 결정된 것일 수 있다.The computing device includes a set of split data 7411 to 7416 and 7421 to 7426 based on values of the ranges rg_w_co_ci1 to rg_w_co_ci6 or input channels 711 to 716 constituting the input activation 710 can be grouped. The first group G1, the second group G2, and the third group G3 shown in FIG. 12 may be determined through this process.
도 15는 본 발명의 일 실시예에 따라 제공되는 연산방법을 나타낸 순서도이다.15 is a flowchart illustrating a calculation method provided according to an embodiment of the present invention.
이하, 도 9a, 도 12, 및 도 15를 함께 참조하여 설명한다.Hereinafter, it will be described with reference to FIGS. 9A, 12, and 15 together.
단계(S410)에서, 컴퓨팅 장치가, 제1입력 데이터와 제2입력 데이터(740)를 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들을 생성할 수 있다.In step S410, the computing device may generate a set of convolution data by convolving the first input data and the second input data 740 for each input channel.
단계(S420)에서, 상기 컴퓨팅 장치가, 상기 한 세트의 콘볼루션 데이터들의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일을 결정할 수 있다. In step S420, the computing device may determine a scale representing each convolution data based on a statistical value of values constituting each convolution data of the set of convolution data.
단계(S430)에서, 상기 컴퓨팅 장치가, 상기 한 세트의 콘볼루션 데이터들 중 제1스케일로 표현된 제1콘볼루션 데이터와 제2스케일로 표현된 제2콘볼루션 데이터에 대한 덧셈 연산을 수행하여 중간 데이터를 생성할 수 있다.In step S430, the computing device performs an addition operation on first convolution data represented by a first scale and second convolution data represented by a second scale among the set of convolution data, Intermediate data can be generated.
단계(S440)에서, 상기 컴퓨팅 장치가, 상기 중간 데이터를 생성하는 단계 이후에, 상기 한 세트의 콘볼루션 데이터들 중 제3스케일로 표현된 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 출력 데이터를 산출할 수 있다.In step S440, after the step of generating the intermediate data, the computing device performs an addition operation on third convolution data expressed in a third scale among the set of convolution data and the intermediate data By doing so, output data can be calculated.
이때, 상기 제3스케일은 상기 제1스케일보다 작지 않고, 상기 제3스케일은 상기 제2스케일보다 작지 않다.At this time, the third scale is not smaller than the first scale, and the third scale is not smaller than the second scale.
제1실시예에서, 상기 제1입력 데이터는 도 12에 제시한 입력 데이터(711~716)이고, 상기 제2입력 데이터는 도 12에 제시한 데이터(7411~7416, 7421~7426)이고, 상기 한 세트의 콘볼루션 데이터들은 도 12에 제시한 데이터(7012, 7034, 7056)일 수 있다. 그리고 상기 각 콘볼루션 데이터를 표현하는 스케일은 도 12에 제시되어 있는 스케일(sc_co_ci1,2, sc_co_ci3,4, 및 sc_co_ci5,6)일 수 있다. 그리고 상기 제1콘볼루션 데이터, 상기 제2콘볼루션 데이터, 및 상기 중간 데이터는 각각 도 12에 제시되어 있는 데이터(7012, 7034, 및 750p)일 수 있다. 그리고 상기 제3콘볼루션 데이터 및 상기 출력 데이터는 각각 도 12에 제시되어 있는 데이터(7056, 750)일 수 있다.In the first embodiment, the first input data is the input data 711 to 716 shown in FIG. 12, the second input data is the data 7411 to 7416, 7421 to 7426 shown in FIG. A set of convolutional data may be data 7012, 7034, and 7056 shown in FIG. 12 . And, the scale representing each convolution data may be the scales (sc_co_ci1,2, sc_co_ci3,4, and sc_co_ci5,6) shown in FIG. 12 . Also, the first convolution data, the second convolution data, and the intermediate data may be data 7012 , 7034 , and 750p shown in FIG. 12 , respectively. Also, the third convolution data and the output data may be data 7056 and 750 shown in FIG. 12 , respectively.
제2실시예에서, 상기 제1입력 데이터는 도 9a에 제시한 입력 데이터(711~716)이고, 상기 제2입력 데이터는 도 9a에 제시한 데이터(7411~7416)이고, 상기 한 세트의 콘볼루션 데이터들은 도 9a에 제시한 데이터(7112, 7134, 7156)일 수 있다. 그리고 상기 각 콘볼루션 데이터를 표현하는 스케일은 도 9a에 제시되어 있는 스케일(sc_co1_ci1,2, sc_co1_ci3,4, 및 sc_c1o_ci5,6)일 수 있다. 그리고 상기 제1콘볼루션 데이터, 상기 제2콘볼루션 데이터, 및 상기 중간 데이터는 각각 도 7a에 제시되어 있는 데이터(7112, 7134, 및 751p)일 수 있다. 그리고 상기 제3콘볼루션 데이터 및 상기 출력 데이터는 각각 도 9a에 제시되어 있는 데이터(7156, 751)일 수 있다.In the second embodiment, the first input data is the input data 711 to 716 shown in FIG. 9A, the second input data is the data 7411 to 7416 shown in FIG. 9A, and the set of conballs The solution data may be data 7112, 7134, and 7156 shown in FIG. 9A. And, the scale representing each of the convolution data may be the scales (sc_co1_ci1,2, sc_co1_ci3,4, and sc_c1o_ci5,6) presented in FIG. 9A. Also, the first convolution data, the second convolution data, and the intermediate data may be data 7112, 7134, and 751p shown in FIG. 7A, respectively. Further, the third convolution data and the output data may be data 7156 and 751 presented in FIG. 9A, respectively.
제3실시예에서, 상기 제1입력 데이터는 도 7a에 제시한 입력 데이터(711~713)이고, 상기 제2입력 데이터는 도 7a에 제시한 데이터(7411~7413)이고, 상기 한 세트의 콘볼루션 데이터들은 도 7a에 제시한 데이터(7511~7513)일 수 있다. 그리고 상기 각 콘볼루션 데이터를 표현하는 스케일은 도 7a에 제시되어 있는 스케일(sc_co1_ci1~sc_co1_ci3)일 수 있다. 그리고 상기 제1콘볼루션 데이터, 상기 제2콘볼루션 데이터, 및 상기 중간 데이터는 각각 도 7a에 제시되어 있는 데이터(7511, 7512 및 751p)일 수 있다. 그리고 상기 제3콘볼루션 데이터 및 상기 출력 데이터는 각각 도 7a에 제시되어 있는 데이터(7513, 751)일 수 있다.In the third embodiment, the first input data is the input data 711 to 713 shown in FIG. 7A, the second input data is the data 7411 to 7413 shown in FIG. 7A, and the set of conballs The solution data may be data 7511 to 7513 presented in FIG. 7A. And, the scale representing each convolution data may be the scale (sc_co1_ci1 to sc_co1_ci3) presented in FIG. 7A. The first convolution data, the second convolution data, and the intermediate data may be data 7511, 7512, and 751p presented in FIG. 7A, respectively. Further, the third convolution data and the output data may be data 7513 and 751 presented in FIG. 7A, respectively.
이때, 상기 단계(S410)는, 상기 제1입력 데이터를 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터와 상기 제2입력 데이터의 한 세트의 출력채널을 입력채널 별로 스플릿하여 얻은 한 세트의 제2스플릿 데이터를, 입력채널 별로 콘볼루션하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계(S411); 및 상기 출력 데이터를 산출하는 단계는, 상기 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터를 산출하는 단계(S412)를 포함할 수 있다. At this time, in the step S410, a set of first split data obtained by splitting the first input data for each input channel and a set of output channels obtained by splitting a set of output channels of the second input data for each input channel generating the set of convolution data by convolving second split data for each input channel (S411); And the calculating of the output data may include calculating output data corresponding to the output channel of the one set of the second input data by performing an addition operation on the third convolution data and the intermediate data ( S412) may be included.
상기 제1실시예에서, 상기 한 세트의 제1스플릿 데이터, 상기 한 세트의 제2스플릿 데이터, 및 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터는 각각 도 12에 제시한 데이터(711~716), 데이터(7411~7416, 7421~7426), 및 데이터(750)일 수 있다. In the first embodiment, the first split data set, the second split data set, and the output data corresponding to the output channel set of the second input data are respectively shown in FIG. 12. It may be data 711 to 716 , data 7411 to 7416 , 7421 to 7426 , and data 750 .
상기 제2실시예에서, 상기 한 세트의 제1스플릿 데이터, 상기 한 세트의 제2스플릿 데이터, 및 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터는 각각 도 9a에 제시한 데이터(711~716), 데이터(7411~7416), 및 데이터(751)일 수 있다. In the second embodiment, the first split data set, the second split data set, and the output data corresponding to the output channel set of the second input data are respectively shown in FIG. 9A. It may be data 711 to 716 , data 7411 to 7416 , and data 751 .
상기 제3실시예에서, 상기 한 세트의 제1스플릿 데이터, 상기 한 세트의 제2스플릿 데이터, 및 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터는 각각 도 7a에 제시한 데이터(711~713), 데이터(7411~7413), 및 데이터(751)일 수 있다. In the third embodiment, the first split data set, the second split data set, and the output data corresponding to the output channel set of the second input data are respectively shown in FIG. 7A. It may be data 711 to 713 , data 7411 to 7413 , and data 751 .
이때, 상기 한 세트의 출력채널은 상기 제2입력 데이터를 구성하는 복수 개의 출력채널 중 어느 하나의 특정 출력채널이며, 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터는 상기 특정 출력채널에 대응하는 출력 데이터일 수 있다.At this time, the set of output channels is any one specific output channel among a plurality of output channels constituting the second input data, and the output data corresponding to the set of output channels of the second input data is the specific output channel. It may be output data corresponding to an output channel.
또는, 상기 단계(S410)는, 상기 한 세트의 제1스플릿 데이터와 상기 한 세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션하여, 각 입력채널에 대응하는 입력채널 콘볼루션 데이터들로 이루어진 한 세트의 입력채널 콘볼루션 데이터들을 생성하는 단계(S413); 및 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계(S414)를 포함할 수 있다.Alternatively, in the step S410, the first split data of the one set and the second split data of the one set are convolved for each input channel to obtain a set of input channel convolution data corresponding to each input channel. Generating input channel convolution data of (S413); and generating the one set of convolution data by grouping the one set of input channel convolution data (S414).
상기 제1실시예에서, 상기 한 세트의 입력채널 콘볼루션 데이터는 도 12에 제시한 데이터(7501~7506)일 수 있다.In the first embodiment, the set of input channel convolution data may be data 7501 to 7506 shown in FIG. 12 .
상기 제2실시예에서, 상기 한 세트의 입력채널 콘볼루션 데이터는 도 9a에 제시한 데이터(7511~7516)일 수 있다.In the second embodiment, the set of input channel convolution data may be data 7511 to 7516 shown in FIG. 9A.
이때, 상기 각각의 콘볼루션 데이터는, 상기 한 세트의 입력채널 콘볼루션 데이터들 중 한 개의 입력채널 콘볼루션 데이터와 동일한 것이거나, 또는 상기 한 세트의 입력채널 콘볼루션 데이터들 중 두 개 이상의 입력채널 콘볼루션 데이터들에 대한 엘레먼트 별 덧셈 연산을 수행하여 산출한 것일 수 있다. At this time, each of the convolution data is the same as one input channel convolution data among the set of input channel convolution data, or two or more input channels among the set of input channel convolution data. It may be calculated by performing an element-by-element addition operation on the convolution data.
이때, 상기 그룹을 결정하기 위하여, 상기 컴퓨팅 장치가, 상기 각각의 제2스플릿 데이터를 구성하는 엘레먼트들의 값들의 레인지를 산출하여 한 세트의 레인지(rg_w_co_ci1~rg_w_co_ci6)를 결정하는 단계; 및 상기 컴퓨팅 장치가, 상기 한 세트의 레인지를 기준으로 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하는 단계를 실행할 수 있다. 이때, 상기 한 세트의 레인지는 도 11에 제시한 레인지(rg_w_co1_ci1 ~ rg_w_co1_ci6) 또는 도 14에 제시한 레인지(rg_w_co_ci1 ~ rg_w_co_ci6)일 수 있다.At this time, in order to determine the group, calculating, by the computing device, a range of values of elements constituting each of the second split data to determine a set of ranges (rg_w_co_ci1 to rg_w_co_ci6); and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges. In this case, the set of ranges may be the ranges (rg_w_co1_ci1 to rg_w_co1_ci6) shown in FIG. 11 or the ranges (rg_w_co_ci1 to rg_w_co_ci6) shown in FIG. 14 .
또는, 상기 그룹을 결정하기 위하여, 상기 컴퓨팅 장치가, 상기 각각의 입력채널 콘볼루션 데이터를 구성하는 엘레먼트들의 값들의 레인지를 산출하여 한 세트의 레인지(rg_co_ci1~rg_co_ci6)를 결정하는 단계; 및 상기 컴퓨팅 장치가, 상기 한 세트의 레인지를 기준으로 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하는 단계를 더 실행할 수 있다. 이때, 상기 한 세트의 레인지는 도 10에 제시한 레인지(rg_co1_ci1 ~ rg_co1_ci6) 또는 도 13에 제시한 레인지(rg_co_ci1 ~ rg_co_ci6)일 수 있다.Alternatively, determining a set of ranges (rg_co_ci1 to rg_co_ci6) by calculating, by the computing device, a range of values of elements constituting each of the input channel convolution data to determine the group; and grouping, by the computing device, the one set of input channel convolution data based on the one set of ranges. In this case, the set of ranges may be the ranges (rg_co1_ci1 to rg_co1_ci6) shown in FIG. 10 or the ranges (rg_co_ci1 to rg_co_ci6) shown in FIG. 13 .
이때, 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계는, 상기 한 세트의 제1스플릿 데이터와 상기 한 세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션하여, 각 입력채널에 대응하는 입력채널 콘볼루션 데이터들로 이루어진 한 세트의 입력채널 콘볼루션 데이터들을 생성하는 단계를 포함할 수 있다. 그리고 상기 각각의 콘볼루션 데이터는, 상기 한 세트의 입력채널 콘볼루션 데이터들 중 한 개의 입력채널 콘볼루션 데이터와 동일한 것일 수 있다.In this case, the step of generating the one set of convolution data may include convolution of the first split data of the one set and the second split data of the one set for each input channel to obtain an input channel convolution corresponding to each input channel. It may include generating a set of input channel convolution data consisting of data. Further, each of the convolution data may be the same as one input channel convolution data among the set of input channel convolution data.
이때, 상기 컴퓨팅 장치는, 상기 제2입력 데이터에 포함된 모든 출력채널에 대하여, 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계, 상기 결정하는 단계, 상기 중간 데이터를 생성하는 단계, 및 상기 산출하는 단계를 실행하도록 되어 있고, 상기 컴퓨팅 장치는, 상기 제2입력 데이터에 포함된 각각의 출력채널에 대하여 생성된 채널별 출력 데이터들을 결합하여 상기 모든 출력채널을 포함하는 출력 데이터를 생성하도록 되어 있을 수 있다.At this time, the computing device includes the step of generating the set of convolution data, the step of determining, the step of generating the intermediate data, and the step of calculating the set of convolution data for all output channels included in the second input data. step, the computing device may be configured to combine output data for each channel generated for each output channel included in the second input data to generate output data including all the output channels. there is.
이때, 상기 제1입력 데이터는 입력 액티베이션이고, 상기 제2입력 데이터는 가중치이며, 상기 출력 데이터는 출력 액티베이션이고, 상기 가중치의 디멘젼은 상기 입력 액티베이션의 디멘젼보다 클 수 있다.In this case, the first input data is an input activation, the second input data is a weight, the output data is an output activation, and a dimension of the weight may be greater than a dimension of the input activation.
이때, 상기 입력 액티베이션은 복수 개의 제1입력채널 데이터를 포함하며, 상기 각각의 제1입력채널 데이터는 2차원 어레이이며, 상기 가중치는 복수 개의 출력채널 데이터를 포함하며, 상기 각각의 출력채널 데이터는 복수 개의 제2입력채널 데이터를 포함하며, 상기 각각의 제2입력채널 데이터는 2차원 어레이일 수 있다. At this time, the input activation includes a plurality of first input channel data, each of the first input channel data is a two-dimensional array, the weight includes a plurality of output channel data, and each of the output channel data is It includes a plurality of second input channel data, and each of the second input channel data may be a two-dimensional array.
상술한 본 발명의 실시예들을 이용하여, 본 발명의 기술 분야에 속하는 자들은 본 발명의 본질적인 특성에서 벗어나지 않는 범위 내에 다양한 변경 및 수정을 용이하게 실시할 수 있을 것이다. 특허청구범위의 각 청구항의 내용은 본 명세서를 통해 이해할 수 있는 범위 내에서 인용관계가 없는 다른 청구항에 결합될 수 있다.Using the above-described embodiments of the present invention, those belonging to the technical field of the present invention will be able to easily implement various changes and modifications without departing from the essential characteristics of the present invention. The content of each claim of the claims may be combined with other claims without reference relationship within the scope understandable through this specification.
<사사-Acknowledgement><Sasa-Acknowledgement>
본 발명은, 오픈엣지테크놀로지 주식회사(과제수행기관)가, 과학기술정보통신부와 한국연구재단 부설 정보통신기획평가원의 지원으로 이루어진 연구사업인 차세대지능형반도체기술개발(설계)-인공지능 프로세서사업 중 복합감각 기반 상황예측형 모바일 인공지능 프로세서 개발(과제고유번호 2020001310, 과제번호 2020-0-01310, 연구기간 2020.04.01 ~ 2024.12.31) 연구과제를 수행하는 과정에서 개발된 것이다. The present invention is a combination of next-generation intelligent semiconductor technology development (design)-artificial intelligence processor business, which is a research project supported by Open Edge Technology Co., Ltd. (project performing organization) and the Ministry of Science and ICT and the National Research Foundation of Korea Information and Communication Planning and Evaluation Institute. It was developed in the process of carrying out the research project development of a sensory-based context predictive mobile artificial intelligence processor (task number 2020001310, task number 2020-0-01310, research period 2020.04.01 ~ 2024.12.31).

Claims (13)

  1. 컴퓨팅 장치가, 제1입력 데이터와 제2입력 데이터를 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들을 생성하는 단계;generating, by a computing device, a set of convolution data by performing a convolution on the first input data and the second input data for each input channel;
    상기 컴퓨팅 장치가, 상기 한 세트의 콘볼루션 데이터들의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일을 결정하는 단계; determining, by the computing device, a scale representing each convolution data of the set of convolution data based on a statistical value of values constituting each convolution data of the set of convolution data;
    상기 컴퓨팅 장치가, 상기 한 세트의 콘볼루션 데이터들 중 제1스케일로 표현된 제1콘볼루션 데이터와 제2스케일로 표현된 제2콘볼루션 데이터에 대한 덧셈 연산을 수행하여 중간 데이터를 생성하는 단계; 및Generating, by the computing device, intermediate data by performing an addition operation on first convolution data represented by a first scale and second convolution data represented by a second scale among the set of convolution data ; and
    상기 컴퓨팅 장치가, 상기 중간 데이터를 생성하는 단계 이후에, 상기 한 세트의 콘볼루션 데이터들 중 제3스케일로 표현된 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 출력 데이터를 산출하는 단계;The computing device, after generating the intermediate data, performs an addition operation on the intermediate data and third convolution data expressed in a third scale among the set of convolution data to obtain output data calculating;
    를 포함하며,Including,
    상기 제3스케일은 상기 제1스케일보다 작지 않고, 상기 제3스케일은 상기 제2스케일보다 작지 않은,The third scale is not smaller than the first scale, and the third scale is not smaller than the second scale.
    연산방법.calculation method.
  2. 제1항에 있어서, According to claim 1,
    상기 한 세트의 콘볼루션 데이터를 생성하는 단계는, The step of generating the set of convolutional data,
    상기 제1입력 데이터를 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터와 상기 제2입력 데이터의 한 세트의 출력채널을 입력채널 별로 스플릿하여 얻은 한 세트의 제2스플릿 데이터를, 입력채널 별로 콘볼루션하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계; 및A set of first split data obtained by splitting the first input data for each input channel and a set of second split data obtained by splitting a set of output channels of the second input data for each input channel are generating the set of convolution data by convolution; and
    상기 출력 데이터를 산출하는 단계는, 상기 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터를 산출하는 단계;The calculating of the output data may include calculating output data corresponding to the set of output channels of the second input data by performing an addition operation on the third convolution data and the intermediate data;
    를 포함하는,including,
    연산방법.calculation method.
  3. 제2항에 있어서, According to claim 2,
    상기 한 세트의 출력채널은 상기 제2입력 데이터를 구성하는 복수 개의 출력채널 중 어느 하나의 특정 출력채널이며,The set of output channels is one specific output channel among a plurality of output channels constituting the second input data,
    상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터는 상기 특정 출력채널에 대응하는 출력 데이터인, Output data corresponding to the set of output channels of the second input data is output data corresponding to the specific output channel,
    연산방법.calculation method.
  4. 제2항에 있어서,According to claim 2,
    입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들을 생성하는 단계는,The step of generating a set of convolution data by performing convolution for each input channel,
    상기 한 세트의 제1스플릿 데이터와 상기 한 세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션하여, 각 입력채널에 대응하는 입력채널 콘볼루션 데이터들로 이루어진 한 세트의 입력채널 콘볼루션 데이터들을 생성하는 단계; 및Generating a set of input channel convolution data consisting of input channel convolution data corresponding to each input channel by convolving the set of first split data and the set of second split data for each input channel step; and
    상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계;generating the set of convolution data by grouping the set of input channel convolution data;
    를 포함하는, including,
    연산방법.calculation method.
  5. 제4항에 있어서, 상기 각각의 콘볼루션 데이터는, 상기 한 세트의 입력채널 콘볼루션 데이터들 중 한 개의 입력채널 콘볼루션 데이터와 동일한 것이거나, 또는 상기 한 세트의 입력채널 콘볼루션 데이터들 중 두 개 이상의 입력채널 콘볼루션 데이터들에 대한 엘레먼트별 덧셈 연산을 수행하여 산출한 것인, 연산방법.The method of claim 4, wherein each of the convolution data is identical to one input channel convolution data of the one set of input channel convolution data, or two of the one set of input channel convolution data. An operation method calculated by performing an element-by-element addition operation on at least one input channel convolution data.
  6. 제4항에 있어서,According to claim 4,
    상기 그룹을 결정하기 위하여,To determine the group,
    상기 컴퓨팅 장치가, 상기 각각의 제2스플릿 데이터를 구성하는 엘레먼트들의 값들의 레인지를 산출하여 한 세트의 레인지를 결정하는 단계; 및determining, by the computing device, a set range by calculating a range of values of elements constituting each of the second split data; and
    상기 컴퓨팅 장치가, 상기 한 세트의 레인지를 기준으로 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하는 단계;grouping, by the computing device, the set of input channel convolution data based on the set of ranges;
    를 더 포함하는,Including more,
    연산방법.calculation method.
  7. 제4항에 있어서,According to claim 4,
    상기 그룹을 결정하기 위하여,To determine the group,
    상기 컴퓨팅 장치가, 상기 각각의 입력채널 콘볼루션 데이터를 구성하는 엘레먼트들의 값들의 레인지를 산출하여 한 세트의 레인지를 결정하는 단계; 및determining, by the computing device, a set range by calculating a range of values of elements constituting the respective input channel convolution data; and
    상기 컴퓨팅 장치가, 상기 한 세트의 레인지를 기준으로 상기 한 세트의 입력채널 콘볼루션 데이터들을 그룹화하는 단계;grouping, by the computing device, the set of input channel convolution data based on the set of ranges;
    를 더 포함하는,Including more,
    연산방법.calculation method.
  8. 제1항에 있어서,According to claim 1,
    상기 한 세트의 콘볼루션 데이터들을 생성하는 단계는, 상기 한 세트의 제1스플릿 데이터와 상기 한 세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션하여, 각 입력채널에 대응하는 입력채널 콘볼루션 데이터들로 이루어진 한 세트의 입력채널 콘볼루션 데이터들을 생성하는 단계;를 포함하며, The generating of the set of convolution data may include convolution of the set of first split data and the set of second split data for each input channel to obtain input channel convolution data corresponding to each input channel. Generating a set of input channel convolution data consisting of; including,
    상기 각각의 콘볼루션 데이터는, 상기 한 세트의 입력채널 콘볼루션 데이터들 중 한 개의 입력채널 콘볼루션 데이터와 동일한 것인,Each of the convolution data is the same as one input channel convolution data among the set of input channel convolution data,
    연산방법.calculation method.
  9. 제8항에 있어서,According to claim 8,
    상기 컴퓨팅 장치는, 상기 제2입력 데이터에 포함된 모든 출력채널에 대하여, 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계, 상기 결정하는 단계, 상기 중간 데이터를 생성하는 단계, 및 상기 산출하는 단계를 실행하도록 되어 있고,The computing device includes the steps of generating, determining, generating the intermediate data, and calculating the set of convolution data for all output channels included in the second input data. is meant to run,
    상기 컴퓨팅 장치는, 상기 제2입력 데이터에 포함된 각각의 출력채널에 대하여 생성된 채널별 출력 데이터들을 결합하여 상기 모든 출력채널을 포함하는 출력 데이터를 생성하도록 되어 있는,The computing device is configured to generate output data including all output channels by combining output data for each channel generated for each output channel included in the second input data.
    연산방법.calculation method.
  10. 제1항에 있어서,According to claim 1,
    상기 제1입력 데이터는 입력 액티베이션이고,The first input data is input activation,
    상기 제2입력 데이터는 가중치이며,The second input data is a weight,
    상기 출력 데이터는 출력 액티베이션이고,the output data is an output activation;
    상기 가중치의 디멘젼은 상기 입력 액티베이션의 디멘젼보다 큰,The dimension of the weight is greater than the dimension of the input activation,
    연산방법.calculation method.
  11. 제10항에 있어서,According to claim 10,
    상기 입력 액티베이션은 복수 개의 제1입력채널 데이터를 포함하며, 상기 각각의 제1입력채널 데이터는 2차원 어레이이며,The input activation includes a plurality of first input channel data, each of the first input channel data is a two-dimensional array,
    상기 가중치는 복수 개의 출력채널 데이터를 포함하며, 상기 각각의 출력채널 데이터는 복수 개의 제2입력채널 데이터를 포함하며, 상기 각각의 제2입력채널 데이터는 2차원 어레이인,The weights include a plurality of output channel data, each of the output channel data includes a plurality of second input channel data, each of the second input channel data is a two-dimensional array,
    연산방법.calculation method.
  12. 하드웨어 가속기를 갖는 컴퓨팅 장치로서,A computing device having a hardware accelerator,
    상기 하드웨어 가속기가, The hardware accelerator,
    제1입력 데이터 및 제2입력데이터를 획득하도록 되어 있고,It is configured to obtain first input data and second input data,
    상기 제1입력 데이터와 상기 제2입력 데이터를 입력채널 별로 콘볼루션하여 한 세트의 콘볼루션 데이터들을 생성하도록 되어 있고,Convolution of the first input data and the second input data for each input channel to generate a set of convolution data;
    상기 한 세트의 콘볼루션 데이터들의 각 콘볼루션 데이터를 구성하는 값들의 통계값을 기초로, 상기 각 콘볼루션 데이터를 표현하는 스케일을 결정하도록 되어 있고, To determine a scale representing each convolution data based on a statistical value of values constituting each convolution data of the set of convolution data;
    상기 한 세트의 콘볼루션 데이터들 중 제1스케일로 표현된 제1콘볼루션 데이터와 제2스케일로 표현된 제2콘볼루션 데이터에 대한 덧셈 연산을 수행하여 중간 데이터를 생성하도록 되어 있고, 그리고 To generate intermediate data by performing an addition operation on first convolution data expressed in a first scale and second convolution data expressed in a second scale among the set of convolution data, and
    상기 중간 데이터를 생성하는 단계 이후에, 상기 한 세트의 콘볼루션 데이터들 중 제3스케일로 표현된 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 출력 데이터를 산출하도록 되어 있으며,After the step of generating the intermediate data, an addition operation is performed on the intermediate data and third convolution data expressed in a third scale among the set of convolution data to calculate output data,
    상기 제3스케일은 상기 제1스케일보다 작지 않고, 상기 제3스케일은 상기 제2스케일보다 작지 않은,The third scale is not smaller than the first scale, and the third scale is not smaller than the second scale.
    컴퓨팅 장치.computing device.
  13. 제12항에 있어서,According to claim 12,
    상기 한 세트의 콘볼루션 데이터를 생성하는 단계는, 상기 제1입력 데이터를 입력채널 별로 스플릿하여 얻은 한 세트의 제1스플릿 데이터와 상기 제2입력 데이터의 한 세트의 출력채널을 입력채널 별로 스플릿하여 얻은 한 세트의 제2스플릿 데이터를, 입력채널 별로 콘볼루션하여 상기 한 세트의 콘볼루션 데이터들을 생성하는 단계; 및 상기 출력 데이터를 산출하는 단계는, 상기 제3콘볼루션 데이터와 상기 중간 데이터에 대한 덧셈 연산을 수행하여, 상기 제2입력 데이터의 상기 한 세트의 출력채널에 대응하는 출력 데이터를 산출하는 단계;를 더 포함하며,The generating of the set of convolution data may include splitting a set of first split data obtained by splitting the first input data for each input channel and a set of output channels of the second input data for each input channel. generating a set of convolution data by convolving the obtained set of second split data for each input channel; And the calculating of the output data may include calculating output data corresponding to the set of output channels of the second input data by performing an addition operation on the third convolution data and the intermediate data; Including more,
    상기 하드웨어 가속기는 내부 메모리를 포함하며, The hardware accelerator includes an internal memory,
    상기 내부메모리의 크기는 상기 제2입력 데이터 전체의 데이터 크기보다 작고, 상기 제2입력 데이터의 한 세트의 출력채널을 입력채널 별로 스플릿하여 얻은 스플릿 데이터의 크기보다 큰,The size of the internal memory is smaller than the data size of the entire second input data and larger than the size of split data obtained by splitting one set of output channels of the second input data for each input channel.
    컴퓨팅 장치.computing device.
PCT/KR2022/006216 2021-09-16 2022-04-29 Add operation method considering data scale, hardware accelerator therefor, and computing device using same WO2023042989A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2021-0124097 2021-09-16
KR1020210124097A KR102395744B1 (en) 2021-09-16 2021-09-16 Method for add operation considering the scale of data and hardware accelerator and computing device for the same

Publications (1)

Publication Number Publication Date
WO2023042989A1 true WO2023042989A1 (en) 2023-03-23

Family

ID=81582619

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/006216 WO2023042989A1 (en) 2021-09-16 2022-04-29 Add operation method considering data scale, hardware accelerator therefor, and computing device using same

Country Status (2)

Country Link
KR (1) KR102395744B1 (en)
WO (1) WO2023042989A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20240008747A (en) * 2022-07-12 2024-01-19 오픈엣지테크놀로지 주식회사 Method for quantization of convolution data considering scale of data, hardware accelerator, and computing device for the same

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010052899A (en) * 1998-06-15 2001-06-25 테크니셰 유니베르시테트 드레스덴 Data calculating device
KR20190051697A (en) * 2017-11-07 2019-05-15 삼성전자주식회사 Method and apparatus for performing devonvolution operation in neural network
KR20190118365A (en) * 2018-04-10 2019-10-18 한국항공대학교산학협력단 Improved binarization apparatus and method of first layer of convolution neural network
KR20200000480A (en) * 2017-04-19 2020-01-02 상하이 캠브리콘 인포메이션 테크놀로지 컴퍼니 리미티드 Processing apparatus and processing method
KR20210099991A (en) * 2020-02-05 2021-08-13 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Deep learning processing unit, method, device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010052899A (en) * 1998-06-15 2001-06-25 테크니셰 유니베르시테트 드레스덴 Data calculating device
KR20200000480A (en) * 2017-04-19 2020-01-02 상하이 캠브리콘 인포메이션 테크놀로지 컴퍼니 리미티드 Processing apparatus and processing method
KR20190051697A (en) * 2017-11-07 2019-05-15 삼성전자주식회사 Method and apparatus for performing devonvolution operation in neural network
KR20190118365A (en) * 2018-04-10 2019-10-18 한국항공대학교산학협력단 Improved binarization apparatus and method of first layer of convolution neural network
KR20210099991A (en) * 2020-02-05 2021-08-13 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Deep learning processing unit, method, device and storage medium

Also Published As

Publication number Publication date
KR102395744B1 (en) 2022-05-09

Similar Documents

Publication Publication Date Title
WO2019164251A1 (en) Method of performing learning of deep neural network and apparatus thereof
WO2020235797A1 (en) Apparatus for processing modular multiply operation and methods thereof
WO2020242057A1 (en) Decompression apparatus and control method thereof
WO2014171705A1 (en) Method for adjusting display area and electronic device thereof
WO2023042989A1 (en) Add operation method considering data scale, hardware accelerator therefor, and computing device using same
WO2014035113A1 (en) Method of controlling touch function and an electronic device thereof
EP3935578A1 (en) Neural network model apparatus and compressing method of neural network model
WO2016159518A1 (en) Device for calculating average of nonlinear data
WO2017206867A1 (en) Sensor shutdown method and apparatus, storage medium, and electronic device
WO2018076453A1 (en) Associated application display method, device and mobile terminal
WO2021125496A1 (en) Electronic device and control method therefor
WO2011105879A2 (en) Frequency reconfigurable digital filter and equalizer using the same
WO2023229094A1 (en) Method and apparatus for predicting actions
WO2020246848A1 (en) Device and method for sorting approximately encrypted ciphertext
EP3659073A1 (en) Electronic apparatus and control method thereof
WO2024014631A1 (en) Quantization method for convolutional data considering data scale, hardware accelerator therefor, and computing apparatus using same
WO2024048868A1 (en) Computation method in neural network and device therefor
WO2021158040A1 (en) Electronic device providing utterance corresponding to context of conversation, and method of operating same
WO2024005590A1 (en) Image scaling device and image scaling method
WO2023043108A1 (en) Method and apparatus for improving effective accuracy of neural network through architecture extension
WO2022045448A1 (en) Method for compressing output data of hardware accelerator, method for decoding data inputted into hardware accelerator, and hardware accelerator therefor
WO2022097954A1 (en) Neural network computation method and neural network weight generation method
WO2019132235A1 (en) Memory apparatus and data processing method thereof
WO2022114451A1 (en) Artificial neural network training method, and pronunciation evaluation method using same
WO2022065561A1 (en) Method for classifying intention of character string and computer program

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

Country of ref document: EP

Kind code of ref document: A1