WO2024010437A1 - 신경 프로세싱 유닛 및 이의 동작 방법 - Google Patents

신경 프로세싱 유닛 및 이의 동작 방법 Download PDF

Info

Publication number
WO2024010437A1
WO2024010437A1 PCT/KR2023/009803 KR2023009803W WO2024010437A1 WO 2024010437 A1 WO2024010437 A1 WO 2024010437A1 KR 2023009803 W KR2023009803 W KR 2023009803W WO 2024010437 A1 WO2024010437 A1 WO 2024010437A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature map
input
size
input feature
processing unit
Prior art date
Application number
PCT/KR2023/009803
Other languages
English (en)
French (fr)
Inventor
박정부
Original Assignee
주식회사 딥엑스
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 딥엑스 filed Critical 주식회사 딥엑스
Priority to KR1020237023587A priority Critical patent/KR20240007745A/ko
Publication of WO2024010437A1 publication Critical patent/WO2024010437A1/ko
Priority to US18/415,684 priority patent/US20240152738A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/20Cooling means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • G06F17/153Multidimensional correlation or convolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration

Definitions

  • This disclosure relates to a Neural Processing Unit (NPU) and a method of operating the same.
  • NPU Neural Processing Unit
  • AI Artificial intelligence
  • the human brain is made up of numerous nerve cells called neurons. Each neuron is connected to hundreds to thousands of other neurons through connections called synapses.
  • the model that models the operating principles of biological neurons and the connections between neurons is called an Artificial Neural Network (ANN) model.
  • ANN Artificial Neural Network
  • an artificial neural network is a system that connects nodes imitating neurons in a layer structure.
  • a typical multilayer neural network consists of an input layer, a hidden layer, and an output layer.
  • the input layer is a layer that accepts external data, and the number of neurons in the input layer is equal to the number of input variables.
  • the hidden layer is located between the input layer and the output layer. It receives signals from the input layer, extracts the characteristics, and transmits them to the output layer.
  • the output layer receives signals from the hidden layer and outputs them to the outside.
  • the input signals between neurons are multiplied by each connection strength, which has a value between 0 and 1, and then summed. If the sum value is greater than the neuron's threshold, the neuron is activated and implemented as an output value through the activation function.
  • DNN deep neural network
  • CNN Convolutional Neural Network
  • a convolutional neural network is a neural network that functions similarly to image processing in the visual cortex of the human brain.
  • Convolutional neural networks are known to be suitable for image processing.
  • Convolutional neural networks can be used for purposes such as classification, object detection, instance segmentation, and image enhancement.
  • a convolutional neural network is composed of repeated convolutional channels and pooling channels. In a convolutional neural network, most of the computation time is taken up by the convolution operation.
  • a convolutional neural network extracts the characteristics of the image of each channel using a matrix-type kernel and recognizes objects by providing constancy such as movement or distortion through pooling.
  • a feature map is obtained through convolution of the input data and the kernel, and then an activation function such as ReLU (Rectified Linear Unit) is applied to generate the activation map for the corresponding channel. Pooling may then be applied.
  • the neural network that actually classifies the pattern is located at the rear of the feature extraction neural network and is called a fully connected layer.
  • most operations are performed through convolution or matrix multiplication.
  • the inventor of the present disclosure has recognized the following matters.
  • the output image is output in the same size as the input image, so the channel for the feature increases and then decreases again.
  • artificial neural network models for image enhancement when the channel decreases, the width and height of the feature map tend to increase. Additionally, artificial neural network models for image enhancement tend to include transpose convolution operations.
  • the NPU can insert zero(s) into the feature map and replace it with a general convolution operation.
  • MAC multiply and accumulate
  • the problem that the present disclosure aims to solve is to provide an apparatus and method for separating the transpose convolution operation of a feature map into a plurality of different convolutions. Therefore, according to the device and method according to the present disclosure, there is an effect of not calculating zero(s) of the feature map in which zero(s) is inserted.
  • the method includes determining, by a controller, that an operation performed in a first convolution layer is a transpose convolution operation, and dividing, by the controller, a kernel used in the transpose convolution operation into a plurality of subkernels. It includes the step of dividing into groups, and performing a convolution operation on the input feature map and each of the plurality of subkernels in the first convolution layer by at least one processing element.
  • the input of the first convolutional layer is an input feature map
  • the input feature map may be a feature map in which input data is padded with at least one zero.
  • the method includes identifying the size of the input data and the size of the input feature map, determining the size of the stride for the plurality of subkernels, and It may further include determining the size of the output data based on at least one of the size of the input feature map or the size of the stride.
  • the kernel includes at least one weight value, and the at least one weight value may be included in one of the plurality of subkernels.
  • the plurality of subkernels include a first subkernel and a second subkernel
  • the first subkernel is the first subkernel when the kernel corresponds to the first window of the input feature map. It is determined according to the location of the input data included in the first window, and the second subkernel is located at the location of the input data included in the second window when the kernel corresponds to the second window of the input feature map. It can be decided accordingly.
  • the method includes performing a convolution operation on an input feature map and each of a plurality of subfilters in the first convolution layer by the at least one processing element, Performing a convolution operation of the input feature map and the first subkernel in a first convolution layer, and performing a convolution operation of the input feature map and the first subkernel in the first convolution layer. Afterwards, it includes performing a convolution operation of the input feature map and the second subkernel.
  • the convolution operation of the input feature map and the first subkernel may be a convolution operation of the input data included in the input feature map and the first subkernel.
  • the output of the first convolutional layer is an output feature map
  • the output feature map may have a size larger than the input data
  • the method includes, by a controller, the size of the input feature map, the size of the output feature map, the position of at least one of the zero or the input data included in the input feature map, The method may further include determining a plurality of subkernels based on at least one of the size of the stride or the size of the kernel.
  • the method includes mapping, by the controller, output data included in the output feature map to an address of an internal memory, and mapping output data included in the output feature map by the internal memory. It may include storing the output data in the mapped address.
  • a neural processing unit according to an example of the present invention is provided.
  • the neural processing unit includes an internal memory configured to store an artificial neural network model, at least one processing element (PE) configured to access the internal memory and configured to process a convolution operation of the artificial neural network model, and It includes a controller operably connected to the internal memory and at least one processing element, and the artificial neural network model is an artificial neural network-based model configured to process image enhancement by taking an image as an input,
  • the controller determines that the operation performed in the first convolution layer is a transpose convolution operation, divides the kernel used in the transpose convolution operation into a plurality of subkernels, and inputs the input features in the first convolution layer. It is configured to control the at least one processing element to perform a convolution operation on the map and each of the plurality of subkernels.
  • the input of the first convolutional layer is an input feature map
  • the input feature map may be a feature map in which input data is padded with at least one zero.
  • the controller identifies the size of the input data and the size of the input feature map, determines the size of the stride for the plurality of subkernels, and sets the input feature.
  • the display device may be further configured to determine a size of output data based on at least one of the size of the map or the size of the stride.
  • the kernel includes at least one weight value, and the at least one weight value may be included in one of the plurality of subkernels.
  • the plurality of subkernels include a first subkernel and a second subkernel
  • the first subkernel is the first subkernel when the kernel corresponds to the first window of the input feature map. It is determined according to the location of the input data included in the first window, and the second subkernel is located at the location of the input data included in the second window when the kernel corresponds to the second window of the input feature map. It can be decided accordingly.
  • the controller performs a convolution operation of the input feature map and the first subkernel in the first convolution layer, and performs a convolution operation of the input feature map and the first subkernel in the first convolution layer. It may be further configured to perform a convolution operation of the input feature map and the second sub-kernel after performing a convolution operation of the first sub-kernel.
  • the convolution operation of the input feature map and the first subkernel may be a convolution operation of the input data included in the input feature map and the first subkernel.
  • the output of the first convolutional layer is an output feature map
  • the output feature map may have a size larger than the input data
  • the controller is configured to: the size of the input feature map, the size of the output feature map, the position of at least one zero or the input data included in the input feature map, and the size of the stride. Alternatively, it may be configured to determine a plurality of subkernels based on at least one of the sizes of the kernel.
  • the controller maps the output data included in the output feature map to an address of an internal memory, and stores the output data included in the output feature map at the mapped address. It can be further configured to control internal memory.
  • a neural processing unit according to an example of the present invention is provided.
  • the neural processing unit includes an internal memory, a controller operably coupled to at least one processing element, and an internal memory configured to store one or more instructions to be executed by the controller, wherein the controller executes the instructions.
  • An operation of determining that the operation performed in the first convolution layer is a transpose convolution operation, an operation of dividing the kernel used in the transpose convolution operation into a plurality of sub-kernels, and an operation of dividing the input feature map and the input feature map in the first convolution layer. It may be configured to control a processing element to perform a convolution operation on each of the plurality of subkernels.
  • the transpose convolution operation of an artificial neural network model to create a low-resolution image into a high-resolution image can be performed by separating it into several types of convolution.
  • unnecessary operations between zeros can be removed in the transpose convolution operation of an artificial neural network model for creating a low-resolution image into a high-resolution image.
  • FIG. 1 is a schematic conceptual diagram illustrating a device including a neural processing unit according to an embodiment of the present disclosure.
  • Figure 2 is a schematic conceptual diagram explaining a neural processing unit according to an embodiment of the present disclosure.
  • FIG. 3 is a schematic conceptual diagram illustrating one processing element among the processing element array applicable to the present disclosure.
  • Figure 4 is a schematic diagram showing the structure of an artificial neural network according to an embodiment of the present disclosure.
  • Figure 5 is a schematic diagram showing a transpose convolution operation according to a comparative example of the present disclosure.
  • Figure 6 is a schematic diagram showing a transpose convolution operation according to an embodiment of the present disclosure.
  • FIG. 7 is a flowchart explaining how a neural processing unit operates according to an embodiment of the present disclosure.
  • Figure 8 is a schematic diagram showing a plurality of subkernels and corresponding input data according to an embodiment of the present disclosure.
  • Figure 9 is a schematic diagram showing a convolution operation performed using a plurality of subkernels in a neural processing unit according to an embodiment of the present disclosure.
  • Figure 10 is a schematic diagram showing systolic array structures according to a comparative example of the present disclosure.
  • Figure 11 is a configuration diagram showing a changeable MAC architecture according to an embodiment of the present disclosure.
  • Figure 12 is a configuration diagram showing the MAC architecture in Output stationary mode according to an embodiment of the present disclosure.
  • Figure 13 is a configuration diagram showing the MAC architecture in Weight stationary or Input stationary mode according to an embodiment of the present disclosure.
  • Embodiments according to the concept of the present disclosure may be implemented in various forms, and embodiments according to the concept of the present disclosure may be implemented in various forms, and should not be construed as limited to the embodiments described in this specification or application. .
  • first and/or second may be used to describe various components, but the components should not be limited by the terms.
  • a first component may be named a second component, and similarly The second component may also be referred to as the first component.
  • expressions such as “A or B,” “at least one of A or/and B,” or “one or more of A or/and B” may include all possible combinations of the items listed together.
  • “A or B,” “at least one of A and B,” or “at least one of A or B” includes (1) at least one A, (2) at least one B, Or (3) it may refer to all cases including both at least one A and at least one B.
  • first,” “second,” “first,” or “second,” used in this document can modify various components regardless of order and/or importance, and refer to one component. It is only used to distinguish from other components and does not limit the components.
  • a first user device and a second user device may represent different user devices regardless of order or importance.
  • the first component may be renamed the second component without departing from the scope of rights described in this document, and similarly, the second component may also be renamed the first component.
  • NPU Abbreviation for Neural Processing Unit, which may refer to a processor specialized for computing artificial neural network models, separate from the CPU (Central processing unit). It is also possible to refer to it as an artificial neural network accelerator.
  • Information about the structure of the artificial neural network Information including information about the number of layers, the number of nodes within the layer, the value of each node, information about the calculation processing method, and information about the weight matrix applied to each node.
  • DNN An abbreviation for Deep Neural Network, which may mean increasing the number of hidden layers of an artificial neural network to implement higher artificial intelligence.
  • CNN An abbreviation for Convolutional Neural Network, it is a neural network that functions similar to image processing in the visual cortex of the human brain. Convolutional neural networks are known to be suitable for image processing and are known to be easy to extract features of input data and identify patterns of features. Weights in CNN may refer to a kernel of size N x M.
  • FIG. 1 is a schematic conceptual diagram illustrating a device including a neural processing unit according to an embodiment of the present disclosure.
  • a device (B) including an NPU (1000) includes an on-chip area (A).
  • a main memory 4000 may be included outside the on-chip area.
  • the main memory 400 may be, for example, system memory such as DRAM.
  • a storage unit including ROM, etc. may be included outside the on-chip area A.
  • a general-purpose processing unit such as a central processing unit (CPU) 2000, an on-chip memory 3000, and an NPU 1000 are disposed.
  • the CPU (2000) is operably connected to the NPU (1000), the on-chip memory (3000), and the main memory (4000).
  • the device B of the present disclosure may be configured as a standalone device, and in this case, it may be configured to exclude the central processing unit 2000.
  • the present disclosure is not limited to this, and the NPU (1000) may be configured to be included within the CPU (2000).
  • the on-chip memory 3000 is a memory mounted on a semiconductor die and may be a memory for caching separately from access to the main memory 4000.
  • the on-chip memory 3000 may be a memory configured to be accessed by other on-chip semiconductors.
  • the on-chip memory 3000 may be a cache memory or a buffer memory.
  • the NPU 1000 includes an internal memory 200, and the internal memory 200 may include, for example, SRAM.
  • the internal memory 200 may be a memory used only for operations in the NPU 1000.
  • Internal memory 200 may be referred to as NPU internal memory.
  • practical may mean that the internal memory 200 is configured to store data related to the artificial neural network processed by the NPU 1000.
  • data related to an artificial neural network may be data about an input feature map, a kernel, and/or an output feature map.
  • the internal memory 200 may be a buffer memory and/or a cache memory configured to store weights, kernels, and/or feature maps required for computation by the NPU 1000. However, it is not limited to this.
  • the internal memory 200 may be composed of memory elements such as SRAM, MRAM, and register files that are relatively faster to read and write than the main memory 4000. However, it is not limited to this.
  • the internal memory 200 may be configured to include a plurality of memories arranged inside the NPU (1000).
  • the internal memory 200 includes a first internal memory (not shown) for storing at least one command and/or instruction for controlling the controller, and a scheduling function in which the operation stage of the compiled artificial neural network model is determined. (scheduling) a second internal memory (not shown) for storing information, and/or parameters of an artificial neural network model (e.g., input feature map, output feature map, weight, kernel, partial sum, etc.) It may also be configured to include a third internal memory (not shown) configured to store data.
  • a third internal memory not shown
  • the device B including the NPU 1000 includes at least one of an internal memory 200, an on-chip memory 3000, and a main memory 4000.
  • At least one memory described below is intended to include at least one of the internal memory 200 and the on-chip memory 3000.
  • the description of the on-chip memory 3000 may be intended to include the internal memory 200 of the NPU 2000 or memory external to the NPU 2000 but in the on-chip area A.
  • the internal memory 200 and/or the on-chip memory 3000 which refers to at least one memory, are distinguished from the main memory 4000 based on the bandwidth of the memory or the bus configuration method rather than location characteristics. It is also possible.
  • the main memory 4000 refers to a memory that is easy to store large amounts of data, but has a relatively low memory bandwidth and relatively high power consumption.
  • the internal memory 200 and the on-chip memory 3000 refer to memories that have relatively high memory bandwidth and relatively low power consumption, but are inefficient for storing large amounts of data.
  • Bus 5000 Each component of the device (B) including the NPU (1000) can communicate through the bus (5000). There may be at least one bus 5000 of device B. Bus 5000 may be referred to as a communication bus and/or a system bus, etc.
  • the internal memory 200 and the on-chip memory 3000 of the NPU 1000 may further be equipped with a separate dedicated bus to ensure more than a certain bandwidth for processing the weights and feature maps of the artificial neural network model.
  • the specific bandwidth may be determined based on the processing performance of the processing element array of the NPU (1000).
  • the specific bandwidth may be determined based on the processing performance of the processing element array of the NPU (1000).
  • the device (B) including the NPU (1000) further includes a Direct Memory Access (DMA) module, configured to directly control the internal memory (200), the on-chip memory (3000), and/or the main memory (4000). It is also possible.
  • DMA Direct Memory Access
  • the DMA module may be configured to directly control data transfer between the NPU 2000 and the on-chip memory 3000 by directly controlling the bus 5000.
  • the DMA module may be configured to directly control data transfer between the on-chip memory 3000 and the main memory 4000 by directly controlling the bus 5000.
  • the DMA module may be configured to directly control data transfer between the internal memory 200 and the main memory 4000 by directly controlling the bus 5000.
  • a neural processing unit (NPU) 1000 is a specialized processor that performs operations for artificial neural networks. NPU 1000 may be referred to as an AI accelerator.
  • An artificial neural network refers to a network of artificial neurons that, when multiple inputs or stimuli come in, multiply each by its weight and add it, and additionally transform and transmit the added value through an activation function.
  • the artificial neural network learned in this way can be used to output inference results from input data.
  • the NPU (1000) may be a semiconductor implemented as an electrical/electronic circuit.
  • the electric/electronic circuit may mean that it includes numerous electronic elements (eg, transistors, capacitors).
  • the NPU 1000 may include a processing element (PE) array, NPU internal memory 200, NPU controller, special function unit (SFU), and NPU interface.
  • PE processing element
  • SFU special function unit
  • NPU interface Each of the processing element array, NPU internal memory 200, NPU scheduler, and NPU interface may be a semiconductor circuit to which numerous transistors are connected.
  • an arbitrary circuit may operate as an array of processing elements, or as an NPU controller.
  • the NPU 1000 includes a processing element array, an NPU internal memory 200 configured to store at least a portion of an artificial neural network model that can be inferred from the processing element array, and data locality information of the artificial neural network model or the structure of the artificial neural network model. It may include an NPU controller configured to control the processing element array and the NPU internal memory 200 based on information about the processing element array and the NPU internal memory 200.
  • the artificial neural network model may include information about data locality or structure of the artificial neural network model.
  • An artificial neural network model may refer to an AI recognition model learned to perform an image enhancement function.
  • the processing element array can perform operations for an artificial neural network. For example, when input data is input, an array of processing elements can cause an artificial neural network to perform learning. After learning is completed, when input data is input, the processing element array can perform an operation to derive an inference result through the trained artificial neural network.
  • the NPU (1000) can load the data of the artificial neural network model stored in the main memory (4000) into the NPU internal memory (200) through the NPU interface.
  • the NPU interface can communicate with the main memory 4000 through the bus 5000.
  • the NPU controller is configured to control the operation of the processing element array for the inference operation of the NPU (1000) and the read and write order of the NPU internal memory (200).
  • the NPU controller is configured to control the order of convolution operations for input data and each of a plurality of subkernels (or filters).
  • the NPU controller is configured to map each element (or output value, output data) included in the feature map to the corresponding address of the NPU internal memory 200 in the feature map output as a result of convolution operations.
  • the NPU controller analyzes the structure of the artificial neural network model or receives the structure of the artificial neural network model. Next, the NPU controller sequentially determines the operation order for each layer. In other words, when the structure of the artificial neural network model is confirmed, the operation order for each layer can be determined.
  • the order of operations or the order of data flow according to the structure of this artificial neural network model can be defined as the data locality of the artificial neural network model at the algorithm level.
  • the NPU controller reflects the structure of the artificial neural network model and sequentially determines the operation order for each layer. In other words, when the structure of the artificial neural network model is confirmed, the operation order for each layer can be determined. As an example, when a convolution transpose operation is performed in a specific convolution layer, the NPU controller may determine the operation order for each sub-layer. When a convolution operation is performed on input data and each of a plurality of sub-filters, each convolution operation can be defined as an operation performed in the sub-layer.
  • the compiler compiles the artificial neural network model so that the artificial neural network model is executed on the NPU 1000, the artificial neural network data locality of the artificial neural network model at the neural processing unit-memory level can be reconstructed.
  • the compiler may be executed by CPU 2000, an online server, or a separate external system.
  • the NPU (1000) computes the corresponding artificial neural network model, for example, feature map tiling, stationary technique of processing elements, number of processing elements of the NPU (1000), NPU (1000)
  • the calculation method of the artificial neural network model to be processed may be configured differently. This is because, even if the same artificial neural network model is processed due to the above-mentioned factors, the NPU (1000) may determine the order of data needed at each moment differently on a clock basis.
  • Figure 2 is a schematic conceptual diagram explaining a neural processing unit according to an embodiment of the present disclosure.
  • the neural processing unit (NPU) 1000 may include a processing element array (PE Array) 100, an internal memory 200, and/or a controller 300.
  • the artificial neural network model 210 may be stored in the internal memory 200.
  • the processing element array 100 includes a plurality of processing elements. Therefore, the processing element array can also be referred to as a plurality of processing elements.
  • the controller 300 processes the processing element array 100 and the NPU internal memory in consideration of the size of the weight values of the artificial neural network model 210, the size of the feature map, and the calculation order of the weight values and/or feature maps. It may be configured to control (200).
  • the controller 300 may receive the sizes of weight values to be calculated in the processing element array 100, the size of the feature map, and the calculation order of the weight values and feature maps.
  • Artificial neural network data that the artificial neural network model may include may include node data or feature maps of each layer, and weight data of each network connecting the nodes of each layer.
  • data related to the artificial neural network that the artificial neural network model may include may be data about an input feature map, a kernel, and/or an output feature map.
  • At least some of the data or parameters of the artificial neural network may be stored in a memory provided inside the controller 300 or in the NPU internal memory 200.
  • the controller 300 may determine that the operation performed in the first convolution layer is a transpose convolution operation.
  • the operation performed in the first convolution layer may be a transpose convolution operation in which the size of the feature (or feature map) increases as the channel decreases. In this way, the operation in which the size of the feature increases as the channel decreases may be referred to as an upscaling, up convolution, or transpose convolution operation.
  • the controller 300 may determine that the operation performed in the corresponding convolution layer among the operations of the plurality of convolution layers is a transpose convolution operation.
  • the controller 300 may divide the kernel used in the transpose convolution operation into a plurality of subkernels.
  • the plurality of subkernels may include a first subkernel, a second subkernel, a third subkernel, and a fourth subkernel.
  • the size of the kernel can be expressed as the product of width and height (width x height).
  • the size of the kernel is 3x3, the size of the first subkernel is 1x1, the size of the second subkernel is 2x1, the size of the third subkernel is 1x2, and the size of the fourth subkernel is 1x1. It could be 2x2.
  • the processing element 110 may perform a convolution operation on the input feature map and each of the plurality of subkernels in the first convolution layer.
  • the processing element 110 may perform a convolution operation of the input feature map and the first subkernel.
  • the processing element 110 may perform a convolution operation of the input feature map and the second subkernel.
  • the processing element 110 may perform a convolution operation of the input feature map and the third subkernel.
  • the processing element 110 may perform a convolution operation of the input feature map and the fourth subkernel.
  • a configuration for reducing the amount of MAC calculation in the NPU 1000 of the present disclosure is to select a method of not calculating padded zeros, especially when performing a convolution operation with zero-padded input data, in the transpose convolution operation described below in FIG. 6.
  • the goal is to minimize the amount of computation.
  • Typical CPU scheduling takes into account fairness, efficiency, stability, response time, etc. and operates to achieve the best efficiency. In other words, it is scheduled to perform the most processing within the same amount of time, taking into account priority, computation time, etc.
  • the controller 300 of the NPU 1000 may determine the processing order based on the calculation method of the parameters of the artificial neural network model.
  • the processing element array 100 includes a plurality of processing elements (PE1, PE2, ...) configured to calculate node data (e.g., feature map) of an artificial neural network and weight data (e.g., kernel) of a connection network. It is configured to do so.
  • Each processing element may include a multiply and accumulate (MAC) operator and/or an Arithmetic Logic Unit (ALU) operator.
  • MAC multiply and accumulate
  • ALU Arithmetic Logic Unit
  • a plurality of processing elements (PE1, PE2, ...) are shown as an example, but instead of a MAC inside one processing element, an operator is implemented with a plurality of multipliers and an adder tree. It is also possible to configure them by arranging them in parallel.
  • the processing element array 100 may also be referred to as at least one processing element including a plurality of operators.
  • the plurality of processing elements (PE1, PE2, ...) shown in FIG. 2 are merely examples for convenience of explanation, and the number of the plurality of processing elements (PE1, PE2, ...) is not limited.
  • the size or number of the processing element array may be determined by the number of the plurality of processing elements (PE1, PE2,).
  • the size of the processing element array can be implemented in the form of an N x M matrix.
  • N and M are integers greater than 0.
  • the processing element array 100 may include N x M processing elements. That is, there may be one or more processing elements.
  • the processing element array 100 may be composed of multiple sub-modules. Accordingly, the processing element array 100 may include processing elements composed of N x M x L submodules. To elaborate, L is the number of submodules of the processing element array, and may be referred to as cores, engines, or threads.
  • the size of the processing element array 100 can be designed considering the characteristics of the artificial neural network model on which the NPU 1000 operates. To explain further, the number of processing elements can be determined by considering the data size of the artificial neural network model to be operated, required operation speed, required power consumption, etc.
  • the data size of the artificial neural network model may be determined in correspondence to the number of layers of the artificial neural network model and the weight data size of each layer.
  • the size of the processing element array 100 is not limited. As the number of processing elements (PE1 Vietnamese 110 of the processing element array 100 increases, the parallel computing ability of the operating artificial neural network model increases, but the manufacturing cost and physical size of the NPU (1000) may increase. there is.
  • the artificial neural network model operated in the NPU 1000 may be an artificial neural network learned to output a low-resolution image as a high-resolution image, that is, an AI model for image enhancement.
  • the size of the element array 100 may be designed as N x M in consideration of the computational characteristics of the artificial neural network model.
  • the element array 100 may include 12 processing elements.
  • the present invention is not limited to this, and the number of the plurality of processing elements (PE1...) 110 may be selected within the range of, for example, 8 to 16,384. That is, the number of processing elements in embodiments of the present disclosure is not limited.
  • the processing element array 100 is configured to perform functions such as addition, multiplication, and accumulation required for artificial neural network operations. Stated differently, the processing element array 100 may be configured to perform a multiplication and accumulation (MAC) operation.
  • MAC multiplication and accumulation
  • Internal memory 200 may be volatile memory. Volatile memory may be a memory that stores data only when power is supplied, and the stored data is destroyed when the power supply is cut off. Volatile memory may include static random access memory (SRAM), dynamic random access memory (DRAM), etc.
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • the internal memory 200 may preferably be SRAM, but is not limited thereto.
  • CNN convolutional neural network
  • DNN deep neural network
  • a convolutional neural network may be a combination of one or several convolutional layers, a pooling layer, and a fully connected layer.
  • Convolutional neural networks have a structure suitable for learning and inference of two-dimensional data, and can be learned through the backpropagation algorithm.
  • the convolutional neural network includes a plurality of channels per layer.
  • a kernel that extracts the features of the input image of the channel.
  • the kernel can be composed of a two-dimensional matrix and performs convolution operations while traversing the input data.
  • the size of the kernel can be determined arbitrarily, and the interval (stride) at which the kernel traverses the input data can also be arbitrarily determined.
  • the degree of matching of the kernel to the entire input data for each kernel may be a feature map or an activation map.
  • the kernel may include one set of weight values or multiple sets of weight values.
  • the processing element array 100 may be configured to process a convolution operation of an artificial neural network, and the activation function operation may be processed in a separate activation function processing module. In this case, the processing element array 100 may be operated only for convolution operations. In particular, in this case, the processing element array 100 is configured to process only integer type data, making it possible to maximize computational efficiency when performing massive convolution operations.
  • an activation function to add nonlinearity can be applied later.
  • an activation function is applied to a feature map that is the result of a convolution operation, it may be referred to as an activation map.
  • Common convolutional neural networks include Alexnet, Squeezenet, VGG16, Resnet152, and Moblienet.
  • Each artificial neural network model has 727 MFLOPs (Mega Floating-point Operations per Second), 837 MFLOPs, 16 MFLOPs, 11 MFLOPs, respectively, for one-time inference.
  • a multiplication number of 11 MFLOPs and 579 MFLOPs is required, and all weights, including the kernel, have storage sizes of 233 MB, 5 MB, 528 MB, 230 MB, and 16 MB, respectively. Therefore, it can be seen that these convolutional neural networks require a considerable amount of hardware resources and power consumption for calculation.
  • FIG. 3 is a schematic conceptual diagram illustrating one processing element among the processing element array applicable to the present disclosure. Below, it can be described with reference to FIG. 2.
  • the processing element array 100 is configured to perform a MAC operation, and may be configured to quantize and output the MAC operation result.
  • the internal memory 200 can store all or part of the artificial neural network model depending on the memory size and data size of the artificial neural network model.
  • the first processing element PE1 may include a multiplier 111, an adder 112, and an accumulator 13.
  • examples according to the present disclosure are not limited thereto, and the processing element array 100 may be modified and implemented in consideration of the computational characteristics of the artificial neural network model.
  • the multiplier 111 multiplies the input (N) bit data and (M) bit data.
  • the operation value of the multiplier 111 is output as (N+M) bit data.
  • N and M are integers greater than 0.
  • a first input unit that receives (N)bit data may be configured to receive a value (e.g., an input feature map) having characteristics such as a variable
  • a second input unit that receives (M)bit data may be configured to receive a value that has characteristics such as a constant. It may be configured to receive a value (for example, a learned weight) having .
  • the input data of the multiplier 111 is not limited to constant values and variable values.
  • the first processing element (PE1) 110 recognizes that the operation result is 0 even if no operation is performed when 0 is input to one of the first and second input units of the multiplier 111. , the operation of the multiplier 111 can be restricted so that it does not perform operations.
  • the multiplier 111 may be configured to operate in a zero skipping manner.
  • the bit width of the data input to the first and second input units of the multiplier 111 may be determined according to the quantization of node data and weight data of each layer of the artificial neural network model. For example, when the node data of the first layer is quantized to 5 bits and the weight data of the first layer is quantized to 7 bits, the first input unit is configured to receive 5 bits of data, and the second input unit is configured to receive 7 bits of data. It can be configured.
  • the NPU 1000 is configured to convert the quantized bit width in real time when quantized data stored in the internal memory 200 is input to the input units of the first processing element PE1.
  • the processing element (PE1) can be controlled.
  • the adder 112 adds the operation value of the multiplier 111 and the operation value of the accumulator 113.
  • the operation value of the adder 112 may be the same as the operation value of the multiplier 111.
  • the value obtained by adding the operation value of the multiplier 111 and the operation value of the accumulator 113 may be the operation value of the adder.
  • the accumulator 113 temporarily stores the data output from the output unit of the adder 112 so that the operation value of the adder 112 and the operation value of the multiplier 111 are accumulated by the number of (L) loops. Specifically, the operation value of the adder 112 output from the output unit of the adder 112 is input to the input unit of the accumulator 113, and the input operation value is temporarily stored in the accumulator 13 and then stored in the accumulator 113. It is output from the output unit. The output operation value is input to the input unit of the adder 112 through a loop. At this time, the calculation value newly output from the output unit of the multiplier 111 is input to the input unit 112 of the adder.
  • the operation value of the accumulator 113 and the new operation value of the multiplier 111 are input to the input unit of the adder 112, and these values are added in the adder 112 and output through the output unit of the adder 112.
  • the data output from the output unit of the adder 112, that is, the new operation value of the adder 642, is input to the input unit of the accumulator 113, and subsequent operations are performed as many loop times as substantially the same as the above-described operations.
  • the accumulator 113 temporarily stores the data output from the output unit of the adder 112 in order to accumulate the operation value of the multiplier 111 and the operation value of the adder 112 by the number of loops, so the accumulator 113
  • the data input to the input unit and the data output from the output unit may have a bit width of (N+M+log2(L)) bits, which is the same as the data output from the output unit of the adder 112.
  • L is an integer greater than 0.
  • the accumulator 113 can receive an initialization reset signal and initialize the data stored inside the accumulator 113 to 0.
  • examples according to the present disclosure are not limited thereto.
  • the output data (N+M+log2(L)) bit of the accumulator 113 may be node data of the next layer or input data of convolution.
  • Figure 4 is a schematic diagram showing the structure of an artificial neural network model according to an embodiment of the present disclosure.
  • FIG. 4 shows the sizes of parameters of an artificial neural network model for each layer according to an embodiment of the present disclosure.
  • the artificial neural network model may have an encoder-decoder based convolution neural network structure.
  • the artificial neural network model may refer to an artificial neural network model configured to process image enhancement.
  • the artificial neural network model may include a contracting path and an expanding path.
  • the contracting path refers to a path that reduces the dimension of an image while increasing the number of channels to capture the features of the input image.
  • the expanding path refers to a path that restores a high-dimensional image by reducing the number of channels and increasing the dimension of the image.
  • the expansion path uses a method of concatenating low-dimensional encoded information into each layer of the decoding stage (i.e., a method of directly connecting the layers of the reduction path and the layers of the expansion path) to create a high-dimensional image. Restore .
  • an input image tile of size 572x572x1 may be input to the artificial neural network.
  • the entire image may be input to the artificial neural network model, or it may be divided into image tiles that are part of the image, and the present disclosure is not limited to the form of the input image.
  • 572x572 refers to the dimension of the map, and 1 refers to the number of channels. That is, an input image tile with one channel and a size of 572x572 can be input to the artificial neural network model.
  • 3x3 convolution operation When an input image tile is input, 3x3 convolution operation, ReLU activation function, and Max pooling can be applied repeatedly.
  • the expansion path may include multiple transpose convolution operations.
  • the transpose convolution operation may be 2x2 up-convolution (up-conv 2x2).
  • up-conv 2x2 For example, in a random convolution layer, a feature map of size 100x100x256 may be output as a feature map of size 200x200x128 by performing a 2x2 up-convolution (up-conv 2x2) operation.
  • the output image In order to obtain a higher resolution image, the output image must be the same size as the input image, or at least output with a similar size, so a transverse convolution operation that is performed while expanding the feature map in the expansion path is necessary.
  • the transpose convolution operation can be performed by inserting zero(s) into the feature map and replacing it with a general convolution operation.
  • transpose convolution which is calculated by inserting zero(s) into the feature map and replacing it with a general convolution operation, will be explained.
  • Figure 5 is a schematic diagram showing a transpose convolution operation according to a comparative example of the present disclosure.
  • Figure 5 shows input data, input feature map 51, kernel 52, and output feature map 53.
  • the input data, input feature map 51, kernel 52, and output feature map 53 may each be composed of a two-dimensional matrix (N x M, where N and M are positive integers).
  • the input data includes element data a and may be 3x3 in size.
  • the input feature map 51 in the input data may be input data padded with zero(s) and may be 7x7 in size. Kernel 52 may be 3x3 in size.
  • the output feature map 53 includes element data b and may be 5x5 in size. Element data included in the output feature map 53 may be referred to as 'output data'.
  • the kernel 52 in an arbitrary convolution layer may perform a convolution operation while traversing the input feature map 51.
  • the convolution operation is calculated by moving the window of the kernel 52 at regular intervals.
  • a window refers to an area of a specified size, and may refer to an area on the input feature map corresponding to the kernel size when performing a convolution operation.
  • the stride at which the kernel 52 traverses the input feature map 51 may be set to 1.
  • a MAC operation for the inserted zero(s) is involved.
  • operation number 8 corresponds to the MAC operation for zero(s).
  • the output value for the operation with zero is zero, so the MAC operation for the inserted zero(s) corresponds to unnecessary MAC calculation amount.
  • the amount of MAC calculations in the transpose convolution operation can be minimized by not calculating padded zeros when performing the convolution operation with the zero-padded input feature map.
  • the MAC operation may be performed in the processing element 110.
  • Figure 6 is a schematic diagram showing a transpose convolution operation according to an embodiment of the present disclosure.
  • the input image is zero-padded, then the zero-padded input image is searched using a specific kernel to extract the features of the image, and the extracted features are transposed to create a feature map. Convolution operation is shown.
  • the input image (or input data) 60 may include a plurality of element data (or pixels) (a1,1 to a3,3).
  • the input image may be 3x3 in size.
  • the input image 60 may be zero-padded.
  • Zero padding is used to make the size of the feature map output after the convolution operation the same as or larger than the input image by adding pixels filled with zero values between and/or at the edges of the element data of the input image.
  • the zero-padded input image 61 may be 7x7 in size.
  • the zero-padded input image 61 may be referred to as an 'input feature map'.
  • Features can be extracted by performing a convolution operation while the 3x3-sized kernel 62 traverses the input feature map 61 with a stride of 1.
  • the features extracted by the 3x3-sized kernel 62 traversing the input feature map 61 with a stride of 1 can be expressed as b1,1 to b5,5.
  • the extracted features can be output as a 5x5 output feature map 63.
  • FIG. 7 is a flowchart explaining how a neural processing unit operates according to an embodiment of the present disclosure.
  • Figure 8 is a schematic diagram showing a plurality of subkernels and corresponding input data according to an embodiment of the present disclosure. Below, it is explained with reference to FIGS. 6 and 9 .
  • the neural processing unit may determine that the operation performed in the first convolution layer is a transpose convolution operation (S702).
  • the neural processing unit may identify the size of the input data and/or the size of the input feature map.
  • the neural processing unit may divide the kernel used in the transpose convolution operation into a plurality of subkernels (S704).
  • the input of the first convolution layer is an input feature map of a certain size, and the input feature map may be a feature map in which the input data is padded with at least one zero.
  • the kernel 62 may be divided into four sub-kernels 82_1, 82_2, 82_3, and 82_4 by a neural processing unit (or controller). Kernel 62 may include weight values k0 through k8. Weight values included in the kernel are included in one of four subkernels (82_1, 82_2, 82_3, 82_4). That is, the weight value included in the kernel is essentially included in one of the plurality of subkernels (82_1, 82_2, 82_3, 82_4), but is not included in duplicate, so that the weight value is included in the plurality of subkernels (82_1, 82_2, 82_3). , 82_4) can be set separately. However, the method of dividing into multiple subkernels is not limited to this.
  • the four subkernels may be referred to as a first subkernel (82_1), a second subkernel (82_2), a third subkernel (82_3), and a fourth subkernel (82_4), respectively.
  • the first subkernel 82_1 may be determined according to the location of the input data included in the first window when the kernel corresponds to the first window of the input feature map.
  • the kernel 62 corresponds to the first window 94_1 of the input feature map 91_1, that is, the first window 94_1 of the input feature map 91_1 and the kernel ( 62)
  • the input data included in the first window 94_1 is a1,1 and corresponds to k4 of the kernel 62.
  • the first subkernel 82_1 may be composed of k4.
  • the convolution operation of the input feature map 91_1 and the first subkernel 82_1 is the convolution of the input data (a1,1) included in the input feature map 91_1 and the first subkernel 82_1. It may be an operation. That is, the first subkernel 82_1 is determined so that the convolution operation of the input feature map 91_1 and the first subkernel 82_1 does not include an operation with zero(s) included in the input feature map 91_1. .
  • the second subkernel 82_2 may be determined according to the location of the input data included in a specific window when the kernel corresponds to the second window of the input feature map.
  • the kernel 62 corresponds to the second window 94_2 of the input feature map 91_1, that is, the second window 94_2 of the input feature map 91_1 and the kernel ( 62)
  • the input data included in the second window 94_2 are a1,1 and a1,2, and correspond to k3 and k5 of the kernel 62, respectively.
  • the second subkernel 82_2 may be composed of k3 and k5.
  • the convolution operation of the input feature map 91_2 and the second subkernel 82_2 is performed by combining the input data (a1,1 and a1,2) included in the input feature map 91_1 and the second subkernel 82_2.
  • third sub-kernel 82_3 and the fourth sub-kernel 82_4 may be configured in a similar manner to the above-described first sub-kernel 82_1 or second sub-kernel 82_2, they will be omitted below.
  • a neural processing unit may determine the size of strides for a plurality of subkernels.
  • the neural processing unit may determine the size of the output data based on at least one of the size of the input feature map or the size of the stride.
  • the neural processing unit is based on at least one of the size of the input feature map, the size of the output feature map, the position of at least one zero or input data included in the input feature map, the size of the stride, or the size of the kernel. Thus, a plurality of subkernels can be determined.
  • the neural processing unit may perform a convolution operation on the input feature map and each of the plurality of subkernels in the first convolution layer (S706).
  • the neural processing unit may control the order of convolution operations for each of the input feature maps and a plurality of subkernels.
  • the neural processing unit (or controller) performs a convolution operation of the input feature map and the first sub-kernel in a first convolution layer, and then performs a convolution operation of the input feature map and the second sub-kernel. can do.
  • the output of the first convolution layer which is output as a result of performing a convolution operation between the input feature map and each of the plurality of subkernels, is an output feature map having a certain size.
  • the output feature map may be larger in size than the input data.
  • the neural processing unit may map output data included in the output feature map to an address in internal memory.
  • the internal memory may store output data included in the output feature map at the mapped address.
  • the product of the first subkernel 82_1 and the element-wise product ( It represents element data of input data 80 on which element-wise multiplication is performed.
  • the zero padded to the input feature map may not be calculated. It works.
  • the element-wise product with the first subkernel 82_1 ( It represents element data of input data 80 on which element-wise multiplication is performed.
  • the zero padded to the input feature map may not be calculated. It works.
  • the third sub-kernel 82_3 moves to stride 2 and the convolution operation with the input feature map is performed 6 times, the product of the third sub-kernel 82_3 and the element-wise product ( It represents element data of input data 80 on which element-wise multiplication is performed.
  • the convolution operation of the zero-padded input feature map and the third sub-kernel 82_3 has the effect of not calculating the zero padded input feature map. There is.
  • the fourth subkernel 82_4 moves to stride 2 and the convolution operation with the input feature map is performed four times, the fourth subkernel 82_4 and the element-wise product ( It represents element data of input data 80 on which element-wise multiplication is performed.
  • the convolution operation of the zero-padded input feature map and the fourth sub-kernel (82_4) has the effect of not calculating the zero padded input feature map. There is.
  • the convolution operation of the first convolution layer is a first type of convolution corresponding to (a) of FIG. 8. operation, a second type of convolution operation corresponding to (b) of FIG. 8, a third type of convolution operation corresponding to (c) of FIG. 8, and a fourth type of convolution operation corresponding to (d) of FIG. 8. It can be divided into multiplication operations.
  • the transpose convolution operation method of the neural processing unit by dividing the stride 2 convolution operation into four types, the padded zero(s) operation can be omitted and the reaction speed (latency) can be improved. ) has the effect of reducing it by 1/4.
  • Figure 9 is a schematic diagram showing a convolution operation performed using a plurality of subkernels in a neural processing unit according to an embodiment of the present disclosure. Below, it is explained with reference to FIGS. 6 and 8 .
  • the first type of convolution operation corresponding to (a) of FIG. 8 is the input feature map (91_1, 91_3) while the first subkernel (92_1) moves to stride 2 in FIG. , 91_5, 91_11, 91_13, 91_15, 91_21, 91_23, 91_25).
  • the second type of convolution operation corresponding to (b) of FIG. 8 is the input feature map (91_2, 91_4, 91_12, 91_14, 91_22, 91_24) and corresponds to the convolution operation performed respectively.
  • the third type of convolution operation corresponding to (c) in FIG. 8 is the input feature map (91_6, 91_8, 91_10, 91_16, 91_18, 91_20) as the third subkernel (92_3) moves to stride 2 in FIG. corresponds to the convolution operation performed respectively.
  • the fourth type of convolution operation corresponding to (d) in FIG. 8 is performed with the input feature maps 91_7, 91_9, 91_17, and 91_19 while the fourth subkernel 92_4 moves to stride 2 in FIG. 9. Corresponds to the convolution operation.
  • one output data (b1) of the output feature map 63 ,1) can be output.
  • Figure 10 is a schematic diagram showing systolic array structures according to a comparative example of the present disclosure.
  • FIG. 10 shows comparative examples of the systolic array structure of the NPU according to the stationary technique of the processing element.
  • An NPU with a systolic array structure may include a processing element array including a plurality of processing elements that perform MAC operations.
  • Systolic array structure refers to a structure that reuses data and performs parallel operations, and this method can be referred to as dataflow. It can be divided into three types depending on what values are stored in the local memory of each processing element.
  • data used in any processing element can be passed to the next processing element located above, below, or to the right, and the data can be used directly in the next processing element.
  • the systolic array according to the Output Stationary (OS) technique is a structure in which the output feature map (OF), that is, the partial sum, can be stored and reused in the local memory of each PE, and the feature value Both the and weight values can be reused.
  • the feature value of each processing element and the weight value included in the kernel can be loaded through FIFO.
  • Each processing element can perform MAC operation using feature values and weight values. At this time, the calculated partial sum can be stored in each processing element, and the partial sum generated next can be accumulated.
  • the feature value may refer to parameters constituting the feature map.
  • Systolic array based on the weight stationary technique is a structure that stores weight values in the local memory of each PE and can be reused during convolution operations.
  • energy consumption when reading weight values can be minimized by minimizing retrieving weight values from DRAM.
  • Feature values for each processing element can be loaded through FIFO.
  • the input data (feature) is shifted from left to right at every cycle, and the calculated partial sum is transferred to the processing element from top to bottom while moving at every cycle. You can.
  • FIG. 10 (c) shows the Systolic array structure according to Input stationary (IS) mode.
  • Systolic array structure according to the input stationary (IS) technique has the same tensor flow as the systolic array structure according to the weight stationary technique.
  • this is a structure in which the input feature map (IF) can be stored and reused in the local memory of each PE.
  • Systolic array structure for each stationary mode may show significant differences in calculation time depending on the type and characteristics of the artificial neural network. This is because the height, width, depth, channels, etc. of inputs and weights vary depending on the type of layer of the artificial neural network.
  • MAC utilization may be significantly low when a systolic array structure based on the output stationary technique is used.
  • MAC utilization can be increased if the Systolic array structure according to the Input stationary mode is used instead of the Systolic array structure according to the Output stationary technique.
  • the MAC operation time in the processing element array is calculated according to the characteristics of each layer of the artificial neural network, and the MAC operation structure for each layer is based on the calculated MAC operation time. You can change (switch).
  • the computation time calculation may be performed at the compilation stage of the artificial neural network model. However, it is not limited to this.
  • the MAC operation time in the processing element array is calculated according to the characteristics of the input feature map of the artificial neural network, and the input feature map is based on the calculated MAC operation time.
  • the MAC operation structure can be switched for each tile (or patch).
  • the computation time calculation may be performed at the compilation stage of the artificial neural network model. However, it is not limited to this.
  • the characteristics of each layer of the artificial neural network may include the shape of an input feature map (IF) and/or weight.
  • the shape of the input feature map (IF) and/or weight may be determined by height, width, depth, and channel.
  • the input feature map of an artificial neural network can be divided into a plurality of small tiles, and each tile can extract features through operations with a kernel. Systolic array structures that can minimize MAC calculation time for each tile may be different.
  • the MAC operation structure of the processing element array of the neural processing unit may be one of a Systolic array structure according to Input stationary mode, a Systolic array structure according to Output stationary mode, and a Systolic array structure according to Weight stationary mode.
  • m is the number of filters
  • e is the height of the output feature map
  • f is the area of the output feature map
  • c is the number of channels
  • r is the height of the filter
  • s is a variable representing the area of the filter.
  • M is the number of filters
  • E is the height of the output feature map
  • F is the width of the output feature map
  • C is the number of channels
  • R is the height of the filter
  • S is a constant representing the width of the filter.
  • the algorithm according to Equation 1 can operate different for-loops in parallel according to each stationary technique.
  • loop-unrolling can be performed on the first to third for-loops in the algorithm according to Equation 1.
  • the first for-loop (Num filters) is operated in parallel as many rows as the number of rows of the processing element array
  • the second for-loop (num_conv_window(height )) and the third for-loop(num_conv_window(width))
  • the first for-loop (Num filters) is operated in parallel as many rows as the number of rows of the processing element array
  • the second for-loop number_conv_window(height )
  • the third for-loop(num_conv_window(width)) can be operated in parallel as many columns as the number of columns in the processing element array.
  • the neural processing unit performs a total MAC operation using the number of processing elements, the input feature map, and/or weights, assuming that the MAC operation using an input feature map and one kernel as input is 1 cycle. Time can be calculated.
  • Figure 11 is a configuration diagram showing a changeable MAC architecture according to an embodiment of the present disclosure.
  • a MAC architecture including four MAC operators (1100_1, 1100_2, 1100_3, 1100_4) is shown.
  • Each of the first MAC operator (1100_1), the second MAC operator (1100_2), the third MAC operator (1100_3), and the fourth MAC operator (1100_4) has a configurable MAC (Configurable MAC) structure.
  • a changeable MAC refers to a MAC with a structure in which the stationary mode can be changed by a control signal from a compiler or controller.
  • the MAC architecture shown in FIG. 11 is only an example, and the number of MAC operators does not limit the technical scope of the present disclosure.
  • the first MAC operator 1100_1 may include a first multiplexer 11, a second multiplexer 12, a register file 1103, and/or a decoder (dec) 1105.
  • the first multiplexer 11 can select and output either the weight (w) 1101_1 or data delivered from the register file 1103.
  • the second multiplexer 12 can select and output either the partial sum (p) 1102_1 or data transferred from the register file 1103.
  • the artificial processing unit calculates multiplication between the output value of the first multiplexer 11 and the input feature map (f) (1104_1), and calculates the multiplication between the calculated result value and the output of the second multiplexer 12. Addition can be performed.
  • the decoder 1105 may receive the result of addition and transfer it to the register file 1103 of the third MAC operator 1100_3 or the first MAC operator 1100_1.
  • Figure 12 is a configuration diagram showing the MAC architecture in Output stationary mode according to an embodiment of the present disclosure.
  • MAC architecture including four MAC operators (1200_1, 1200_2, 1200_3, 1200_4) in output stationary mode is shown.
  • the dotted line indicates the path through which actual data is transmitted in output stationary mode.
  • the first MAC operator 1200_1 may include a first multiplexer 13, a second multiplexer 14, a register file 1203, and a decoder (dec) 1205.
  • the first multiplexer 13 may select and output the weight (w) (1201_1) or the weight (w) (1201_1) from among the data transmitted from the register file (1103).
  • the weight (w) 1201_1 can be delivered to the first multiplexer 13 and simultaneously transferred to the third MAC operator 1200_3 and reused. Depending on the embodiment, the weight (w) 1201_1 may be delivered to MAC operators located in the same column in a pipeline format.
  • the second multiplexer 14 may select and output data transmitted from the register file 1103 among the partial sum (p) 1102_1 or data transmitted from the register file 1103.
  • the register file 1103 may be an accumulator in which partial sums are stored. Accordingly, data transferred from the register file 1103 to the second multiplexer 14 may be a partial sum.
  • the artificial processing unit calculates the multiplication between the weight (w), which is the output value of the first multiplexer 13, and the input feature map (f) (1204_1), and calculates the calculated result value and the second multiplexer (14). You can calculate addition between partial sums that are the output values of ).
  • the decoder 1105 may receive the result of the addition and transfer it to the register file 1203 of the first MAC operator 1200_1.
  • the input feature map (f) 1204_1 is transmitted to calculate the multiplication with the weight (w), which is the output value of the first multiplexer 13, and can also be transmitted to the second MAC operator 1200_2 and reused.
  • the input feature map (f) 1204_1 may be delivered to MAC operators located in the same row in a pipeline format.
  • Figure 13 is a configuration diagram showing the MAC architecture in Weight stationary or Input stationary mode according to an embodiment of the present disclosure.
  • MAC architecture including four MAC operators (1300_1, 1300_2, 1300_3, 1300_4) in Weight stationary or Input stationary mode is shown.
  • the dotted line indicates the path through which actual data is transmitted in Weight stationary or Input stationary mode.
  • the first MAC operator 1300_1 may include a first multiplexer 15, a second multiplexer 16, a register file 1303, and a decoder (dec) 1305.
  • the first multiplexer 15 may select and output data transmitted from the register file 1103 among the weight (w) 1301_1 or data transmitted from the register file 1103.
  • the second multiplexer 16 may select and output the partial sum (p) 1302_1 or the partial sum (p) 1302_1 among the data transmitted from the register file 1103.
  • the register file 1303 may store weights in Weight stationary mode and an input feature map in Input stationary mode. Weights or input feature maps stored according to stationary mode may be referred to as 'Preload data'. Accordingly, the data passed from the register file 1303 to the second multiplexer 16 may be a weight or an input feature map.
  • the artificial processing unit calculates the multiplication between the preload data, which is the output value of the first multiplexer 15, and the input feature map (f) 1204_1, and calculates the result of the calculation and the output value of the second multiplexer 14. Addition between partial sums (p) (1302_1), which are output values, can be calculated.
  • the decoder 1105 may receive the result of the addition and transfer it to be reused as the partial sum (p) 1302_3 of the third MAC operator 1200_1.
  • the input feature map (f) 1304_1 is transmitted to calculate multiplication with preload data, which is the output value of the first multiplexer 15, and can also be transmitted to the second MAC operator 1200_2 and reused.
  • the input feature map (f) 1204_1 may be delivered to MAC operators located in the same row in a pipeline format.
  • the MAC operation time in the processing element array is calculated according to the characteristics of each layer of the artificial neural network, and the MAC operation structure for each layer is based on the calculated MAC operation time. You can change (switch). Therefore, by adopting the optimal MAC operation structure among the three modes of MAC operation structure for each layer, the MAC operation amount of the neural processing unit can be minimized.
  • the MAC operation time in the processing element array is calculated according to the characteristics of the input feature map of the artificial neural network, and the input feature map is based on the calculated MAC operation time.
  • the MAC operation structure can be switched for each tile (or patch). Therefore, the amount of MAC calculation of the neural processing unit can be minimized by adopting the optimal MAC calculation structure among the three modes of MAC calculation structure for each layer.

Landscapes

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

Abstract

본 발명의 일 예시에 따른 신경 프로세싱 유닛의 동작 방법이 제공된다. 상기 방법은, 컨트롤러에 의해, 제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱(Transpose Convolution) 연산임을 결정하는 단계, 상기 컨트롤러에 의해, 상기 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분하는 단계, 적어도 하나의 프로세싱 엘리먼트에 의해, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행하는 단계를 포함한다.

Description

신경 프로세싱 유닛 및 이의 동작 방법
본 개시는 신경 프로세싱 유닛(Neural Processing Unit, NPU) 및 이의 동작 방법에 관한 것이다.
인간은 인식(Recognition), 분류(Classification), 추론(Inference), 예측(Predict), 조작/의사결정(Control/Decision making) 등을 할 수 있는 지능을 갖추고 있다. 인공지능(artificial intelligence: AI)은 인간의 지능을 인공적으로 모방하는 것을 의미한다.
인간의 뇌는 뉴런(Neuron)이라는 수많은 신경세포로 이루어져 있다. 각각의 뉴런은 시냅스(Synapse)라고 불리는 연결부위를 통해 수 백에서 수 천 개의 다른 뉴런들과 연결되어 있다. 인간의 지능을 모방하기 위하여, 생물학적 뉴런의 동작원리와 뉴런 간의 연결 관계를 모델링한 것을, 인공신경망(Artificial Neural Network, ANN) 모델이라고 한다. 즉, 인공신경망은 뉴런들을 모방한 노드들을 레이어(Layer: 계층) 구조로 연결시킨, 시스템이다.
이러한 인공신경망모델은 레이어 수에 따라 '단층 신경망'과 '다층 신경망'으로 구분한다.
일반적인 다층신경망은 입력 레이어와 은닉 레이어, 출력 레이어로 구성된다. (1) 입력 레이어(input layer)는 외부의 자료들을 받아들이는 레이어로서, 입력 레이어의 뉴런 수는 입력되는 변수의 수와 동일하다. (2) 은닉 레이어(hidden layer)는 입력 레이어와 출력 레이어 사이에 위치하며 입력 레이어로부터 신호를 받아 특성을 추출하여 출력층으로 전달한다. (3) 출력 레이어(output layer)는 은닉 레이어로부터 신호를 받아 외부로 출력한다. 뉴런 간의 입력신호는 0에서 1 사이의 값을 갖는 각각의 연결강도와 곱해진 후 합산된다. 합산 값이 뉴런의 임계치보다 크면 뉴런이 활성화되어 활성화 함수를 통하여 출력 값으로 구현된다.
한편, 보다 높은 인공 지능을 구현하기 위하여, 인공신경망의 은닉 레이어의 개수를 늘린 것을 심층 신경망(Deep Neural Network, DNN)이라고 한다.
DNN에는 여러 종류가 있다. 일 예로, 컨볼루션 신경망(Convolutional Neural Network, CNN)은 입력 데이터의 특징들을 추출하고, 특징들의 패턴을 파악하기에 용이한 것으로 알려져 있다.
컨볼루션 신경망(CNN)은 인간 뇌의 시각 피질에서 영상을 처리하는 것과 유사한 기능을 하는 신경망이다. 컨볼루션 신경망은 영상처리에 적합한 것으로 알려져 있다. 컨볼루션 신경망은 분류(Classification), 객체 탐지(Object Detection), 인스턴스 분할(Instance Segmentation), 이미지 향상(Image Enhancement) 등의 목적으로 사용될 수 있다.
컨볼루션 신경망은 컨볼루션 채널들과 풀링(pooling) 채널들이 반복되는 형태로 구성된다. 컨볼루션 신경망에서 대부분의 연산시간은 컨볼루션 동작이 차지한다. 컨볼루션 신경망은 행렬(Matrix) 형태의 커널(kernel)에 의해 각 채널의 영상의 특징을 추출하고, 풀링(Pooling)에 의해 이동이나 왜곡 등의 항상성을 제공하는 방식으로 사물을 인식한다. 각 채널에서는 입력 데이터와 커널의 컨볼루션으로 특징맵(Feature Map)을 구한 후 ReLU(Rectified Linear Unit) 같은 활성함수를 적용하여 해당 채널의 활성화 맵을 생성한다. 이후 풀링이 적용될 수 있다. 패턴을 실제로 분류하는 신경망은 특징 추출 신경망의 후단에 위치하며, 완전 연결 레이어(Fully Connected Layer)라고 한다. 컨볼루션 신경망의 연산 처리에서 대부분의 연산은 컨볼루션 또는 행렬곱을 통해 수행된다.
본 개시의 발명자는 하기의 사항들에 대하여 인식하였다.
이미지 향상(Image Enhancement)을 위한 인공신경망모델의 경우, 출력 이미지는 입력 이미지와 같은 사이즈로 출력되므로 특징(feature)에 대한 채널이 증가했다가 다시 감소하는 형태이다.
이미지 향상(Image Enhancement)을 위한 인공신경망모델의 경우, 채널이 감소할 때에는 특징맵(feature map)의 가로(width) 및 세로(height)의 길이가 증가하는 경향이 있다. 또한, 이미지 향상을 위한 인공신경망모델의 경우, 전치 합성곱(Transpose Convolution) 연산을 포함하는 경향이 있다.
NPU는 전치 합성곱 연산 수행 시, 특징맵에 zero(s)를 삽입하여 일반적인 합성곱 연산으로 대체하여 연산할 수 있다.
일반적인 합성곱 연산을 이용하여 전치 합성곱 연산을 수행하는 경우, 삽입된 zero(s)에 대한 MAC(multiply and accumulate) 연산을 수반하게 되므로 반응 속도(latency)가 증가한다.
또한, 일반적인 합성곱 연산을 이용하여 전치 합성곱 연산을 수행하는 경우, 삽입된 zero(s)에 대한 MAC 연산을 수반하게 되므로 불필요한 MAC 연산량이 증가한다.
이에, 본 개시가 해결하고자 하는 과제는 특징맵의 전치 합성곱 연산을 서로 다른 복수 개의 합성곱으로 분리하여 연산하는 장치 및 방법을 제공하는 것이다. 따라서 본 개시에 따른 장치 및 방법에 의하면 zero(s)가 삽입된 특징맵의 zero(s)를 연산하지 않을 수 있는 효과가 있다.
단 본 개시는 이에 제한되지 않으며, 또 다른 과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.
전술한 바와 같은 과제를 해결하기 위하여 본 발명의 일 예시에 따른 신경 프로세싱 유닛의 동작 방법이 제공된다.
상기 방법은, 컨트롤러에 의해, 제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱(Transpose Convolution) 연산임을 결정하는 단계, 상기 컨트롤러에 의해, 상기 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분하는 단계, 적어도 하나의 프로세싱 엘리먼트에 의해, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행하는 단계를 포함한다.
본 발명의 일 실시예에 따르면, 제1 컨볼루션 레이어의 입력은 입력 특징맵(Input feature map)이고, 상기 입력 특징맵은 입력 데이터에 적어도 하나의 제로가 패딩된 특징맵일 수 있다.
본 발명의 일 실시예에 따르면, 상기 방법은, 상기 입력 데이터의 크기 및 상기 입력 특징맵의 크기를 식별하는 단계, 복수 개의 상기 서브 커널들에 대한 스트라이드(Stride)의 크기를 결정하는 단계 및 상기 입력 특징맵의 크기 또는 상기 스트라이드의 크기 중 적어도 하나에 기초하여, 출력 데이터의 크기를 결정하는 단계를 더 포함할 수 있다.
본 발명의 일 실시예에 따르면, 상기 커널은 적어도 하나의 가중치 값을 포함하고, 적어도 하나의 상기 가중치 값은 복수 개의 상기 서브 커널들 중 하나에 포함될 수 있다.
본 발명의 일 실시예에 따르면, 복수 개의 상기 서브 커널들은 제1 서브 커널 및 제2 서브 커널을 포함하고, 상기 제1 서브 커널은 상기 입력 특징맵의 제1 윈도우에 상기 커널이 대응될 때 상기 제1 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정되고, 상기 제2 서브 커널은 상기 입력 특징맵의 제2 윈도우에 상기 커널이 대응될 때 상기 제2 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정될 수 있다.
본 발명의 일 실시예에 따르면, 상기 방법은, 적어도 하나의 상기 프로세싱 엘리먼트에 의해, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 서브 필터들 각각의 컨볼루션 연산을 수행하는 단계는, 상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하는 단계 및 상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하고 난 후, 상기 입력 특징맵과 상기 제2 서브 커널의 컨볼루션 연산을 수행하는 단계를 포함한다.
본 발명의 일 실시예에 따르면, 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산은, 상기 입력 특징맵에 포함된 상기 입력 데이터와 상기 제1 서브 커널의 컨볼루션 연산일 수 있다.
본 발명의 일 실시예에 따르면, 상기 제1 컨볼루션 레이어의 출력은 출력 특징맵(Output feature map)이고, 상기 출력 특징맵은 상기 입력 데이터보다 큰 사이즈일 수 있다.
본 발명의 일 실시예에 따르면, 상기 방법은, 컨트롤러에 의해, 상기 입력 특징맵의 크기, 상기 출력 특징맵의 크기, 상기 입력 특징맵에 포함된 적어도 하나의 상기 제로 또는 상기 입력 데이터의 위치, 상기 스트라이드의 크기 또는 상기 커널의 크기 중 적어도 하나에 기초하여 복수의 상기 서브 커널들을 결정하는 단계를 더 포함할 수 있다.
본 발명의 일 실시예에 따르면, 상기 방법은, 상기 컨트롤러에 의해, 상기 출력 특징맵에 포함된 출력 데이터를 내부 메모리의 주소에 맵핑하는 단계 및 상기 내부 메모리에 의해, 상기 출력 특징맵에 포함된 상기 출력 데이터를 상기 맵핑된 주소에 저장하는 단계를 포함할 수 있다.
전술한 바와 같은 과제를 해결하기 위하여 본 발명의 일 예시에 따른 신경 프로세싱 유닛이 제공된다.
신경 프로세싱 유닛은, 인공신경망모델을 저장하도록 구성된 내부 메모리, 상기 내부 메모리에 액세스(access)하도록 구성되며 상기 인공신경망모델의 합성곱 연산을 처리하도록 구성된 적어도 하나의 프로세싱 엘리먼트(processing element; PE) 및 상기 내부 메모리, 적어도 하나의 상기 프로세싱 엘리먼트와 동작 가능하게 연결된 컨트롤러(controller)를 포함하고, 상기 인공신경망모델은 이미지를 입력으로 하여 이미지 향상(Image Enhancement)을 처리하도록 구성된 인공 신경망 기반의 모델이고, 상기 컨트롤러는, 제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱 연산임을 결정하고, 상기 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분하고, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행하도록 상기 적어도 하나의 프로세싱 엘리먼트를 제어하도록 구성된다.
본 발명의 일 실시예에 따르면, 제1 컨볼루션 레이어의 입력은 입력 특징맵(Input feature map)이고, 상기 입력 특징맵은 입력 데이터에 적어도 하나의 제로가 패딩된 특징맵일 수 있다.
본 발명의 일 실시예에 따르면, 상기 컨트롤러는, 상기 입력 데이터의 크기 및 상기 입력 특징맵의 크기를 식별하고, 복수 개의 상기 서브 커널들에 대한 스트라이드(Stride)의 크기를 결정하고, 상기 입력 특징맵의 크기 또는 상기 스트라이드의 크기 중 적어도 하나에 기초하여 출력 데이터의 크기를 결정하도록 추가로 구성될 수 있다.
본 발명의 일 실시예에 따르면, 상기 커널은 적어도 하나의 가중치 값을 포함하고, 적어도 하나의 상기 가중치 값은 복수 개의 상기 서브 커널들 중 하나에 포함될 수 있다.
본 발명의 일 실시예에 따르면, 복수 개의 상기 서브 커널들은 제1 서브 커널 및 제2 서브 커널을 포함하고, 상기 제1 서브 커널은 상기 입력 특징맵의 제1 윈도우에 상기 커널이 대응될 때 상기 제1 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정되고, 상기 제2 서브 커널은 상기 입력 특징맵의 제2 윈도우에 상기 커널이 대응될 때 상기 제2 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정될 수 있다.
본 발명의 일 실시예에 따르면, 상기 컨트롤러는, 상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하고, 상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하고 난 후 상기 입력 특징맵과 상기 제2 서브 커널의 컨볼루션 연산을 수행하도록 추가로 구성될 수 있다.
본 발명의 일 실시예에 따르면, 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산은, 상기 입력 특징맵에 포함된 상기 입력 데이터와 상기 제1 서브 커널의 컨볼루션 연산일 수 있다.
본 발명의 일 실시예에 따르면, 상기 제1 컨볼루션 레이어의 출력은 출력 특징맵(Output feature map)이고, 상기 출력 특징맵은 상기 입력 데이터보다 큰 사이즈일 수 있다.
본 발명의 일 실시예에 따르면, 상기 컨트롤러는, 상기 입력 특징맵의 크기, 상기 출력 특징맵의 크기, 상기 입력 특징맵에 포함된 적어도 하나의 상기 제로 또는 상기 입력 데이터의 위치, 상기 스트라이드의 크기 또는 상기 커널의 크기 중 적어도 하나에 기초하여 복수의 상기 서브 커널들을 결정하도록 구성될 수 있다.
본 발명의 일 실시예에 따르면, 상기 컨트롤러는, 상기 출력 특징맵에 포함된 출력 데이터를 내부 메모리의 주소에 맵핑하고, 상기 출력 특징맵에 포함된 상기 출력 데이터를 상기 맵핑된 주소에 저장하도록 상기 내부 메모리를 제어하도록 추가로 구성될 수 있다.
전술한 바와 같은 과제를 해결하기 위하여 본 발명의 일 예시에 따른 신경 프로세싱 유닛이 제공된다.
신경 프로세싱 유닛은, 내부 메모리, 적어도 하나의 프로세싱 엘리먼트와 동작 가능하게 연결된 컨트롤러(controller) 및 상기 컨트롤러에 의해 실행되는 하나 이상의 명령어들을 저장하도록 구성된 내부 메모리를 포함하고, 상기 컨트롤러는 상기 명령어들을 실행하여 제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱 연산임을 결정하는 동작, 상기 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분하는 동작, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행하도록 프로세싱 엘리먼트를 제어하는 동작을 수행하도록 구성될 수 있다.
본 개시에 따르면, 저해상도의 이미지를 고해상도로 이미지를 만들기 위한 인공신경망모델의 전치 합성곱 연산을 여러 타입의 컨볼루션으로 분리하여 수행할 수 있다.
본 개시에 따르면, 저해상도의 이미지를 고해상도로 이미지를 만들기 위한 인공신경망모델의 전치 합성곱 연산에서 불필요한 제로들 간의 연산을 제거할 수 있다.
본 개시에 따르면, 저해상도의 이미지를 고해상도로 이미지를 만들기 위한 인공신경망모델의 전치 합성곱 연산에서 MAC(multiply and accumulate) 연산량을 감소시킬 수 있다.
본 개시에 따른 효과는 이상에서 예시된 내용에 의해 제한되지 않으며, 더욱 다양한 효과들이 본 발명 내에 포함되어 있다.
도 1은 본 개시의 일 실시예에 따른 신경 프로세싱 유닛이 포함된 장치를 설명하는 개략적인 개념도이다.
도 2는 본 개시의 일 실시예에 따른 신경 프로세싱 유닛을 설명하는 개략적인 개념도이다.
도 3은 본 개시에 적용될 수 있는 프로세싱 엘리먼트 어레이 중 하나의 프로세싱 엘리먼트를 설명하는 개략적인 개념도이다.
도 4는 본 개시의 일 실시예에 따른 인공신경망의 구조를 나타내는 개략도이다.
도 5는 본 개시의 비교예에 따른 전치 합성곱 연산을 나타내는 개략도이다.
도 6은 본 개시의 실시예에 따른 전치 합성곱 연산을 나타내는 개략도이다.
도 7은 본 개시의 실시예에 따른 신경 프로세싱 유닛이 동작하는 방법을 설명하는 순서도이다.
도 8은 본 개시의 실시예에 따른 복수 개의 서브 커널들 및 이에 대응되는 입력 데이터를 나타내는 개략도이다.
도 9는 본 개시의 실시예에 따른 신경 프로세싱 유닛에서 복수 개의 서브 커널들을 이용하여 수행되는 합성곱 연산을 나타내는 개략도이다.
도 10은 본 개시의 비교예에 따른 systolic array 구조들을 나타내는 개략도이다.
도 11은 본 개시의 실시예에 따른 변경가능한 MAC 아키텍쳐를 나타내는 구성도이다.
도 12는 본 개시의 실시예에 따른 Output stationary 모드에서의 MAC 아키텍쳐를 나타내는 구성도이다.
도 13은 본 개시의 실시예에 따른 Weight stationary 또는 Input stationary 모드에서의 MAC 아키텍쳐를 나타내는 구성도이다.
본 명세서 또는 출원에 개시되어 있는 본 개시의 개념에 따른 실시 예들에 대해서 특정한 구조적 내지 단계적 설명들은 단지 본 개시의 개념에 따른 실시 예를 설명하기 위한 목적으로 예시된 것이다.
본 개시의 개념에 따른 실시 예들은 다양한 형태로 실시될 수 있으며 본 개시의 개념에 따른 실시 예들은 다양한 형태로 실시될 수 있으며 본 명세서 또는 출원에 설명된 실시 예들에 한정되는 것으로 해석되어서는 아니 된다.
본 개시의 개념에 따른 실시 예는 다양한 변경을 가할 수 있고 여러 가지 형태를 가질 수 있으므로 특정 실시 예들을 도면에 예시하고 본 명세서 또는 출원에 상세하게 설명하고자 한다. 그러나, 이는 본 개시의 개념에 따른 실시 예를 특정한 개시 형태에 대해 한정하려는 것이 아니며, 본 개시의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.
제 1 및/또는 제 2 등의 용어는 다양한 구성 요소들을 설명하는데 사용될 수 있지만, 상기 구성 요소들은 상기 용어들에 의해 한정되어서는 안 된다.
상기 용어들은 하나의 구성 요소를 다른 구성 요소로부터 구별하는 목적으로만, 예컨대 본 개시의 개념에 따른 권리 범위로부터 이탈되지 않은 채, 제 1 구성요소는 제 2 구성요소로 명명될 수 있고, 유사하게 제 2 구성요소는 제 1 구성요소로도 명명될 수 있다.
어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.
구성요소들 간의 관계를 설명하는 다른 표현들, 즉 "~사이에"와 "바로 ~사이에" 또는 "~에 이웃하는"과 "~에 직접 이웃하는" 등도 마찬가지로 해석되어야 한다.
본 문서에서, "A 또는 B," "A 또는/및 B 중 적어도 하나," 또는 "A 또는/및 B 중 하나 또는 그 이상" 등의 표현은 함께 나열된 항목들의 모든 가능한 조합을 포함할 수 있다. 예를 들면, "A 또는 B," "A 및 B 중 적어도 하나," 또는 "A 또는 B 중 적어도 하나"는, (1) 적어도 하나의 A를 포함, (2) 적어도 하나의 B를 포함, 또는(3) 적어도 하나의 A 및 적어도 하나의 B 모두를 포함하는 경우를 모두 지칭할 수 있다.
본 문서에서 사용된 "제 1," "제 2," "첫째," 또는 "둘째," 등의 표현들은 다양한 구성요소들을, 순서 및/또는 중요도에 상관없이 수식할 수 있고, 한 구성요소를 다른 구성요소와 구분하기 위해 사용될 뿐 해당 구성요소들을 한정하지 않는다. 예를 들면, 제 1 사용자 기기와 제 2 사용자 기기는, 순서 또는 중요도와 무관하게, 서로 다른 사용자 기기를 나타낼 수 있다. 예를 들면, 본 문서에 기재된 권리범위를 벗어나지 않으면서 제 1 구성요소는 제 2 구성요소로 명명될 수 있고, 유사하게 제 2 구성요소도 제 1 구성요소로 바꾸어 명명될 수 있다.
본 문서에서 사용된 용어들은 단지 특정한 실시 예를 설명하기 위해 사용된 것으로, 다른 예시의 범위를 한정하려는 의도가 아닐 수 있다.
단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함할 수 있다. 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 용어들은 본 문서에 기재된 기술분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가질 수 있다.
본 문서에 사용된 용어들 중 일반적인 사전에 정의된 용어들은, 관련 기술의 문맥상 가지는 의미와 동일 또는 유사한 의미로 해석될 수 있으며, 본 문서에서 명백하게 정의되지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다. 경우에 따라서, 본 문서에서 정의된 용어일지라도 본 문서의 실시 예들을 배제하도록 해석될 수 없다.
본 명세서에서 사용한 용어는 단지 특정한 실시 예를 설명하기 위해 사용된 것으로, 본 개시를 한정하려는 의도가 아니다.
단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 서술된 특징, 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.
다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 명세서에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.
본 발명의 여러 예시들의 각각 특징들이 부분적으로 또는 전체적으로 서로 결합 또는 조합 가능하며, 당업자가 충분히 이해할 수 있듯이 기술적으로 다양한 연동 및 구동이 가능하며, 각 예시들이 서로에 대하여 독립적으로 실시 가능할 수도 있고 연관 관계로 함께 실시 가능할 수도 있다.
실시 예를 설명함에 있어서 본 개시가 속하는 기술 분야에 익히 알려져 있고 본 개시와 직접적으로 관련이 없는 기술 내용에 대해서는 설명을 생략한다. 이는 불필요한 설명을 생략함으로써 본 개시의 요지를 흐리지 않고 더욱 명확히 전달하기 위함이다.
<용어의 정의>
이하, 본 명세서에서 제시되는 개시들의 이해를 돕고자, 본 명세서에서 사용되는 용어들에 대하여 간략하게 정리하기로 한다.
NPU: 신경 프로세싱 유닛(Neural Processing Unit)의 약어로서, CPU(Central processing unit)과 별개로 인공신경망모델의 연산을 위해 특화된 프로세서를 의미할 수 있다. 인공신경망 가속기로 지칭되는 것도 가능하다.
인공신경망의 구조에 대한 정보: 레이어의 개수에 대한 정보, 레이어 내의 노드의 개수, 각 노드의 값, 연산 처리 방법에 대한 정보, 각 노드에 적용되는 가중치 행렬에 대한 정보 등을 포함하는 정보이다.
인공신경망모델의 데이터 지역성: 학습이 완료된 인공신경망(ANN)의 구조가 확정되면, 인공신경망모델을 컴파일하여 확정된 모든 연산순서 및 연산 종류를 포함하는 정보이다.
DNN: 심층 신경망(Deep Neural Network)의 약어로서, 보다 높은 인공 지능을 구현하기 위하여, 인공신경망의 은닉 레이어의 개수를 늘린 것을 의미할 수 있다.
CNN: 컨볼루션 신경망(Convolutional Neural Network)의 약어로서, 인간 뇌의 시각 피질에서 영상을 처리하는 것과 유사한 기능을 하는 신경망이다. 컨볼루션 신경망은 영상처리에 적합한 것으로 알려져 있으며, 입력 데이터의 특징들을 추출하고, 특징들의 패턴을 파악하기에 용이한 것으로 알려져 있다. CNN에서의 가중치는 N x M 크기의 커널을 지칭할 수 있다.
이하, 첨부한 도면을 참조하여 본 개시의 실시 예를 설명함으로써, 본 개시를 상세히 설명한다. 이하, 본 개시의 실시 예를 첨부된 도면을 참조하여 상세하게 설명한다.
도 1은 본 개시의 일 실시예에 따른 신경 프로세싱 유닛이 포함된 장치를 설명하는 개략적인 개념도이다.
도 1을 참조하면 NPU(1000)이 포함된 장치(B)는 온칩 영역(A)을 포함한다. 온칩 영역 외부에는 메인 메모리(4000)가 포함될 수 있다. 메인 메모리(400)는 예를 들어 DRAM등과 같은 시스템 메모리일 수 있다. 도시되지 않았으나, 온칩 영역(A) 외부에는 ROM등을 포함하는 저장부가 포함될 수 있다.
온칩 영역(A)에는 중앙 프로세싱 유닛(CPU)(2000)와 같은 범용 프로세싱 유닛과 온칩 메모리(3000) 그리고 NPU(1000)가 배치된다. CPU(2000)는 NPU(1000)와 온칩 메모리(3000) 그리고 메인 메모리(4000)에 동작 가능하게 연결된다.
단 본 개시의 장치(B)는 독립형(standalone) 장치로 구성될 수 있으며, 이러한 경우 중앙 프로세싱 유닛(2000)이 배제되도록 구성되는 것도 가능하다.
단, 본 개시는 이에 제한되지 않으며, CPU(2000) 내부에 NPU(1000)가 포함되도록 구성되는 것도 가능하다.
온칩 메모리(3000)는 반도체 다이에 실장된 메모리로 메인 메모리(4000) 액세스와 별도로 캐싱을 위한 메모리일 수 있다.
예를 들면, 온칩 메모리(3000)는 다른 온칩 반도체들이 액세스하도록 설정된 메모리일 수도 있다. 예를 들면, 온칩 메모리(3000)는 캐시 메모리 또는 버퍼 메모리 일 수 있다.
NPU(1000)는 내부 메모리(200)를 포함하며, 내부 메모리(200)는 예를 들어 SRAM을 포함할 수 있다. 내부 메모리(200)는 실질적으로 NPU(1000)에서의 연산에만 사용되는 메모리 일 수 있다. 내부 메모리(200)는 NPU 내부 메모리로 지칭될 수 있다. 여기서 실질적이란, 내부 메모리(200)에는 NPU(1000)가 처리하는 인공신경망과 관련된 데이터를 저장하도록 구성된 것을 의미할 수 있다. 일 예로, 인공신경망과 관련된 데이터는 입력 특징맵, 커널 및/또는 출력 특징맵에 대한 데이터일 수 있다.
예를 들면, 내부 메모리(200)는 NPU(1000) 연산에 필요한 가중치, 커널 및/또는 특징맵을 저장하도록 구성된 버퍼 메모리 및/또는 캐시 메모리 일 수 있다. 단, 이에 제한되지 않는다.
예를 들면, 내부 메모리(200)는 SRAM, MRAM, 레지스터 파일(Register file) 등의 읽고 쓰기가 메인 메모리(4000)보다 상대적으로 더 빠른 메모리 소자로 구성될 수 있다. 단, 이에 제한되지 않는다.
예를 들면, 내부 메모리(200)는 NPU(1000) 내부에 배치된 복수의 메모리들을 포함하도록 구성될 수 있다. 예를 들면, 내부 메모리(200)는 컨트롤러를 제어하기 위한 적어도 하나의 명령어 및/또는 인스트럭션(instruction)을 저장하기 위한 제1 내부 메모리(미도시), 컴파일된 인공신경망모델의 연산 단계가 결정된 스케줄링(scheduling) 정보를 저장하기 위한 제2 내부 메모리(미도시), 및/또는 인공신경망모델의 파라미터(예를 들면, 입력 특징맵, 출력 특징맵, 가중치, 커널, 부분합(partial sum) 등)을 저장하도록 구성된 제3 내부 메모리(미도시) 등을 포함하도록 구성되는 것도 가능하다.
NPU(1000)가 포함된 장치(B)는 내부 메모리(200), 온칩 메모리(3000), 메인 메모리(4000) 중 적어도 하나를 포함한다.
이하에서 설명하는 “적어도 하나의 메모리”는 내부 메모리(200), 및 온칩 메모리(3000)중 적어도 하나를 포함하도록 의도된다.
또한, 온칩 메모리(3000)의 기재는 NPU(2000)의 내부 메모리(200) 또는 NPU(2000)의 외부에 있으나 온칩 영역(A)에 있는 메모리를 포함하도록 의도될 수 있다.
다만, 적어도 하나의 메모리를 지칭하는 내부 메모리(200) 및/또는 온칩 메모리(3000)는 위치적 특성이 아닌 메모리의 대역폭(bandwidth) 기준 또는 버스의 구성 방식에 따라 메인 메모리(4000)와 구분하는 것도 가능하다.
통상적으로 메인 메모리(4000)는 대용량의 데이터를 저장하기 용이하나, 메모리 대역폭이 상대적으로 낮고, 전력 소모가 상대적으로 큰 메모리를 지칭한다.
통상적으로 내부 메모리(200)와 온칩 메모리(3000)는 메모리 대역폭이 상대적으로 높고, 전력 소모가 상대적으로 낮으나, 대용량의 데이터를 저장하기에 비효율 적인 메모리를 지칭한다.
NPU(1000)이 포함된 장치(B)의 각각의 구성요소는 버스(5000)를 통해서 통신할 수 있다. 장치(B)의 버스(5000)는 적어도 하나일 수 있다. 버스(5000)는 통신 버스 및/또는 시스템 버스 등으로 지칭될 수 있다.
NPU(1000)의 내부 메모리(200)와 온칩 메모리(3000)는 인공신경망모델의 가중치와 특징맵 처리를 위해 특정 대역폭 이상을 보장하기 위해서 별도의 전용 버스를 더 구비하는 것도 가능하다.
온 칩 메모리(3000)와 메인 메모리(4000) 사이에는 특정 대역폭 이상을 보장하기 위해서 별도의 전용 버스를 더 구비하는 것도 가능하다. 상기 특정 대역폭은 NPU(1000)의 프로세싱 엘리먼트 어레이의 처리 성능을 기준으로 결정될 수 있다.
NPU(1000)의 내부 메모리(200)와 메인 메모리(4000) 사이에는 특정 대역폭 이상을 보장하기 위해서 별도의 전용 버스를 더 구비하는 것도 가능하다. 상기 특정 대역폭은 NPU(1000)의 프로세싱 엘리먼트 어레이의 처리 성능을 기준으로 결정될 수 있다.
NPU(1000)이 포함된 장치(B)는 DMA(Direct Memory Access) 모듈을 더 포함하여, 내부 메모리(200), 온 칩 메모리(3000) 및/또는 메인 메모리(4000)를 직접 제어하도록 구성되는 것도 가능하다.
예를 들면, DMA 모듈은 버스(5000)를 직접 제어하여 NPU(2000)와 온칩 메모리(3000)의 데이터 전송을 직접 제어하도록 구성될 수 있다.
예를 들면, DMA 모듈은 버스(5000)를 직접 제어하여 온칩 메모리(3000)와 메인 메모리(4000)의 데이터 전송을 직접 제어하도록 구성될 수 있다.
예를 들면, DMA 모듈은 버스(5000)를 직접 제어하여 내부 메모리(200)와 메인 메모리(4000)의 데이터 전송을 직접 제어하도록 구성될 수 있다.
신경 프로세싱 유닛(neural processing unit, NPU)(1000)은 인공신경망을 위한 동작을 수행하도록 특화된 프로세서이다. NPU(1000)는 AI 가속기로 지칭될 수 있다.
인공신경망은 여러 입력 또는 자극이 들어오면 각각 가중치를 곱해 더해주고, 추가적으로 편차를 더한 값을 활성화 함수를 통해 변형하여 전달하는 인공 뉴런들이 모인 네트워크를 의미한다. 이렇게 학습된 인공신경망은 입력 데이터로부터 추론(inference) 결과를 출력하는데 사용될 수 있다.
상기 NPU(1000)은 전기/전자 회로로 구현된 반도체일 수 있다. 상기 전기/전자 회로라 함은 수많은 전자 소자, (예컨대 트렌지스터, 커패시터)를 포함하는 것을 의미할 수 있다. 상기 NPU(1000)은 프로세싱 엘리먼트(processing element: PE) 어레이, NPU 내부 메모리(200), NPU 컨트롤러, 특수 기능 유닛(SFU) 및 NPU 인터페이스를 포함할 수 있다. 프로세싱 엘리먼트 어레이, NPU 내부 메모리(200), NPU 스케줄러, 및 NPU 인터페이스 각각은 수많은 트렌지스터들이 연결된 반도체 회로일 수 있다.
따라서, 이들 중 일부는 육안으로는 식별되어 구분되기 어려울 수 있고, 동작에 의해서만 식별될 수 있다. 예컨대, 임의 회로는 프로세싱 엘리먼트 어레이로 동작하기도 하고, 혹은 NPU 컨트롤러로 동작될 수도 있다.
상기 NPU(1000)은 프로세싱 엘리먼트 어레이, 프로세싱 엘리먼트 어레이에서 추론될 수 있는 인공신경망모델의 적어도 일부를 저장하도록 구성된 NPU 내부 메모리(200), 및 인공신경망모델의 데이터 지역성 정보 또는 인공신경망모델의 구조에 대한 정보에 기초하여 프로세싱 엘리먼트 어레이 및 NPU 내부 메모리(200)를 제어하도록 구성된 NPU 컨트롤러를 포함할 수 있다.
인공신경망모델은 인공신경망모델의 데이터 지역성 정보 또는 구조에 대한 정보를 포함할 수 있다.
인공신경망모델은 이미지 향상 기능을 수행하도록 학습된 AI 인식모델을 의미할 수 있다.
프로세싱 엘리먼트 어레이는 인공신경망을 위한 동작을 수행할 수 있다. 예를 들어, 입력 데이터가 입력되었을 때, 프로세싱 엘리먼트 어레이는 인공신경망이 학습을 수행하도록 할 수 있다. 학습이 완료된 이후, 입력 데이터가 입력되었을 때, 프로세싱 엘리먼트 어레이는 학습 완료된 인공신경망을 통해 추론 결과를 도출하는 동작을 수행할 수 있다.
예를 들면, NPU(1000)은 NPU 인터페이스를 통해서 메인 메모리(4000)에 저장된 인공신경망모델의 데이터를 NPU 내부 메모리(200)으로 불러올 수 있다. NPU 인터페이스는 버스(5000)를 통해서 메인 메모리(4000)와 통신할 수 있다.
NPU 컨트롤러는 NPU(1000)의 추론 연산을 위한 프로세싱 엘리먼트 어레이의 연산 및 NPU 내부 메모리(200)의 읽기 및 쓰기 순서를 제어하도록 구성된다. NPU 컨트롤러는 입력 데이터와 복수의 서브 커널들(또는, 필터들) 각각에 대한 합성곱 연산의 순서를 제어하도록 구성된다. NPU 컨트롤러는 합성곱 연산들의 결과로 출력되는 특징맵에 있어서, 특징맵에 포함된 각 요소들(또는, 출력 값들, 출력 데이터)을 NPU 내부 메모리(200)의 대응되는 주소에 맵핑하도록 구성된다.
NPU 컨트롤러는 인공신경망모델의 구조를 분석하거나 또는 인공신경망모델의 구조를 제공받는다. 다음으로, NPU 컨트롤러는 각 레이어 별 연산순서를 순차적으로 결정한다. 즉, 인공신경망모델의 구조가 확정될 경우, 레이어 별 연산순서가 정해질 수 있다. 이러한 인공신경망모델의 구조에 따른 연산의 순서 또는 데이터 흐름의 순서를 알고리즘 레벨에서의 인공신경망모델의 데이터 지역성으로 정의할 수 있다.
NPU 컨트롤러는 상기 인공신경망모델의 구조를 반영하여 각 레이어 별 연산순서를 순차적으로 결정한다. 즉, 인공신경망모델의 구조가 확정될 경우, 레이어 별 연산순서가 정해질 수 있다. 예시적으로, NPU 컨트롤러는 특정 컨볼루션 레이어에서 컨볼루션 전치 연산이 수행되는 경우, 서브 레이어 별 연산 순서가 정해질 수 있다. 입력 데이터와 복수 개의 서브 필터들 각각의 컨볼루션 연산이 수행될 때, 각각의 컨볼루션 연산을 서브 레이어에서 수행되는 연산으로 정의할 수 있다.
인공신경망모델이 NPU(1000)에서 실행되도록 컴파일러가 인공신경망모델을 컴파일 할 경우, 신경 프로세싱 유닛-메모리 레벨에서의 인공신경망모델의 인공신경망 데이터 지역성이 재구성될 수 있다. 예를 들어, 컴파일러는 CPU(2000), 온라인 서버 또는 별도의 외부 시스템에 의해 실행될 수 있다.
NPU(1000)가 해당 인공신경망모델을 연산하는 방식, 예를 들면, 특징맵 타일링(feature map tiling), 프로세싱 엘리먼트의 스테이셔너리(Stationary) 기법, NPU(1000)의 프로세싱 엘리먼트 개수, NPU(1000) 내 특징맵 및 가중치의 크기, 내부 메모리 용량, NPU(1000)내의 메모리 계층 구조, 및 해당 인공신경망모델을 연산 처리하기 위한 NPU(1000)의 연산 동작의 순서를 결정해 주는 컴파일러의 알고리즘 특성 등에 따라, 동일한 인공신경망모델의 경우에도 처리하고자 하는 인공신경망모델의 계산 방법이 상이하게 구성될 수 있다. 왜냐하면, 상술한 요인들에 의해서 동일한 인공신경망모델을 연산 처리하더라도 NPU(1000)가 클럭 단위로 매 순간 필요한 데이터의 순서를 상이하게 결정할 수 있기 때문이다.
도 2는 본 개시의 일 실시예에 따른 신경 프로세싱 유닛을 설명하는 개략적인 개념도이다.
신경 프로세싱 유닛(NPU)(1000)은 프로세싱 엘리먼트 어레이(Processing Element Array, PE Array)(100), 내부 메모리(200) 및/또는 컨트롤러(300)를 포함할 수 있다. 내부 메모리(200)에는 본 개시의 예시적인 실시예에 따른 인공신경망모델(210)이 저장될 수 있다. 프로세싱 엘리먼트 어레이(100)는 복수의 프로세싱 엘리먼트를 포함한다. 따라서 프로세싱 엘리먼트 어레이는 복수의 프로세싱 엘리먼트로 지칭되는 것도 가능하다.
컨트롤러(300)는 인공신경망모델(210)의 가중치 값들의 크기, 특징맵(feature map)의 크기, 가중치 값들 및/또는 특징맵의 계산 순서 등을 고려하여 프로세싱 엘리먼트 어레이(100) 및 NPU 내부 메모리(200)을 제어하도록 구성될 수 있다.
컨트롤러(300)는 프로세싱 엘리먼트 어레이(100)에서 계산될 가중치 값들의 크기, 특징맵의 크기, 및 가중치 값들과 특징맵의 계산 순서 등을 수신할 수 있다. 인공신경망모델이 포함할 수 있는 인공신경망의 데이터는 각 레이어의 노드 데이터 또는 특징맵, 및 각각의 레이어의 노드를 연결하는 연결망 각각의 가중치 데이터를 포함할 수 있다. 일 예로, 인공신경망모델이 포함할 수 있는 인공신경망과 관련된 데이터는 입력 특징맵, 커널 및/또는 출력 특징맵에 대한 데이터일 수 있다.
인공신경망의 데이터 또는 파라미터들 중 적어도 일부는 컨트롤러(300) 내부에 제공되는 메모리 또는 NPU 내부 메모리(200)에 저장될 수 있다.
컨트롤러(300)는 제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱 연산임을 결정할 수 있다. 제1 컨볼루션 레이어에서 수행되는 연산은 채널이 감소하면서 특징(feature)(또는, 특징맵)의 크기가 증가하게 되는 전치 합성곱 연산일 수 있다. 이렇게, 채널이 감소하면서 특징의 크기가 증가하게 되는 연산은 업 스케일링(upscaling), 업 컨볼루션(up convolution), 전치 합성곱(Transpose Convolution) 연산으로 지칭될 수 있다. 컨트롤러(300)는 복수 개의 컨볼루션 레이어들의 연산 중 해당 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱 연산임을 결정할 수 있다.
컨트롤러(300)는 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분할 수 있다. 일 실시 예에 따르면, 복수 개의 서브 커널들은 제1 서브 커널, 제2 서브 커널, 제3 서브 커널, 제4 서브 커널을 포함할 수 있다. 커널의 크기는 가로(width)와 세로(height)의 곱(width x height)으로 나타낼 수 있다. 일 실시예에 따르면, 커널의 크기는 3x3이고, 제1 서브 커널의 크기는 1x1이고, 제2 서브 커널의 크기는 2x1이고, 제3 서브 커널의 크기는 1x2이고, 제4 서브 커널의 크기는 2x2일 수 있다.
프로세싱 엘리먼트(110)는 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 서브 커널들 각각의 컨볼루션 연산을 수행할 수 있다.
프로세싱 엘리먼트(110)은 입력 특징맵과 제1 서브 커널의 컨볼루션 연산을 수행할 수 있다. 프로세싱 엘리먼트(110)은 입력 특징맵과 제2 서브 커널의 컨볼루션 연산을 수행할 수 있다. 프로세싱 엘리먼트(110)은 입력 특징맵과 제3 서브 커널의 컨볼루션 연산을 수행할 수 있다. 프로세싱 엘리먼트(110)은 입력 특징맵과 제4 서브 커널의 컨볼루션 연산을 수행할 수 있다.
본 개시의 NPU(1000)에서 MAC 연산량을 감소시키는 구성은 특히 제로 패딩된 입력 데이터와의 합성곱 연산 시 패딩된 제로를 연산하지 않는 방식을 택함으로써, 도 6 이하에서 설명할 전치 합성곱 연산에서 연산량을 최소화하는 것이다.
일반적인 CPU의 스케줄링은 공평성, 효율성, 안정성, 반응 시간 등을 고려하여, 최상의 효율을 낼 수 있도록 동작한다. 즉, 우선 순위, 연산 시간 등을 고려해서 동일 시간내에 가장 많은 프로세싱을 수행하도록 스케줄링 된다.
종래의 CPU는 각 프로세싱의 우선 순서, 연산 처리 시간 등의 데이터를 고려하여 작업을 스케줄링 하는 알고리즘을 사용하였다.
이와 다르게 NPU(1000)의 컨트롤러(300)는 인공신경망모델의 파라미터들의 계산 방식에 기초하여 프로세싱 순서를 결정할 수 있다.
프로세싱 엘리먼트 어레이(100)는 인공신경망의 노드 데이터(예를 들면, 특징맵)와 연결망의 가중치 데이터(예를 들면, 커널)를 연산하도록 구성된 복수의 프로세싱 엘리먼트들(PE1, PE2, …)을 포함하도록 구성된다. 각각의 프로세싱 엘리먼트는 MAC (multiply and accumulate) 연산기 및/또는 ALU (Arithmetic Logic Unit) 연산기를 포함할 수 있다. 단, 본 개시에 따른 예시들은 이에 제한되지 않는다.
도 2에서는 예시적으로 복수의 프로세싱 엘리먼트들(PE1, PE2, …)이 도시되었지만, 하나의 프로세싱 엘리먼트 내부에 MAC을 대체하여, 복수의 곱셈기(multiplier) 및 가산기 트리(adder tree)로 구현된 연산기들이 병렬로 배치되어 구성되는 것도 가능하다. 이러한 경우, 프로세싱 엘리먼트 어레이(100)는 복수의 연산기를 포함하는 적어도 하나의 프로세싱 엘리먼트로 지칭되는 것도 가능하다.
또한, 도 2에 도시된 복수의 프로세싱 엘리먼트들(PE1, PE2, …)은 단지 설명의 편의를 위한 예시이며, 복수의 프로세싱 엘리먼트들(PE1, PE2, …)의 개수는 제한되지 않는다. 복수의 프로세싱 엘리먼트들(PE1, PE2, …)의 개수에 의해서 프로세싱 엘리먼트 어레이의 크기 또는 개수가 결정될 수 있다. 프로세싱 엘리먼트 어레이의 크기는 N x M 행렬 형태로 구현될 수 있다. 여기서 N 과 M은 0보다 큰 정수이다. 이에, 프로세싱 엘리먼트 어레이(100)는 N x M 개의 프로세싱 엘리먼트를 포함할 수 있다. 즉, 프로세싱 엘리먼트는 1개 이상일 수 있다.
또한, 프로세싱 엘리먼트 어레이(100)는 복수 서브 모듈로 구성되는 것도 가능하다. 이에, 프로세싱 엘리먼트 어레이(100)는 N x M x L 개의 서브 모듈로 구성된 프로세싱 엘리먼트를 포함할 수 있다. 부연 설명하면 L개는 프로세싱 엘리먼트 어레이의 서브 모듈의 개수로, 코어, 엔진 또는 쓰레드 등으로 지칭될 수 있다.
프로세싱 엘리먼트 어레이(100)의 크기는 NPU(1000)이 작동하는 인공신경망모델의 특성을 고려하여 설계할 수 있다. 부연 설명하면, 프로세싱 엘리먼트의 개수는 작동할 인공신경망모델의 데이터 크기, 요구되는 동작 속도, 요구되는 소비 전력 등을 고려하여 결정될 수 있다. 인공신경망모델의 데이터 크기는 인공신경망모델의 레이어 수와 각각의 레이어의 가중치 데이터 크기에 대응되어 크기가 결정될 수 있다.
따라서, 본 개시의 일 예시에 따른 프로세싱 엘리먼트 어레이(100)의 크기는 제한되지 않는다. 프로세싱 엘리먼트 어레이(100)의 프로세싱 엘리먼트들(PE1…)(110)의 개수가 증가할수록 작동하는 인공신경망모델의 병렬 연산 능력이 증가되나, NPU(1000)의 제조 비용 및 물리적인 크기가 증가될 수 있다.
예를 들면, NPU(1000)에서 작동되는 인공신경망모델은 저해상도의 이미지를 고해상도 이미지로 출력하도록 학습된 인공신경망, 즉 이미지 향상을 위한 AI 모델일 수 있다. 이러한 경우, 엘리먼트 어레이(100)의 크기는 인공신경망모델의 연산량 특성을 고려하여 N x M로 설계될 수 있다. 다르게 설명하면, 엘리먼트 어레이(100)는 12개의 프로세싱 엘리먼트들을 포함할 수 있다. 단, 이에 제한되지 않으며, 복수의 프로세싱 엘리먼트들(PE1…)(110)의 개수는 예를 들면, 8개 내지 16,384 범위 내에서 선택되는 것도 가능하다. 즉, 본 개시의 실시예들에서 프로세싱 엘리먼트의 개수는 제한되지 않는다.
프로세싱 엘리먼트 어레이(100)는 인공신경망 연산에 필요한 덧셈, 곱셈, 누산 등의 기능을 수행하도록 구성된다. 다르게 설명하면, 프로세싱 엘리먼트 어레이(100)는 MAC(multiplication and accumulation) 연산을 수행하도록 구성될 수 있다.
내부 메모리(200)는 휘발성 메모리일 수 있다. 휘발성 메모리는 전원이 공급된 경우에만 데이터를 저장하고, 전원 공급이 차단되면 저장된 데이터가 소멸되는 메모리일 수 있다. 휘발성 메모리는 정적 랜덤 액세스 메모리 (Static Random Access Memory; SRAM), 동적 랜덤 액세스 메모리 (Dynamic Random Access Memory; DRAM) 등을 포함할 수 있다. 내부 메모리(200)는 바람직하게는 SRAM일 수 있으나, 이에 한정되지 않는다.
이하에서는 인공신경망 중에서 심층 신경망(DNN, Deep Neural Network)의 한 종류인 컨볼루션 신경망(CNN, Convolutional Neural Network)에 대해서 집중적으로 설명하기로 한다.
컨볼루션 신경망은 하나 또는 여러 개의 컨볼루션 레이어(convolutional layer)과 통합 레이어(pooling layer), 완전하게 연결된 레이어(fully connected layer)들의 조합일 수 있다. 컨볼루션 신경망은 2차원 데이터의 학습 및 추론에 적합한 구조를 가지고 있으며, 역전달(Backpropagation algorithm)을 통해 학습될 수 있다.
본 개시의 예시에서, 컨볼루션 신경망에는 레이어마다 복수의 채널을 포함한다. 채널마다 채널의 입력 영상의 특징을 추출하는 커널이 존재한다. 커널은 2차원 행렬로 구성될 수 있으며, 입력 데이터를 순회하면서 컨볼루션 연산 수행한다. 커널의 크기는 임의로 결정될 수 있으며, 커널이 입력 데이터를 순회하는 간격(stride) 또한 임의로 결정될 수 있다. 커널 하나당 입력 데이터 전체에 대한 커널의 일치 정도는 특징맵(feature map) 또는 활성화 맵일 수 있다. 이하에서 커널은 일 세트의 가중치 값들 또는 복수의 세트의 가중치 값들을 포함할 수 있다.
프로세싱 엘리먼트 어레이(100)는 인공신경망의 컨벌루션 연산을 처리하도록 구성되고, 활성화 함수 연산은 별도의 활성화 함수 처리 모듈에서 처리하도록 구성될 수 있다. 이러한 경우, 프로세싱 엘리먼트 어레이(100)는 컨벌루션 연산만을 위해서 동작될 수 있다. 특히 이러한 경우, 프로세싱 엘리먼트 어레이(100)는 정수 타입의 데이터만 처리하도록 구성되어, 방대한 합성곱 연산 시 연산 효율을 극대화하는 것도 가능하다.
이처럼 컨볼루션 연산은 입력 데이터와 커널의 조합으로 이루어진 연산이므로, 이후 비선형성을 추가하기 위한 활성화 함수가 적용될 수 있다. 컨볼루션 연산의 결과인 특징맵에 활성화 함수가 적용되면 활성화 맵으로 지칭될 수 있다.
일반적인 컨볼루션 신경망은 Alexnet, Squeezenet, VGG16, Resnet152, Moblienet 등이 있는데, 각 인공신경망모델은 한번의 추론을 위해 각각 727 MFLOPs(Mega Floating-point Operations per Second), 837 MFLOPs, 16 MFLOPs, 11 MFLOPs, 11 MFLOPs, 579 MFLOPs의 곱셈 횟수가 필요하고, 커널을 포함한 모든 가중치가 각각 233 MB, 5 MB, 528 MB, 230 MB, 16 MB의 저장 크기를 갖는다. 따라서, 이러한 컨볼루션 신경망은 연산을 위해 상당히 많은 양의 하드웨어 리소스와 전력 소모량을 요구함을 알 수 있다.
도 3은 본 개시에 적용될 수 있는 프로세싱 엘리먼트 어레이 중 하나의 프로세싱 엘리먼트를 설명하는 개략적인 개념도이다. 이하에서, 도 2를 참조하여 설명될 수 있다.
도 2를 참조하면, 프로세싱 엘리먼트 어레이(100)는 MAC 연산을 수행하도록 구성되고, MAC 연산 결과를 양자화해서 출력하도록 구성될 수 있다. 단, 본 개시의 예시들은 이에 제한되지 않는다. 내부 메모리(200)는 메모리 크기와 인공신경망모델의 데이터 크기에 따라 인공신경망모델의 전부 또는 일부를 저장할 수 있다.
도 3을 참조하면, 제1 프로세싱 엘리먼트(PE1)는 곱셈기(Multiplier)(111), 가산기(Adder)(112), 및 누산기(Accumulator)(13)를 포함할 수 있다. 단, 본 개시에 따른 예시들은 이에 제한되지 않으며, 프로세싱 엘리먼트 어레이(100)는 인공신경망모델의 연산 특성을 고려하여 변형 실시될 수도 있다.
곱셈기(111)는 입력 받은 (N)bit 데이터와 (M)bit 데이터를 곱한다. 곱셈기(111)의 연산 값은 (N+M)bit 데이터로 출력된다. 여기서 N과 M은 0보다 큰 정수이다. (N)bit 데이터를 입력 받는 제1 입력부는 변수 같은 특성을 가지는 값(예를 들면, 입력 특징맵)을 입력 받도록 구성될 수 있고, (M)bit 데이터를 입력 받는 제2 입력부는 상수 같은 특성을 가지는 값(예를 들면, 학습이 완료된 가중치)을 입력 받도록 구성될 수 있다. 단, 곱셈기(111)의 입력 데이터는 상수 값과 변수 값에 제한되지 않는다.
한편, 제1 프로세싱 엘리먼트(PE1)(110)는 곱셈기(111)의 제1 입력부 및 제 2 입력부 중 하나의 입력부에 0이 입력될 때, 연산을 하지 않더라도 연산 결과가 0인 것을 인지하고 있기 때문에, 곱셈기(111)가 연산을 하지 않도록 동작을 제한할 수 있다.
예를 들면, 곱셈기(111)의 제1 입력부 및 제2 입력부 중 하나의 입력부에 0이 입력될 때, 곱셈기(111)는 제로 스키핑(zero skipping) 방식으로 동작하도록 구성될 수 있다.
곱셈기(111)의 제1 입력부 및 제2 입력부에 입력되는 데이터는 인공신경망모델의 각각의 레이어의 노드 데이터 및 가중치 데이터의 양자화에 따라서 비트 폭(bit width)이 결정될 수 있다. 예를 들면, 제1 레이어의 노드 데이터가 5bit로 양자화 되고 제1 레이어의 가중치 데이터가 7bit로 양자화되는 경우 제1 입력부는 5bit의 데이터를 입력 받도록 구성되고, 제2 입력부는 7bit의 데이터를 입력 받도록 구성될 수 있다.
도 2 내지 도 3을 참조하면, NPU(1000)는 내부 메모리(200)에 저장된 양자화된 데이터가 제1 프로세싱 엘리먼트(PE1)의 입력부들에 입력될 때 양자화된 비트 폭이 실시간으로 변환되도록 제1 프로세싱 엘리먼트(PE1)를 제어할 수 있다.
가산기(112)는 곱셈기(111)의 연산 값과 누산기(113)의 연산 값을 가산한다. (L)loops가 0일 경우, 누산된 데이터가 없으므로, 가산기(112)의 연산 값은 곱셈기(111)의 연산 값과 동일할 수 있다. (L)loops가 1일 경우, 곱셈기(111)의 연산 값과 누산기(113)의 연산 값이 가산된 값이 가산기의 연산 값일 수 있다.
누산기(113)는 가산기(112)의 연산 값과 곱셈기(111)의 연산 값이 (L)loops 횟수만큼 누산되도록 가산기(112)의 출력부에서 출력된 데이터를 임시 저장한다. 구체적으로, 가산기(112)의 출력부에서 출력된 가산기(112)의 연산 값은 누산기(113)의 입력부에 입력되고, 입력된 연산 값은 누산기(13)에 임시 저장되었다가 누산기(113)의 출력부에서 출력된다. 출력된 연산 값은 루프에 의해 가산기(112)의 입력부에 입력된다. 이때, 가산기의 입력부(112)에는 곱셈기(111)의 출력부에서 새롭게 출력된 연산 값이 함께 입력된다. 즉, 누산기(113)의 연산 값과 곱셈기(111)의 새로운 연산 값이 가산기(112)의 입력부에 입력되고, 이 값들이 가산기(112)에서 가산되어 가산기(112)의 출력부를 통해 출력된다. 가산기(112)의 출력부에서 출력된 데이터, 즉 가산기(642)의 새로운 연산 값은 누산기(113)의 입력부에 입력되며, 이후 동작들은 상술한 동작들과 실질적으로 동일하게 루프 횟수만큼 수행된다.
이처럼, 누산기(113)는 곱셈기(111)의 연산 값과 가산기(112)의 연산 값을 루프 횟수만큼 누산하기 위해 가산기(112)의 출력부에서 출력된 데이터를 임시 저장하므로, 누산기(113)의 입력부에 입력되는 데이터 및 출력부에서 출력되는 데이터는 가산기(112)의 출력부에서 출력된 데이터와 같은 (N+M+log2(L))bit의 비트 폭을 가질 수 있다. 여기서 L은 0보다 큰 정수이다.
누산기(113)는 누산이 종료되면, 초기화 신호(initialization reset)를 인가받아서 누산기(113) 내부에 저장된 데이터를 0으로 초기화 할 수 있다. 단, 본 개시에 따른 예시들은 이에 제한되지 않는다.
누산기(113)의 출력 데이터(N+M+log2(L))bit는 다음 레이어의 노드 데이터 또는 컨볼루션의 입력 데이터가 될 수 있다.
도 4는 본 개시의 일 실시예에 따른 인공신경망모델의 구조를 나타내는 개략도이다.
도 4는 본 개시의 일 실시에에 따른 인공신경망모델의 파라미터들의 크기를 레이어(layer)별로 도시한다. 인공신경망모델은 인코더-디코더(encoder-decoder) 기반의 합성곱 신경망(Convolution Neural Network) 구조를 가질 수 있다. 실시예에서, 인공신경망모델은 이미지 향상을 처리하도록 구성된 인공신경망모델을 의미할 수 있다.
도 4를 참조하면, 인공신경망모델은 축소 경로(contracting path)와 확장 경로(expending path)를 포함할 수 있다. 축소 경로(contracting path)는 입력 이미지의 특징을 포착할 수 있도록 채널의 수를 늘리면서 이미지의 차원을 축소하는 경로를 의미한다. 확장 경로(expending path)는 채널의 수를 줄이고 이미지의 차원을 늘리면서 고차원의 이미지를 복원하는 경로를 의미한다. 확장 경로는 저차원으로 인코딩 된 정보를 디코딩 단계의 각 레이어에 합치는(concatenation) 방법(즉, 축소 경로의 레이어와 확장 경로의 레이어를 직접 연결(skip connection)하는 방법)을 이용하여 고차원의 이미지를 복원한다.
일 실시예에서, 572x572x1 사이즈의 입력 이미지 타일(input image tile)이 인공 신경망에 입력될 수 있다. 인공신경망모델에는 이미지 전체가 입력될 수도 있고, 이미지의 일부인 이미지 타일로 나눠서 입력될 수도 있으며, 본 개시는 입력 이미지의 형태에 제한되지 않는다. 572x572는 맵(map)의 차원을 의미하고, 1은 채널의 수를 의미한다. 즉, 1개의 채널을 갖고 크기가 572x572인 입력 이미지 타일이 인공신경망모델에 입력될 수 있다.
입력 이미지 타일(tile)이 입력되면, 3x3 컨볼루션 연산 및 ReLU 활성화 함수, Max pooling이 반복적으로 적용될 수 있다.
확장 경로는 복수 개의 전치 합성곱 연산을 포함할 수 있다. 실시예에서, 전치 합성곱 연산은 2x2 업 컨볼루션(up-conv 2x2)일 수 있다. 일 예로, 임의의 컨볼루션 레이어에서, 100x100x256 크기의 특징맵은 2x2 업 컨볼루션(up-conv 2x2) 연산을 수행하여 200x200x128 크기의 특징맵으로 출력될 수 있다.
보다 높은 해상도의 이미지를 얻기 위해서는 출력 이미지가 입력 이미지와 같은 크기이거나 적어도 유사한 크기로 출력되어야 하기 때문에, 확장 경로에서 특징맵을 확장하면서 진행되는 전치 합성곱 연산이 필요하다.
전치 합성곱 연산은 특징맵에 zero(s)를 삽입하여 일반적인 합성곱 연산으로 대체하여 연산할 수 있다.
이하의 도 5에서는 특징맵에 zero(s)를 삽입하여 일반적인 합성곱 연산으로 대체하여 연산하는 전치 합성곱에 대해 설명하기로 한다.
도 5는 본 개시의 비교예에 따른 전치 합성곱 연산을 나타내는 개략도이다.
도 5는 입력 데이터, 입력 특징맵(51), 커널(52) 및 출력 특징맵(53)이 도시된다. 입력데이터, 입력 특징맵(51), 커널(52) 및 출력 특징맵(53)은 각각 2차원 행렬(N x M, N과 M은 양의 정수)로 구성될 수 있다.
실시예에서, 입력 데이터는 요소 데이터 a를 포함하고, 3x3 크기일 수 있다. 입력데이터에 입력 특징맵(51)은 zero(s)가 패딩된 입력 데이터일 수 있고, 7x7 크기일 수 있다. 커널(52)은 3x3 크기일 수 있다. 출력 특징맵(53)은 요소 데이터 b를 포함하고, 5x5 크기일 수 있다. 출력 특징맵(53)에 포함된 요소 데이터들은 '출력 데이터'로 지칭될 수 있다.
(a) 내지 (d)를 참조하면, 임의의 컨볼루션 레이어에서 커널(52)은 입력 특징맵(51)을 순회하면서 합성곱 연산을 수행할 수 있다. 즉, 합성곱 연산은 커널(52)의 윈도우를 일정한 간격으로 이동해가면서 계산한다. 윈도우란 지정한 크기의 영역을 의미하며, 합성곱 연산 시 커널 크기에 대응되는 입력 특징맵 상의 영역을 의미할 수 있다. 실시예에서, 커널(52)이 입력 특징맵(51)을 순회하는 간격(stride)는 1로 설정될 수 있다.
본 비교예에 따른 일반적인 합성곱 연산을 이용하여 전치 합성곱 연산을 수행하는 경우, 삽입된 zero(s)에 대한 MAC 연산을 수반하게 된다. (a)를 참조하면, 입력 특징맵(51)의 9개의 요소 데이터와 커널(52)의 컨볼루션 연산 수행 시, 8번의 연산이 zero(s)에 대한 MAC 연산에 해당된다. 커널(52)과 상관없이 zero와의 연산에 대한 출력 값은 zero이므로, 삽입된 zero(s)에 대한 MAC 연산은 불필요한 MAC 연산량에 해당된다.
본 개시의 실시예에 따른 인공 신경망의 동작 방법에 따르면 제로 패딩된 입력 특징맵과의 합성곱 연산 시 패딩된 제로를 연산하지 않음으로써 전치 합성곱 연산에서 MAC 연산량을 최소화할 수 있다.
상기 MAC 연산은 프로세싱 엘리먼트(110)에서 수행될 수 있다.
도 6은 본 개시의 실시예에 따른 전치 합성곱 연산을 나타내는 개략도이다.
도 6을 참조하면, 임의의 컨볼루션 레이어에서, 입력 이미지를 제로 패딩한 후, 제로 패딩된 입력 이미지를 특정 커널을 이용하여 탐색하면서 이미지의 특징들을 추출하고, 추출한 특징들을 특징맵으로 생성하는 전치 컨볼루션 연산을 도시한다.
입력 이미지(또는, 입력 데이터)(60)는 복수 개의 요소 데이터들(또는, 픽셀들)(a1,1 내지 a3,3)을 포함할 수 있다. 입력 이미지는 3x3 크기일 수 있다.
본 개시의 실시예에 따른 전치 합성곱 연산에서, 입력 이미지(60)는 제로 패딩(zero-padding)될 수 있다. 제로 패딩은 입력 이미지의 요소 데이터들 사이 및/또는 가장자리에 제로 값으로 채운 픽셀들을 추가함으로써 합성곱 연산 후 출력되는 특징맵의 크기가 입력 이미지와 같거나 입력 이미지보다 크게 만들기 위함이다.
제로 패딩 된 입력 이미지(61)는 7x7 크기일 수 있다. 제로 패딩 된 입력 이미지(61)는 '입력 특징맵'으로 지칭될 수 있다.
3x3 크기의 커널(62)이 입력 특징맵(61)을 간격(stride) 1로 순회하면서 합성곱 연산을 수행함으로써, 특징이 추출될 수 있다. 3x3 크기의 커널(62)이 입력 특징맵(61)을 간격(stride) 1로 순회하면서 추출한 특징들은 b1,1 내지 b5,5로 표현될 수 있다. 추출한 특징들은 5x5 크기의 출력 특징맵(63)으로 출력될 수 있다.
도 7은 본 개시의 실시예에 따른 신경 프로세싱 유닛이 동작하는 방법을 설명하는 순서도이다. 도 8은 본 개시의 실시예에 따른 복수 개의 서브 커널들 및 이에 대응되는 입력 데이터를 나타내는 개략도이다. 이하에서, 도 6, 도 9를 참조하여 설명된다.
도 7을 참조하면, 신경 프로세싱 유닛(또는, 컨트롤러)은 제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱(Transpose Convolution) 연산임을 결정할 수 있다(S702).
신경 프로세싱 유닛(또는, 컨트롤러)은 입력 데이터의 크기 및/또는 입력 특징맵의 크기를 식별할 수 있다.
신경 프로세싱 유닛(또는, 컨트롤러)은 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분할 수 있다(S704).
제1 컨볼루션 레이어의 입력은 일정한 크기를 갖는 입력 특징맵(Input feature map)이고, 입력 특징맵은 입력 데이터에 적어도 하나의 제로가 패딩된 특징맵일 수 있다.
도 6 및 도 8을 참조하면, 커널(62)은 신경 프로세싱 유닛(또는, 컨트롤러)에 의해 4개의 서브 커널들(82_1, 82_2, 82_3, 82_4)로 구분될 수 있다. 커널(62)은 가중치 값들(k0 내지 k8)을 포함할 수 있다. 커널에 포함된 가중치 값들은 4개의 서브 커널들(82_1, 82_2, 82_3, 82_4) 중 하나에 포함된다. 즉, 커널에 포함된 가중치 값은 복수 개의 서브 커널들(82_1, 82_2, 82_3, 82_4) 중 하나에 필수적으로 포함되되, 중복되어 포함되지는 않는 방식으로 복수 개의 서브 커널들(82_1, 82_2, 82_3, 82_4)이 구분되어 설정될 수 있다. 단, 복수 개의 서브 커널로 구분하는 방식은 이에 제한되지 않는다.
실시예에서, 4개의 서브 커널들은 각각 제1 서브 커널(82_1), 제2 서브 커널(82_2), 제3 서브 커널(82_3), 제4 서브 커널(82_4)로 지칭될 수 있다.
제1 서브 커널(82_1)은 입력 특징맵의 제1 윈도우에 커널이 대응될 때, 제1 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정될 수 있다.
도 6 및 도 9를 참조하면, 입력 특징맵(91_1)의 제1 윈도우(94_1)에 커널(62)이 대응될 때, 즉, 입력 특징맵(91_1)의 제1 윈도우(94_1)와 커널(62) 사이에 합성곱 연산이 수행될 때, 제1 윈도우(94_1)에 포함된 입력 데이터는 a1,1이고 커널(62)의 k4에 대응된다. 이 때 제1 서브 커널(82_1)은 k4로 구성될 수 있다. 이로써, 입력 특징맵(91_1)과 제1 서브 커널(82_1)의 컨볼루션 연산은, 입력 특징맵(91_1)에 포함된 상기 입력 데이터(a1,1)와 제1 서브 커널(82_1)의 컨볼루션 연산일 수 있다. 즉, 입력 특징맵(91_1)과 제1 서브 커널(82_1)의 컨볼루션 연산은 입력 특징맵(91_1)에 포함된 zero(s)와의 연산을 포함하지 않도록 제1 서브 커널(82_1)이 결정된다.
제2 서브 커널(82_2)은 입력 특징맵의 제2 윈도우에 커널이 대응될 때, 특정 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정될 수 있다.
도 6 및 도 9를 참조하면, 입력 특징맵(91_1)의 제2 윈도우(94_2)에 커널(62)이 대응될 때, 즉, 입력 특징맵(91_1)의 제2 윈도우(94_2)와 커널(62) 사이에 합성곱 연산이 수행될 때, 제2 윈도우(94_2)에 포함된 입력 데이터는 a1,1 및 a1,2이고, 각각 커널(62)의 k3 및 k5에 대응된다. 이 때 제2 서브 커널(82_2)은 k3 및 k5로 구성될 수 있다. 이로써, 입력 특징맵(91_2)과 제2 서브 커널(82_2)의 컨볼루션 연산은, 입력 특징맵(91_1)에 포함된 상기 입력 데이터(a1,1 및 a1,2)와 제2 서브 커널(82_2)의 컨볼루션 연산일 수 있다. 즉, 입력 특징맵(91_1)과 제2 서브 커널(82_2)의 컨볼루션 연산은 입력 특징맵(91_1)에 포함된 zero(s)와의 연산을 포함하지 않도록 제2 서브 커널(82_2)이 결정된다.
제3 서브 커널(82_3) 및 제4 서브 커널(82_4)은 상술한 제1 서브 커널(82_1) 또는 제2 서브 커널(82_2)과 유사한 방식으로 구성될 수 있으므로, 이하 생략한다.
신경 프로세싱 유닛(또는, 컨트롤러)은 복수 개의 상기 서브 커널들에 대한 스트라이드(Stride)의 크기를 결정할 수 있다.
신경 프로세싱 유닛(또는, 컨트롤러)은 입력 특징맵의 크기 또는 스트라이드의 크기 중 적어도 하나에 기초하여, 출력 데이터의 크기를 결정할 수 있다.
신경 프로세싱 유닛(또는, 컨트롤러)은 입력 특징맵의 크기, 출력 특징맵의 크기, 입력 특징맵에 포함된 적어도 하나의 제로 또는 입력 데이터의 위치, 상기 스트라이드의 크기 또는 커널의 크기 중 적어도 하나에 기초하여 복수의 서브 커널들을 결정할 수 있다.
도 7을 다시 참조하면, 신경 프로세싱 유닛(또는, 컨트롤러)은 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행할 수 있다(S706).
신경 프로세싱 유닛(또는, 컨트롤러)은 입력 특징맵과 복수의 서브 커널들 각각에 대한 합성곱 연산의 순서를 제어할 수 있다.
신경 프로세싱 유닛(또는, 컨트롤러)은 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하고 난 후, 입력 특징맵과 상기 제2 서브 커널의 컨볼루션 연산을 수행할 수 있다.
제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행한 결과 출력되는 제1 컨볼루션 레이어의 출력은, 일정한 크기를 갖는 출력 특징맵(Output feature map)이다. 출력 특징맵은 입력 데이터보다 큰 사이즈일 수 있다.
신경 프로세싱 유닛(또는, 컨트롤러)은 출력 특징맵에 포함된 출력 데이터를 내부 메모리의 주소에 맵핑할 수 있다. 내부 메모리는 출력 특징맵에 포함된 출력 데이터를 상기 맵핑된 주소에 저장할 수 있다.
도 8의 (a)를 참조하면, 제1 서브 커널(82_1)이 스트라이드 2로 이동하면서 입력 특징맵과의 합성곱 연산이 9번 수행될 때, 제1 서브 커널(82_1)과 요소별 곱(element-wise multiplication)이 수행되는 입력 데이터(80)의 요소 데이터를 나타낸다. 본 개시의 실시예에 따른 제1 서브 커널(82_1)에 따르면, 제로 패딩 된 입력 특징맵과 제1 서브 커널(82_1)의 합성곱 연산으로, 입력 특징맵에 패딩 된 제로는 연산하지 않을 수 있는 효과가 있다.
도 8의 (b)를 참조하면, 제2 서브 커널(82_2)이 스트라이드 2로 이동하면서 입력 특징맵과의 합성곱 연산이 6번 수행될 때, 제1 서브 커널(82_1)과 요소별 곱(element-wise multiplication)이 수행되는 입력 데이터(80)의 요소 데이터를 나타낸다. 본 개시의 실시예에 따른 제2 서브 커널(82_2)에 따르면, 제로 패딩 된 입력 특징맵과 제2 서브 커널(82_2)의 합성곱 연산으로, 입력 특징맵에 패딩 된 제로는 연산하지 않을 수 있는 효과가 있다.
도 8의 (c)를 참조하면, 제3 서브 커널(82_3)이 스트라이드 2로 이동하면서 입력 특징맵과의 합성곱 연산이 6번 수행될 때, 제3 서브 커널(82_3)과 요소별 곱(element-wise multiplication)이 수행되는 입력 데이터(80)의 요소 데이터를 나타낸다. 본 개시의 실시예에 따른 제3 서브 커널(82_3)에 따르면, 제로 패딩 된 입력 특징맵과 제3 서브 커널(82_3)의 합성곱 연산으로 입력 특징맵에 패딩 된 제로는 연산하지 않을 수 있는 효과가 있다.
도 8의 (d)를 참조하면, 제4 서브 커널(82_4)이 스트라이드 2로 이동하면서 입력 특징맵과의 합성곱 연산이 4번 수행될 때, 제4 서브 커널(82_4)과 요소별 곱(element-wise multiplication)이 수행되는 입력 데이터(80)의 요소 데이터를 나타낸다. 본 개시의 실시예에 따른 제4 서브 커널(82_4)에 따르면, 제로 패딩 된 입력 특징맵과 제4 서브 커널(82_4)의 합성곱 연산으로 입력 특징맵에 패딩 된 제로는 연산하지 않을 수 있는 효과가 있다.
신경 프로세싱 유닛(또는, 컨트롤러)에 의해 복수 개의 서브 커널들(92_1 내지 92_4)로 구분됨에 따라, 제1 컨볼루션 레이어의 합성 곱 연산은 도 8의 (a)에 대응되는 제1 타입의 합성곱 연산, 도 8의 (b)에 대응되는 제2 타입의 합성곱 연산, 도 8의 (c)에 대응되는 제3 타입의 합성곱 연산, 도 8의 (d)에 대응되는 제4 타입의 합성곱 연산으로 구분될 수 있다.
본 개시의 실시예에 따른 신경 프로세싱 유닛의 전치 합성곱 연산 방법에 따르면, 스트라이드 2의 합성곱 연산을 네가지 타입으로 구분하여 수행함으로써, 패딩 된 zero(s) 연산을 생략할 수 있고 반응 속도(latency)를 1/4 감소시킬 수 있는 효과가 있다.
도 9는 본 개시의 실시예에 따른 신경 프로세싱 유닛에서 복수 개의 서브 커널들을 이용하여 수행되는 합성곱 연산을 나타내는 개략도이다. 이하에서, 도 6 및 도 8을 참조하여 설명된다.
도 6 및 도 9를 참조하면, 3x3 크기의 입력 데이터에 제로 패딩 된 7x7 크기의 입력 특징맵(91_1 내지 91_25)을 복수 개의 서브 커널들(92_1 내지 92_4)을 이용하여 25번의 합성곱 연산을 수행하고, 5x5 크기의 출력 특징맵(63)을 출력하는 과정이 도시된다.
도 8 내지 도 9를 참조하면, 도 8의 (a)에 대응되는 제1 타입의 합성곱 연산은, 도 9에서 제1 서브 커널(92_1)이 스트라이드 2로 이동하면서 입력 특징맵(91_1, 91_3, 91_5, 91_11, 91_13, 91_15, 91_21, 91_23, 91_25)과 수행되는 합성곱 연산에 대응된다.
또한, 도 8의 (b)에 해당하는 제2 타입의 합성곱 연산은, 도 9에서 제2 서브 커널(92_2)이 스트라이드 2로 이동하면서 입력 특징맵(91_2, 91_4, 91_12, 91_14, 91_22, 91_24)과 각각 수행되는 합성곱 연산에 대응된다.
도 8의 (c)에 해당하는 제3 타입의 합성곱 연산은, 도 9에서 제3 서브 커널(92_3)이 스트라이드 2로 이동하면서 입력 특징맵(91_6, 91_8, 91_10, 91_16, 91_18, 91_20)과 각각 수행되는 합성곱 연산에 대응된다.
도 8의 (d)에 해당하는 제4 타입의 합성곱 연산은, 도 9에서 제4 서브 커널(92_4)이 스트라이드 2로 이동하면서 입력 특징맵(91_7, 91_9, 91_17, 91_19)과 각각 수행되는 합성곱 연산에 대응된다.
도 9에 도시된 바와 같이, 입력 특징맵(91_1 내지 91_25)이 복수 개의 서브 커널들(92_1 내지 92_4) 중 하나와 특정 윈도우에서 합성곱 연산을 수행하면, 출력 특징맵의 출력 데이터 1개가 출력될 수 있다.
일 예로, 도 6 및 도 9를 참조하면, 입력 특징맵(91_1)이 제1 서브 커널(92_1)과 특정 윈도우에서 합성곱 연산을 수행하면, 출력 특징맵(63)의 1개의 출력 데이터(b1,1)가 출력될 수 있다.
도 6 및 도 9를 참조하면, 입력 특징맵(91_1~91_25)이 복수 개의 서브 커널들(92_1~92_4) 중 하나와 모든 윈도우에서 합성곱 연산을 수행하면, 출력 특징맵의 모든 출력 데이터(b1,1 내지 b5,5)(또는, 5x5 크기의 출력 특징맵(63))가 출력될 수 있다.
도 10은 본 개시의 비교예에 따른 systolic array 구조들을 나타내는 개략도이다.
도 10은 프로세싱 엘리먼트의 스테이셔너리(Stationary) 기법에 따른 NPU의 systolic array 구조의 비교예들을 나타낸다. Systolic array 구조를 갖는 NPU는 MAC 연산을 수행하는 복수 개의 프로세싱 엘리먼트들을 포함하는 프로세싱 엘리먼트 어레이를 포함할 수 있다. Systolic array 구조는 데이터를 재사용하여 병렬적으로 연산하는 구조를 의미하며, 이러한 방식을 dataflow로 지칭할 수 있다. 각 프로세싱 엘리먼트의 로컬 메모리에 어떤 값이 저장되는지에 따라 세가지 종류로 나뉠 수 있다.
Systolic array 구조에 따르면, 데이터를 레지스터 파일에서 가져올 필요 없이, 임의의 프로세싱 엘리먼트에서 사용한 데이터를 위, 아래, 또는 오른쪽에 위치한 다음 프로세싱 엘리먼트로 전달하여, 다음 프로세싱 엘리먼트에서 해당 데이터를 바로 사용할 수 있다.
도 10의 (a)를 참조하면, Output Stationary(OS) 모드에 따른 systolic array 구조를 나타낸다.
Output Stationary(OS) 기법에 따른 systolic array는 출력 특징맵(Output Feature map, OF), 즉, 부분합(partial sum)을 각 PE의 로컬 메모리에 저장하여 재사용할 수 있는 구조로, 특징(feature) 값과 가중치(weight) 값 모두 재사용할 수 있다. 각 프로세싱 엘리먼트에 특징(feature) 값과 커널에 포함된 가중치(weight) 값은 FIFO를 통해 로딩될 수 있다. 각 프로세싱 엘리먼트는 특징 값과 가중치 값을 이용하여 MAC 연산을 수행할 수 있다. 이 때 연산된 부분 합(partial sum)은 각 프로세싱 엘리먼트에 저장하고, 다음에 발생된 부분 합을 누적시킬 수 있다.
여기서 특징 값은 특징맵을 구성하는 파라미터를 지칭할 수 있다.
도 10의 (b)를 참조하면, Weight Stationary(WS) 모드에 따른 Systolic array 구조를 나타낸다.
Weight stationary 기법에 따른 Systolic array는 가중치(weight) 값을 각 PE의 로컬 메모리에 저장하여, 컨볼루션 연산 시 재사용할 수 있는 구조이다. Weight Stationary 기법에 따르면, DRAM에서 가중치 값을 가져오는 것을 최소화함으로써 가중치 값을 읽어올 때의 에너지 소모를 최소화할 수 있다. 각 프로세싱 엘리먼트에 특징(feature) 값은 FIFO를 통해 로딩될 수 있다. 프로세싱 엘리먼트 어레이에 가중치가 프리 로딩(pre-loading)되고, 프로세싱 엘리먼트 어레이에 가중치가 맵핑된 후 해당 가중치와 연산되는 입력 데이터(feature)가 가장 왼쪽 열(column)부터 계속해서 피딩(feeding)하는 방식을 통해, 컨볼루션 연산을 수행할 수 있다. 이 때 시스톨릭 어레이 내부에서 매 사이클(cycle)마다 입력 데이터(feature)가 왼쪽에서 오른쪽으로 시프트되고, 연산된 부분 합(partial sum)은 매 사이클(cycle)로 이동하면서 위에서 아래로 프로세싱 엘리먼트에 전달할 수 있다.
도 10의 (c)를 참조하면, Input stationary(IS) 모드에 따른 Systolic array 구조를 나타낸다.
Input stationary(IS) 기법에 따른 Systolic array 구조는 Weight stationary 기법에 따른 Systolic array 구조와 tensor flow가 동일하다. 다만, Weight stationary 기법에 따른 Systolic array 구조와는 달리, 입력 특징맵(Input Feature map, IF)을 각 PE의 로컬 메모리에 저장하여 재사용할 수 있는 구조이다.
각 Stationary 모드에 따른 Systolic array 구조는 인공신경망의 종류 및 특성에 따라 계산 시간에 큰 차이를 보일 수 있다. 인공신경망의 레이어 종류에 따라 입력 및 가중치의 높이(height), 넓이(width), 깊이(depth), 채널(channel) 등이 다양하기 때문이다.
예를 들어, 채널 수가 작은 레이어에서, Output stationary 기법에 따른 systolic array 구조를 사용하는 경우 MAC 이용률(utilization)이 현저히 낮을 수 있다. 채널 수가 작은 레이어에서는 Output stationary 기법에 따른 Systolic array 구조 대신 Input stationary 모드에 따른 Systolic array 구조를 사용한다면 MAC 이용률(utilization)을 높일 수 있다.
Output stationary 모드 따른 Systolic array 구조로 고정된 NPU를 사용하는 경우, 채널의 수를 줄이고 이미지의 차원을 늘리면서 고차원의 이미지를 복원하는 경로가 필요한 이미지 향상을 위한 인공신경망모델을 사용한다면 MAC 이용률이 현저히 낮아지므로 이를 해결할 Dataflow의 개선이 필요할 수 있다.
본 개시의 실시예에 따른 신경 프로세싱 유닛의 동작 방법에 따르면, 인공신경망의 각 레이어의 특성에 따라 프로세싱 엘리먼트 어레이에서의 MAC 연산 시간을 계산하고, 계산된 MAC 연산 시간에 기초하여 레이어 별로 MAC 연산 구조를 변경(switch)할 수 있다. 상기 연산 시간 계산은 인공신경망모델의 컴파일 단계에서 수행될 수 있다. 단 이에 제한되지 않는다.
본 개시의 다른 실시예에 따른 신경 프로세싱 유닛의 동작 방법에 따르면, 인공신경망의 입력 특징맵의 특성에 따라 프로세싱 엘리먼트 어레이에서의 MAC 연산 시간을 계산하고, 계산된 MAC 연산 시간에 기초하여 입력 특징맵의 타일(tile)(또는, 패치(patch)) 별로 MAC 연산 구조를 변경(switch)할 수 있다. 상기 연산 시간 계산은 인공신경망모델의 컴파일 단계에서 수행될 수 있다. 단 이에 제한되지 않는다.
인공신경망의 각 레이어의 특성은 입력 특징맵(Input Feature map, IF) 및/또는 가중치(weight)의 모양(shape)을 포함할 수 있다. 입력 특징맵(Input Feature map, IF) 및/또는 가중치(weight)의 모양(shape)이란 높이(height), 넓이(width), 깊이(depth), 채널(channel)으로 결정될 수 있다.
인공신경망의 입력 특징맵은 복수 개의 작은 타일(tile)로 분할될 수 있고, 각 타일은 커널과의 연산을 통해 특징을 추출할 수 있다. 타일 별로 MAC 연산 시간을 최소화할 수 있는 Systolic array 구조가 상이할 수 있다.
신경 프로세싱 유닛의 프로세싱 엘리먼트 어레이의 MAC 연산 구조는 Input stationary 모드에 따른 Systolic array 구조, Output stationary 모드에 따른 Systolic array 구조, Weight stationary 모드에 따른 Systolic array 중 하나일 수 있다.
컨볼루션 신경망에서, 대부분의 연산 시간은 컨볼루션 동작이 차지한다. 컨볼루션 동작을 위한 MAC 연산의 수는 아래의 수학식 1과 같은 알고리즘으로 계산될 수 있다.
[수학식 1]
for (m=0; m<M; m++)         // Num filters
    for (e=0; e<E; e++)         // num_conv_window(height)
      for (f=0; f<F; f++)          // num_conv_window(width)
        for (c=0; c<C; c++)     // Elements per filter(channel)
          for (r=0; r<R; r++)     // Elements per filter(height)
            for (s=0; s<S; s++)  // Elements per filter(width)
            {
                output[m][e][f] = input[c][e+r][f+s]  * weight[m][c][r][s]
                time = time + 1;
            }
수학식 1을 참조하면, m은 필터의 개수, e는 출력 특징맵의 높이, f는 출력 특징맵의 넓이, c는 채널의 수, r은 필터의 높이, s는 필터의 넓이를 각각 나타내는 변수이다. M은 필터의 개수, E는 출력 특징맵의 높이, F는 출력 특징맵의 넓이, C는 채널의 수, R은 필터의 높이, S는 필터의 넓이를 각각 나타내는 상수이다.
수학식 1에 따른 알고리즘은 각 stationary 기법에 따라 각기 다른 for-loop를 병렬로 연산할 수 있다. Output stationary 모드에 따른 systolic array 구조인 경우, 수학식 1에 따른 알고리즘에서 첫 번째 내지 세 번째 for-loop를 루프 언롤링(loop-unrolling)을 수행할 수 있다. 구체적으로, Output stationary 모드에 따른 Systolic array 구조인 경우, 첫 번째의 for-loop(Num filters)를 프로세싱 엘리먼트 어레이의 행(row)의 수만큼 병렬로 연산하고, 두 번째 for-loop(num_conv_window(height))와 세 번째 for-loop(num_conv_window(width))를 프로세싱 엘리먼트 어레이의 열(column)의 수만큼 병렬로 연산할 수 있다.
본 개시의 실시예에 따른 신경 프로세싱 유닛은, 입력 특징맵과 1개의 커널을 입력으로 하는 MAC 연산을 1 cycle이라고 했을 때, 프로세싱 엘리먼트의 개수, 입력 특징맵 및/또는 가중치를 이용하여 총 MAC 연산 시간을 계산할 수 있다.
도 11은 본 개시의 실시예에 따른 변경가능한 MAC 아키텍쳐를 나타내는 구성도이다.
도 11을 참조하면, 4개의 MAC 연산기(1100_1, 1100_2, 1100_3, 1100_4)를 포함하는 MAC 아키텍쳐가 도시된다. 제1 MAC 연산기(1100_1), 제2 MAC 연산기(1100_2), 제3 MAC 연산기(1100_3) 및 제4 MAC 연산기(1100_4) 각각은 변경 가능한 MAC(Configurable MAC)의 구조를 가진다. 변경 가능한 MAC이란, 컴파일러 또는 컨트롤러의 제어 신호에 의해 stationary 모드를 변경할 수 있는 구조의 MAC을 의미한다. 도 11에 도시된 MAC 아키텍쳐는 일 실시예에 불과하고, MAC 연산기의 개수는 본 개시의 기술적 범위를 제한하지 않는다.
도 11을 참조하면, 제1 MAC 연산기(1100_1)는 제1 멀티플렉서(11), 제2 멀티플렉서(12), 레지스터 파일(1103) 및/또는 디코더(dec)(1105)를 포함할 수 있다.
제1 멀티플렉서(11)는 가중치(w)(1101_1) 또는 레지스터 파일(1103)로부터 전달된 데이터 중 어느 하나를 선택하여 출력할 수 있다.
제2 멀티플렉서(12)는 부분 합(p)(1102_1) 또는 레지스터 파일(1103)로부터 전달된 데이터 중 어느 하나를 선택하여 출력할 수 있다.
본 개시의 실시예에 따른 인공 프로세싱 유닛은 제1 멀티플렉서(11)의 출력 값과 입력 특징맵(f)(1104_1) 간의 곱셈을 연산하고, 연산된 결과 값과 제2 멀티플렉서(12)의 출력 간의 덧셈을 연산할 수 있다.
디코더(1105)는 덧셈의 결과 값을 수신하여 제3 MAC 연산기(1100_3) 또는 제1 MAC 연산기(1100_1)의 레지스터 파일(1103)에 전달할 수 있다.
도 12는 본 개시의 실시예에 따른 Output stationary 모드에서의 MAC 아키텍쳐를 나타내는 구성도이다.
도 12를 참조하면, Output stationary 모드에서의 4개의 MAC 연산기(1200_1, 1200_2, 1200_3, 1200_4)를 포함하는 MAC 아키텍쳐가 도시된다. 도 12에서, 점선은 Output stationary 모드에서 실제 데이터가 전달되는 경로를 의미한다.
제1 MAC 연산기(1200_1)는 제1 멀티플렉서(13), 제2 멀티플렉서(14), 레지스터 파일(1203), 디코더(dec)(1205)를 포함할 수 있다.
제1 멀티플렉서(13)는 가중치(w)(1201_1) 또는 레지스터 파일(1103)로부터 전달된 데이터 중 가중치(w)(1201_1)를 선택하여 출력할 수 있다.
가중치(w)(1201_1)는 제1 멀티플렉서(13)에 전달됨과 동시에, 제3 MAC 연산기(1200_3)로 전달되어 재사용될 수 있다. 실시예에 따라, 가중치(w)(1201_1)는 파이프라인(pipeline) 형식으로 같은 열(column)에 위치한 MAC 연산기들로 전달될 수 있다.
제2 멀티플렉서(14)는 부분 합(p)(1102_1) 또는 레지스터 파일(1103)로부터 전달된 데이터 중 레지스터 파일(1103)로부터 전달된 데이터를 선택하여 출력할 수 있다. 도 12에서, 레지스터 파일(1103)은 부분 합(partial sum)이 저장되는 누산기(accumulator)일 수 있다. 따라서, 레지스터 파일(1103)로부터 제2 멀티플렉서(14)에 전달된 데이터는 부분 합일 수 있다.
본 개시의 실시예에 따른 인공 프로세싱 유닛은 제1 멀티플렉서(13)의 출력 값인 가중치(w)와 입력 특징맵(f)(1204_1) 간의 곱셈을 연산하고, 연산된 결과 값과 제2 멀티플렉서(14)의 출력 값인 부분합 간의 덧셈을 연산할 수 있다.
디코더(1105)는 덧셈의 결과 값을 수신하여, 제1 MAC 연산기(1200_1)의 레지스터 파일(1203)에 전달할 수 있다.
입력 특징맵(f)(1204_1)은 제1 멀티플렉서(13)의 출력 값인 가중치(w)와 곱셈을 연산하기 위해 전달됨과 동시에, 제2 MAC 연산기(1200_2)로 전달되어 재사용될 수 있다. 실시예에 따라, 입력 특징맵(f)(1204_1)은 파이프라인(pipeline) 형식으로 같은 행(row)에 위치한 MAC 연산기들로 전달될 수 있다.
도 13은 본 개시의 실시예에 따른 Weight stationary 또는 Input stationary 모드에서의 MAC 아키텍쳐를 나타내는 구성도이다.
도 13을 참조하면, Weight stationary 또는 Input stationary 모드에서의 4개의 MAC 연산기(1300_1, 1300_2, 1300_3, 1300_4)를 포함하는 MAC 아키텍쳐가 도시된다. 도 13에서, 점선은 Weight stationary 또는 Input stationary 모드에서 실제 데이터가 전달되는 경로를 의미한다.
제1 MAC 연산기(1300_1)는 제1 멀티플렉서(15), 제2 멀티플렉서(16), 레지스터 파일(1303), 디코더(dec)(1305)를 포함할 수 있다.
제1 멀티플렉서(15)는 가중치(w)(1301_1) 또는 레지스터 파일(1103)로부터 전달된 데이터 중 레지스터 파일(1103)로부터 전달된 데이터를 선택하여 출력할 수 있다.
제2 멀티플렉서(16)는 부분 합(p)(1302_1) 또는 레지스터 파일(1103)로부터 전달된 데이터 중 부분 합(p)(1302_1)을 선택하여 출력할 수 있다. 도 12에서, 레지스터 파일(1303)에는 Weight stationary 모드인 경우에는 가중치, Input stationary 모드인 경우에는 입력 특징맵이 저장될 수 있다. Stationary 모드에 따라 저장된 가중치 또는 입력 특징맵은 'Preload data'로 지칭될 수 있다. 따라서, 레지스터 파일(1303)로부터 제2 멀티플렉서(16)에 전달된 데이터는 가중치 또는 입력 특징맵일 수 있다.
본 개시의 실시예에 따른 인공 프로세싱 유닛은 제1 멀티플렉서(15)의 출력 값인 Preload data와 입력 특징맵(f)(1204_1) 간의 곱셈을 연산하고, 연산된 결과 값과 제2 멀티플렉서(14)의 출력 값인 부분 합(p)(1302_1) 간의 덧셈을 연산할 수 있다.
디코더(1105)는 덧셈의 결과 값을 수신하여, 제3 MAC 연산기(1200_1)의 부분합(p)(1302_3)으로 재사용할 수 있도록 전달할 수 있다.
입력 특징맵(f)(1304_1)은 제1 멀티플렉서(15)의 출력 값인 Preload data와 곱셈을 연산하기 위해 전달됨과 동시에, 제2 MAC 연산기(1200_2)로 전달되어 재사용될 수 있다. 실시예에 따라, 입력 특징맵(f)(1204_1)은 파이프라인(pipeline) 형식으로 같은 행(row)에 위치한 MAC 연산기들로 전달될 수 있다.
본 개시의 실시예에 따른 신경 프로세싱 유닛의 동작 방법에 따르면, 인공신경망의 각 레이어의 특성에 따라 프로세싱 엘리먼트 어레이에서의 MAC 연산 시간을 계산하고, 계산된 MAC 연산 시간에 기초하여 레이어 별로 MAC 연산 구조를 변경(switch)할 수 있다. 따라서, 레이어 별로 3개 모드의 MAC 연산 구조 중 최적의 MAC 연산 구조를 채택함으로써 신경 프로세싱 유닛의 MAC MAC 연산량을 최소화할 수 있다.
본 개시의 다른 실시예에 따른 신경 프로세싱 유닛의 동작 방법에 따르면, 인공신경망의 입력 특징맵의 특성에 따라 프로세싱 엘리먼트 어레이에서의 MAC 연산 시간을 계산하고, 계산된 MAC 연산 시간에 기초하여 입력 특징맵의 타일(tile)(또는, 패치(patch)) 별로 MAC 연산 구조를 변경(switch)할 수 있다. 따라서, 레이어 별로 3개 모드의 MAC 연산 구조 중 최적의 MAC 연산 구조를 채택함으로써 신경 프로세싱 유닛의 MAC 연산량을 최소화할 수 있다.
본 명세서와 도면에 게시된 본 개시의 예시들은 본 개시의 기술내용을 쉽게 설명하고 본 개시의 이해를 돕기 위해 특정 예를 제시한 것뿐이며, 본 명의 범위를 한정하고자 하는 것은 아니다. 여기에 게시된 예시들 이외에도 발명의 기술적 사상에 바탕을 둔 다른 변형 예들이 실시 가능하다는 것은 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자에게 자명한 것이다.
[이 발명을 지원한 국가연구개발사업]
[과제고유번호]1711175834
[과제번호]R-20210401-010439
[부처명]과학기술정보통신부
[과제관리(전문)기관명]정보통신산업진흥원
[연구사업명]인공지능반도체혁신기업집중육성
[연구과제명]엣지용 인공신경망 프로세서를 위한 컴파일러와 런타임 SW 기술 개발
[기여율]1/1
[과제수행기관명](주)딥엑스
[연구기간]2022.06.01 ~ 2022.12.31

Claims (21)

  1. 신경 프로세싱 유닛(Neural Processing Unit, NPU)의 동작 방법으로서,
    컨트롤러에 의해, 제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱(Transpose Convolution) 연산임을 결정하는 단계;
    상기 컨트롤러에 의해, 상기 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분하는 단계;
    적어도 하나의 프로세싱 엘리먼트에 의해, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행하는 단계;를 포함하는,
    신경 프로세싱 유닛의 동작 방법.
  2. 제1항에 있어서,
    상기 제1 컨볼루션 레이어의 입력은 입력 특징맵(Input feature map)이고,
    상기 입력 특징맵은 입력 데이터에 적어도 하나의 제로가 패딩(Padding)된 특징맵인,
    신경 프로세싱 유닛의 동작 방법.
  3. 제2항에 있어서,
    상기 입력 데이터의 크기 및 상기 입력 특징맵의 크기를 식별하는 단계;
    복수 개의 상기 서브 커널들에 대한 스트라이드(Stride)의 크기를 결정하는 단계; 및
    상기 입력 특징맵의 크기 또는 상기 스트라이드의 크기 중 적어도 하나에 기초하여, 출력 데이터의 크기를 결정하는 단계;를 더 포함하는,
    신경 프로세싱 유닛의 동작 방법.
  4. 제1항에 있어서,
    상기 커널은 적어도 하나의 가중치 값을 포함하고,
    적어도 하나의 상기 가중치 값은 복수 개의 상기 서브 커널들 중 하나에 포함되는,
    신경 프로세싱 유닛의 동작 방법.
  5. 제3항에 있어서,
    복수 개의 상기 서브 커널들은 제1 서브 커널 및 제2 서브 커널을 포함하고,
    상기 제1 서브 커널은, 상기 입력 특징맵의 제1 윈도우에 상기 커널이 대응될 때 상기 제1 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정되고,
    상기 제2 서브 커널은, 상기 입력 특징맵의 제2 윈도우에 상기 커널이 대응될 때 상기 제2 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정되는,
    신경 프로세싱 유닛의 동작 방법.
  6. 제5항에 있어서,
    적어도 하나의 상기 프로세싱 엘리먼트에 의해, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 서브 필터들 각각의 컨볼루션 연산을 수행하는 단계;는,
    상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하는 단계; 및
    상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하고 난 후, 상기 입력 특징맵과 상기 제2 서브 커널의 컨볼루션 연산을 수행하는 단계;를 포함하는,
    신경 프로세싱 유닛의 동작 방법.
  7. 제6항에 있어서,
    상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산은, 상기 입력 특징맵에 포함된 상기 입력 데이터와 상기 제1 서브 커널의 컨볼루션 연산인,
    신경 프로세싱 유닛의 동작 방법.
  8. 제7항에 있어서,
    상기 제1 컨볼루션 레이어의 출력은 출력 특징맵(Output feature map)이고,
    상기 출력 특징맵은 상기 입력 데이터보다 큰 사이즈인,
    신경 프로세싱 유닛의 동작 방법.
  9. 제8항에 있어서,
    컨트롤러에 의해, 상기 입력 특징맵의 크기, 상기 출력 특징맵의 크기, 상기 입력 특징맵에 포함된 적어도 하나의 상기 제로 또는 상기 입력 데이터의 위치, 상기 스트라이드의 크기 또는 상기 커널의 크기 중 적어도 하나에 기초하여 복수의 상기 서브 커널들을 결정하는 단계;를 더 포함하는,
    신경 프로세싱 유닛의 동작 방법.
  10. 제8항에 있어서,
    상기 컨트롤러에 의해, 상기 출력 특징맵에 포함된 출력 데이터를 내부 메모리의 주소에 맵핑하는 단계; 및
    상기 내부 메모리에 의해, 상기 출력 특징맵에 포함된 상기 출력 데이터를 상기 맵핑된 주소에 저장하는 단계;를 더 포함하는,
    신경 프로세싱 유닛의 동작 방법.
  11. 인공신경망모델을 저장하도록 구성된 내부 메모리;
    상기 내부 메모리에 액세스(access)하도록 구성되며, 상기 인공신경망모델의 합성곱 연산을 처리하도록 구성된 적어도 하나의 프로세싱 엘리먼트(processing element; PE); 및
    상기 내부 메모리, 적어도 하나의 상기 프로세싱 엘리먼트와 동작 가능하게 연결된 컨트롤러(controller);를 포함하고,
    상기 인공신경망모델은 이미지를 입력으로 하여 이미지 향상(Image Enhancement)을 처리하도록 구성된 인공 신경망 기반의 모델이고,
    상기 컨트롤러는,
    제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱 연산임을 결정하고, 상기 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분하고, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행하도록 상기 적어도 하나의 프로세싱 엘리먼트를 제어하도록 구성된,
    신경 프로세싱 유닛.
  12. 제11항에 있어서,
    상기 제1 컨볼루션 레이어의 입력은 입력 특징맵(Input feature map)이고,
    상기 입력 특징맵은 입력 데이터에 적어도 하나의 제로가 패딩된 특징맵인,
    신경 프로세싱 유닛.
  13. 제12항에 있어서,
    상기 컨트롤러는,
    상기 입력 데이터의 크기 및 상기 입력 특징맵의 크기를 식별하고, 복수 개의 상기 서브 커널들에 대한 스트라이드(Stride)의 크기를 결정하고, 상기 입력 특징맵의 크기 또는 상기 스트라이드의 크기 중 적어도 하나에 기초하여 출력 데이터의 크기를 결정하도록 추가로 구성된,
    신경 프로세싱 유닛.
  14. 제11항에 있어서,
    상기 커널은 적어도 하나의 가중치 값을 포함하고,
    적어도 하나의 상기 가중치 값은 복수 개의 상기 서브 커널들 중 하나에 포함되는,
    신경 프로세싱 유닛.
  15. 제13항에 있어서,
    복수 개의 상기 서브 커널들은 제1 서브 커널 및 제2 서브 커널을 포함하고,
    상기 제1 서브 커널은, 상기 입력 특징맵의 제1 윈도우에 상기 커널이 대응될 때 상기 제1 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정되고,
    상기 제2 서브 커널은, 상기 입력 특징맵의 제2 윈도우에 상기 커널이 대응될 때 상기 제2 윈도우에 포함된 상기 입력 데이터의 위치에 따라 결정되는,
    신경 프로세싱 유닛.
  16. 제15항에 있어서,
    상기 컨트롤러는,
    상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하고, 상기 제1 컨볼루션 레이어에서 상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산을 수행하고 난 후 상기 입력 특징맵과 상기 제2 서브 커널의 컨볼루션 연산을 수행하도록 추가로 구성된,
    신경 프로세싱 유닛.
  17. 제16항에 있어서,
    상기 입력 특징맵과 상기 제1 서브 커널의 컨볼루션 연산은, 상기 입력 특징맵에 포함된 상기 입력 데이터와 상기 제1 서브 커널의 컨볼루션 연산인,
    신경 프로세싱 유닛.
  18. 제17항에 있어서,
    상기 제1 컨볼루션 레이어의 출력은 출력 특징맵(Output feature map)이고,
    상기 출력 특징맵은 상기 입력 데이터보다 큰 사이즈인,
    신경 프로세싱 유닛.
  19. 제18항에 있어서,
    상기 컨트롤러는,
    상기 입력 특징맵의 크기, 상기 출력 특징맵의 크기, 상기 입력 특징맵에 포함된 적어도 하나의 상기 제로 또는 상기 입력 데이터의 위치, 상기 스트라이드의 크기 또는 상기 커널의 크기 중 적어도 하나에 기초하여 복수의 상기 서브 커널들을 결정하도록 구성된,
    신경 프로세싱 유닛.
  20. 제18항에 있어서,
    상기 컨트롤러는,
    상기 출력 특징맵에 포함된 출력 데이터를 내부 메모리의 주소에 맵핑하고, 상기 출력 특징맵에 포함된 상기 출력 데이터를 상기 맵핑된 주소에 저장하도록 상기 내부 메모리를 제어하도록 추가로 구성된,
    신경 프로세싱 유닛.
  21. 내부 메모리, 적어도 하나의 프로세싱 엘리먼트와 동작 가능하게 연결된 컨트롤러(controller); 및
    상기 컨트롤러에 의해 실행되는 하나 이상의 명령어들을 저장하도록 구성된 내부 메모리;를 포함하고,
    상기 컨트롤러는 상기 명령어들을 실행하여:
    제1 컨볼루션 레이어에서 수행되는 연산이 전치 합성곱 연산임을 결정하는 동작, 상기 전치 합성곱 연산에 사용되는 커널을 복수 개의 서브 커널들로 구분하는 동작, 상기 제1 컨볼루션 레이어에서 입력 특징맵과 복수 개의 상기 서브 커널들 각각의 컨볼루션 연산을 수행하도록 프로세싱 엘리먼트를 제어하는 동작을 수행하도록 구성된,
    신경 프로세싱 유닛.
PCT/KR2023/009803 2022-07-08 2023-07-10 신경 프로세싱 유닛 및 이의 동작 방법 WO2024010437A1 (ko)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020237023587A KR20240007745A (ko) 2022-07-08 2023-07-10 신경 프로세싱 유닛 및 이의 동작 방법
US18/415,684 US20240152738A1 (en) 2022-07-08 2024-01-18 Neural processing unit and method of operation thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20220084611 2022-07-08
KR10-2022-0084611 2022-07-08

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/415,684 Continuation US20240152738A1 (en) 2022-07-08 2024-01-18 Neural processing unit and method of operation thereof

Publications (1)

Publication Number Publication Date
WO2024010437A1 true WO2024010437A1 (ko) 2024-01-11

Family

ID=89453831

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/009803 WO2024010437A1 (ko) 2022-07-08 2023-07-10 신경 프로세싱 유닛 및 이의 동작 방법

Country Status (3)

Country Link
US (1) US20240152738A1 (ko)
KR (1) KR20240007745A (ko)
WO (1) WO2024010437A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180073118A (ko) * 2016-12-22 2018-07-02 삼성전자주식회사 컨볼루션 신경망 처리 방법 및 장치
KR20190051697A (ko) * 2017-11-07 2019-05-15 삼성전자주식회사 뉴럴 네트워크의 디컨벌루션 연산을 수행하는 장치 및 방법
KR20200095300A (ko) * 2019-01-31 2020-08-10 삼성전자주식회사 뉴럴 네트워크의 컨볼루션 연산을 처리하는 방법 및 장치
KR20210099991A (ko) * 2020-02-05 2021-08-13 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. 딥 러닝 처리 장치, 방법, 기기 및 저장 매체
KR20220097161A (ko) * 2020-12-31 2022-07-07 주식회사 딥엑스 인공신경망을 위한 방법 및 신경 프로세싱 유닛

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180073118A (ko) * 2016-12-22 2018-07-02 삼성전자주식회사 컨볼루션 신경망 처리 방법 및 장치
KR20190051697A (ko) * 2017-11-07 2019-05-15 삼성전자주식회사 뉴럴 네트워크의 디컨벌루션 연산을 수행하는 장치 및 방법
KR20200095300A (ko) * 2019-01-31 2020-08-10 삼성전자주식회사 뉴럴 네트워크의 컨볼루션 연산을 처리하는 방법 및 장치
KR20210099991A (ko) * 2020-02-05 2021-08-13 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. 딥 러닝 처리 장치, 방법, 기기 및 저장 매체
KR20220097161A (ko) * 2020-12-31 2022-07-07 주식회사 딥엑스 인공신경망을 위한 방법 및 신경 프로세싱 유닛

Also Published As

Publication number Publication date
KR20240007745A (ko) 2024-01-16
US20240152738A1 (en) 2024-05-09

Similar Documents

Publication Publication Date Title
WO2013115431A1 (ko) 신경망 컴퓨팅 장치 및 시스템과 그 방법
WO2020190112A1 (en) Method, apparatus, device and medium for generating captioning information of multimedia data
WO2020197241A1 (en) Device and method for compressing machine learning model
WO2015016640A1 (ko) 신경망 컴퓨팅 장치 및 시스템과 그 방법
WO2020231049A1 (en) Neural network model apparatus and compressing method of neural network model
WO2022154471A1 (en) Image processing method, image processing apparatus, electronic device and computer-readable storage medium
WO2019009491A1 (ko) 영상을 부호화 또는 복호화하는 방법 및 장치
WO2022005188A1 (en) Entity recognition method, apparatus, electronic device and computer readable storage medium
EP3714406A1 (en) Electronic apparatus and control method thereof
WO2019088659A1 (en) Method and apparatus for processing image
WO2019143026A1 (ko) 특징맵 압축을 이용한 이미지 처리 방법 및 장치
WO2020242260A1 (ko) 전역적 문맥을 이용하는 기계 학습 기반의 이미지 압축을 위한 방법 및 장치
WO2022154457A1 (en) Action localization method, device, electronic equipment, and computer-readable storage medium
WO2022039334A1 (ko) 신경망 프로세싱 유닛
EP4100914A1 (en) Image processing method and electronic apparatus
WO2017095195A1 (ko) 시스템 리소스 관리를 위한 방법 및 장치
WO2019143024A1 (ko) 라인 단위 연산을 이용한 초해상화 방법 및 장치
WO2019143027A1 (ko) 이미지 파이프라인 처리 방법 및 장치
WO2024010437A1 (ko) 신경 프로세싱 유닛 및 이의 동작 방법
WO2023080276A1 (ko) 쿼리 기반 데이터베이스 연동 딥러닝 분산 시스템 및 그 방법
WO2023038414A1 (en) Information processing method, apparatus, electronic device, storage medium and program product
WO2022092988A1 (en) A memory device for an artificial neural network
WO2023068821A1 (ko) 자기-지도 학습 기반의 다중 객체 추적 장치 및 방법
WO2023128009A1 (ko) 뉴럴 프로세싱 장치 및 그의 동기화 방법
WO2024076165A1 (ko) 신경망 연산을 위한 명령어 세트 생성방법과 이를 위한 컴퓨팅 장치

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

Country of ref document: EP

Kind code of ref document: A1