Neural network device, neural network system and method for processing neural network model
By using the computing processor and internal memory to store feature maps in neural network systems and adopting reuse and module forwarding strategies, the execution of the computing processing map is optimized, solving the problem of inefficient computing in deep learning, and improving computing speed and storage Utilization of resources.
Patent Information
- Application Number
- CN202010068165.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-07-22
- Filing Date
- 2020-01-20
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-01-20
AI Technical Summary
The prior art is difficult to effectively execute the operational processing diagram in deep learning, resulting in low computing efficiency and insufficient utilization of storage resources.
By introducing a computing processor into the neural network system, the input feature map is stored using internal memory, and the execution of the computing processing map is optimized by reusing policies and module forwarding strategies, the dependence on external memory is reduced and the computing speed is improved.
The calculation speed and efficiency of the computing processor are improved, the data input and output of external memory are reduced, and the utilization of storage resources is optimized.
Smart Images

Figure CN111461310B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on and claims the benefit of priority from Korean Patent Application No. 10-2019-0007583 filed on January 21, 2019, in the Korean Intellectual Property Office, and Korean Patent Application No. 10-2019-0088529 filed on July 22, 2019, in the Korean Intellectual Property Office, the disclosures of which are incorporated herein by reference in their entirety. Background Art
[0003] The present disclosure relates to a neural network system for performing deep learning on an input model by using an operation processing graph of a neural network, and more particularly, to a neural network system for efficiently performing calculations on an operation processing graph by using an internal memory for the operation processing graph, and to a method for processing a neural network model by using the neural network system.
[0004] Artificial neural network (ANN) refers to a computing architecture that models a biological brain. Deep learning, machine learning, etc. can be implemented based on ANN. Recently, as operations to be processed by using ANN are rapidly increasing, it is expected to efficiently perform operation processing by using ANN. Summary of the invention
[0005] According to an embodiment, a neural network system for processing a neural network model including an operation processing graph is provided, the neural network system including an operation processor, wherein the operation processing graph includes a plurality of operations, and the operation processor includes an internal memory storing a first module input feature graph. The operation processor is configured to: obtain a first branch output feature graph by performing a first operation among a plurality of operations based on the stored first module input feature graph; and obtain a second branch output feature graph by performing a second operation among a plurality of operations based on the stored first module input feature graph. The internal memory maintains the storage of the first module input feature graph when performing the first operation.
[0006] According to an embodiment, a method is provided for processing a neural network model including an operation processing graph using an operation processor including an internal memory, wherein the operation processing graph includes a plurality of operations, and the method includes storing a first module input feature graph in the internal memory. The method also includes: obtaining a first branch output feature graph by performing a first operation in a plurality of operations based on the stored first module input feature graph; obtaining a second branch output feature graph by performing a second operation in a plurality of operations based on the stored first module input feature graph; and maintaining storage of the first module input feature graph while performing the first operation.
[0007] According to an embodiment, a neural network device for processing an operation processing graph including a plurality of operations includes an internal memory storing a first feature map. The neural network device also includes at least one resource configured to: obtain a second feature map by performing a first operation in the plurality of operations based on the stored first feature map; store the obtained second feature map in the internal memory; and obtain a third feature map by performing a second operation in the plurality of operations based on the stored second feature map. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 is a block diagram illustrating a neural network system according to an embodiment.
[0009] Figure 2 is a block diagram showing a post-processor according to an embodiment.
[0010] Figure 3 is a flowchart illustrating the operation of the post-processor according to the embodiment.
[0011] Figure 4 is a diagram showing an operation process diagram according to the embodiment.
[0012] Figure 5 is a diagram showing modules according to an embodiment.
[0013] Figure 6 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment.
[0014] Figure 7 is a diagram illustrating a neural network processing method according to a reuse strategy according to an embodiment.
[0015] Figure 8 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment.
[0016] Fig. 9 is a diagram illustrating a neural network processing method according to a reuse strategy and a module forwarding strategy according to an embodiment.
[0017] Fig.10 is a diagram illustrating a neural network processing method according to a reuse strategy and a module forwarding strategy according to an embodiment.
[0018] Fig.11 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment.
[0019] Fig.12 is a diagram illustrating a neural network processing method according to a reuse strategy and an operation forwarding strategy according to an embodiment.
[0020] Fig.13is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment.
[0021] Fig.14 is a diagram showing a neural network processing method according to an embodiment.
[0022] Fig.15 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment.
[0023] Fig.16 is a block diagram showing an arithmetic processor according to an embodiment.
[0024] Fig.17 is a block diagram showing an arithmetic processor according to an embodiment.
[0025] Fig.18 is a block diagram illustrating an electronic system according to an embodiment. DETAILED DESCRIPTION
[0026] Figure 1 is a block diagram illustrating a neural network system according to an embodiment.
[0027] Reference Figure 1 , the neural network system 10 may include multiple application APPs, a post-processor 100, an operation processor 200, and an external memory 300. Multiple application APPs may be generated by various application programming interfaces (APIs), and various tasks may be performed by using a neural network model. The neural network model may include various neural network models, such as but not limited to: convolutional neural network (CNN) (including GoogLeNet, AlexNet, VGG network, etc.), region with convolutional neural network (R-CNN), region proposal network (RPN), recurrent neural network (RNN), stack-based deep neural network (S-DNN), deep belief network (DBN), restricted Boltzmann machine (RBM), fully convolutional network, long short-term memory (LSTM) network, and classification network. In addition, the neural network model that performs a task may include a sub-neural network, and the sub-neural network may include a heterogeneous neural network, and may be implemented using a heterogeneous neural network model.
[0028] A plurality of applications APP may request the post-processor 100 to perform data processing using the neural network model by outputting the input model IM to the post-processor 100 .
[0029] The post-processor 100 may include a model analyzer 120, a module detector 140, and a sequence manager 160. Each component included in the post-processor 100 may be implemented by software, and may be implemented by a neural network platform (e.g., an evolutionary deep network (EDEN)). In another example, each component included in the post-processor 100 may be implemented by hardware (e.g., an electronic circuit, a central processing unit (CPU), or an application processor (AP)). In one example, the post-processor 100 may be implemented by a framework of a neural network.
[0030] The model analyzer 120 may receive an input model IM from a plurality of applications APP, the input model IM including data for a neural network, and the model analyzer 120 may generate an operation processing graph OPG by analyzing the input model IM. The operation processing graph OPG may refer to a data structure represented by a graph including a plurality of operation nodes. The model analyzer 120 may output the operation processing graph OPG to the module detector 140.
[0031] The module detector 140 may divide the operation processing graph OPG into a plurality of modules M1 to Mn. As used herein, the term "module" may refer to a unit group consisting of a plurality of operations that receive an input feature map and thus output an output feature map. That is, a module may receive an input feature map via an input node, and may generate an output feature map via an output node. The module detector 140 may classify at least one operation that shares an input node and an output node among the operations included in the operation processing graph OPG as a module, and may generate an operation processing graph OPG divided into a plurality of modules M1 to Mn. Figure 4 This is described in detail.
[0032] The sequence manager 160 may determine the processing order of multiple branches included in the module. As used herein, the term "branch" may refer to a unit group consisting of multiple operations connected in series. In an embodiment, the sequence manager 160 may determine the processing order of multiple branches so that the amount of memory used can be reduced. Figure 4 This is described in detail.
[0033] The operation processor 200 may include operation resources including various operation processing devices, such as a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), a digital signal processor (DSP), a field programmable gate array (FPGA), a neural network processing unit (NPU), an electronic control unit (ECU), an image signal processor (ISP), etc. The operation processor 200 may include task-specific dedicated hardware for processing operations by using a neural network model, such as an NPU.
[0034] In one example, the computing processor 200 may include communication resources capable of supporting internal communications (e.g., system bus, peripheral component interconnect (PCI), PCI Express (PCIe), serial advanced technology attachment (SATA), small computer system interface (SCSI), and serial attached SCSI (SAS)) and / or supporting external communications (e.g., universal serial bus (USB), Ethernet, WiFi, Bluetooth, near field communication (NFC), radio frequency identification (RFID), and mobile telecommunications).
[0035] In one example, the operation processor 200 may include heterogeneous resources. In one example, the operation processor 200 may include an NPU as a first resource and a GPU as a second resource.
[0036] The operation processor 200 may include a memory manager 220 and an internal memory 240. The operation processor 200 may receive an operation processing graph OPG divided into a plurality of modules M1 to Mn from the post-processor 100 and may perform at least one operation included in the operation processing graph OPG by using the internal memory 240.
[0037] The memory manager 220 may determine a memory for processing a plurality of operations included in the operation processing graph OPG. The memory storing the input feature graph and the weight is used by the operation processor 200 to perform the operations included in the operation processing graph OPG, and the memory manager 220 may determine one of the internal memory 240 and the external memory 300 as a memory for performing the operation based on the storage amount used for the operation processing (e.g., the data amount of the input feature graph, the data amount of the output feature graph, the data amount of the weight, and the working memory).
[0038] The internal memory 240 is a memory located inside the operation processor 200 for operation processing of the operation processor 200, and may include at least one storage device. As an example, the internal memory 240 may include at least one selected from the group consisting of a volatile memory and a non-volatile memory, wherein the non-volatile memory may include a flash memory, a phase change random access memory (PRAM), a magnetic random access memory (MRAM), a resistive random access memory (RRAM), a ferroelectric random access memory (FRAM), etc., and the volatile memory may include a dynamic random access memory (DRAM), a static random access memory (SRAM), a synchronous DRAM (SDRAM), a latch, a flip-flop, a register, etc. Here, although the internal memory 240 is described as an SRAM, the inventive concept is not limited thereto.
[0039] The external memory 300 is a memory for various operations of the neural network system 10 located outside the operation processor 200, and may include at least one storage device. As an example, the external memory 300 may include at least one selected from the group consisting of a volatile memory and a non-volatile memory, wherein the non-volatile memory may include a flash memory, a PRAM, an MRAM, an RRAM, a FRAM, etc., and the volatile memory may include a DRAM, an SRAM, an SDRAM, a latch, a flip-flop, a register, etc. Here, although the external memory 300 is described as a DRAM, the inventive concept is not limited thereto.
[0040] The operation processor 200 may store the feature map FM in the external memory 300, or may load the stored feature map FM from the external memory 300. For this purpose, the operation processor 200 may further include an access device (e.g., direct memory access (DMA), memory DMA (MDMA), peripheral DMA (PDMA), remote DMA (RDMA), or smart DMA (SDMA)) to control access to the external memory 300.
[0041] The operation processor 200 according to the embodiment may store the input feature map in the internal memory 240, and may perform calculations on a plurality of branches included in one of the modules M1 to Mn by repeatedly using the input feature map stored in the internal memory 240. Therefore, the operation processor 200 may perform operation processing by using the internal memory 240 having a relatively high data input / output rate, rather than using the external memory 300 connected via various access devices, and the operation processing speed of the operation processor 200 may be increased.
[0042] The post-processor 100 may further include: a task manager that allocates at least a portion of the operation processing graph OPG based on its structural features, the types of operations included therein, etc.; and a compiler that performs compilation to translate the operation processing graph OPG into a programming language that the operation processor 200 can understand. In addition, the post-processor 100 may further include an operating system for driving various functional blocks, and the operating system may include various mobile operating systems, online operating systems, offline operating systems, etc. In one example, the operating system may be implemented by Linux, Linux-based Android, Windows, iOS, Mac OS, Chromium OS, etc.
[0043] In addition, although Figure 1An example of the memory manager 220 included in the operation processor 200 is shown, but this is an example, and in another example, the memory manager 220 may be included in the post-processor 100. That is, in an embodiment, the post-processor 100 may determine a memory for processing an operation included in the operation processing graph OPG.
[0044] In addition, similarly, although Figure 1 It is shown that the module detector 140 and the sequence manager 160 are included in the post-processor 100, but this is an example, and in another example, at least one selected from the module detector 140 and the sequence manager 160 may be included in the operation processor 200. That is, in an embodiment, the operation processor 200 may divide the operation process graph OPG into a plurality of modules M1 to Mn, and may determine a processing order of a plurality of branches included in the modules.
[0045] Figure 2 is a block diagram showing a post-processor according to an embodiment. Reference will be omitted Figure 1 Repeat description given.
[0046] Reference Figure 2 The post-processor 100 may include a model analyzer 120 , a module detector 140 , and a sequence manager 160 , and the model analyzer 120 may include a model parser 121 , a model builder 122 , and a model optimizer 123 .
[0047] The model parser 121 may generate model information Info_M by parsing the input model IM received from the application APP. The input model IM may include request information for executing instructions programmed in the application APP by using a neural network, and the term "parsing" may refer to a process of analyzing a grammatical structure or syntax of the input model. In one example, the model information Info_M may include metadata including size information of the input model IM.
[0048] The model builder 122 may generate an operation processing graph OPG' from the input model IM based on the model information Info_M received from the model parser 121. The operation processing graph OPG' may refer to a graph including a plurality of operation nodes.
[0049] The model optimizer 123 may perform an optimization operation on the operation processing graph OPG', and may output the original operation processing graph OPG_org generated as a result of the optimization operation to the module detector 140. The optimization operation may refer to an operation for minimizing and optimizing the amount of operation processing for the operation processing graph OPG'. In an embodiment, the optimization operation may include: a graph replacement operation for replacing at least a portion of the operation processing graph OPG' with another graph; a graph merging operation for merging at least a portion of the operation processing graph OPG'; and a graph segmentation operation for segmenting at least a portion from the operation processing graph OPG'.
[0050] The module detector 140 may receive an original operation processing graph OPG_org, may detect a plurality of modules M1 to Mn by analyzing the received original operation processing graph OPG_org, and may thus generate a module-divided operation processing graph OPG_m. In one example, the module detector 140 may classify a plurality of branches that receive an input feature graph and thus generate an output feature graph into modules.
[0051] In an embodiment, the module detector 140 may detect a skip connection operation, exclude the skip connection operation, and then divide the original operation processing graph OPG_org into a plurality of modules M1 to Mn. In addition, the module detector 140 may generate a module-divided operation processing graph OPG_m by dividing the original operation processing graph OPG_org into a plurality of modules M1 to Mn, and then include the skip connection operation therein again. According to an embodiment, the skip connection operation may be processed by using the external memory 300. Figure 3 and Figure 4 A method for generating a module-divided operation processing graph OPG_m is described in detail.
[0052] As used herein, the term "skip connection operation" may refer to an operation that connects between two branches. In one example, the module detector 140 may determine a skip connection operation based on the layer length between two nodes connected to the operation, which will be referred to below. Figure 4 Describe in detail.
[0053] The sequence manager 160 may receive the module-divided operation processing graph OPG_m and may determine the processing order in the plurality of branches included in the module. In an embodiment, the sequence manager 160 may determine the processing order so that the processing storage amount is minimized, and may generate the operation processing graph OPG by including information about the determined processing order in the module-divided operation processing graph OPG_m.
[0054] According to an embodiment, the post-processor 100 may divide the operation processing graph OPG into modules and adjust the operation processing graph OPG between a plurality of branches included in the modules, thereby minimizing the amount of storage used to process the operation processing graph OPG. Therefore, the operation processor 200 ( Figure 1 ) can execute the operations included in the operation processing graph OPG by effectively using the internal memory 240.
[0055] Figure 3 is a flowchart showing the operation of the post-processor according to the embodiment, and Figure 4 is a diagram showing an operation process diagram according to the embodiment.
[0056] Reference Figure 1 , Figure 3 and Figure 4 , the post-processor 100 can generate an operation processing graph OPG (S110) by analyzing the input model IM. Figure 4 In the example, by analyzing the input model IM, the post-processor 100 can generate an operation processing graph OPG, which includes: multiple first operations OP11_1 to OP11_3 and OP12, multiple second operations OP21_1 to OP21_3, OP22_1 to OP22_4, OP23_1 and OP23_2 and OP24_1 to OP24_3, a third operation OP3 and a fourth operation OP4.
[0057] Multiple first operations OP11_1 to OP11_3 and OP12, multiple second operations OP21_1 to OP21_3, OP22_1 to OP22_4, OP23_1 and OP23_2 and OP24_1 to OP24_3, the third operation OP3 and the fourth operation OP4 can respectively represent various mathematical operations (for example, convolution operation, rectified linear unit operation, memory copy operation, cascade operation, etc.), and can be the same or different operations from each other.
[0058] The post-processor 100 may exclude the skip connection operation SC from the operation processing graph OPG (S120). In an embodiment, the post-processor 100 may detect the layer length between two nodes to which the operation is connected, and may determine the skip connection operation SC based on the layer length. In an embodiment, the post-processor 100 may determine the operation connected between branches respectively included in different modules as the skip connection operation SC.
[0059] exist Figure 4In an example, the post-processor 100 may determine the third operation OP3 connected between layers whose number is greater than a predetermined number (e.g., the number of operations connected between nodes) as a skip connection operation SC, and may exclude the third operation OP3 when dividing the operation processing graph OPG into modules. In another example, the post-processor 100 may determine the third operation OP3 connected between the first branch B1 of the second module M2 and the first module M1 as a skip connection operation SC, and may exclude the third operation OP3 when dividing the operation processing graph OPG into modules.
[0060] Refer again Figure 3 , the post-processor 100 may divide the operation processing graph OPG excluding the skip connection operation SC into a plurality of modules M1 and M2 (S130). In an embodiment, the post-processor 100 may classify a plurality of operations that receive an input feature map and generate an output feature map into one module. In an embodiment, the post-processor 100 may classify the operations included in a plurality of parallel-connected branches that share one input node and one output node into one module.
[0061] exist Figure 4 In the example of, the post-processor 100 may classify a plurality of first operations OP11_1 to OP11_3 and OP12 respectively executed to receive an input feature map as a first module M1, and then output an output feature map, and similarly, a plurality of second operations OP21_1 to OP21_3, OP22_1 to OP22_4, OP23_1 and OP23_2, and OP24_1 to OP24_3 may be classified as a second module M2. In another example, the post-processor 100 may detect a first branch B1, a second branch B2, a third branch B3, and a fourth branch B4 connected in parallel and sharing an input node and an output node, and may classify a plurality of second operations OP21_1 to OP21_3, OP22_1 to OP22_4, OP23_1 and OP23_2, and OP24_1 to OP24_3 included in the first branch B1, the second branch B2, the third branch B3, and the fourth branch B4 as a second module M2.
[0062] Reference again Figure 3 , the post-processor 100 may determine the processing order of the branches included in each of the plurality of modules M1 and M2 (S140). In an embodiment, the post-processor 100 may determine the processing order of the plurality of branches B1 to B4 based on the amount of data used to process each of the plurality of branches B1 to B4.
[0063] exist Figure 4In an example of the second module M2 of the post-processor 100, the post-processor 100 may change the processing order of the first branch B1 to the fourth branch B4. In one example, the post-processor 100 may change the processing order in the order of increasing amount of data for processing. In an example in which the third branch B3, the first branch B1, the fourth branch B4, and the second branch B2 have gradually increasing amounts of data for processing in this order, the post-processor 100 may change the processing order in the order of the third branch B3, the first branch B1, the fourth branch B4, and the second branch B2.
[0064] In another example, the post-processor 100 may change the processing order in the order of decreasing data amount for processing. In an example in which the third branch B3, the first branch B1, the fourth branch B4, and the second branch B2 respectively have gradually increasing data amounts for processing in this order, the post-processor 100 may change the processing order in the order of the second branch B2, the fourth branch B4, the first branch B1, and the third branch B3.
[0065] Reference again Figure 3 , the post-processor 100 may include the skip connection operation SC in the operation processing graph OPG again ( S150 ), and may output the operation processing graph OPG after the processing is completed to the operation processor 200 ( S160 ).
[0066] Figure 5 is a diagram showing a module according to an embodiment. Reference will be omitted Figure 4 Repeat description given.
[0067] Reference Figure 1 and Figure 5 , the second module M2 may include a first branch B1 to a fourth branch B4. The operation processor 200 may generate a first branch output feature map OFM_B1 by sequentially performing first branch operations OP21_1 to OP21_3 (in this order) using the module input feature map IFM_M as input, and may generate a second branch output feature map OFM_B2 by sequentially performing second branch operations OP22_1 to OP22_4 (in this order) using the module input feature map IFM_M as input.
[0068] In addition, the operation processor 200 can generate a third branch output feature map OFM_B3 by using the module input feature map IFM_M as input and executing the third branch operations OP23_1 and OP23_2 (in this order) in sequence, and can generate a fourth branch output feature map OFM_B4 by using the module input feature map IFM_M as input and executing the fourth branch operations OP24_1 to OP24_3 (in this order) in sequence.
[0069] In one example, the operation processor 200 can generate a first feature map FM1 by performing a first operation OP22_1 using the module input feature map IFM_M as an input, and can generate a second feature map FM2 by performing a second operation OP22_2 using the first feature map FM1 as an input. In addition, the operation processor 200 can generate a third feature map FM3 by performing a third operation OP22_3 using the second feature map FM2 as an input, and can generate a second branch output feature map OFM_B2 by performing a fourth operation OP22_4 using the third feature map FM3 as an input.
[0070] The operation processor 200 can generate the module output feature map OFM_M by using the first branch output feature map OFM_B1 to the fourth branch output feature map OFM_B4. In one example, the operation processor 200 can generate the module output feature map OFM_M by cascading the first branch output feature map OFM_B1 to the fourth branch output feature map OFM_B4 using a cascade function.
[0071] Figure 6 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment. Figure 6 An embodiment of a method of operating a computational processor by using a reuse strategy is shown.
[0072] Reference Figure 1 , Figure 5 and Figure 6 , the operation processor 200 may store the module input feature map IFM_M in the internal memory 240 (S210). The operation processor 200 may continuously perform the operations OP21_1 to OP21_3 included in the first branch B1 by using the module input feature map IFM_M stored in the internal memory 240 (S220). The operation processor 200 may store the first branch output feature map OFM_B1 generated as a result of continuously performing the operations OP21_1 to OP21_3 included in the first branch B1 in the external memory 300 (S230).
[0073] The operation processor 200 may continuously perform the operations OP22_1 to OP22_4 included in the second branch B2 by reusing the module input feature map IFM_M stored in the internal memory 240 (S240). The operation processor 200 may store the second branch output feature map OFM_B2 generated as a result of continuously performing the operations OP22_1 to OP22_4 included in the second branch B2 in the external memory 300 (S250).
[0074] Here, as described above, a strategy of using the internal memory 240 so that operations included in a plurality of branches B1 to B4 are performed by reusing the module input feature map IFM_M stored in the internal memory 240 is referred to as a reuse strategy.
[0075] In a similar manner, the operation processor 200 can perform operations included in all branches in the module (for example, operations included in the third branch B3 and the fourth branch B4), and when the calculations of all branches in the module are completed, the module output feature map OFM_M can be generated by using the plurality of branch output feature maps OFM_B1 to OFM_B4 stored in the external memory 300 (S260). The operation processor 200 can perform one or more operations included in the subsequent module (for example, Figure 4 The fourth operation OP4) (S270).
[0076] The operation processor 200 according to the embodiment can use the module input feature map IFM_M stored in the internal memory 240 based on the reuse strategy when performing calculations on multiple branches B1 to B4, thereby reducing the amount of data input to and output from the external memory 300 and improving the operation processing speed.
[0077] Figure 7 is a diagram illustrating a neural network processing method according to a reuse strategy according to an embodiment.
[0078] Reference Figure 1 and Figure 7 , at a first time point t1, the operation processor 200 may store the module input feature map IFM_M in the internal memory 240, and may process the operation included in the first branch B1 by using the module input feature map IFM_M stored in the internal memory 240. When processing the operation included in the first branch B1, the operation processor 200 may use the remaining processing area PA except the area where the module input feature map IFM_M is stored. In one example, the processing area PA may include a storage area for processing at least one selected from the group consisting of a working memory, a weight value, and an output feature map generated as a result of the operation. The operation processor 200 may store the first branch output feature map OFM_B1 in the external memory 300 through direct memory access (DMA), the first branch output feature map OFM_B1 being generated by processing the operation included in the first branch B1.
[0079] At the second time point t2, the operation processor 200 may process the operation included in the second branch B2 by using the module input feature map IFM_M stored in the internal memory 240, and may store the second branch output feature map OFM_B2 generated as a result thereof in the external memory 300. At the third time point t3, the operation processor 200 may process the operation included in the third branch B3 by using the module input feature map IFM_M stored in the internal memory 240, and may store the third branch output feature map OFM_B3 generated as a result thereof in the external memory 300. In addition, at the fourth time point t4, the operation processor 200 may process the operation included in the fourth branch B4 by using the module input feature map IFM_M stored in the internal memory 240, and may store the fourth branch output feature map OFM_B4 generated as a result thereof in the external memory 300.
[0080] At the fifth time point t5, the operation processor 200 may load the first to fourth branch output feature maps OFM_B1 to OFM_B4 stored in the external memory 300, and may generate a module output feature map OFM M by using the loaded first to fourth branch output feature maps OFM_B1 to OFM_B4. The operation processor 200 may store the generated module output feature map OFM_M in the internal memory 240, and may use the module output feature map OFM_M as an input to a subsequent module or operation.
[0081] Figure 8 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment. Figure 8 An embodiment of a method of operating a computational processor by using a reuse strategy and a module forwarding strategy is shown.
[0082] Reference Figure 1 , Figure 5 and Figure 8 , the operation processor 200 may store the module input feature map IFM_M in the internal memory 240 (S310). The operation processor 200 may continuously perform the operations OP21_1 to OP21_3 included in the first branch B1 by using the module input feature map IFM_M stored in the internal memory 240 (S320). The operation processor 200 may store the first branch output feature map OFM_B1 generated as a result of continuously performing the operations OP21_1 to OP21_3 included in the first branch B1 in the internal memory 240 (S330).
[0083] The operation processor 200 may continuously perform the operations OP22_1 to OP22_4 included in the second branch B2 by reusing the module input feature map IFM_M stored in the internal memory 240 (S340). The operation processor 200 may store the second branch output feature map OFM_B2 generated as a result of continuously performing the operations OP22_1 to OP22_4 included in the second branch B2 in the internal memory 240 (S350).
[0084] In a similar manner, the operation processor 200 may perform operations included in all branches in the module (e.g., operations included in the third branch B3 and the fourth branch B4), and when the calculations of all branches in the module are completed, the module output feature map OFM_M may be generated by using the plurality of branch output feature maps OFM_B1 to OFM_B4 stored in the internal memory 240 (S360). The operation processor 200 may perform one or more operations included in subsequent modules (e.g., Figure 4 The fourth operation OP4) (S370).
[0085] Here, the strategy of using the internal memory 240 so that (as in operations S360 and S370) the module output feature map OFM_M is stored in the internal memory 240, and using the module output feature map OFM_M stored in the internal memory 240 as the input of subsequent modules or operations can be called a module forwarding strategy.
[0086] According to the embodiment, the operation processor 200 can use the module output feature map OFM_M stored in the internal memory 240 as the input of subsequent modules or operations based on the module forwarding strategy, thereby reducing the amount of data input to and output from the external memory 300 and improving the operation processing speed.
[0087] although Figure 8 An embodiment in which the reuse strategy and the module forwarding strategy are used together is shown, but this is an example, and in an embodiment, the operation processor 200 can perform the neural network processing method using only the internal memory 240 by using the module forwarding strategy. That is, in one example, the operation processor 200 can store the module output feature map OFM_M in the internal memory 240 by using the module input feature map IFM_M stored in the external memory 300, and can use the module output feature map OFM_M stored in the internal memory 240 as an input to a subsequent module or operation.
[0088] Fig. 9 is a diagram illustrating a neural network processing method according to a reuse strategy and a module forwarding strategy according to an embodiment.
[0089] Reference Figure 1 and Fig. 9 At the first time point t1, the operation processor 200 may store the module input feature map IFM_M in the internal memory 240, and may process the operation included in the first branch B1 by using the module input feature map IFM_M stored in the internal memory 240. The operation processor 200 may store the first branch output feature map OFM_B1 generated by processing the operation included in the first branch B1 in the internal memory 240.
[0090] At the second time point t2, the operation processor 200 may process the operation included in the second branch B2 by using the module input feature map IFM_M stored in the internal memory 240, and may store the second branch output feature map OFM_B2 generated as a result thereof in the internal memory 240. At the third time point t3, the operation processor 200 may process the operation included in the third branch B3 by using the module input feature map IFM_M stored in the internal memory 240, and may store the third branch output feature map OFM_B3 generated as a result thereof in the internal memory 240. In addition, at the fourth time point t4, the operation processor 200 may process the operation included in the fourth branch B4 by using the module input feature map IFM_M stored in the internal memory 240, and may store the fourth branch output feature map OFM_B4 generated as a result thereof in the internal memory 240.
[0091] At the fifth time point t5, the operation processor 200 may generate a module output feature map OFM_M by using the first branch output feature map OFM_B1 to the fourth branch output feature map OFM_B4 stored in the internal memory 240, and may store the module output feature map OFM_M in the internal memory 240. At the sixth time point t6, the operation processor 200 may perform the operation included in the subsequent module M_sub by using the module output feature map OFM_M. In an embodiment, since the module input feature map IFM_M is no longer used for the subsequent module M_sub, the operation processor 200 may perform the operation included in the subsequent module M_sub by using the area where the module input feature map IFM_M has been stored until the fifth time point t5 as the processing area PA.
[0092] Fig.10 is a diagram showing a neural network processing method according to a reuse strategy and a module forwarding strategy according to an embodiment. Fig.10 The operations of the operation processor at the first time point t1 to the third time point t3 can be the same as those in the above reference Fig. 9The operations described are the same or similar, so their description will be omitted.
[0093] Reference Figure 1 and Fig.10 At the fourth time point t4, the operation processor 200 may process the operation included in the fourth branch B4 by using the module input feature map IFM_M stored in the internal memory 240, and may store the fourth branch output feature map OFM_B4 generated as a result thereof in the internal memory 240. According to an embodiment, the operation processor 200 may overwrite at least a portion of the region storing the module input feature map IFM_M with the fourth branch output feature map OFM_B4.
[0094] At the fifth time point t5, the operation processor 200 may generate a module output feature map OFM_M by using the first to fourth branch output feature maps OFM_B1 to OFM_B4 stored in the internal memory 240. At the sixth time point t6, the operation processor 200 may perform operations included in a subsequent module M_sub by using the module output feature map OFM_M.
[0095] In an embodiment, since the module input feature map IFM_M is no longer used after the result of the last operation in multiple branches B1 to B4 is generated, the operation processor 200 can use at least a portion of the area that has stored the module input feature map IFM_M until the fourth time point t4 as an area for the fourth branch output feature map OFM_B4 (which is the result of the last operation), and can perform the operations included in the subsequent module M_sub by using the remaining area that stores the module input feature map IFM_M as the processing area PA.
[0096] Fig.11 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment. Figure 8 An embodiment of a method of operating an operation processor by using a reuse policy and an operation forwarding policy is shown.
[0097] Reference Figure 1 , Figure 5 and Fig.11 , the operation processor 200 may store the module input feature map IFM_M in the internal memory 240 (S410). The operation processor 200 may perform the first operation OP22_1 included in the second branch B2 by using the module input feature map IFM_M stored in the internal memory 240 (S420). The operation processor 200 may store the first feature map FM1 generated as a result of performing the first operation OP22_1 in the internal memory 240 (S430).
[0098] The operation processor 200 may perform the second operation OP22_2 (S440) by using the first feature map FM1 stored in the internal memory 240. The operation processor 200 may store the second feature map FM2 generated as a result of performing the second operation OP222 in the internal memory 240 (S450).
[0099] In a similar manner, the operation processor 200 may perform all operations in the branch (e.g., the third operation OP22_3 and the fourth operation OP22_4), and may generate a second branch output feature map OFM_B2 as a result of performing the last operation (e.g., the fourth operation OP22_4) in the operation in the branch (S460). The operation processor 200 may store the generated second branch output feature map OFM_B2 in the internal memory 240 (S470), and may perform subsequent modules or operations (e.g., Figure 4 The fourth operation OP4).
[0100] Here, the strategy of using the internal memory 240 so that the feature maps FM1 to FM3 generated as a result of operations OP22_1 to OP22_4 (as in operations S430 to S460) are stored in the internal memory 240, and using each of the feature maps FM1 to FM3 stored in the internal memory 240 as an input for each subsequent operation can be referred to as an operation forwarding strategy.
[0101] The operation processor 200 according to the embodiment can use each of the feature maps FM1 to FM3 stored in the internal memory 240 as the input of each subsequent operation based on the operation forwarding strategy, thereby reducing the amount of data input to and output from the external memory 300 and improving the operation processing speed.
[0102] although Fig.11 An embodiment in which the reuse strategy and the operation forwarding strategy are used together is shown, but this is an example, and in an embodiment, the operation processor 200 can perform the neural network processing method using only the internal memory 240 by using the operation forwarding strategy. That is, in one example, the operation processor 200 can generate feature maps FM1 to FM3 by performing operations using the module input feature map IFM_M stored in the external memory 300, can store the generated feature maps FM1 to FM3 in the internal memory 240, and can use each of the feature maps FM1 to FM3 stored in the internal memory 240 as an input for each subsequent operation.
[0103] Fig.12 is a diagram illustrating a neural network processing method according to a reuse strategy and an operation forwarding strategy according to an embodiment.
[0104] Reference Figure 1 , Figure 5 and Fig.12 , at a first time point t1, the operation processor 200 may store the first branch output feature map OFM_B1 in the internal memory 240, and may process the first operation OP22_1 by using the module input feature map IFM_M stored in the internal memory 240, wherein the first branch output feature map OFM_B1 is generated as a result of processing the module input feature map IFM_M and the first branch B1. During the processing of the first operation OP22_1, the operation processor 200 may process the first operation OP22_1 by using the processing area PA except for the area where the module input feature map IFM_M and the first branch output feature map OFM_B1 are stored. The operation processor 200 may store the first feature map FM1 generated by processing the operation included in the first operation OP22_1 in the internal memory 240.
[0105] At the second time point t2, the operation processor 200 may process the second operation OP22_2 by using the first feature map FM1 stored in the internal memory 240, and may store the second feature map FM2 generated as a result thereof in the internal memory 240. During the processing of the second operation OP22_2, the operation processor 200 may process the second operation OP22_2 by using the remaining processing area PA except for the area storing the module input feature map IFM_M, the first branch output feature map OFM_B1, and the first feature map FM1.
[0106] At the third time point t3, the operation processor 200 may process the third operation OP22_3 by using the second feature map FM2 stored in the internal memory 240, and may store the third feature map FM3 generated as a result thereof in the internal memory 240. In an embodiment, since the first feature map FM1 is no longer used to calculate the operation processing map OPG, the operation processor 200 may overwrite the area of the internal memory 240 storing the first feature map FM1 with the third feature map FM3. During the processing of the third operation OP22_3, the operation processor 200 may process the third operation OP22_3 by using the remaining processing area PA except for the area storing the module input feature map IFM_M, the first branch output feature map OFM_B1, the first feature map FM1, and the second feature map FM2.
[0107] At the fourth time point t4, the operation processor 200 may process the fourth operation OP22_4 by using the third feature map FM3 stored in the internal memory 240, and may store the second branch output feature map OFM_B2 generated as a result thereof in the internal memory 240. In an embodiment, since the second feature map FM2 and the third feature map FM3 are no longer used to calculate the operation processing map OPG, the operation processor 200 may overwrite the area of the internal memory 240 storing the second feature map FM2 and the third feature map FM3 with the second branch output feature map OFM_B2. During the processing of the fourth operation OP22_4, the operation processor 200 may process the fourth operation OP22_4 by using the remaining processing area PA except for the area storing the module input feature map IFM_M, the first branch output feature map OFM_B1, the second feature map FM2, and the third feature map FM3.
[0108] Fig.13 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment.
[0109] Reference Figure 1 and Fig.13 , the operation processor 200 may store the input feature map in the internal memory 240 (S510). The operation processor 200 may generate an output feature map by performing at least one operation using the input feature map stored in the internal memory 240 (S520). The operation processor 200 may determine whether the output feature map can be stored in the internal memory 240 based on the data amount of the output feature map and the free storage amount of the internal memory 240 (S530). Here, the free storage amount may refer to the data amount of the remaining storage area other than other data (e.g., module input feature map, etc.), weights, and working memory for operation processing that have been stored in the internal memory 240.
[0110] When the output feature map can be stored in the internal memory 240, that is, when the data amount of the output feature map is less than the free storage amount of the internal memory 240, the operation processor 200 may store the output feature map in the internal memory 240 (S540). The operation processor 200 may perform subsequent operations by using the output feature map stored in the internal memory 240 (S545).
[0111] When the output feature map cannot be stored in the internal memory 240, that is, when the data amount of the output feature map is greater than the free storage amount of the internal memory 240, the operation processor 200 may store the output feature map in the external memory 300 (S550). The operation processor 200 may perform subsequent operations by using the output feature map stored in the external memory 300 (S555).
[0112] Fig.14 is a diagram showing a neural network processing method according to an embodiment.
[0113] Reference Figure 1 , Figure 5 and Fig.14 , at the first time point t1, the operation processor 200 may store the first branch output feature map OFM_B1 generated as a result of processing the module input feature map IFM_M and the first branch B1 in the internal memory 240, and may process the first operation OP22_1 by using the module input feature map IFM_M stored in the internal memory 240. During the processing of the first operation OP22_1, the operation processor 200 may process the first operation OP22_1 by using the remaining processing area PA except the area where the module input feature map IFM_M and the first branch output feature map OFM_B1 are stored. The operation processor 200 may determine that the first feature map FM1 generated as a result of the first operation OP22_1 can be stored in the internal memory 240 based on the data amount of the first feature map FM1 and the free storage amount of the internal memory 240, and the operation processor 200 may store the first feature map FM1 in the internal memory 240.
[0114] At the second time point t2, the operation processor 200 may process the second operation OP22_2 by using the first feature map FM1 stored in the internal memory 240, and may generate the second feature map FM2. The operation processor 200 may determine that the second feature map FM2 generated as a result of the second operation OP22_2 cannot be stored in the internal memory 240 based on the data amount of the second feature map FM2 and the free storage amount of the internal memory 240, and the operation processor 200 may store the second feature map FM2 in the external memory 300 through DMA.
[0115] At the third time point t3, the operation processor 200 may process the third operation OP22_3 by using the second feature map FM2 stored in the external memory 300, and may generate the third feature map FM3. The operation processor 200 may determine that the third feature map FM3 generated as a result of the third operation OP22_3 can be stored in the internal memory 240 based on the data amount of the third feature map FM3 and the free storage amount of the internal memory 240, and the operation processor 200 may store the third feature map FM3 in the internal memory 240. In one example, the operation processor 200 may overwrite the area storing the first feature map FM1 which is no longer used for subsequent operations with the third feature map FM3.
[0116] At the fourth time point t4, the operation processor 200 may process the fourth operation OP22_4 by using the third feature map FM3 stored in the internal memory 240, and may generate the second branch output feature map OFM_B2. The operation processor 200 may determine that the second branch output feature map OFM_B2 generated as a result of the fourth operation OP22_4 cannot be stored in the internal memory 240 based on the data amount of the second branch output feature map OFM_B2 and the free storage amount of the internal memory 240, and the operation processor 200 may store the second branch output feature map OFM_B2 in the external memory 300 through DMA.
[0117] Fig.15 is a flowchart illustrating a method of operating an arithmetic processor according to an embodiment.
[0118] Reference Figure 1 and Fig.15 , the memory manager 220 may calculate the amount of memory used to execute operations included in the module (S610). The memory manager 220 may establish an internal memory usage policy based on the calculated amount of memory (S620).
[0119] In an embodiment, when the calculated storage amount is equal to or less than the first reference value, the memory manager 220 may process the operation processing graph OPG based on the reuse policy. The memory manager 220 may perform calculations on multiple branches using the module input feature graph stored in the internal memory 240 based on the reuse policy.
[0120] In an embodiment, when the calculated storage amount is equal to or less than the second reference value, the memory manager 220 may process the operation processing graph OPG based on the module forwarding strategy. The memory manager 220 may use the module output feature graph stored in the internal memory 240 as an input to a subsequent module or operation based on the module forwarding strategy.
[0121] In an embodiment, when the calculated storage amount is equal to or less than the third reference value, the memory manager 220 may use the feature map stored in the internal memory 240 as an input for a subsequent operation based on an operation forwarding strategy.
[0122] Fig.16 is a block diagram showing an arithmetic processor according to an embodiment. Fig.16 An embodiment of multiple resources performing neural network processing operations according to a reuse strategy is shown. Reference will be omitted Figure 1 Repeat description given.
[0123] Reference Fig.16, the operation processor 200a may include a first resource 210a, a second resource 230a, and an internal memory 240a. Each of the first resource 210a and the second resource 230a may include a neural network operation processing device, for example, a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), a digital signal processor (DSP), a field programmable gate array (FPGA), a neural network processing unit (NPU), an electronic control unit (ECU), or an image signal processor (ISP), and the first resource 210a and the second resource 230a may be different resources, respectively.
[0124] The first resource 210a may receive the module input feature map IFM_M from the internal memory 240a, and may generate a first branch output feature map OFM_B1 by performing at least one operation included in the first branch. The first resource 210a may store the generated first branch output feature map OFM_B1 in the internal memory 240a.
[0125] The second resource 230a may receive the module input feature map IFM_M from the internal memory 240a, and may generate a second branch output feature map OFM_B2 by performing at least one operation included in the second branch. The second resource 230a may store the generated second branch output feature map OFM_B2 in the internal memory 240a.
[0126] According to an embodiment, multiple resources (ie, the first and second resources 210a and 230a) can share the internal memory 240a, and the module input feature map IFM_M can be reused, so the neural network operation processing speed can be improved.
[0127] Fig.17 is a block diagram showing an arithmetic processor according to an embodiment. Fig.17 An embodiment of multiple resources performing neural network processing operations according to a module forwarding strategy or an operation forwarding strategy is shown. Figure 1 and Fig.16 Repeat description given.
[0128] Reference Fig.17, the operation processor 200b may include a first resource 210b, a second resource 230b, and an internal memory 240b. The first resource 210b may perform a first operation based on an input feature map, and may generate a first feature map FM1 as a result of the first operation. In an embodiment, the first operation may be an operation effectively performed by the first resource 210b. The first resource 210b may store the generated first feature map FM1 in the internal memory 240b. In addition, the first resource 210b may output a first feature map address ADDR_FM1 on the internal memory 240b to the second resource 230b.
[0129] The second resource 230b may receive the first feature map FM1 from the internal memory 240b based on the first feature map address ADDR_FM1, and may generate the second feature map FM2 by performing a second operation based on the first feature map FM1. In an embodiment, the second operation may be an operation effectively performed by the second resource 230b. The second resource 230b may store the generated second feature map FM2 in the internal memory 240b, and may output the second feature map address ADDR_FM2 on the internal memory 240b to the first resource 210b.
[0130] The first resource 210 b may receive the second feature map FM2 from the internal memory 240 b based on the second feature map address ADDR_FM2 and may perform subsequent operations based on the second feature map FM2 .
[0131] According to an embodiment, multiple resources (ie, the first resource 210b and the second resource 230b) can share the internal memory 240b and can forward feature maps separately, thereby improving the processing speed of neural network operations.
[0132] Fig.18 is a block diagram illustrating an electronic system according to an embodiment.
[0133] Reference Fig.18 , the electronic system 1000 can extract effective information by analyzing input data in real time based on a neural network, and can determine a condition based on the extracted information, or can control components of an electronic device in which the electronic system 1000 is installed. For example, the electronic system 1000 can be applied to a robot device (e.g., a drone or an advanced driver assistance system (ADAS)), a smart TV, a smart phone, a medical device, a mobile device, an image display device, a measuring device, an IoT device, etc., and in addition, the electronic system 1000 can be installed in any one or any combination of various electronic devices.
[0134] The electronic system 1000 may include a processor 1010, a RAM 1020, a neural network device 1030, a memory 1040, a sensor 1050, and a transmitter / receiver (Tx / Rx) 1060. The components of the electronic system 1000 may be connected to each other in a communicable manner via a bus. The processor 1010 may control the overall operation of the electronic system 1000. For example, the processor 1010 may control the function of the neural network device 1030 by executing a program stored in the RAM 1020. In addition, the processor 1010 may output an input model to be deep-learned based on a neural network to the neural network device 1030 by controlling the RAM 1020, the memory 1040, etc. In an embodiment, the processor 1010 may divide an operation processing graph into modules, and may adjust the operation processing graph between a plurality of branches included in the modules. The RAM 1020 may temporarily store programs, data, applications, or instructions.
[0135] The neural network device 1030 may include an SRAM and may perform various operations for neural network processing by using the SRAM. In one example, the neural network device 1030 may be implemented with software stored in a system memory (e.g., a read-only memory (ROM)) and may operate based on the control of the processor 1010.
[0136] The memory 1040 is a storage location for storing data, and may store, for example, various data generated in the process of performing operations by the neural network device 1030. The sensor 1050 may sense or receive a signal (e.g., an image signal, an audio signal, a magnetic signal, a bio-signal, a touch signal, etc.) from outside the electronic system 1000, and may convert the signal into data. The Tx / Rx 1060 may include a computing resource for performing a large number of operations based on a neural network, or may include a communication resource implemented through various wired or wireless interfaces that may communicate with devices outside the electronic system 1000.
[0137] In an embodiment, the neural network device 1030 may process the operation processing graph based on a reuse strategy. The neural network device 1030 may use the module input feature graph stored in the SRAM when performing calculations on multiple branches based on the reuse strategy.
[0138] In an embodiment, the neural network device 1030 may process the operation processing graph based on the module forwarding strategy. The neural network device 1030 may use the module output feature graph stored in the SRAM as the input of the subsequent module or operation based on the module forwarding strategy.
[0139] In an embodiment, the neural network device 1030 may use the feature map stored in the SRAM as an input for subsequent operations based on an operation forwarding strategy.
[0140] The example embodiments described above can be written in a program executable on a computer and can be implemented in a general-purpose digital computer that runs the program using a computer-readable recording medium. In addition, the data structure used in the above example embodiments can be recorded in a computer-readable recording medium in various ways. The computer-readable recording medium may include a storage medium such as a magnetic storage medium (e.g., ROM, floppy disk, hard disk, etc.) or an optical reading medium (e.g., a compact disc-ROM (CD-ROM), a digital versatile disk (DVD), etc.).
[0141] While the inventive concept has been shown and described with reference to embodiments thereof, it will be understood that various changes in form and details may be made therein without departing from the spirit and scope of the following claims.
Claims
1. A neural network system for processing a neural network model including an operation processing graph, wherein the operation processing graph includes a plurality of operations, the neural network system include: an operation processor, comprising an internal memory, wherein the internal memory stores a first module input feature map, and A post-processor, the post-processor being configured to divide the operation processing graph into a plurality of modules; Wherein, the operation processor is configured as: Based on the stored first module input feature map, obtaining a first branch output feature map by performing a first operation of the plurality of operations; and Based on the stored first module input feature map, a second branch output feature map is obtained by performing a second operation of the plurality of operations after performing the first operation, and The internal memory maintains storage of the first module input feature map when the first operation is executed, Each of the multiple modules includes multiple branches. wherein each of the plurality of branches corresponds to a storage area size among a plurality of storage area sizes for processing the plurality of branches, and an operation included in each branch is independent of operations included in other branches of the plurality of branches, The post-processor is further configured to determine a processing order of the plurality of branches based on a size of a storage area used to process each of the plurality of branches, and The processing order arranges the multiple branches in a manner that the sizes of the multiple storage areas sequentially increase or the sizes of the multiple storage areas sequentially decrease.
2. The neural network system according to claim 1, in, The multiple branches are configured to receive an input feature map via a node.
3. The neural network system according to claim 2, in, The plurality of branches include: a first branch including the first operation, and a second branch including the second operation, and Wherein, the operation processor is further configured as: Based on the stored first module input feature map, obtaining the first branch output feature map by executing the first operation included in the first branch; and Based on the stored first module input feature map, the second branch output feature map is obtained by executing the second operation included in the second branch.
4. The neural network system according to claim 1, in, The plurality of branches include: a first branch processed using a first storage area and a second branch processed using a second storage area larger than the first storage area, and The post-processor is further configured to obtain a processing order of the multiple branches so that the second branch is processed earlier than the first branch.
5. The neural network system of claim 2, further comprising an external memory connected to the operation processor via direct memory access (DMA), in, The plurality of modules include a first module and a second module, The operation processing graph includes a skip connection operation, wherein the skip connection operation connects a first operation node included in the first module and a second operation node included in the second module, and The post-processor is further configured to exclude the skip connection operation from the operation processing graph, thereby using the external memory to process the skip connection operation.
6. The neural network system according to claim 1, in, The operation processing diagram includes multiple modules, and Wherein, the operation processor is further configured as: Based on the stored first module input feature map, obtaining a first module output feature map by executing a third operation included in a first module among the plurality of modules; storing the obtained first module output feature map in the internal memory; and Based on the stored first module output feature map, a second module output feature map is obtained by executing a fourth operation included in a second module among the multiple modules.
7. The neural network system according to claim 1, in, The computing processor is further configured to: Based on the first feature map, obtaining a second feature map by performing a third operation among the plurality of operations; storing the obtained second feature map in the internal memory; as well as Based on the stored second feature map, a third feature map is obtained by performing a fourth operation of the plurality of operations.
8. The neural network system according to claim 1, in, The operation processing graph includes a plurality of branches that share a first input node and a first output node, wherein the plurality of branches includes a last branch that is processed last among the plurality of branches, and Wherein, the operation processor is further configured as: Based on the stored first module input feature map, obtaining a third branch output feature map by performing a third operation included in the last branch; and The area of the internal memory storing the first module input feature map is overwritten with the obtained third branch output feature map.
9. The neural network system according to claim 1, in, The operation processing graph includes a plurality of branches that share a first input node and a first output node, Each of the plurality of branches receives the first module input feature map, The plurality of branches include a first branch and a second branch, the first branch includes the first operation, the second branch includes the second operation, and Wherein, the operation processor is further configured as: Obtaining the first branch output feature map by performing the first operation included in the first branch using a first remaining area of the internal memory, wherein the first remaining area does not include a first area of the internal memory storing the first module input feature map; and storing the obtained first branch output feature map in the second area of the internal memory; Obtaining the second branch output feature map by performing the second operation included in the second branch using a second remaining area of the internal memory, wherein the second remaining area does not include the first area and the second area storing the first branch output feature map; and The obtained second branch output feature map is stored in the third area of the internal memory.
10. The neural network system according to claim 1 further comprises a dynamic random access memory (DRAM) connected to the operation processor via direct memory access (DMA), in, The internal memory includes static random access memory "SRAM".
11. A method of processing a neural network model including an operation processing graph using an operation processor including an internal memory, wherein the operation processing graph includes a plurality of operations, the method include: Storing a first module input feature map in the internal memory; Dividing the operation processing graph into a plurality of modules; Based on the stored first module input feature map, obtaining a first branch output feature map by performing a first operation among the multiple operations; Based on the stored first module input feature map, obtaining a second branch output feature map by performing a second operation among the multiple operations; as well as When performing the first operation, the storage of the first module input feature map is maintained in the internal memory, Each of the multiple modules includes multiple branches. wherein each of the plurality of branches corresponds to a storage area size among a plurality of storage area sizes for processing the plurality of branches, and an operation included in each branch is independent of operations included in other branches of the plurality of branches, The method further comprises: determining a processing order of the plurality of branches based on a size of a storage area used to process each of the plurality of branches, and The processing order arranges the multiple branches in a manner that the sizes of the multiple storage areas sequentially increase or the sizes of the multiple storage areas sequentially decrease.
12. The method according to claim 11, in, The multiple branches share one input node and one output node.
13. The method according to claim 11, in, The plurality of branches include: a first branch processed using a first storage area, and a second branch processed using a second storage area larger than the first storage area, and Wherein, obtaining the processing order of the multiple branches includes: obtaining the processing order of the multiple branches so that the second branch is processed earlier than the first branch.
14. The method according to claim 12, in, The plurality of modules include a first module and a second module, The operation processing graph includes a skip connection operation, wherein the skip connection operation connects a first operation node included in the first module and a second operation node included in the second module. The method further comprises excluding the skip connection operation from the operation processing graph, and Partitioning the operation processing graph includes dividing the operation processing graph excluding the skip connection operation into the plurality of modules.
15. The method according to claim 14, further comprising: include: The skip connection operations are processed via an external memory connected to the operation processor through direct memory access (DMA).
16. The method according to claim 11, in, The operation processing diagram includes multiple modules, and Wherein, the method further comprises: Based on the stored first module input feature map, obtaining a first module output feature map by executing a third operation included in a first module among the plurality of modules; storing the obtained first module output feature map in the internal memory; and Based on the stored first module output feature map, a second module output feature map is obtained by executing a fourth operation included in a second module among the multiple modules.
17. The method according to claim 11, in, The method further comprises: Based on the first feature map, obtaining a second feature map by performing a third operation among the plurality of operations; storing the obtained second feature map in the internal memory; and Based on the stored second feature map, a third feature map is obtained by performing a fourth operation of the plurality of operations.
18. The method according to claim 11, in, The operation processing graph includes a plurality of branches that share a first input node and a first output node, wherein the plurality of branches includes a last branch that is processed last among the plurality of branches, and Wherein, the method further comprises: Based on the stored first module input feature map, obtaining a third branch output feature map by performing a third operation included in the last branch; and The area of the internal memory storing the first module input feature map is overwritten with the obtained third branch output feature map.
19. The method according to claim 11, in, The operation processing graph includes a plurality of branches that share a first input node and a first output node, Each of the plurality of branches receives the first module input feature map, The plurality of branches include a first branch and a second branch, the first branch includes the first operation, the second branch includes the second operation, and Wherein, the method further comprises: Obtaining the first branch output feature map by performing the first operation included in the first branch using a first remaining area of the internal memory, wherein the first remaining area does not include a first area of the internal memory storing the first module input feature map; storing the obtained first branch output feature map in the second area of the internal memory; Obtaining the second branch output feature map by performing the second operation included in the second branch using a second remaining area of the internal memory, wherein the second remaining area does not include the first area and the second area storing the first branch output feature map; and The obtained second branch output feature map is stored in the third area of the internal memory.
20. The method according to claim 11, in, The operation processing diagram includes a first module, and Wherein, the method further comprises: obtaining a storage amount for performing a first operation included in the first module among the plurality of operations; comparing the acquired storage capacity with the free storage capacity of the internal memory; and Based on the comparison between the storage amount and the free storage amount, a usage strategy of the internal memory is established.
21. The method according to claim 11, further comprising: include: Based on the input feature map, obtain an output feature map by performing at least one operation of the plurality of operations; Based on the data amount of the obtained output feature map and the free storage amount of the internal memory, identifying whether to store the obtained output feature map in the internal memory; storing the output feature map in the internal memory based on the output feature map being identified as being to be stored in the internal memory; as well as Based on the output feature map being identified as not being stored in the internal memory, the output feature map is stored in an external memory connected to the operation processor via direct memory access (DMA).
22. A neural network device for processing an operation processing graph, the operation processing graph comprising a plurality of operations, the neural network device include: An internal memory storing a first feature map; as well as At least one processor is configured to implement at least one resource, wherein the at least one resource is configured to: Dividing the operation processing graph into a plurality of modules; Based on the stored first feature map, obtaining a second feature map by performing a first operation of the plurality of operations; storing the obtained second feature map in the internal memory; as well as Based on the stored second feature map, a third feature map is obtained by performing a second operation of the plurality of operations, Each of the multiple modules includes multiple branches. wherein each of the plurality of branches corresponds to a storage area size among a plurality of storage area sizes for processing the plurality of branches, and an operation included in each branch is independent of operations included in other branches of the plurality of branches, wherein the at least one processor is further configured to determine a processing order of the plurality of branches based on a size of a storage area used to process each of the plurality of branches, and The processing order arranges the multiple branches in a manner that the sizes of the multiple storage areas sequentially increase or the sizes of the multiple storage areas sequentially decrease.
23. The neural network device according to claim 22, in, The at least one resource comprises: The first resource is configured as: Based on the stored first feature map, obtaining the second feature map by performing the first operation; and storing the obtained second feature map at a first address of the internal memory; and The second resource is configured to obtain the third feature map by performing the second operation based on the second feature map stored at the first address.
