WO2023163453A1 - Neural network model optimization method to be executed in embedded device, neural network model optimization apparatus, and neural network model optimization system - Google Patents

Neural network model optimization method to be executed in embedded device, neural network model optimization apparatus, and neural network model optimization system Download PDF

Info

Publication number
WO2023163453A1
WO2023163453A1 PCT/KR2023/002279 KR2023002279W WO2023163453A1 WO 2023163453 A1 WO2023163453 A1 WO 2023163453A1 KR 2023002279 W KR2023002279 W KR 2023002279W WO 2023163453 A1 WO2023163453 A1 WO 2023163453A1
Authority
WO
WIPO (PCT)
Prior art keywords
neural network
network model
optimization
information
embedded device
Prior art date
Application number
PCT/KR2023/002279
Other languages
French (fr)
Korean (ko)
Inventor
이현재
김재우
Original Assignee
주식회사 에너자이
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from KR1020220023380A external-priority patent/KR102462001B1/en
Priority claimed from KR1020220023382A external-priority patent/KR102462002B1/en
Application filed by 주식회사 에너자이 filed Critical 주식회사 에너자이
Publication of WO2023163453A1 publication Critical patent/WO2023163453A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/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

Definitions

  • the present application relates to a method for optimizing a neural network model, an apparatus for optimizing a neural network model, and a system for optimizing a neural network model. Specifically, the present application relates to a method, apparatus, and system for optimizing a neural network model to be executed in an embedded device.
  • artificial intelligence technology develops, there is a demand for artificial intelligence technology to be applied to embedded devices with embedded systems used in various industries. Accordingly, lightweight technologies have been developed, and artificial intelligence technology can be applied to embedded devices with low performance and low specifications.
  • artificial intelligence technology can be applied to embedded devices through inference engine technology, which is software developed to efficiently execute pre-learned artificial intelligence models on embedded devices.
  • a conventional embedded AI execution engine adopts a method of reading information about model execution in the embedded device itself, setting a model execution order, and allocating memory necessary for model execution to execute the model.
  • executing the above-described preparation processes for model execution in the embedded device itself which has limitations in memory space, causes a considerable burden on the hardware environment of the embedded device.
  • conventional embedded artificial intelligence execution engines have a problem in that additional manual work is required for optimization of non-standardized hardware requirements.
  • conventional embedded artificial intelligence execution engines have limitations in that engine codes must be manually modified one by one in order to use special instructions of each hardware or to use optimization techniques such as For Loop Unrolling. That is, the conventional embedded artificial intelligence execution engine could be optimized only for specific hardware, and in order to actually use it in hardware other than specific hardware, a process of manually optimizing execution functions was essentially required.
  • One problem to be solved by the present invention is to provide a neural network model optimization method, a neural network model optimization apparatus, and a neural network model optimization system for optimally executing a neural network model in an embedded device in consideration of hardware information of the embedded device.
  • a method for optimizing a neural network model includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. , and at least one of parameters of the neural network model; optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information; optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and transmitting the optimal code information, wherein the optimizing the structure of the neural network model and obtaining instruction information includes generating a directed acyclic graph (DAG) based on the execution data.
  • DAG directed acyclic graph
  • determining an execution order of operations based on the directed acyclic graph detecting a target operation pattern of the directed acyclic graph corresponding to the reference operation pattern based on a predetermined reference operation pattern, and merging a first target operation and a second target operation included in the target operation pattern; obtaining a first memory space map based on the determined execution order, and performing optimization related to memory allocation based on the first memory space map; and generating an instruction related to the memory address based on a result of performing the optimization.
  • An apparatus for optimizing a neural network model includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model.
  • a directed acyclic graph is generated based on the execution data, an execution order of operations is determined based on the directed acyclic graph, and an execution sequence of operations corresponding to the reference operation pattern is determined based on a predetermined reference operation pattern.
  • Detecting a target operation pattern of a directed acyclic graph merging a first target operation and a second target operation included in the target operation pattern, obtaining a first memory space map based on the determined execution order, and 1 It may be configured to obtain the instruction information by performing optimization related to memory allocation based on a memory space map and generating an instruction related to a memory address based on a result of performing the optimization.
  • a method for optimizing a neural network model includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. and at least one of parameters of the neural network model; Optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information, wherein the instruction information includes information related to at least one of a type of operation, an operation value, and a memory address.
  • the obtaining of the optimal code information comprises: acquiring computing environment information of the embedded device; obtaining an optimization parameter from instruction information through an agent trained by reinforcement learning; and generating code information to be used in the embedded device based on the optimization parameter.
  • An apparatus for optimizing a neural network model includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model.
  • Optimization is performed, instruction information, including information related to at least one of a type of operation and a memory address, is obtained, and optimization for an embedded device in which the neural network model is to be driven is performed based on the instruction information. and obtains optimal code information, and is configured to transmit the optimal code information, wherein the processor obtains computing environment information of the embedded device and obtains an optimization parameter from instruction information through an agent trained by reinforcement learning. and to obtain the optimal code information by generating code information to be used in the embedded device based on the optimization parameter.
  • the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to an embodiment of the present application, the non-standardization problem of hardware of an embedded device and the structural limitations of existing artificial intelligence execution engines are solved, and the neural network model It can be optimized for the hardware platform of the embedded device.
  • the execution capability of the neural network model in an embedded device can be improved.
  • the neural network model optimization method the neural network model optimization apparatus, and the neural network model optimization system according to embodiments of the present application, power consumption required to execute a neural network model in an embedded device can be reduced.
  • FIG. 1 is a schematic diagram of a neural network model optimization system according to an embodiment of the present application.
  • FIG. 2 is a flowchart illustrating a method for optimizing a neural network model according to an embodiment of the present application.
  • FIG. 3 is a flowchart specifying steps of optimizing the structure of a neural network model and obtaining instruction information according to an embodiment of the present application.
  • FIG. 4 is a diagram illustrating an aspect of a directed acyclic graph according to an embodiment of the present application.
  • FIG. 5 is a diagram illustrating an aspect of merging a first target operation and a second target operation according to an embodiment of the present application.
  • FIG. 6 is a diagram illustrating one aspect of a first memory space map according to an embodiment of the present application.
  • FIG. 7 is a diagram illustrating an aspect of optimization related to memory allocation according to an embodiment of the present application.
  • FIG. 8 is a flowchart specifying steps of optimizing an embedded device and obtaining optimal code information according to an embodiment of the present application.
  • FIG. 9 is a diagram illustrating an aspect of training an agent through a reinforcement learning method according to an embodiment of the present application.
  • a method for optimizing a neural network model includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. , and at least one of parameters of the neural network model; optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information; optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and transmitting the optimal code information, wherein the optimizing the structure of the neural network model and obtaining instruction information includes generating a directed acyclic graph (DAG) based on the execution data.
  • DAG directed acyclic graph
  • determining an execution order of operations based on the directed acyclic graph detecting a target operation pattern of the directed acyclic graph corresponding to the reference operation pattern based on a predetermined reference operation pattern, and merging a first target operation and a second target operation included in the target operation pattern; obtaining a first memory space map based on the determined execution order, and performing optimization related to memory allocation based on the first memory space map; and generating an instruction related to the memory address based on a result of performing the optimization.
  • the merging of the first target operation and the second target operation may include obtaining predetermined reference operation pattern information—the reference operation pattern information includes the first operation and the first operation pattern. includes a second operation associated with the operation; detecting the first target operation corresponding to the first operation and the second target operation corresponding to the second operation from the directed acyclic graph based on the reference operation pattern information; and merging the first target operation and the second target operation, and transforming a kernel based on a result of the merging.
  • the performing of optimization related to memory allocation may include generating the first memory space map based on the determined execution order and the size of data output through the operation; changing a first memory tensor storing a value input through a third target operation into a second memory tensor storing a value output through the third target operation; and generating a second memory space map from the first memory space map based on the change result.
  • the determining of the execution order of the operations may include a first memory space required for a fourth target operation included in a first branch of the directed acyclic graph and the directional ratio. calculating a second memory space required for a fifth target operation included in a second branch of the cycle graph; comparing the first memory space and the second memory space; and determining an execution order of the fourth target operation and the fifth target operation according to the comparison result.
  • the execution order of the fourth target operation when the first memory space is larger than the second memory space, the execution order of the fourth target operation is assigned a lower priority than the execution order of the fifth target operation, and the first When the memory space is smaller than the second memory space, the execution order of the fourth target operation may be assigned a priority over the execution order of the fifth target operation.
  • the optimizing the structure of the neural network model and acquiring instruction information may include acquiring input data and output data related to an operation of the neural network model; and adjusting the input data and the output data to values corresponding to a predetermined integer range.
  • a computer-readable recording medium recording a program for executing the neural network model optimization method may be provided.
  • An apparatus for optimizing a neural network model includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model.
  • a directed acyclic graph is generated based on the execution data, an execution order of operations is determined based on the directed acyclic graph, and an execution sequence of operations corresponding to the reference operation pattern is determined based on a predetermined reference operation pattern.
  • Detecting a target operation pattern of a directed acyclic graph merging a first target operation and a second target operation included in the target operation pattern, obtaining a first memory space map based on the determined execution order, and 1 It may be configured to obtain the instruction information by performing optimization related to memory allocation based on a memory space map and generating an instruction related to a memory address based on a result of performing the optimization.
  • a method for optimizing a neural network model includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. and at least one of parameters of the neural network model; Optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information, wherein the instruction information includes information related to at least one of a type of operation, an operation value, and a memory address.
  • the obtaining of the optimal code information comprises: acquiring computing environment information of the embedded device; obtaining an optimization parameter from instruction information through an agent trained by reinforcement learning; and generating code information to be used in the embedded device based on the optimization parameter.
  • the obtaining of the optimization parameter may include inputting at least one of at least one operation type information corresponding to the operation, memory state information, and computing environment information of the embedded device to the agent. doing; and obtaining an optimization parameter output through the agent.
  • the optimization parameter may be related to at least one of a parameter for selecting an algorithm type to be performed for the operation, a parameter related to a block size of the operation, and a parameter related to a code length. there is.
  • the agent according to an initial rule, is based on target device information related to a computing environment of a target embedded device, memory state information, and at least one algorithm type information corresponding to an operation.
  • the agent may be trained by updating the initial rule so that an evaluation value for the performance of a code generated through the predicted value is maximized.
  • generating code information to be used in the embedded device may include generating codes to correspond to the instruction information based on the optimization parameter; and compiling the generated code and converting it into a binary file format.
  • a computer-readable recording medium recording a program for executing the neural network model optimization method may be provided.
  • An apparatus for optimizing a neural network model includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model.
  • Optimization is performed, instruction information, including information related to at least one of a type of operation and a memory address, is obtained, and optimization for an embedded device in which the neural network model is to be driven is performed based on the instruction information. and obtains optimal code information, and is configured to transmit the optimal code information, wherein the processor obtains computing environment information of the embedded device and obtains an optimization parameter from instruction information through an agent trained by reinforcement learning. and to obtain the optimal code information by generating code information to be used in the embedded device based on the optimization parameter.
  • FIG. 1 is a schematic diagram of a neural network model optimization system according to an embodiment of the present application.
  • the neural network model optimization system 10 may include the embedded device 100 and the neural network model optimization device 1000 (or server).
  • the embedded device 100 may mean a device including a programmable arbitrary embedded system made for a specific purpose (or specific function).
  • the embedded device 100 may include hardware including a processor and/or memory.
  • the embedded device 100 may include firmware for controlling hardware.
  • the embedded device 100 may be configured to execute an arbitrary artificial intelligence model by inputting arbitrary software to firmware, including an artificial intelligence execution engine.
  • the artificial intelligence execution engine is software for maximally and efficiently executing a pre-learned neural network model on the embedded device 100, and is a technology aimed at actual use of artificial intelligence and improves efficiency in the environment of the device to be mounted. height function.
  • an execution engine may be implemented in accordance with the specifications of a slow operation speed and low power consumption, which are computing environments of the mobile device.
  • an execution engine may be implemented to maximize high-performance parallel processing capability.
  • the embedded device 100 obtains optimal code information optimized for the computing environment of the embedded device 100 from the neural network model optimization device 1000, and adds (or inputs) the optimal code information to the firmware. )can do.
  • optimal code information can be generated by analyzing the internal structure of the neural network model.
  • the optimal code information may be generated in consideration of a computing environment including memory specifications and/or processor specifications of the embedded device 100 .
  • the embedded device 100 may add optimal code information generated by the neural network model optimization apparatus 1000 to firmware and execute the neural network model.
  • the neural network model optimization apparatus 1000 is configured so that a neural network model trained in any device (or server) other than the embedded device 100 can be optimally executed in the computing environment of the embedded device 100. , optimization of the computational structure and/or memory allocation of the neural network model may be performed. In addition, the apparatus 1000 for optimizing the neural network model according to an embodiment of the present application may automatically generate optimal code for optimally executing the neural network model in the computing environment of the embedded device 100 .
  • An apparatus 1000 for optimizing a neural network model may include a transceiver 1100, a memory 1200, and a processor 1300.
  • the transceiver 1100 of the neural network model optimization apparatus 1000 may communicate with any external device including the embedded device 100 .
  • the neural network model optimization apparatus 1000 may transmit optimal code information obtained by performing optimization to the embedded device 100 through the transceiver 1100 .
  • the neural network model optimization apparatus 1000 may receive computing environment information of the embedded device 100 from the embedded device 100 or any external device through the transceiver 1100 .
  • the neural network model optimization apparatus 1000 may receive a trained neural network model and/or execution data for executing the neural network model through the transceiver 1100 .
  • the apparatus 1000 for optimizing a neural network model may transmit and receive various types of data by accessing a network through the transceiver 1100 .
  • the transceiver may largely include a wired type and a wireless type. Since the wired type and the wireless type each have advantages and disadvantages, the wired type and the wireless type may be simultaneously provided in the apparatus 1000 for optimizing a neural network model in some cases.
  • a wireless local area network (WLAN)-based communication method such as Wi-Fi may be mainly used.
  • a cellular communication eg, LTE, 5G-based communication method may be used.
  • the wireless communication protocol is not limited to the above example, and any suitable wireless type communication method may be used.
  • LAN Local Area Network
  • USB Universal Serial Bus
  • the memory 1200 of the neural network model optimization apparatus 1000 may store various kinds of information. Various types of data may be temporarily or semi-permanently stored in the memory 1200 . Examples of the memory may include a hard disk drive (HDD), a solid state drive (SSD), flash memory, read-only memory (ROM), and random access memory (RAM). there is.
  • the memory 1200 may be provided in a form embedded in the neural network model optimization apparatus 1000 or in a detachable form.
  • the memory 1200 includes an operating system (OS) for driving the neural network model optimization device 1000 or a program for operating each component of the neural network model optimization device 1000, as well as the components of the neural network model optimization device 1000.
  • OS operating system
  • Various data required for operation may be stored.
  • the processor 1300 may control overall operations of the neural network model optimization apparatus 1000 .
  • the processor 1300 may perform an operation of acquiring execution data of a neural network model for which learning has been completed, an operation of optimizing the structure of the neural network model, an operation of performing optimization of an embedded device, and an operation of performing optimization result.
  • Overall operations of the neural network model optimization apparatus 1000 such as obtaining optimal code information and/or transmitting optimal code information, may be controlled.
  • the processor 1300 may load and execute a program for overall operation of the neural network model optimization apparatus 1000 from the memory 1200 .
  • the processor 1300 may be implemented as an application processor (AP), a central processing unit (CPU), a microcontroller unit (MCU), or a similar device according to hardware, software, or a combination thereof.
  • AP application processor
  • CPU central processing unit
  • MCU microcontroller unit
  • FIG. 2 is a flowchart illustrating a method for optimizing a neural network model according to an embodiment of the present application.
  • a method for optimizing a neural network model includes obtaining execution data of a trained neural network model (S1000), optimizing the structure of the neural network model and obtaining instruction information (S2000), Optimizing the embedded device and obtaining optimal code information (S3000) and transmitting the optimal code information (S4000) may be further included.
  • the apparatus 1000 for optimizing the neural network model may obtain execution data of the learned neural network model through the transceiver 1100 .
  • the execution data is any data necessary to execute the neural network model, including layer data of the neural network model, operation data constituting the neural network model, and/or arbitrary weights (or parameters) related to the neural network model. It may mean covering the appropriate data of.
  • the neural network model optimization apparatus 1000 optimizes the structure of the neural network model based on the execution data of the neural network model, for example, the structure of the neural network model. Lightening can be performed for .
  • the neural network model optimization apparatus 1000 may be configured to perform an operation of detecting an operation pattern included in an operation structure of a neural network model and merging target operations included in the operation pattern.
  • the neural network model optimization apparatus 1000 may determine an execution order of operations of the neural network model, and perform memory allocation-related optimization based on the determined execution order.
  • the neural network model optimization apparatus 1000 may obtain instruction information according to the optimization result.
  • the instruction information may include instructions for types of operations of the neural network model and/or instructions for a memory address related to each operation of the neural network model. Step S2000 will be described in more detail in FIGS. 3 to 7 .
  • the neural network model optimization apparatus 1000 is a code for optimally executing the trained neural network model in the computing environment of the embedded device 100.
  • the apparatus 1000 for optimizing the neural network model obtains optimization parameters based on the instruction information and embedded device information acquired in step S2000 through an agent trained with a reinforcement learning technique, and the embedded device 100 based on the optimization parameters. It can be implemented to generate optimal code information to be used in Step S3000 will be described in more detail in FIGS. 8 to 9 .
  • the neural network model optimization apparatus 1000 transmits the obtained optimal code information through the transceiver 1100 to any external device (or external device including the embedded device 100). server).
  • FIG. 3 is a flowchart specifying steps of optimizing the structure of a neural network model and obtaining instruction information according to an embodiment of the present application.
  • step of optimizing the structure of the neural network model and obtaining instruction information (S2000) according to an embodiment of the present application, generating a directed acyclic graph (DAG) based on execution data ( S2100), determining an execution order of operations based on the DAG (S2200), detecting a target operation pattern of the DAG corresponding to a predetermined reference operation pattern, and including a first target operation and a second target included in the target operation pattern merging operations (S2300), obtaining a first memory space map based on the determined execution order, and performing optimization related to memory allocation based on the first memory space map (S2400); Based on this, a step of generating an instruction related to the memory address (S2500) may be further included.
  • DAG directed acyclic graph
  • the neural network model optimization apparatus 1000 performs the execution data of the neural network model (eg, layer data of the neural network model, the neural network model).
  • a DAG may be generated based on operation data constituting , and/or parameters of a neural network model, etc.). DAG may refer to any infinite directed graph without directed cycles.
  • FIG. 4 is a diagram illustrating one aspect of a DAG according to an embodiment of the present application.
  • the DAG may include information related to a data dependency relationship of each function constituting the neural network model, for example, a connection relationship between each function.
  • the DAG is information related to a connection relationship related to a first branch structure including a second operation (eg, B) connected to a first operation (eg, A) and a third operation (eg, C) connected to the second operation.
  • the DAG is information related to a connection relationship related to a second branch structure including a fourth operation (eg, D) connected to a first operation (eg, A) and a fifth operation (eg, E) connected to the fourth operation.
  • the DAG may include information related to a connection relationship related to the third operation and the sixth operation (eg, F) connected to the fifth operation.
  • FIG. 4 is only an example for convenience of description of the DAG, and is not construed as being limited thereto.
  • the neural network model optimization apparatus 1000 may determine the execution order of one or more operations constituting the neural network model using the DAG.
  • Any suitable rules may be used to determine the order of execution.
  • the neural network model optimization apparatus 1000 may determine an execution order of DAG operations based on a memory space required for operations constituting the neural network model.
  • the apparatus 1000 for optimizing the neural network model provides a first memory space required for an operation included in a first branch of the DAG (eg, B in FIG. 4 ) and an operation included in a second branch of the DAG (eg, in FIG. 4 ).
  • the second memory space required for D) is calculated, the first memory space and the second memory space are compared, and the operation included in the first branch (eg, B in FIG. 4) and the second branch are performed based on the comparison result. It is possible to determine an execution order between operations included in (eg, D in FIG. 4 ).
  • the neural network model optimization apparatus 1000 changes the execution order of the operation included in the first branch (eg, B in FIG. 4 ) to the operation included in the second branch ( For example, it may be assigned in a lower order than the execution order of D) of FIG. 4 .
  • the neural network model optimization apparatus 1000 changes the execution order of the operation included in the first branch (eg, B in FIG. 4 ) to the operation included in the second branch (eg, B in FIG. 4 ). , can be assigned in priority order of execution of D) of FIG. 4 .
  • the apparatus 1000 for optimizing the neural network model may determine the execution order of operations constituting the neural network model in consideration of the branch structure of the DAG. For example, sequentially executing operations included in the same branch may be more advantageous in terms of memory space than executing operations included in a first branch and executing operations included in a second branch. Therefore, the neural network model optimization apparatus 1000 sequentially executes the operations included in the first branch (eg, B and C in FIG. 4 ), and then performs the operations included in the second branch (eg, B and C in FIG. 4 ). The order of execution can be determined to execute D and E). Alternatively, the neural network model optimization apparatus 1000 executes operations included in the second branch (eg, D and E in FIG. 4 ) and performs operations included in the first branch (eg, B and C in FIG. 4 ). You can decide the execution order to execute.
  • the first branch eg, B and C in FIG. 4
  • the neural network model optimization apparatus 1000 executes operations included in the second branch (eg, D and E in FIG. 4
  • the neural network model optimization apparatus 1000 In the step of detecting the target operation pattern of the DAG corresponding to the predetermined reference operation pattern and merging the first target operation and the second target operation included in the target operation pattern (S2300), the neural network model optimization apparatus 1000, A predetermined reference operation pattern may be obtained, and a target operation pattern of the DAG corresponding to the reference operation pattern may be detected. In addition, in the step of detecting the target operation pattern of the DAG corresponding to the predetermined reference operation pattern and merging the first target operation and the second target operation included in the target operation pattern (S2300), the neural network model optimization apparatus 1000 may be implemented to perform an operation of merging operations included in the detected target operation pattern.
  • the step of merging the first target operation and the second target operation includes predetermined reference operation pattern information-reference operation pattern information is a first operation and a second operation associated with the first operation. Detecting a first target operation corresponding to the first operation and a second target operation corresponding to the second operation from the DAG based on the reference operation pattern information, and the first target operation The method may further include merging the first target operation and the second target operation, and converting a kernel based on a result of the merging.
  • FIG. 5 is a diagram illustrating an aspect of merging a first target operation and a second target operation according to an embodiment of the present application.
  • the neural network model optimization apparatus 1000 obtains the predetermined reference operation pattern information.
  • the reference calculation pattern information is information related to a commonly used calculation pattern, and may be set in advance.
  • the reference operation pattern information may be related to an operation pattern including a first operation (eg, convolution) and a second operation connected to the first operation (eg, Rectified Linear Unit (ReLu)).
  • a first operation eg, convolution
  • a second operation connected to the first operation eg, Rectified Linear Unit (ReLu)
  • the reference operation pattern information may be related to an operation pattern in which a convolution operation is performed, and a depthwise convolution operation and an activation operation are sequentially performed.
  • the reference operation pattern information obtains an intermediate result value by performing a depthwise convolution operation for compressing data for each channel by applying a filter for each channel related to the color of the image, and based on the intermediate result value It may include an operation pattern that performs a pointwise operation.
  • the neural network model optimization apparatus 1000 uses the reference operation pattern information.
  • a first target operation eg, the first target operation in FIG. 5
  • a second target operation eg, ReLu
  • an arbitrary pattern matching algorithm may be used to detect the target operation pattern.
  • the neural network model optimization apparatus 1000 performs the first target operation (eg, convolution in FIG. 5 ) and the second target operation. (eg, ReLu in FIG. 5 ) and convert kernels included in the target operation pattern into a single kernel (eg, Convolution + ReLu kernel) based on the merge result.
  • the first target operation eg, convolution in FIG. 5
  • the second target operation e.g, ReLu in FIG. 5
  • convert kernels included in the target operation pattern into a single kernel eg, Convolution + ReLu kernel
  • the neural network model optimization apparatus 1000 performs input data and/or output data of calculation constituting the neural network model. It is possible to perform purification on .
  • the neural network model optimization apparatus 1000 may convert input data and/or output data of a decimal type operation into an integer within a specific range by using a quantization technique.
  • quantization is a technique of converting a 32-bit decimal point (float) value into an 8-bit integer (int).
  • the neural network model optimization apparatus 1000 calculates a scale and a zero point for each data tensor for an operation constituting a neural network model, and converts a 32-bit decimal point value into an 8-bit integer value (int8Value) having a relatively small capacity can be converted to
  • the neural network model optimization apparatus 1000 may be configured to convert or adjust a 32-bit decimal point value into an 8-bit integer value through the following equation.
  • the aforementioned 8-bit integer quantization is just one example, and the neural network model optimization apparatus 1000 converts or adjusts an arbitrary decimal point value to 0 or 8-bit natural number value in addition to the 8-bit integer to fit the structure of the neural network model. It can be implemented to perform optimization for
  • a first memory space map is obtained based on the determined execution order, , performing optimization related to memory allocation based on the first memory space map (S2400).
  • FIG. 6 is a diagram illustrating one aspect of a first memory space map according to an embodiment of the present application.
  • the neural network model optimization apparatus 1000 determines the determined in step S2200.
  • a first memory space map may be generated based on an execution order and a memory space required for each operation. Specifically, according to the rule described above with reference to FIG. 4 , the execution order of operations constituting the neural network model (eg, the order of A, B, C, D, E, and F in FIG. 6 ) may be determined. In this case, the neural network model optimization apparatus 1000 may generate a first memory space map based on a memory space related to the size of data output through each operation.
  • the neural network model optimization apparatus 1000 considers the memory space required for data output through operation A and the execution order of operations (eg, operation B and operation D) requiring data output through operation A, and operation A You can place a memory tensor (eg, T1) associated with
  • the neural network model optimization apparatus 1000 considers a memory space required for data output through operation B and an execution order of operations (eg, operation C) requiring data output through operation B, and performs a memory space related to operation B.
  • a tensor e.g., T2 can be placed.
  • the T2 memory tensor in which data output through operation B is stored may be disposed adjacent to the T1 memory tensor related to operation A that stores data necessary for operation B.
  • the neural network model optimization apparatus 1000 considers the memory space related to the size of data output through operations constituting the neural network model (eg, operations C, D, E, etc.) and the execution order of operations in the first memory. You can create spatial maps.
  • the operation of arranging the memory tensor of the neural network model optimization apparatus 1000 centering on the first memory space map shown in FIG. 6 has been described.
  • the first memory space map shown in FIG. 6 is only an example for convenience of explanation, and should not be construed as being limited thereto.
  • FIG. 7 is a diagram illustrating an aspect of optimization related to memory allocation according to an embodiment of the present application.
  • the neural network model optimization apparatus 1000 configures the neural network model.
  • a first memory space map generated based on an execution order of operations and a memory space related to a size of data output through the operations may be obtained.
  • the neural network model optimization apparatus 1000 may perform memory allocation-related optimization based on the first memory space map.
  • the neural network model optimization apparatus 1000 uses a memory in-placing technique to assign an output space of a specific operation (eg, a ReLu operation, an Add operation, and/or a Sigmoid operation) to a corresponding You can perform an operation to overwrite the input space of an operation.
  • the neural network model optimization apparatus 1000 utilizes a memory in-placement technique to store a value input to a specific operation (eg, the third target operation (operation C) in FIG. 7). It can be implemented to change the T2 memory tensor of 7) to a memory tensor (eg, the T3 memory tensor of FIG.
  • the apparatus 1000 for optimizing the neural network model may generate a second memory space map from the first memory space map based on a change result of the memory tensor.
  • the second memory space map occupies a relatively smaller memory space than the first memory space map. Therefore, according to the neural network model optimization method according to an embodiment of the present application through this operation, the total required memory space can be reduced and the execution speed of operations can be increased.
  • the neural network model optimization apparatus 1000 is based on the optimization result related to merging of target operations included in the above-described target operation pattern or memory allocation.
  • an instruction related to a memory address of a memory tensor corresponding to each operation constituting the neural network model and/or an instruction related to the type of each operation constituting the neural network model may be generated.
  • the method for optimizing a neural network model may include optimizing an embedded device and obtaining optimal code information (S3000).
  • optimization of a neural network model for an embedded device will be described in more detail. According to an embodiment of the present application, it may be implemented to perform optimization of a neural network model for an embedded device using a reinforcement learning technique.
  • FIG. 8 is a flowchart specifying steps of optimizing an embedded device and obtaining optimal code information according to an embodiment of the present application.
  • Optimizing the embedded device and obtaining optimal code information includes acquiring computing environment information of the embedded device (S3100), through an agent trained through reinforcement learning. The method may further include obtaining an optimization parameter based on the instruction information (S3200) and generating optimal code information to be used in the embedded device based on the optimization parameter (S3300).
  • the neural network model optimization apparatus 1000 In the step of obtaining computing environment information of the embedded device (S3100), the neural network model optimization apparatus 1000, through the transceiver 1100, the neural network model optimization apparatus 1000, the embedded device 100 or any external Computing environment information (eg, memory information and processor information of the embedded device 100) of the embedded device 100, which is a target device on which the neural network model will be executed, may be obtained from the device.
  • the neural network model optimization apparatus 1000 includes the embedded device (such as device type information or target function information of the embedded device 100) ( In 100), it is possible to obtain arbitrary information about variables affecting the execution of the neural network model.
  • the neural network model optimization apparatus 1000 In the step of obtaining optimization parameters based on instruction information through an agent trained by reinforcement learning (S3200), the neural network model optimization apparatus 1000 generates an optimal code using an agent trained using a reinforcement learning technique. Optimization parameters can be obtained for
  • the neural network model optimization apparatus 1000 includes memory state information, operation type information included in the instruction information, and embedded device ( At least one of embedded device information including computing environment information of 100) may be input to the agent, and an optimization parameter output through the agent may be acquired.
  • the optimization parameter is any parameter related to the code necessary to execute the neural network model, including a parameter for selecting the type of algorithm to be performed for the operation, a parameter related to the block size of the operation, and/or a parameter related to the length of the code. Variables can be related.
  • the operation type input to the agent is convolution.
  • the trained agent may output a parameter for selecting at least one algorithm from among convolution-related algorithms, for example, the Im2Col algorithm, the default algorithm, and the FFT algorithm, based on the input value.
  • the agent may output a parameter related to the block size of an operation and/or a parameter related to a code length based on an input value.
  • the apparatus 1000 for optimizing the neural network model may obtain the optimization parameters output through the agent.
  • FIG. 9 is a diagram illustrating an aspect of training an agent through a reinforcement learning method according to an embodiment of the present application.
  • the neural network model optimization apparatus 1000 may acquire optimization parameters through an agent learned through 'reinforcement learning'.
  • the agent receives operation type information, memory state information, and embedded device information (or target device information) based on an initial rule (policy) and optimizes parameters (eg, parameters for selecting an algorithm type, blocks of operations) parameters related to the size, and/or parameters related to the length of the code, etc.).
  • the code generator may obtain optimization parameters and generate codes based on the optimization parameters.
  • execution and evaluation of the performance of the generated code are performed, and based on the evaluation result, an initial rule of the agent may be updated to maximize the evaluation value of the code performance (ie, to maximize the performance of the code). .
  • the initial rule of the agent may be learned to be updated so as to output an optimization parameter that maximizes the evaluation value of the performance of the code.
  • the trained agent may receive operation type information, memory state information, and/or embedded device information and output optimization parameters capable of generating code with maximized performance.
  • the neural network model optimization apparatus 1000 selects the type of algorithm to be performed for the optimization parameter (eg, operation) generated in step S3200.
  • Optimal code information to be used in the embedded device 100 may be generated based on a parameter related to a block size of an operation, a parameter related to a block size of an operation, and/or a parameter related to a code length.
  • the neural network model optimization apparatus 1000 may generate an optimal code based on an optimization parameter and a memory address of a corresponding operation through a code generator.
  • the optimization parameter is a parameter for selecting at least one algorithm (eg, Im2Col algorithm) from among the Im2Col algorithm, the Default algorithm, and the FFT algorithm, a parameter related to a block size value of an operation, and/or a parameter related to a code length value.
  • the neural network model optimization apparatus 1000 may generate an optimal code through a code generator based on the optimization parameter and the memory address of the operation included in the instruction information.
  • generating optimal code information to be used in an embedded device based on an optimization parameter includes code corresponding to instruction information based on the optimization parameter.
  • the step of generating, compiling the generated code and converting it into a binary file form may be further included.
  • the neural network model optimization apparatus 1000 may generate code (eg, C language code) based on the optimization parameter and store the generated code in a memory address included in instruction information.
  • the apparatus 1000 for optimizing the neural network model may compile and convert the generated code into a binary file (eg, an API file).
  • the neural network model optimization apparatus 1000 may transmit the binary file of the generated code to the embedded device 100 or an arbitrary external device through the transceiver 1100 .
  • the optimal code is transmitted to the embedded device 100 in the form of a binary file (eg, an API file), so that the user of the embedded device 100 can visually check the optimal code.
  • the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to an embodiment of the present application, the non-standardization problem of hardware of an embedded device and the structural limitations of existing artificial intelligence execution engines are solved, and the neural network model It can be optimized for the hardware platform of the embedded device.
  • the execution capability of the neural network model in an embedded device can be improved.
  • the neural network model optimization method the neural network model optimization apparatus, and the neural network model optimization system according to embodiments of the present application, power consumption required to execute a neural network model in an embedded device can be reduced.
  • Various operations of the neural network model optimization apparatus 1000 described above may be stored in the memory 1200 of the neural network model optimization apparatus 1000, and the processor 1300 of the neural network model optimization apparatus 1000 may be stored in the memory 1200. Can be provided to perform actions.
  • the neural network model optimization method, the neural network model optimization device, and the neural network model optimization system disclosed in this application provide an efficient method of artificial intelligence models in various embedded systems, including home appliances, vehicle sensors, products for the safety of infants or the elderly, and smart watches. can be used for execution.

Abstract

A neural network model optimization method according to an embodiment of the present application comprises the steps of: obtaining execution data of a neural network model that has completed training, wherein the execution data includes at least one of layer data of the neural network model, operation data constituting the neural network model, and a parameter of the neural network model; on the basis of the execution data of the neural network model, optimizing the structure of the neural network model and obtaining instruction information; on the basis of the instruction information, optimizing an embedded device in which the neural network model is to be run and obtaining optimal code information; and transmitting the optimal code information.

Description

임베디드 장치에서 실행될 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템A method for optimizing a neural network model to be executed in an embedded device, a device for optimizing a neural network model, and a system for optimizing a neural network model
본 출원은 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 관한 것이다. 구체적으로 본 출원은 임베디드 장치에서 실행될 신경망 모델을 최적화하는 방법, 장치, 및 시스템에 관한 것이다. The present application relates to a method for optimizing a neural network model, an apparatus for optimizing a neural network model, and a system for optimizing a neural network model. Specifically, the present application relates to a method, apparatus, and system for optimizing a neural network model to be executed in an embedded device.
인공지능 기술이 발전하면서 다양한 산업 분야에서 활용되는 임베디드 시스템이 내재된 임베디드 장치에 인공지능 기술이 접목되는 것이 요구되고 있다. 이에 따라 경량화 기술들이 개발되었고 저성능, 저사양인 임베디드 장치들에 인공지능 기술이 접목될 수 있게 되었다. 특히, 미리 학습이 완료된 인공지능 모델을 임베디드 장치에 최대한 효율적으로 실행시키도록 개발된 소프트웨어인 실행 엔진(Inference Engine) 기술을 통하여 임베디드 장치에 인공지능 기술이 접목될 수 있게 되었다.As artificial intelligence technology develops, there is a demand for artificial intelligence technology to be applied to embedded devices with embedded systems used in various industries. Accordingly, lightweight technologies have been developed, and artificial intelligence technology can be applied to embedded devices with low performance and low specifications. In particular, artificial intelligence technology can be applied to embedded devices through inference engine technology, which is software developed to efficiently execute pre-learned artificial intelligence models on embedded devices.
종래의 임베디드용 인공지능 실행 엔진은 임베디드 장치 자체에서 모델의 실행에 대한 정보를 읽고, 모델 실행 순서를 설정하고, 모델 실행에 필요한 메모리를 할당하여 모델을 실행하는 방식을 채택하고 있었다. 다만, 메모리 공간에 제약이 존재하는 임베디드 장치 자체에서 전술한 모델 실행을 위한 준비 과정들을 실행하는 것은 임베디드 장치의 하드웨어 환경에 상당한 부담을 야기하였다.A conventional embedded AI execution engine adopts a method of reading information about model execution in the embedded device itself, setting a model execution order, and allocating memory necessary for model execution to execute the model. However, executing the above-described preparation processes for model execution in the embedded device itself, which has limitations in memory space, causes a considerable burden on the hardware environment of the embedded device.
또한, 종래의 임베디드용 인공지능 실행 엔진은 비표준화된 하드웨어 요구사항에 대한 최적화를 위하여는 추가적인 수작업이 요구된다는 문제가 존재하였다. 구체적으로 종래의 임베디드용 인공지능 실행 엔진은, 각 하드웨어의 특수 명령어를 이용하거나, For Loop Unrolling 등의 최적화 기술을 이용하기 위하여 엔진 코드를 일일이 수작업으로 수정해야 하는 제약이 존재였다. 즉 종래의 임베디드용 인공지능 실행 엔진은 특정 하드웨어에만 최적화될 수 있었으며, 특정 하드웨어 이외의 하드웨어에서 실제로 사용하기 위하여는 수작업으로 실행 함수들을 최적화하는 과정이 필수적으로 요구되었다. In addition, conventional embedded artificial intelligence execution engines have a problem in that additional manual work is required for optimization of non-standardized hardware requirements. Specifically, conventional embedded artificial intelligence execution engines have limitations in that engine codes must be manually modified one by one in order to use special instructions of each hardware or to use optimization techniques such as For Loop Unrolling. That is, the conventional embedded artificial intelligence execution engine could be optimized only for specific hardware, and in order to actually use it in hardware other than specific hardware, a process of manually optimizing execution functions was essentially required.
이에, 인공지능 모델 및 임베디드 장치의 하드웨어 정보(컴퓨팅 사양)에 기초하여 신경망 모델을 임베디드 장치에서 최적으로 실행하기 위한 신경망 모델 최적화 방법, 장치 및 시스템의 개발이 요구된다.Accordingly, it is required to develop a neural network model optimization method, device, and system for optimally executing a neural network model in an embedded device based on an artificial intelligence model and hardware information (computing specifications) of the embedded device.
본 발명이 해결하고자 하는 일 과제는, 임베디드 장치의 하드웨어 정보를 고려하여 신경망 모델을 임베디드 장치에서 최적으로 실행하기 위한 신경망 모델 최적화 방법, 신경망 모델 최적화 장치 및 신경망 모델 최적화 시스템을 제공하는 것이다. One problem to be solved by the present invention is to provide a neural network model optimization method, a neural network model optimization apparatus, and a neural network model optimization system for optimally executing a neural network model in an embedded device in consideration of hardware information of the embedded device.
본 발명이 해결하고자 하는 과제가 상술한 과제로 제한되는 것은 아니며, 언급되지 아니한 과제들은 본 명세서 및 첨부된 도면으로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The problem to be solved by the present invention is not limited to the above-mentioned problems, and problems not mentioned will be clearly understood by those skilled in the art from this specification and the accompanying drawings. .
본 출원의 일 실시예에 따른 신경망 모델 최적화 방법은, 학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-; 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계; 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계; 및 상기 최적 코드 정보를 송신하는 단계;를 포함하되, 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계는, 상기 실행 데이터에 기초하여 방향성 비사이클 그래프(DAG)를 생성하는 단계; 상기 방향성 비사이클 그래프에 기초하여 연산들의 실행 순서를 결정하는 단계; 미리 정해진 기준 연산 패턴에 기초하여 상기 기준 연산 패턴에 대응되는 상기 방향성 비사이클 그래프의 대상 연산 패턴을 검출하고, 상기 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하는 단계; 상기 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 상기 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하는 단계; 및 최적화 수행 결과에 기초하여 메모리 주소와 관련된 인스트럭션을 생성하는 단계;를 더 포함할 수 있다. A method for optimizing a neural network model according to an embodiment of the present application includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. , and at least one of parameters of the neural network model; optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information; optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and transmitting the optimal code information, wherein the optimizing the structure of the neural network model and obtaining instruction information includes generating a directed acyclic graph (DAG) based on the execution data. ; determining an execution order of operations based on the directed acyclic graph; detecting a target operation pattern of the directed acyclic graph corresponding to the reference operation pattern based on a predetermined reference operation pattern, and merging a first target operation and a second target operation included in the target operation pattern; obtaining a first memory space map based on the determined execution order, and performing optimization related to memory allocation based on the first memory space map; and generating an instruction related to the memory address based on a result of performing the optimization.
본 출원의 일 실시예에 따른 신경망 모델 최적화 장치는, 학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 송수신부; 및 상기 실행 데이터 및 상기 임베디드 장치의 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델에 대한 최적화를 수행하는 프로세서;를 포함하되, 상기 프로세서는, 학습이 완료된 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-를 획득하고, 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하고, 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 송신하도록 구성되되, 상기 프로세서는, 상기 실행 데이터에 기초하여 방향성 비사이클 그래프(DAG)를 생성하고, 상기 방향성 비사이클 그래프에 기초하여 연산들의 실행 순서를 결정하고, 미리 정해진 기준 연산 패턴에 기초하여 상기 기준 연산 패턴에 대응되는 상기 방향성 비사이클 그래프의 대상 연산 패턴을 검출하고, 상기 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하고, 상기 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 상기 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하고, 최적화 수행 결과에 기초하여 메모리 주소와 관련된 인스트럭션을 생성함으로써, 상기 인스트럭션 정보를 획득하도록 구성될 수 있다. An apparatus for optimizing a neural network model according to an embodiment of the present application includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model. Obtaining at least one of layer data of, operation data constituting the neural network model, and parameters of the neural network model, and determining the structure of the neural network model based on the execution data of the neural network model. Perform optimization and obtain instruction information, perform optimization for an embedded device in which the neural network model is to be driven based on the instruction information, obtain optimal code information, and transmit the optimal code information, wherein the processor , A directed acyclic graph (DAG) is generated based on the execution data, an execution order of operations is determined based on the directed acyclic graph, and an execution sequence of operations corresponding to the reference operation pattern is determined based on a predetermined reference operation pattern. Detecting a target operation pattern of a directed acyclic graph, merging a first target operation and a second target operation included in the target operation pattern, obtaining a first memory space map based on the determined execution order, and 1 It may be configured to obtain the instruction information by performing optimization related to memory allocation based on a memory space map and generating an instruction related to a memory address based on a result of performing the optimization.
본 출원의 일 실시예에 따른 신경망 모델 최적화 방법은, 학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data) 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-; 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계-상기 인스트럭션 정보는 연산의 유형, 연산의 및 메모리 주소 중 적어도 하나와 관련된 정보를 포함함-; 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계; 및 상기 최적 코드 정보를 송신하는 단계;를 포함하되, 상기 최적 코드 정보를 획득하는 단계는, 상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계; 강화 학습으로 훈련된 에이전트를 통하여, 인스트럭션 정보로부터 최적화 파라미터를 획득하는 단계; 및 상기 최적화 파라미터에 기초하여 상기 임베디드 장치에서 이용될 코드 정보를 생성하는 단계;를 더 포함할 수 있다. A method for optimizing a neural network model according to an embodiment of the present application includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. and at least one of parameters of the neural network model; Optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information, wherein the instruction information includes information related to at least one of a type of operation, an operation value, and a memory address. ; optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and transmitting the optimal code information, wherein the obtaining of the optimal code information comprises: acquiring computing environment information of the embedded device; obtaining an optimization parameter from instruction information through an agent trained by reinforcement learning; and generating code information to be used in the embedded device based on the optimization parameter.
본 출원의 일 실시예에 따른 신경망 모델 최적화 장치는, 학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 송수신부; 및 상기 실행 데이터 및 상기 임베디드 장치의 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델에 대한 최적화를 수행하는 프로세서;를 포함하되, 상기 프로세서는, 학습이 완료된 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-를 획득하고, 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보-상기 인스트럭션 정보는 연산의 유형, 및 메모리 주소 중 적어도 하나와 관련된 정보를 포함함-를 획득하고, 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 송신하도록 구성되되, 상기 프로세서는, 상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하고, 강화 학습으로 훈련된 에이전트를 통하여, 인스트럭션 정보로부터 최적화 파라미터를 획득하고, 상기 최적화 파라미터에 기초하여 상기 임베디드 장치에서 이용될 코드 정보를 생성함으로써 상기 최적 코드 정보를 획득하도록 구성될 수 있다. An apparatus for optimizing a neural network model according to an embodiment of the present application includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model. Obtaining at least one of layer data of, operation data constituting the neural network model, and parameters of the neural network model, and determining the structure of the neural network model based on the execution data of the neural network model. Optimization is performed, instruction information, including information related to at least one of a type of operation and a memory address, is obtained, and optimization for an embedded device in which the neural network model is to be driven is performed based on the instruction information. and obtains optimal code information, and is configured to transmit the optimal code information, wherein the processor obtains computing environment information of the embedded device and obtains an optimization parameter from instruction information through an agent trained by reinforcement learning. and to obtain the optimal code information by generating code information to be used in the embedded device based on the optimization parameter.
본 발명의 과제의 해결 수단이 상술한 해결 수단들로 제한되는 것은 아니며, 언급되지 아니한 해결 수단들은 본 명세서 및 첨부된 도면으로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The solutions to the problems of the present invention are not limited to the above-described solutions, and solutions not mentioned will be clearly understood by those skilled in the art from this specification and the accompanying drawings. You will be able to.
본 출원의 실시예에 따른 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 의하면, 임베디드 장치의 하드웨어의 비표준화 문제와 기존 인공지능 실행 엔진의 구조적인 제약을 해결하고, 신경망 모델을 임베디드 장치의 하드웨어 플랫폼에 대하여 최적화시킬 수 있다. According to the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to an embodiment of the present application, the non-standardization problem of hardware of an embedded device and the structural limitations of existing artificial intelligence execution engines are solved, and the neural network model It can be optimized for the hardware platform of the embedded device.
본 출원의 실시예에 따른 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 의하면, 임베디드 장치에서의 신경망 모델의 실행 능력이 향상될 수 있다.According to the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to the embodiments of the present application, the execution capability of the neural network model in an embedded device can be improved.
본 출원의 실시예에 따른 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 의하면, 임베디드 장치에서 신경망 모델을 실행시키기 위하여 필요한 전력 사용량을 감소시킬 수 있다. According to the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to embodiments of the present application, power consumption required to execute a neural network model in an embedded device can be reduced.
본 발명의 효과가 상술한 효과들로 제한되는 것은 아니며, 언급되지 아니한 효과들은 본 명세서 및 첨부된 도면으로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확히 이해될 수 있을 것이다.Effects of the present invention are not limited to the above-mentioned effects, and effects not mentioned will be clearly understood by those skilled in the art from this specification and the accompanying drawings.
도 1은 본 출원의 일 실시예에 따른 신경망 모델 최적화 시스템의 개략도이다. 1 is a schematic diagram of a neural network model optimization system according to an embodiment of the present application.
도 2는 본 출원의 일 실시예에 따른 신경망 모델 최적화 방법을 나타낸 순서도이다.2 is a flowchart illustrating a method for optimizing a neural network model according to an embodiment of the present application.
도 3은 본 출원의 일 실시예에 따른 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계를 구체화한 순서도이다. 3 is a flowchart specifying steps of optimizing the structure of a neural network model and obtaining instruction information according to an embodiment of the present application.
도 4는 본 출원의 일 실시예에 따른 방향성 비사이클 그래프의 일 양상을 도시한 도면이다.4 is a diagram illustrating an aspect of a directed acyclic graph according to an embodiment of the present application.
도 5는 본 출원의 일 실시예에 따른 제1 대상 연산과 제2 대상 연산을 병합하는 일 양상을 도시한 도면이다. 5 is a diagram illustrating an aspect of merging a first target operation and a second target operation according to an embodiment of the present application.
도 6은 본 출원의 일 실시예에 따른 제1 메모리 공간 맵의 일 양상을 도시한 도면이다. 6 is a diagram illustrating one aspect of a first memory space map according to an embodiment of the present application.
도 7은 본 출원의 일 실시예에 따른 메모리 할당과 관련된 최적화의 일 양상을 도시한 도면이다. 7 is a diagram illustrating an aspect of optimization related to memory allocation according to an embodiment of the present application.
도 8은 본 출원의 일 실시예에 따른 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계를 구체화한 순서도이다. 8 is a flowchart specifying steps of optimizing an embedded device and obtaining optimal code information according to an embodiment of the present application.
도 9는 본 출원의 일 실시예에 따른 강화 학습 방식을 통하여 에이전트를 훈련시키는 일 양상을 도시한 도면이다. 9 is a diagram illustrating an aspect of training an agent through a reinforcement learning method according to an embodiment of the present application.
본 출원의 일 실시예에 따른 신경망 모델 최적화 방법은, 학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-; 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계; 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계; 및 상기 최적 코드 정보를 송신하는 단계;를 포함하되, 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계는, 상기 실행 데이터에 기초하여 방향성 비사이클 그래프(DAG)를 생성하는 단계; 상기 방향성 비사이클 그래프에 기초하여 연산들의 실행 순서를 결정하는 단계; 미리 정해진 기준 연산 패턴에 기초하여 상기 기준 연산 패턴에 대응되는 상기 방향성 비사이클 그래프의 대상 연산 패턴을 검출하고, 상기 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하는 단계; 상기 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 상기 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하는 단계; 및 최적화 수행 결과에 기초하여 메모리 주소와 관련된 인스트럭션을 생성하는 단계;를 더 포함할 수 있다. A method for optimizing a neural network model according to an embodiment of the present application includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. , and at least one of parameters of the neural network model; optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information; optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and transmitting the optimal code information, wherein the optimizing the structure of the neural network model and obtaining instruction information includes generating a directed acyclic graph (DAG) based on the execution data. ; determining an execution order of operations based on the directed acyclic graph; detecting a target operation pattern of the directed acyclic graph corresponding to the reference operation pattern based on a predetermined reference operation pattern, and merging a first target operation and a second target operation included in the target operation pattern; obtaining a first memory space map based on the determined execution order, and performing optimization related to memory allocation based on the first memory space map; and generating an instruction related to the memory address based on a result of performing the optimization.
본 출원의 일 실시예에 따르면, 상기 제1 대상 연산과 상기 제2 대상 연산을 병합하는 단계는, 미리 정해진 기준 연산 패턴 정보를 획득하는 단계-상기 기준 연산 패턴 정보는 제1 연산 및 상기 제1 연산과 연계된 제2 연산을 포함함-; 상기 기준 연산 패턴 정보에 기초하여 상기 방향성 비사이클 그래프로부터 상기 제1 연산에 대응되는 상기 제1 대상 연산 및 상기 제2 연산에 대응되는 상기 제2 대상 연산을 검출하는 단계; 및 상기 제1 대상 연산과 상기 제2 대상 연산을 병합하고, 상기 병합 결과에 기초하여 커널을 변환하는 단계;를 더 포함할 수 있다. According to an embodiment of the present application, the merging of the first target operation and the second target operation may include obtaining predetermined reference operation pattern information—the reference operation pattern information includes the first operation and the first operation pattern. includes a second operation associated with the operation; detecting the first target operation corresponding to the first operation and the second target operation corresponding to the second operation from the directed acyclic graph based on the reference operation pattern information; and merging the first target operation and the second target operation, and transforming a kernel based on a result of the merging.
본 출원의 일 실시예에 따르면, 상기 메모리 할당과 관련된 최적화를 수행하는 단계는, 상기 결정된 실행 순서 및 상기 연산을 통하여 출력되는 데이터의 크기에 기초하여 상기 제1 메모리 공간 맵을 생성하는 단계; 제3 대상 연산으로 입력된 값이 저장되는 제1 메모리 텐서를 상기 제3 대상 연산을 통하여 출력된 값이 저장되는 제2 메모리 텐서로 변경하는 단계; 및 상기 변경 결과에 기초하여 상기 제1 메모리 공간 맵으로부터 제2 메모리 공간 맵을 생성하는 단계;를 더 포함할 수 있다. According to one embodiment of the present application, the performing of optimization related to memory allocation may include generating the first memory space map based on the determined execution order and the size of data output through the operation; changing a first memory tensor storing a value input through a third target operation into a second memory tensor storing a value output through the third target operation; and generating a second memory space map from the first memory space map based on the change result.
본 출원의 일 실시예에 따르면, 상기 연산들의 실행 순서를 결정하는 단계는, 상기 방향성 비사이클 그래프의 제1 브랜치(branch)에 포함된 제4 대상 연산에 요구되는 제1 메모리 공간과 상기 방향성 비사이클 그래프의 제2 브랜치에 포함된 제5 대상 연산에 요구되는 제2 메모리 공간을 연산하는 단계; 상기 제1 메모리 공간과 상기 제2 메모리 공간을 비교하는 단계; 및 상기 비교 결과에 따라 상기 제4 대상 연산과 상기 제5 대상 연산의 실행 순서를 결정하는 단계;를 더 포함할 수 있다. According to an embodiment of the present application, the determining of the execution order of the operations may include a first memory space required for a fourth target operation included in a first branch of the directed acyclic graph and the directional ratio. calculating a second memory space required for a fifth target operation included in a second branch of the cycle graph; comparing the first memory space and the second memory space; and determining an execution order of the fourth target operation and the fifth target operation according to the comparison result.
본 출원의 일 실시예에 따르면, 상기 제1 메모리 공간이 상기 제2 메모리 공간보다 큰 경우, 상기 제4 대상 연산의 실행 순서는 상기 제5 대상 연산의 실행 순서보다 후순위로 할당하되, 상기 제1 메모리 공간이 상기 제2 메모리 공간보다 작은 경우, 상기 제4 대상 연산의 실행 순서는 상기 제5 대상 연산의 실행 순서보다 선순위로 할당할 수 있다. According to an embodiment of the present application, when the first memory space is larger than the second memory space, the execution order of the fourth target operation is assigned a lower priority than the execution order of the fifth target operation, and the first When the memory space is smaller than the second memory space, the execution order of the fourth target operation may be assigned a priority over the execution order of the fifth target operation.
본 출원의 일 실시예에 따르면, 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계는, 상기 신경망 모델의 연산(operation)과 관련된 입력 데이터 및 출력 데이터를 획득하는 단계; 및 상기 입력 데이터 및 상기 출력 데이터를 미리 결정된 정수 범위에 해당하는 값으로 조정하는 단계;를 더 포함할 수 있다. According to an embodiment of the present application, the optimizing the structure of the neural network model and acquiring instruction information may include acquiring input data and output data related to an operation of the neural network model; and adjusting the input data and the output data to values corresponding to a predetermined integer range.
본 출원의 일 실시예에 따르면, 상기 신경망 모델 최적화 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체가 제공될 수 있다.According to an embodiment of the present application, a computer-readable recording medium recording a program for executing the neural network model optimization method may be provided.
본 출원의 일 실시예에 따른 신경망 모델 최적화 장치는, 학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 송수신부; 및 상기 실행 데이터 및 상기 임베디드 장치의 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델에 대한 최적화를 수행하는 프로세서;를 포함하되, 상기 프로세서는, 학습이 완료된 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-를 획득하고, 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하고, 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 송신하도록 구성되되, 상기 프로세서는, 상기 실행 데이터에 기초하여 방향성 비사이클 그래프(DAG)를 생성하고, 상기 방향성 비사이클 그래프에 기초하여 연산들의 실행 순서를 결정하고, 미리 정해진 기준 연산 패턴에 기초하여 상기 기준 연산 패턴에 대응되는 상기 방향성 비사이클 그래프의 대상 연산 패턴을 검출하고, 상기 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하고, 상기 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 상기 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하고, 최적화 수행 결과에 기초하여 메모리 주소와 관련된 인스트럭션을 생성함으로써, 상기 인스트럭션 정보를 획득하도록 구성될 수 있다. An apparatus for optimizing a neural network model according to an embodiment of the present application includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model. Obtaining at least one of layer data of, operation data constituting the neural network model, and parameters of the neural network model, and determining the structure of the neural network model based on the execution data of the neural network model. Perform optimization and obtain instruction information, perform optimization for an embedded device in which the neural network model is to be driven based on the instruction information, obtain optimal code information, and transmit the optimal code information, wherein the processor , A directed acyclic graph (DAG) is generated based on the execution data, an execution order of operations is determined based on the directed acyclic graph, and an execution sequence of operations corresponding to the reference operation pattern is determined based on a predetermined reference operation pattern. Detecting a target operation pattern of a directed acyclic graph, merging a first target operation and a second target operation included in the target operation pattern, obtaining a first memory space map based on the determined execution order, and 1 It may be configured to obtain the instruction information by performing optimization related to memory allocation based on a memory space map and generating an instruction related to a memory address based on a result of performing the optimization.
본 출원의 일 실시예에 따른 신경망 모델 최적화 방법은, 학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data) 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-; 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계-상기 인스트럭션 정보는 연산의 유형, 연산의 및 메모리 주소 중 적어도 하나와 관련된 정보를 포함함-; 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계; 및 상기 최적 코드 정보를 송신하는 단계;를 포함하되, 상기 최적 코드 정보를 획득하는 단계는, 상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계; 강화 학습으로 훈련된 에이전트를 통하여, 인스트럭션 정보로부터 최적화 파라미터를 획득하는 단계; 및 상기 최적화 파라미터에 기초하여 상기 임베디드 장치에서 이용될 코드 정보를 생성하는 단계;를 더 포함할 수 있다. A method for optimizing a neural network model according to an embodiment of the present application includes the steps of acquiring execution data of a neural network model that has been trained - the execution data includes layer data of the neural network model and operation data constituting the neural network model. and at least one of parameters of the neural network model; Optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information, wherein the instruction information includes information related to at least one of a type of operation, an operation value, and a memory address. ; optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and transmitting the optimal code information, wherein the obtaining of the optimal code information comprises: acquiring computing environment information of the embedded device; obtaining an optimization parameter from instruction information through an agent trained by reinforcement learning; and generating code information to be used in the embedded device based on the optimization parameter.
본 출원의 일 실시예에 따르면, 상기 최적화 파라미터를 획득하는 단계는, 상기 연산에 대응되는 적어도 하나 이상의 연산 유형 정보, 메모리 상태 정보, 및 상기 임베디드 장치의 컴퓨팅 환경 정보 중 적어도 하나를 상기 에이전트에 입력하는 단계; 및 상기 에이전트를 통하여 출력되는 최적화 파라미터를 획득하는 단계;를 더 포함할 수 있다.According to an embodiment of the present application, the obtaining of the optimization parameter may include inputting at least one of at least one operation type information corresponding to the operation, memory state information, and computing environment information of the embedded device to the agent. doing; and obtaining an optimization parameter output through the agent.
본 출원의 일 실시예에 따르면, 상기 최적화 파라미터는, 상기 연산에 대하여 수행될 알고리즘 유형을 선택하는 파라미터, 상기 연산의 블록 사이즈와 관련된 파라미터, 및 코드의 길이와 관련된 파라미터 중 적어도 하나와 관련될 수 있다.According to an embodiment of the present application, the optimization parameter may be related to at least one of a parameter for selecting an algorithm type to be performed for the operation, a parameter related to a block size of the operation, and a parameter related to a code length. there is.
본 출원의 일 실시예에 따르면, 상기 에이전트는, 초기 규칙에 따라, 타겟 임베디드 장치의 컴퓨팅 환경과 관련된 타겟 장치 정보, 메모리 상태 정보, 및 연산(operation)에 대응되는 적어도 하나 이상의 알고리즘 유형 정보에 기초하여 파라미터와 관련된 예측값을 출력하도록 구성되되, 상기 에이전트는, 예측값을 통하여 생성된 코드의 성능에 대한 평가값이 최대화되도록 상기 초기 규칙이 갱신됨으로써 훈련될 수 있다. According to an embodiment of the present application, the agent, according to an initial rule, is based on target device information related to a computing environment of a target embedded device, memory state information, and at least one algorithm type information corresponding to an operation. The agent may be trained by updating the initial rule so that an evaluation value for the performance of a code generated through the predicted value is maximized.
본 출원의 일 실시예에 따르면, 상기 임베디드 장치에서 이용될 코드 정보를 생성하는 단계는, 상기 최적화 파라미터에 기초하여 상기 인스트럭션 정보에 대응되도록 코드를 생성하는 단계; 및 상기 생성된 코드를 컴파일하여 바이너리 파일 형태로 변환하는 단계;를 더 포함할 수 있다. According to one embodiment of the present application, generating code information to be used in the embedded device may include generating codes to correspond to the instruction information based on the optimization parameter; and compiling the generated code and converting it into a binary file format.
본 출원의 일 실시예에 따르면, 상기 신경망 모델 최적화 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체가 제공될 수 있다.According to an embodiment of the present application, a computer-readable recording medium recording a program for executing the neural network model optimization method may be provided.
본 출원의 일 실시예에 따른 신경망 모델 최적화 장치는, 학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 송수신부; 및 상기 실행 데이터 및 상기 임베디드 장치의 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델에 대한 최적화를 수행하는 프로세서;를 포함하되, 상기 프로세서는, 학습이 완료된 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-를 획득하고, 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보-상기 인스트럭션 정보는 연산의 유형, 및 메모리 주소 중 적어도 하나와 관련된 정보를 포함함-를 획득하고, 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 송신하도록 구성되되, 상기 프로세서는, 상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하고, 강화 학습으로 훈련된 에이전트를 통하여, 인스트럭션 정보로부터 최적화 파라미터를 획득하고, 상기 최적화 파라미터에 기초하여 상기 임베디드 장치에서 이용될 코드 정보를 생성함으로써 상기 최적 코드 정보를 획득하도록 구성될 수 있다. An apparatus for optimizing a neural network model according to an embodiment of the present application includes a transceiver for acquiring execution data of a trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and a processor configured to optimize the neural network model based on the execution data and computing environment information of the embedded device, wherein the processor includes execution data of the neural network model that has been learned - the execution data is the neural network model. Obtaining at least one of layer data of, operation data constituting the neural network model, and parameters of the neural network model, and determining the structure of the neural network model based on the execution data of the neural network model. Optimization is performed, instruction information, including information related to at least one of a type of operation and a memory address, is obtained, and optimization for an embedded device in which the neural network model is to be driven is performed based on the instruction information. and obtains optimal code information, and is configured to transmit the optimal code information, wherein the processor obtains computing environment information of the embedded device and obtains an optimization parameter from instruction information through an agent trained by reinforcement learning. and to obtain the optimal code information by generating code information to be used in the embedded device based on the optimization parameter.
본 출원의 상술한 목적, 특징들 및 장점은 첨부된 도면과 관련된 다음의 상세한 설명을 통해 보다 분명해질 것이다. 다만, 본 출원은 다양한 변경을 가할 수 있고 여러 가지 실시예들을 가질 수 있는 바, 이하에서는 특정 실시예들을 도면에 예시하고 이를 상세히 설명하고자 한다.The foregoing objects, features and advantages of the present application will become more apparent from the following detailed description taken in conjunction with the accompanying drawings. However, the present application can apply various changes and can have various embodiments. Hereinafter, specific embodiments will be illustrated in the drawings and described in detail.
명세서 전체에 걸쳐서 동일한 참조번호들은 원칙적으로 동일한 구성요소들을 나타낸다. 또한, 각 실시예의 도면에 나타나는 동일한 사상의 범위 내의 기능이 동일한 구성요소는 동일한 참조부호를 사용하여 설명하며, 이에 대한 중복되는 설명은 생략하기로 한다.Like reference numerals designate essentially like elements throughout the specification. In addition, components having the same function within the scope of the same idea appearing in the drawings of each embodiment will be described using the same reference numerals, and overlapping descriptions thereof will be omitted.
본 출원과 관련된 공지 기능 혹은 구성에 대한 구체적인 설명이 본 출원의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 본 명세서의 설명 과정에서 이용되는 숫자(예를 들어, 제1, 제2 등)는 하나의 구성요소를 다른 구성요소와 구분하기 위한 식별기호에 불과하다.If it is determined that a detailed description of a known function or configuration related to the present application may unnecessarily obscure the subject matter of the present application, the detailed description thereof will be omitted. In addition, numbers (eg, first, second, etc.) used in the description process of this specification are only identifiers for distinguishing one component from another component.
또한, 이하의 실시예에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다.In addition, the suffixes "module" and "unit" for components used in the following embodiments are given or used interchangeably in consideration of ease of writing the specification, and do not have meanings or roles that are distinguished from each other by themselves.
이하의 실시예에서, 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다.In the following examples, expressions in the singular number include plural expressions unless the context clearly dictates otherwise.
이하의 실시예에서, 포함하다 또는 가지다 등의 용어는 명세서상에 기재된 특징, 또는 구성요소가 존재함을 의미하는 것이고, 하나 이상의 다른 특징들 또는 구성요소가 부가될 가능성을 미리 배제하는 것은 아니다.In the following embodiments, terms such as include or have mean that features or components described in the specification exist, and do not preclude the possibility that one or more other features or components may be added.
도면에서는 설명의 편의를 위하여 구성 요소들이 그 크기가 과장 또는 축소될 수 있다. 예컨대, 도면에서 나타난 각 구성의 크기 및 두께는 설명의 편의를 위해 임의로 나타낸 것으로, 본 발명이 반드시 도시된 바에 한정되지 않는다.In the drawings, the size of components may be exaggerated or reduced for convenience of explanation. For example, the size and thickness of each component shown in the drawings are arbitrarily shown for convenience of explanation, and the present invention is not necessarily limited to those shown.
어떤 실시예가 달리 구현 가능한 경우에 특정한 프로세스의 순서는 설명되는 순서와 다르게 수행될 수도 있다. 예를 들어, 연속하여 설명되는 두 프로세스가 실질적으로 동시에 수행될 수도 있고, 설명되는 순서와 반대의 순서로 진행될 수 있다.If an embodiment is otherwise implementable, the order of specific processes may be performed differently from the order described. For example, two processes that are described in succession may be performed substantially concurrently, or may proceed in an order reverse to that described.
이하의 실시예에서, 구성 요소 등이 연결되었다고 할 때, 구성 요소들이 직접적으로 연결된 경우뿐만 아니라 구성요소들 중간에 구성 요소들이 개재되어 간접적으로 연결된 경우도 포함한다.In the following embodiments, when components are connected, a case in which the components are directly connected as well as a case in which components are interposed between the components and connected indirectly is included.
예컨대, 본 명세서에서 구성 요소 등이 전기적으로 연결되었다고 할 때, 구성 요소 등이 직접 전기적으로 연결된 경우뿐만 아니라, 그 중간에 구성 요소 등이 개재되어 간접적으로 전기적 연결된 경우도 포함한다.For example, when it is said that components are electrically connected in this specification, not only the case where the components are directly electrically connected, but also the case where the components are interposed and electrically connected indirectly is included.
이하에서는 도 1 내지 도 9를 참고하여 본 출원의 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 관하여 설명한다. Hereinafter, the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system of the present application will be described with reference to FIGS. 1 to 9 .
도 1은 본 출원의 일 실시예에 따른 신경망 모델 최적화 시스템의 개략도이다. 1 is a schematic diagram of a neural network model optimization system according to an embodiment of the present application.
본 출원의 일 실시예에 따른 신경망 모델 최적화 시스템(10)은 임베디드 장치(100) 및 신경망 모델 최적화 장치(1000, 혹은 서버)를 포함할 수 있다. The neural network model optimization system 10 according to an embodiment of the present application may include the embedded device 100 and the neural network model optimization device 1000 (or server).
임베디드 장치(100)는 특정 목적(혹은 특정 기능)을 가지고 만들어진 프로그래밍이 가능한 임의의 임베디드 시스템(Embedded system)이 내재된 장치를 포괄하는 의미일 수 있다. 임베디드 장치(100)는 프로세서 및/또는 메모리를 포함하는 하드웨어를 포함할 수 있다. 또한, 임베디드 장치(100)는 하드웨어를 제어하기 위한 펌웨어(Firmware)를 포함할 수 있다. 또한, 임베디드 장치(100)는 인공지능 실행 엔진을 포함하여 임의의 소프트웨어를 펌웨어에 입력하여 임의의 인공지능 모델을 실행하도록 구성될 수 있다. 여기서, 인공지능 실행 엔진(Inference Engine)은 미리 학습된 신경망 모델을 임베디드 장치(100)에 최대한 효율적으로 실행시키기 위한 소프트웨어로서, 인공지능 실사용에 목적을 둔 기술이며 탑재되는 장치의 환경에 효율성을 높이는 기능을 수행한다. 예컨대, 모바일 기기의 경우, 모바일 기기의 컴퓨팅 환경인 느린 연산속도 및 저전력 사양에 맞춰 실행엔진이 구현될 수 있다. 다른 예로, 컴퓨팅 성능이 상대적으로 높은 PC 서버의 경우에는 고성능 병렬처리 능력을 극대화하도록 실행 엔진이 구현될 수 있다.The embedded device 100 may mean a device including a programmable arbitrary embedded system made for a specific purpose (or specific function). The embedded device 100 may include hardware including a processor and/or memory. Also, the embedded device 100 may include firmware for controlling hardware. In addition, the embedded device 100 may be configured to execute an arbitrary artificial intelligence model by inputting arbitrary software to firmware, including an artificial intelligence execution engine. Here, the artificial intelligence execution engine (Inference Engine) is software for maximally and efficiently executing a pre-learned neural network model on the embedded device 100, and is a technology aimed at actual use of artificial intelligence and improves efficiency in the environment of the device to be mounted. height function. For example, in the case of a mobile device, an execution engine may be implemented in accordance with the specifications of a slow operation speed and low power consumption, which are computing environments of the mobile device. As another example, in the case of a PC server having relatively high computing performance, an execution engine may be implemented to maximize high-performance parallel processing capability.
본 출원의 일 실시예에 따른 임베디드 장치(100)는 신경망 모델 최적화 장치(1000)로부터 임베디드 장치(100)의 컴퓨팅 환경에 최적화된 최적 코드 정보를 획득하고, 최적 코드 정보를 펌웨어에 추가(혹은 입력)할 수 있다. 후술할 바와 같이, 최적 코드 정보는 신경망 모델의 내부 구조를 분석하여 생성될 수 있다. 또한, 최적 코드 정보는 임베디드 장치(100)의 메모리 사양 및/또는 프로세서 사양 등을 포함한 컴퓨팅 환경을 고려하여 생성될 수 있다. 또한, 임베디드 장치(100)는 신경망 모델 최적화 장치(1000)로부터 생성된 최적 코드 정보를 펌웨어에 추가하고, 신경망 모델의 실행을 수행할 수 있다. The embedded device 100 according to an embodiment of the present application obtains optimal code information optimized for the computing environment of the embedded device 100 from the neural network model optimization device 1000, and adds (or inputs) the optimal code information to the firmware. )can do. As will be described later, optimal code information can be generated by analyzing the internal structure of the neural network model. In addition, the optimal code information may be generated in consideration of a computing environment including memory specifications and/or processor specifications of the embedded device 100 . In addition, the embedded device 100 may add optimal code information generated by the neural network model optimization apparatus 1000 to firmware and execute the neural network model.
본 출원의 일 실시예에 따른 신경망 모델 최적화 장치(1000)는 임베디드 장치(100) 이외의 임의의 장치(혹은 서버)에서 훈련된 신경망 모델이 임베디드 장치(100)의 컴퓨팅 환경에서 최적으로 실행될 수 있도록, 신경망 모델의 연산 구조 및/또는 메모리 할당에 대한 최적화를 수행할 수 있다. 또한, 본 출원의 일 실시예에 따른 신경망 모델 최적화 장치(1000)는 신경망 모델이 임베디드 장치(100)의 컴퓨팅 환경에서 최적으로 실행될 수 있는 최적 코드를 자동적으로 생성할 수 있다. The neural network model optimization apparatus 1000 according to an embodiment of the present application is configured so that a neural network model trained in any device (or server) other than the embedded device 100 can be optimally executed in the computing environment of the embedded device 100. , optimization of the computational structure and/or memory allocation of the neural network model may be performed. In addition, the apparatus 1000 for optimizing the neural network model according to an embodiment of the present application may automatically generate optimal code for optimally executing the neural network model in the computing environment of the embedded device 100 .
본 출원의 일 실시예에 따른 신경망 모델 최적화 장치(1000)는 송수신부(1100), 메모리(1200), 및 프로세서(1300)를 포함할 수 있다.An apparatus 1000 for optimizing a neural network model according to an embodiment of the present application may include a transceiver 1100, a memory 1200, and a processor 1300.
신경망 모델 최적화 장치(1000)의 송수신부(1100)는 임베디드 장치(100)를 포함하여 임의의 외부 기기와 통신을 수행할 수 있다. 예컨대, 신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통해, 최적화를 수행함으로써 획득한 최적 코드 정보를 임베디드 장치(100)로 송신할 수 있다. 또한, 신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통해, 임베디드 장치(100) 혹은 임의의 외부 장치로부터 임베디드 장치(100)의 컴퓨팅 환경 정보를 수신할 수 있다. 또한 신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통해, 학습이 완료된 신경망 모델 및/또는 신경망 모델을 실행시키기 위한 실행데이터를 수신할 수 있다. The transceiver 1100 of the neural network model optimization apparatus 1000 may communicate with any external device including the embedded device 100 . For example, the neural network model optimization apparatus 1000 may transmit optimal code information obtained by performing optimization to the embedded device 100 through the transceiver 1100 . In addition, the neural network model optimization apparatus 1000 may receive computing environment information of the embedded device 100 from the embedded device 100 or any external device through the transceiver 1100 . In addition, the neural network model optimization apparatus 1000 may receive a trained neural network model and/or execution data for executing the neural network model through the transceiver 1100 .
신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통해, 네트워크에 접속하여 각종 데이터를 송수신할 수 있다. 송수신부는 크게 유선 타입과 무선 타입을 포함할 수 있다. 유선 타입과 무선 타입은 각각의 장단점을 가지므로, 경우에 따라서 신경망 모델 최적화 장치(1000)에는 유선 타입과 무선 타입이 동시에 마련될 수도 있다. 여기서, 무선 타입의 경우에는 주로 와이파이(Wi-Fi) 같은 WLAN(Wireless Local Area Network) 계열의 통신 방식을 이용할 수 있다. 또는, 무선 타입의 경우에는 셀룰러 통신, 예컨대, LTE, 5G 계열의 통신 방식을 이용할 수 있다. 다만, 무선 통신 프로토콜이 상술한 예시에 제한되는 것은 아니며, 임의의 적절한 무선 타입의 통신 방식을 이용하는 것도 가능하다. 유선 타입의 경우에는 LAN(Local Area Network)이나 USB(Universal Serial Bus) 통신이 대표적인 예이며 그 외의 다른 방식도 가능하다.The apparatus 1000 for optimizing a neural network model may transmit and receive various types of data by accessing a network through the transceiver 1100 . The transceiver may largely include a wired type and a wireless type. Since the wired type and the wireless type each have advantages and disadvantages, the wired type and the wireless type may be simultaneously provided in the apparatus 1000 for optimizing a neural network model in some cases. Here, in the case of the wireless type, a wireless local area network (WLAN)-based communication method such as Wi-Fi may be mainly used. Alternatively, in the case of a wireless type, a cellular communication, eg, LTE, 5G-based communication method may be used. However, the wireless communication protocol is not limited to the above example, and any suitable wireless type communication method may be used. In the case of a wired type, LAN (Local Area Network) or USB (Universal Serial Bus) communication is a representative example, and other methods are also possible.
신경망 모델 최적화 장치(1000)의 메모리(1200)는 각종 정보를 저장할 수 있다. 메모리(1200)에는 각종 데이터가 임시적으로 또는 반영구적으로 저장될 수 있다. 메모리의 예로는 하드 디스크(HDD: Hard Disk Drive), SSD(Solid State Drive), 플래쉬 메모리(flash memory), 롬(ROM: Read-Only Memory), 램(RAM: Random Access Memory) 등이 있을 수 있다. 메모리(1200)는 신경망 모델 최적화 장치(1000)에 내장되는 형태나 탈부착 가능한 형태로 제공될 수 있다. 메모리(1200)에는 신경망 모델 최적화 장치(1000)를 구동하기 위한 운용 프로그램(OS: Operating System)이나 신경망 모델 최적화 장치(1000)의 각 구성을 동작시키기 위한 프로그램을 비롯해 신경망 모델 최적화 장치(1000)의 동작에 필요한 각종 데이터가 저장될 수 있다.The memory 1200 of the neural network model optimization apparatus 1000 may store various kinds of information. Various types of data may be temporarily or semi-permanently stored in the memory 1200 . Examples of the memory may include a hard disk drive (HDD), a solid state drive (SSD), flash memory, read-only memory (ROM), and random access memory (RAM). there is. The memory 1200 may be provided in a form embedded in the neural network model optimization apparatus 1000 or in a detachable form. The memory 1200 includes an operating system (OS) for driving the neural network model optimization device 1000 or a program for operating each component of the neural network model optimization device 1000, as well as the components of the neural network model optimization device 1000. Various data required for operation may be stored.
프로세서(1300)는 신경망 모델 최적화 장치(1000)의 전반적인 동작을 제어할 수 있다. 예컨대, 프로세서(1300)는 후술할 학습이 완료된 신경망 모델의 실행 데이터를 획득하는 동작, 신경망 모델의 구조에 대한 최적화를 수행하는 동작, 임베디드 장치에 대한 최적화를 수행하는 동작, 최적화 결과에 따라 생성된 최적 코드 정보를 획득하는 동작, 및/또는 최적 코드 정보를 송신하는 동작 등 신경망 모델 최적화 장치(1000)의 전반적인 동작을 제어할 수 있다. 구체적으로 프로세서(1300)는 메모리(1200)로부터 신경망 모델 최적화 장치(1000)의 전반적인 동작을 위한 프로그램을 로딩하여 실행할 수 있다. 프로세서(1300)는 하드웨어나 소프트웨어 또는 이들의 조합에 따라 AP(Application Processor), CPU(Central Processing Unit), MCU(Microcontroller Unit)나 이와 유사한 장치로 구현될 수 있다. 이때, 하드웨어적으로는 전기적 신호를 처리하여 제어 기능을 수행하는 전자 회로 형태로 제공될 수 있으며, 소프트웨어적으로는 하드웨어적 회로를 구동시키는 프로그램이나 코드 형태로 제공될 수 있다.The processor 1300 may control overall operations of the neural network model optimization apparatus 1000 . For example, the processor 1300 may perform an operation of acquiring execution data of a neural network model for which learning has been completed, an operation of optimizing the structure of the neural network model, an operation of performing optimization of an embedded device, and an operation of performing optimization result. Overall operations of the neural network model optimization apparatus 1000, such as obtaining optimal code information and/or transmitting optimal code information, may be controlled. In detail, the processor 1300 may load and execute a program for overall operation of the neural network model optimization apparatus 1000 from the memory 1200 . The processor 1300 may be implemented as an application processor (AP), a central processing unit (CPU), a microcontroller unit (MCU), or a similar device according to hardware, software, or a combination thereof. In this case, in terms of hardware, it may be provided in the form of an electronic circuit that processes electrical signals to perform a control function, and in terms of software, it may be provided in the form of a program or code that drives a hardware circuit.
이하에서는 도 2 내지 도 9를 참고하여, 본 출원의 일 실시예에 따른 신경망 모델 최적화 장치(1000)의 동작 및 신경망 모델 최적화 방법을 구체적으로 서술한다. Hereinafter, an operation of the neural network model optimization apparatus 1000 and a method for optimizing a neural network model according to an embodiment of the present application will be described in detail with reference to FIGS. 2 to 9 .
도 2는 본 출원의 일 실시예에 따른 신경망 모델 최적화 방법을 나타낸 순서도이다.2 is a flowchart illustrating a method for optimizing a neural network model according to an embodiment of the present application.
본 출원의 일 실시예에 따른 신경망 모델 최적화 방법은, 학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계(S1000), 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계(S2000), 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계(S3000), 및 최적 코드 정보를 송신하는 단계(S4000)를 더 포함할 수 있다.A method for optimizing a neural network model according to an embodiment of the present application includes obtaining execution data of a trained neural network model (S1000), optimizing the structure of the neural network model and obtaining instruction information (S2000), Optimizing the embedded device and obtaining optimal code information (S3000) and transmitting the optimal code information (S4000) may be further included.
학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계(S1000)에서는, 신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통하여 학습이 완료된 신경망 모델의 실행 데이터를 획득할 수 있다. 여기서, 실행 데이터란, 신경망 모델의 계층 데이터, 신경망 모델을 구성하는 연산 데이터(operation data), 및/또는 신경망 모델과 관련된 임의의 가중치(혹은 파라미터)를 포함하여, 신경망 모델을 실행시키기 위하여 필요한 임의의 적절한 데이터를 포괄하는 의미일 수 있다. In the step of acquiring execution data of the learned neural network model ( S1000 ), the apparatus 1000 for optimizing the neural network model may obtain execution data of the learned neural network model through the transceiver 1100 . Here, the execution data is any data necessary to execute the neural network model, including layer data of the neural network model, operation data constituting the neural network model, and/or arbitrary weights (or parameters) related to the neural network model. It may mean covering the appropriate data of.
신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계(S2000)에서는, 신경망 모델 최적화 장치(1000)는 신경망 모델의 실행데이터에 기초하여 신경망 모델의 구조에 대한 최적화, 예컨대 신경망 모델의 구조에 대한 경량화를 수행할 수 있다. 일 예로, 신경망 모델 최적화 장치(1000)는 신경망 모델의 연산 구조에 포함된 연산 패턴을 검출하고, 연산 패턴에 포함된 대상 연산들을 병합하는 동작을 수행하도록 구성될 수 있다. 다른 예로, 신경망 모델 최적화 장치(1000)는 신경망 모델의 연산들의 실행 순서를 결정하고, 결정된 실행 순서에 기초하여 메모리 할당과 관련된 최적화를 수행할 수 있다. In the step of optimizing the structure of the neural network model and obtaining instruction information (S2000), the neural network model optimization apparatus 1000 optimizes the structure of the neural network model based on the execution data of the neural network model, for example, the structure of the neural network model. Lightening can be performed for . For example, the neural network model optimization apparatus 1000 may be configured to perform an operation of detecting an operation pattern included in an operation structure of a neural network model and merging target operations included in the operation pattern. As another example, the neural network model optimization apparatus 1000 may determine an execution order of operations of the neural network model, and perform memory allocation-related optimization based on the determined execution order.
신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계(S2000)에서는, 신경망 모델 최적화 장치(1000)는 최적화 수행 결과에 따라 인스트럭션 정보를 획득할 수 있다. 여기서, 인스트럭션 정보는, 신경망 모델의 연산들의 유형에 대한 인스트럭션, 및/또는 신경망 모델의 각 연산과 관련된 메모리 주소에 대한 인스트럭션을 포함할 수 있다. S2000 단계에 대하여는 도 3 내지 도 7에서 보다 구체적으로 서술하기로 한다. In the step of optimizing the structure of the neural network model and obtaining instruction information (S2000), the neural network model optimization apparatus 1000 may obtain instruction information according to the optimization result. Here, the instruction information may include instructions for types of operations of the neural network model and/or instructions for a memory address related to each operation of the neural network model. Step S2000 will be described in more detail in FIGS. 3 to 7 .
임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계(S3000)에서는, 신경망 모델 최적화 장치(1000)는, 훈련이 완료된 신경망 모델을 임베디드 장치(100)의 컴퓨팅 환경에 최적으로 실행시키기 위한 코드를 생성할 수 있다. 구체적으로 신경망 모델 최적화 장치(1000)는 강화 학습 기법으로 훈련된 에이전트를 통하여, S2000 단계에서 획득한 인스트럭션 정보 및 임베디드 장치 정보에 기초하여 최적화 파라미터를 획득하고, 최적화 파라미터에 기초하여 임베디드 장치(100)에서 이용될 최적 코드 정보를 생성하도록 구현될 수 있다. S3000 단계에 대하여는 도 8 내지 도 9에서 보다 구체적으로 서술하기로 한다.In the step of optimizing the embedded device and obtaining optimal code information (S3000), the neural network model optimization apparatus 1000 is a code for optimally executing the trained neural network model in the computing environment of the embedded device 100. can create Specifically, the apparatus 1000 for optimizing the neural network model obtains optimization parameters based on the instruction information and embedded device information acquired in step S2000 through an agent trained with a reinforcement learning technique, and the embedded device 100 based on the optimization parameters. It can be implemented to generate optimal code information to be used in Step S3000 will be described in more detail in FIGS. 8 to 9 .
최적 코드 정보를 송신하는 단계(S4000)에서는, 신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통하여, 획득된 최적 코드 정보를 임베디드 장치(100)를 포함하여 임의의 외부 장치(혹은 외부 서버)로 송신하도록 구현될 수 있다. In the step of transmitting the optimal code information (S4000), the neural network model optimization apparatus 1000 transmits the obtained optimal code information through the transceiver 1100 to any external device (or external device including the embedded device 100). server).
이하에서는 도 3 내지 7을 참고하여 본 출원의 일 실시예에 따른 신경망 모델의 구조에 대한 최적화에 관한 내용을 보다 구체적으로 서술하도록 한다. Hereinafter, the optimization of the structure of the neural network model according to an embodiment of the present application will be described in more detail with reference to FIGS. 3 to 7 .
도 3은 본 출원의 일 실시예에 따른 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계를 구체화한 순서도이다. 3 is a flowchart specifying steps of optimizing the structure of a neural network model and obtaining instruction information according to an embodiment of the present application.
본 출원의 일 실시예에 따른 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계(S2000)는, 실행 데이터에 기초하여 방향성 비사이클 그래프(Directed Acyclic Graph, DAG)를 생성하는 단계(S2100), DAG에 기초하여 연산들의 실행 순서를 결정하는 단계(S2200), 미리 정해진 기준 연산 패턴에 대응되는 DAG의 대상 연산 패턴을 검출하고, 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하는 단계(S2300), 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하는 단계(S2400), 및 최적화 수행 결과에 기초하여 메모리 주소와 관련된 인스트럭션을 생성하는 단계(S2500)를 더 포함할 수 있다. In the step of optimizing the structure of the neural network model and obtaining instruction information (S2000) according to an embodiment of the present application, generating a directed acyclic graph (DAG) based on execution data ( S2100), determining an execution order of operations based on the DAG (S2200), detecting a target operation pattern of the DAG corresponding to a predetermined reference operation pattern, and including a first target operation and a second target included in the target operation pattern merging operations (S2300), obtaining a first memory space map based on the determined execution order, and performing optimization related to memory allocation based on the first memory space map (S2400); Based on this, a step of generating an instruction related to the memory address (S2500) may be further included.
실행 데이터에 기초하여 방향성 비사이클 그래프(Directed Acyclic Graph, 이하 DAG)를 생성하는 단계(S2100)에서는, 신경망 모델 최적화 장치(1000)는 신경망 모델의 실행 데이터(예컨대, 신경망 모델의 계층 데이터, 신경망 모델을 구성하는 연산 데이터(operation data), 및/또는 신경망 모델의 파라미터 등)에 기초하여 DAG를 생성할 수 있다. DAG는 방향 순환이 없는 임의의 무한 유향 그래프를 지칭하는 의미일 수 있다. In the step of generating a directed acyclic graph (DAG) based on the execution data (S2100), the neural network model optimization apparatus 1000 performs the execution data of the neural network model (eg, layer data of the neural network model, the neural network model). A DAG may be generated based on operation data constituting , and/or parameters of a neural network model, etc.). DAG may refer to any infinite directed graph without directed cycles.
도 4는 본 출원의 일 실시예에 따른 DAG의 일 양상을 도시한 도면이다. 4 is a diagram illustrating one aspect of a DAG according to an embodiment of the present application.
DAG는 신경망 모델을 구성하는 각 함수들의 데이터 의존 관계, 예컨대, 각 함수들의 연결관계와 관련된 정보를 포함할 수 있다. 예컨대, DAG는 제1 연산(예컨대, A)과 연결된 제2 연산(예컨대, B) 및 제2 연산과 연결된 제3 연산(예컨대, C)을 포함하는 제1 브랜치 구조와 관련된 연결관계와 관련된 정보를 포함할 수 있다. 예컨대, DAG는 제1 연산(예컨대, A)과 연결된 제4 연산(예컨대, D) 및 제4 연산과 연결된 제5 연산(예컨대, E)을 포함하는 제2 브랜치 구조와 관련된 연결관계와 관련된 정보를 포함할 수 있다. 또한, DAG는 제3 연산과 제5 연산과 연결된 제6 연산(예컨대, F)과 관련된 연결관계와 관련된 정보를 포함할 수 있다. 다만, 도 4는 DAG의 설명의 편의를 위한 예시에 불과하며, 이에 제한적으로 해석되지 않는다. The DAG may include information related to a data dependency relationship of each function constituting the neural network model, for example, a connection relationship between each function. For example, the DAG is information related to a connection relationship related to a first branch structure including a second operation (eg, B) connected to a first operation (eg, A) and a third operation (eg, C) connected to the second operation. can include For example, the DAG is information related to a connection relationship related to a second branch structure including a fourth operation (eg, D) connected to a first operation (eg, A) and a fifth operation (eg, E) connected to the fourth operation. can include In addition, the DAG may include information related to a connection relationship related to the third operation and the sixth operation (eg, F) connected to the fifth operation. However, FIG. 4 is only an example for convenience of description of the DAG, and is not construed as being limited thereto.
DAG에 기초하여 연산들의 실행 순서를 결정하는 단계(S2200)에서는, 신경망 모델 최적화 장치(1000)는 DAG를 이용하여 신경망 모델을 구성하는 적어도 하나 이상의 연산들의 실행 순서를 결정할 수 있다. In determining the execution order of operations based on the DAG ( S2200 ), the neural network model optimization apparatus 1000 may determine the execution order of one or more operations constituting the neural network model using the DAG.
실행 순서를 결정하는 데는 임의의 적절한 규칙이 이용될 수 있다. Any suitable rules may be used to determine the order of execution.
일 예로, 신경망 모델 최적화 장치(1000)는 신경망 모델을 구성하는 연산에 요구되는 메모리 공간에 기초하여 DAG의 연산들의 실행 순서를 결정할 수 있다. 예컨대, 신경망 모델 최적화 장치(1000)는 DAG의 제1 브랜치에 포함된 연산(예컨대, 도 4의 B)에 요구되는 제1 메모리 공간과 DAG의 제2 브랜치에 포함된 연산(예컨대, 도 4의 D)에 요구되는 제2 메모리 공간을 연산하고, 제1 메모리 공간과 제2 메모리 공간을 비교하고, 비교 결과에 기초하여 제1 브랜치에 포함된 연산(예컨대, 도 4의 B)과 제2 브랜치에 포함된 연산(예컨대, 도 4의 D) 간의 실행 순서를 결정할 수 있다. 구체적으로 제1 메모리 공간이 제2 메모리 공간보다 큰 경우, 신경망 모델 최적화 장치(1000)는 제1 브랜치에 포함된 연산(예컨대, 도 4의 B)의 실행 순서를 제2 브랜치에 포함된 연산(예컨대, 도 4의 D)의 실행 순서보다 후순위로 할당할 수 있다. 반면 제1 메모리 공간이 제2 메모리 공간보다 작은 경우, 신경망 모델 최적화 장치(1000)는 제1 브랜치에 포함된 연산(예컨대, 도 4의 B)의 실행 순서를 제2 브랜치에 포함된 연산(예컨대, 도 4의 D)의 실행 순서보다 선순위로 할당할 수 있다.For example, the neural network model optimization apparatus 1000 may determine an execution order of DAG operations based on a memory space required for operations constituting the neural network model. For example, the apparatus 1000 for optimizing the neural network model provides a first memory space required for an operation included in a first branch of the DAG (eg, B in FIG. 4 ) and an operation included in a second branch of the DAG (eg, in FIG. 4 ). The second memory space required for D) is calculated, the first memory space and the second memory space are compared, and the operation included in the first branch (eg, B in FIG. 4) and the second branch are performed based on the comparison result. It is possible to determine an execution order between operations included in (eg, D in FIG. 4 ). Specifically, when the first memory space is larger than the second memory space, the neural network model optimization apparatus 1000 changes the execution order of the operation included in the first branch (eg, B in FIG. 4 ) to the operation included in the second branch ( For example, it may be assigned in a lower order than the execution order of D) of FIG. 4 . On the other hand, when the first memory space is smaller than the second memory space, the neural network model optimization apparatus 1000 changes the execution order of the operation included in the first branch (eg, B in FIG. 4 ) to the operation included in the second branch (eg, B in FIG. 4 ). , can be assigned in priority order of execution of D) of FIG. 4 .
다른 예로, 신경망 모델 최적화 장치(1000)는 DAG의 브랜치 구조를 고려하여 신경망 모델을 구성하는 연산들의 실행 순서를 결정할 수 있다. 예컨대, 같은 브랜치에 포함된 연산들을 순차적으로 실행하는 것이, 제1 브랜치에 포함된 연산을 실행하고 제2 브랜치에 포함된 연산을 실행하는 것보다는 메모리 공간 측면에 유리할 수 있다. 따라서, 신경망 모델 최적화 장치(1000)는 제1 브랜치에 포함된 연산들(예컨대, 도 4의 B, C)을 순차적으로 실행한 이후에, 제2 브랜치에 포함된 연산들(예컨대, 도 4의 D, E)를 실행하도록 실행 순서를 결정할 수 있다. 혹은 신경망 모델 최적화 장치(1000)는 제2 브랜치에 포함된 연산들(예컨대, 도 4의 D, E)을 실행하고, 제1 브랜치에 포함된 연산들(예컨대, 도 4의 B, C)를 실행하도록 실행 순서를 결정할 수 있다. As another example, the apparatus 1000 for optimizing the neural network model may determine the execution order of operations constituting the neural network model in consideration of the branch structure of the DAG. For example, sequentially executing operations included in the same branch may be more advantageous in terms of memory space than executing operations included in a first branch and executing operations included in a second branch. Therefore, the neural network model optimization apparatus 1000 sequentially executes the operations included in the first branch (eg, B and C in FIG. 4 ), and then performs the operations included in the second branch (eg, B and C in FIG. 4 ). The order of execution can be determined to execute D and E). Alternatively, the neural network model optimization apparatus 1000 executes operations included in the second branch (eg, D and E in FIG. 4 ) and performs operations included in the first branch (eg, B and C in FIG. 4 ). You can decide the execution order to execute.
미리 정해진 기준 연산 패턴에 대응되는 DAG의 대상 연산 패턴을 검출하고, 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하는 단계(S2300)에서는, 신경망 모델 최적화 장치(1000)는, 미리 정해진 기준 연산 패턴을 획득하고, 기준 연산 패턴에 대응되는 DAG의 대상 연산 패턴을 검출할 수 있다. 또한, 미리 정해진 기준 연산 패턴에 대응되는 DAG의 대상 연산 패턴을 검출하고, 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하는 단계(S2300)에서는, 신경망 모델 최적화 장치(1000)는 검출된 대상 연산 패턴에 포함된 연산들을 병합하는 동작을 수행하도록 구현될 수 있다. In the step of detecting the target operation pattern of the DAG corresponding to the predetermined reference operation pattern and merging the first target operation and the second target operation included in the target operation pattern (S2300), the neural network model optimization apparatus 1000, A predetermined reference operation pattern may be obtained, and a target operation pattern of the DAG corresponding to the reference operation pattern may be detected. In addition, in the step of detecting the target operation pattern of the DAG corresponding to the predetermined reference operation pattern and merging the first target operation and the second target operation included in the target operation pattern (S2300), the neural network model optimization apparatus 1000 may be implemented to perform an operation of merging operations included in the detected target operation pattern.
보다 구체적으로 본 출원의 일 실시예에 따른 제1 대상 연산과 제2 대상 연산을 병합하는 단계는, 미리 정해진 기준 연산 패턴 정보-기준 연산 패턴 정보는 제1 연산 및 제1 연산과 연계된 제2 연산을 포함함-를 획득하는 단계, 기준 연산 패턴 정보에 기초하여 DAG로부터 제1 연산에 대응되는 제1 대상 연산 및 제2 연산에 대응되는 제2 대상 연산을 검출하는 단계, 및 제1 대상 연산과 제2 대상 연산을 병합하고, 병합 결과에 기초하여 커널을 변환하는 단계를 더 포함할 수 있다. More specifically, the step of merging the first target operation and the second target operation according to an embodiment of the present application includes predetermined reference operation pattern information-reference operation pattern information is a first operation and a second operation associated with the first operation. Detecting a first target operation corresponding to the first operation and a second target operation corresponding to the second operation from the DAG based on the reference operation pattern information, and the first target operation The method may further include merging the first target operation and the second target operation, and converting a kernel based on a result of the merging.
도 5는 본 출원의 일 실시예에 따른 제1 대상 연산과 제2 대상 연산을 병합하는 일 양상을 도시한 도면이다. 5 is a diagram illustrating an aspect of merging a first target operation and a second target operation according to an embodiment of the present application.
미리 정해진 기준 연산 패턴 정보-기준 연산 패턴 정보는 제1 연산 및 제1 연산과 연계된 제2 연산을 포함함-를 획득하는 단계에서는, 신경망 모델 최적화 장치(1000)는 미리 정해진 기준 연산 패턴 정보를 획득할 수 있다. 이때, 기준 연산 패턴 정보는 일반적으로 많이 이용되는 연산 패턴과 관련된 정보로, 미리 설정될 수 있다. 예컨대, 기준 연산 패턴 정보는 제1 연산(예컨대, 콘볼루션(Convolution)) 및 제1 연산과 연결된 제2 연산(예컨대, Rectified Linear Unit (ReLu))을 포함하는 연산 패턴과 관련될 수 있다. 다만 이는 설명의 편의를 위한 예시에 불과하며, 임의의 적절한 연산 패턴이 미리 설정될 수 있다. 예컨대, 기준 연산 패턴 정보는 컨볼루션(Convolution) 연산을 수행하고, 뎁스와이스 컨볼루션(Depthwise convolution) 연산과 액티베이션(Activation) 연산을 순차적으로 수행하는 연산 패턴과 관련될 수 있다. 다른 예로, 기준 연산 패턴 정보는 이미지의 색상과 관련된 채널별로 필터를 적용하여 채널별로 데이터를 압축하는 뎁스와이스 컨볼루션(Depthwise convolution) 연산을 수행하여 중간 결과값을 획득하고, 중간결과 값에 기초하여 포인트와이스(Pointwise) 연산을 수행하는 연산 패턴을 포함할 수 있다. In the step of acquiring predetermined reference operation pattern information, wherein the reference operation pattern information includes a first operation and a second operation associated with the first operation, the neural network model optimization apparatus 1000 obtains the predetermined reference operation pattern information. can be obtained In this case, the reference calculation pattern information is information related to a commonly used calculation pattern, and may be set in advance. For example, the reference operation pattern information may be related to an operation pattern including a first operation (eg, convolution) and a second operation connected to the first operation (eg, Rectified Linear Unit (ReLu)). However, this is merely an example for convenience of explanation, and any suitable operation pattern may be set in advance. For example, the reference operation pattern information may be related to an operation pattern in which a convolution operation is performed, and a depthwise convolution operation and an activation operation are sequentially performed. As another example, the reference operation pattern information obtains an intermediate result value by performing a depthwise convolution operation for compressing data for each channel by applying a filter for each channel related to the color of the image, and based on the intermediate result value It may include an operation pattern that performs a pointwise operation.
기준 연산 패턴 정보에 기초하여 DAG로부터 제1 연산에 대응되는 제1 대상 연산 및 제2 연산에 대응되는 제2 대상 연산을 검출하는 단계에서는, 신경망 모델 최적화 장치(1000)는 기준 연산 패턴 정보를 이용하여 DAG에 포함된 제1 연산(예컨대, Convolution)에 대응되는 제1 대상 연산(예컨대, 도 5의 제1 대상 연산), 및 제2 연산(예컨대, ReLu)에 대응되는 제2 대상 연산(예컨대, 도 5의 제2 대상 연산)을 포함하는 대상 연산 패턴을 검출할 수 있다. 이때, 대상 연산 패턴을 검출하기 위하여 임의의 패턴 매칭 알고리즘이 이용될 수 있다. In the step of detecting a first target operation corresponding to the first operation and a second target operation corresponding to the second operation from the DAG based on the reference operation pattern information, the neural network model optimization apparatus 1000 uses the reference operation pattern information. a first target operation (eg, the first target operation in FIG. 5 ) corresponding to the first operation (eg, convolution) included in the DAG, and a second target operation (eg, ReLu) corresponding to the second operation (eg, ReLu) , the second target operation of FIG. 5) may be detected. At this time, an arbitrary pattern matching algorithm may be used to detect the target operation pattern.
제1 대상 연산과 제2 대상 연산을 병합하고, 병합 결과에 기초하여 커널을 변환하는 단계에서는, 신경망 모델 최적화 장치(1000)는 제1 대상 연산(예컨대, 도 5의 Convolution)과 제2 대상 연산(예컨대, 도 5의 ReLu)를 병합하고, 병합 결과에 기초하여 대상 연산 패턴에 포함된 커널들을 단일 커널(예컨대, Convolution + ReLu 커널)로 변환하도록 구현될 수 있다. 본 실시예에 따르면, 제1 대상 연산과 제2 대상 연산을 병합하여 일체로 연산을 수행함으로써, 연산에 요구되는 메모리 공간을 줄이고, 실행 속도를 높일 수 있다는 유리한 효과가 제공될 수 있다. In the step of merging the first target operation and the second target operation and transforming the kernel based on the merge result, the neural network model optimization apparatus 1000 performs the first target operation (eg, convolution in FIG. 5 ) and the second target operation. (eg, ReLu in FIG. 5 ) and convert kernels included in the target operation pattern into a single kernel (eg, Convolution + ReLu kernel) based on the merge result. According to the present embodiment, by merging the first target operation and the second target operation and performing the operation integrally, an advantageous effect of reducing a memory space required for the operation and increasing execution speed may be provided.
다시 도 2를 참고하면, 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계(S2000)에서는, 신경망 모델 최적화 장치(1000)는 신경망 모델을 구성하는 연산의 입력 데이터 및/또는 출력 데이터에 대한 정수화를 수행할 수 있다. 구체적으로 신경망 모델 최적화 장치(1000)는 양자화 기법을 활용하여 소수 형태의 연산의 입력 데이터 및/또는 출력 데이터를 특정 범위의 정수로 변환할 수 있다. 여기서 양자화(Quantizaiton)는 32 비트 소수점(float) 값을 8비트 정수(int)로 변환하는 기법이다. 신경망 모델 최적화 장치(1000)는 신경망 모델을 구성하는 연산에 대한 데이터 텐서별로 스케일(Scale)와 제로 포인트(ZeroPoint)를 연산하여, 32 비트 소수점 값을 용량이 상대적으로 작은 8비트 정수 값(int8Value)으로 변환할 수 있다. 예컨대, 신경망 모델 최적화 장치(1000)는 하기의 수학식을 통하여 32 비트 소수점 값을 8비트의 정수 값으로 변환하거나 조정하도록 구성될 수 있다. Referring back to FIG. 2 , in the step of optimizing the structure of the neural network model and obtaining instruction information (S2000), the neural network model optimization apparatus 1000 performs input data and/or output data of calculation constituting the neural network model. It is possible to perform purification on . In detail, the neural network model optimization apparatus 1000 may convert input data and/or output data of a decimal type operation into an integer within a specific range by using a quantization technique. Here, quantization is a technique of converting a 32-bit decimal point (float) value into an 8-bit integer (int). The neural network model optimization apparatus 1000 calculates a scale and a zero point for each data tensor for an operation constituting a neural network model, and converts a 32-bit decimal point value into an 8-bit integer value (int8Value) having a relatively small capacity can be converted to For example, the neural network model optimization apparatus 1000 may be configured to convert or adjust a 32-bit decimal point value into an 8-bit integer value through the following equation.
수학식: Int8Value = (RealValue/Scale)- ZeroPointFormula: Int8Value = (RealValue/Scale)- ZeroPoint
다만, 전술한 8비트 정수 양자화는 하나의 예시에 불과하며, 신경망 모델 최적화 장치(1000)는 8비트 정수 외에도, 임의의 소수점 값을 0 혹은 8 비트 자연수 값으로 변환하거나 조정하여 신경망 모델의 구조에 대한 최적화를 수행하도록 구현될 수 있다. However, the aforementioned 8-bit integer quantization is just one example, and the neural network model optimization apparatus 1000 converts or adjusts an arbitrary decimal point value to 0 or 8-bit natural number value in addition to the 8-bit integer to fit the structure of the neural network model. It can be implemented to perform optimization for
다시 도 3을 참고하면, 본 출원의 일 실시예에 따른 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계(S2000)는, 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하는 단계(S2400)를 더 포함할 수 있다. Referring back to FIG. 3 , in the step of optimizing the structure of a neural network model and obtaining instruction information according to an embodiment of the present application (S2000), a first memory space map is obtained based on the determined execution order, , performing optimization related to memory allocation based on the first memory space map (S2400).
도 6은 본 출원의 일 실시예에 따른 제1 메모리 공간 맵의 일 양상을 도시한 도면이다. 6 is a diagram illustrating one aspect of a first memory space map according to an embodiment of the present application.
결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하는 단계(S2400)에서는, 신경망 모델 최적화 장치(1000)는, S2200 단계에서 결정된 실행 순서 및 각 연산에 요구되는 메모리 공간에 기초하여 제1 메모리 공간 맵을 생성할 수 있다. 구체적으로 도 4와 관련하여 전술한 규칙에 따라 신경망 모델을 구성하는 연산들의 실행 순서(예컨대, 도 6의 A, B, C, D, E, F 순)가 결정될 수 있다. 이때, 신경망 모델 최적화 장치(1000)는 각 연산을 통하여 출력되는 데이터의 크기와 관련된 메모리 공간에 기초하여 제1 메모리 공간 맵을 생성할 수 있다. 예컨대, 신경망 모델 최적화 장치(1000)는 연산 A를 통하여 출력되는 데이터에 필요한 메모리 공간과 연산 A를 통하여 출력되는 데이터가 필요한 연산들(예컨대, 연산 B, 연산 D)의 실행 순서를 고려하여 연산 A와 관련된 메모리 텐서(예컨대, T1)를 배치할 수 있다. 또한, 신경망 모델 최적화 장치(1000)는 연산 B를 통하여 출력되는 데이터에 필요한 메모리 공간과 연산 B를 통하여 출력되는 데이터가 필요한 연산들(예컨대, 연산 C)의 실행 순서를 고려하여 연산 B와 관련된 메모리 텐서(예컨대, T2)를 배치할 수 있다. 이때, 연산 B를 통하여 출력되는 데이터가 저장되는 T2 메모리 텐서는 연산 B에 필요한 데이터를 저장하고 있는 연산 A와 관련된 T1 메모리 텐서의 인접 위치에 배치될 수 있다. 유사한 방식으로 신경망 모델 최적화 장치(1000)는 신경망 모델을 구성하는 연산들(예컨대, 연산 C, D, E 등)을 통하여 출력되는 데이터 크기와 관련된 메모리 공간과 연산들의 실행 순서를 고려하여 제1 메모리 공간 맵을 생성할 수 있다. In the step of obtaining a first memory space map based on the determined execution order and performing optimization related to memory allocation based on the first memory space map (S2400), the neural network model optimization apparatus 1000 determines the determined in step S2200. A first memory space map may be generated based on an execution order and a memory space required for each operation. Specifically, according to the rule described above with reference to FIG. 4 , the execution order of operations constituting the neural network model (eg, the order of A, B, C, D, E, and F in FIG. 6 ) may be determined. In this case, the neural network model optimization apparatus 1000 may generate a first memory space map based on a memory space related to the size of data output through each operation. For example, the neural network model optimization apparatus 1000 considers the memory space required for data output through operation A and the execution order of operations (eg, operation B and operation D) requiring data output through operation A, and operation A You can place a memory tensor (eg, T1) associated with In addition, the neural network model optimization apparatus 1000 considers a memory space required for data output through operation B and an execution order of operations (eg, operation C) requiring data output through operation B, and performs a memory space related to operation B. A tensor (e.g., T2) can be placed. In this case, the T2 memory tensor in which data output through operation B is stored may be disposed adjacent to the T1 memory tensor related to operation A that stores data necessary for operation B. In a similar way, the neural network model optimization apparatus 1000 considers the memory space related to the size of data output through operations constituting the neural network model (eg, operations C, D, E, etc.) and the execution order of operations in the first memory. You can create spatial maps.
이상에서는 도 6에 도시된 제1 메모리 공간 맵을 중심으로 신경망 모델 최적화 장치(1000)의 메모리 텐서를 배치하는 동작을 설명하였다. 다만 도 6에 도시된 제1 메모리 공간 맵은 설명의 편의를 위한 예시일 뿐이며, 이에 제한적으로 해석되어서는 아니된다. In the above, the operation of arranging the memory tensor of the neural network model optimization apparatus 1000 centering on the first memory space map shown in FIG. 6 has been described. However, the first memory space map shown in FIG. 6 is only an example for convenience of explanation, and should not be construed as being limited thereto.
도 7은 본 출원의 일 실시예에 따른 메모리 할당과 관련된 최적화의 일 양상을 도시한 도면이다. 7 is a diagram illustrating an aspect of optimization related to memory allocation according to an embodiment of the present application.
결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하는 단계(S2400)에서는, 신경망 모델 최적화 장치(1000)는 신경망 모델을 구성하는 연산들의 실행 순서 및 연산들을 통하여 출력되는 데이터 크기와 관련된 메모리 공간에 기초하여 생성된 제1 메모리 공간 맵을 획득할 수 있다. In the step of obtaining a first memory space map based on the determined execution order and performing optimization related to memory allocation based on the first memory space map (S2400), the neural network model optimization apparatus 1000 configures the neural network model. A first memory space map generated based on an execution order of operations and a memory space related to a size of data output through the operations may be obtained.
또한, 신경망 모델 최적화 장치(1000)는 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행할 수 있다. 일 예로, 신경망 모델 최적화 장치(1000)는 메모리 인-플레이싱(Memory In-placing) 기법을 활용하여, 특정 연산(예컨대, ReLu 연산, Add 연산, 및/또는 Sigmoid 연산 등)의 출력 공간을 해당 연산의 입력 공간에 덮어쓰는 동작을 수행할 수 있다. 구체적으로 신경망 모델 최적화 장치(1000)는 메모리 인-플레이싱 기법을 활용하여, 특정 연산(예컨대, 도 7의 제3 대상 연산(연산 C))으로 입력된 값이 저장되는 메모리 텐서(예컨대, 도 7의 T2 메모리 텐서)를 특정 연산(예컨대, 도 7의 제3 대상 연산(연산 C))를 통하여 출력된 값이 저장되는 메모리 텐서(예컨대, 도 7의 T3 메모리 텐서)로 변경하도록 구현될 수 있다. 또한, 신경망 모델 최적화 장치(1000)는 메모리 텐서의 변경 결과에 기초하여 제1 메모리 공간 맵으로부터 제2 메모리 공간 맵을 생성할 수 있다. 제2 메모리 공간 맵은 제1 메모리 공간 맵보다는 상대적으로 적은 메모리 공간을 차지하게 된다. 따라서 본 동작을 통하여 본 출원의 일 실시예에 따른 신경망 모델 최적화 방법에 의하면, 필요한 전체 메모리 공간을 줄이고, 연산들의 실행 속도를 높일 수 있다. Also, the neural network model optimization apparatus 1000 may perform memory allocation-related optimization based on the first memory space map. As an example, the neural network model optimization apparatus 1000 uses a memory in-placing technique to assign an output space of a specific operation (eg, a ReLu operation, an Add operation, and/or a Sigmoid operation) to a corresponding You can perform an operation to overwrite the input space of an operation. Specifically, the neural network model optimization apparatus 1000 utilizes a memory in-placement technique to store a value input to a specific operation (eg, the third target operation (operation C) in FIG. 7). It can be implemented to change the T2 memory tensor of 7) to a memory tensor (eg, the T3 memory tensor of FIG. 7) in which a value output through a specific operation (eg, the third target operation (Operation C) of FIG. 7) is stored. there is. Also, the apparatus 1000 for optimizing the neural network model may generate a second memory space map from the first memory space map based on a change result of the memory tensor. The second memory space map occupies a relatively smaller memory space than the first memory space map. Therefore, according to the neural network model optimization method according to an embodiment of the present application through this operation, the total required memory space can be reduced and the execution speed of operations can be increased.
최적화 수행 결과에 기초하여 메모리 주소와 관련된 인스트럭션을 생성하는 단계(S2500)에서는, 신경망 모델 최적화 장치(1000)는 전술한 대상 연산 패턴에 포함된 대상 연산들의 병합 혹은 메모리 할당과 관련된 최적화 수행 결과에 기초하여, 신경망 모델을 구성하는 각 연산에 대응되는 메모리 텐서의 메모리 주소와 관련된 인스트럭션, 및/또는 신경망 모델을 구성하는 각 연산의 유형과 관련된 인스트럭션을 생성할 수 있다. In the step of generating an instruction related to the memory address based on the optimization result (S2500), the neural network model optimization apparatus 1000 is based on the optimization result related to merging of target operations included in the above-described target operation pattern or memory allocation. Thus, an instruction related to a memory address of a memory tensor corresponding to each operation constituting the neural network model and/or an instruction related to the type of each operation constituting the neural network model may be generated.
다시 도 2를 참고하면, 본 출원의 일 실시예에 따른 신경망 모델의 최적화 방법은 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계(S3000)를 포함할 수 있다. Referring back to FIG. 2 , the method for optimizing a neural network model according to an embodiment of the present application may include optimizing an embedded device and obtaining optimal code information (S3000).
이하에서는 도 8 내지 9를 참고하여 본 출원의 일 실시예에 따른 임베디드 장치에 대한 신경망 모델의 최적화에 관한 내용을 보다 구체적으로 서술하도록 한다. 본 출원의 일 실시예에 따르면, 강화 학습 기법을 활용하여 임베디드 장치에 대한 신경망 모델의 최적화를 수행하도록 구현될 수 있다.Hereinafter, with reference to FIGS. 8 and 9 , optimization of a neural network model for an embedded device according to an embodiment of the present application will be described in more detail. According to an embodiment of the present application, it may be implemented to perform optimization of a neural network model for an embedded device using a reinforcement learning technique.
도 8은 본 출원의 일 실시예에 따른 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계를 구체화한 순서도이다. 8 is a flowchart specifying steps of optimizing an embedded device and obtaining optimal code information according to an embodiment of the present application.
본 출원의 일 실시예에 따른 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계(S3000)는, 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계(S3100), 강화 학습으로 훈련된 에이전트를 통하여 인스트럭션 정보에 기초하여 최적화 파라미터를 획득하는 단계(S3200), 및 최적화 파라미터에 기초하여 임베디드 장치에서 이용될 최적 코드 정보를 생성하는 단계(S3300)를 더 포함할 수 있다. Optimizing the embedded device and obtaining optimal code information according to an embodiment of the present application (S3000) includes acquiring computing environment information of the embedded device (S3100), through an agent trained through reinforcement learning. The method may further include obtaining an optimization parameter based on the instruction information (S3200) and generating optimal code information to be used in the embedded device based on the optimization parameter (S3300).
임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계(S3100)에서는, 신경망 모델 최적화 장치(1000)는, 신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통하여, 임베디드 장치(100) 혹은 임의의 외부 장치로부터 신경망 모델이 실행될 타겟 장치인 임베디드 장치(100)의 컴퓨팅 환경 정보(예컨대, 임베디드 장치(100)의 메모리 정보 및 프로세서 정보)를 획득할 수 있다. 한편, 도 8에서는 도시하지는 않았지만, 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계(S3100)에서는, 신경망 모델 최적화 장치(1000)는, 임베디드 장치(100)의 장치 유형 정보나 타겟 기능 정보 등 임베디드 장치(100)에서 신경망 모델을 실행시키기는 영향을 주는 변수에 대한 임의의 정보를 획득할 수 있다. In the step of obtaining computing environment information of the embedded device (S3100), the neural network model optimization apparatus 1000, through the transceiver 1100, the neural network model optimization apparatus 1000, the embedded device 100 or any external Computing environment information (eg, memory information and processor information of the embedded device 100) of the embedded device 100, which is a target device on which the neural network model will be executed, may be obtained from the device. On the other hand, although not shown in FIG. 8, in the step of obtaining computing environment information of the embedded device (S3100), the neural network model optimization apparatus 1000 includes the embedded device (such as device type information or target function information of the embedded device 100) ( In 100), it is possible to obtain arbitrary information about variables affecting the execution of the neural network model.
강화 학습으로 훈련된 에이전트를 통하여 인스트럭션 정보에 기초하여 최적화 파라미터를 획득하는 단계(S3200)에서는, 신경망 모델 최적화 장치(1000)는 강화 학습 기법을 활용하여 훈련된 에이전트를 이용하여, 최적 코드를 생성하기 위한 최적화 파라미터를 획득할 수 있다. In the step of obtaining optimization parameters based on instruction information through an agent trained by reinforcement learning (S3200), the neural network model optimization apparatus 1000 generates an optimal code using an agent trained using a reinforcement learning technique. Optimization parameters can be obtained for
강화 학습으로 훈련된 에이전트를 통하여 인스트럭션 정보에 기초하여 최적화 파라미터를 획득하는 단계(S3200)에서는, 신경망 모델 최적화 장치(1000)는, 메모리 상태 정보, 인스트럭션 정보에 포함된 연산 유형 정보, 및 임베디드 장치(100)의 컴퓨팅 환경 정보를 포함하는 임베디드 장치 정보 중 적어도 하나를 에이전트에 입력하고, 에이전트를 통하여 출력되는 최적화 파라미터를 획득할 수 있다. 여기서 최적화 파라미터란, 연산에 대하여 수행될 알고리즘 유형을 선택하는 파라미터, 연산의 블록 사이즈와 관련된 파라미터, 및/또는 코드의 길이와 관련된 파라미터를 포함하여, 신경망 모델을 실행시키기 위하여 필요한 코드와 관련된 임의의 변수와 관련될 수 있다. In the step of acquiring optimization parameters based on the instruction information through an agent trained by reinforcement learning (S3200), the neural network model optimization apparatus 1000 includes memory state information, operation type information included in the instruction information, and embedded device ( At least one of embedded device information including computing environment information of 100) may be input to the agent, and an optimization parameter output through the agent may be acquired. Here, the optimization parameter is any parameter related to the code necessary to execute the neural network model, including a parameter for selecting the type of algorithm to be performed for the operation, a parameter related to the block size of the operation, and/or a parameter related to the length of the code. Variables can be related.
일 예로, 에이전트에 입력된 연산 유형을 콘볼루션(Convolution)이라고 가정한다. 이때, 훈련이 완료된 에이전트는, 입력값에 기초하여 콘볼루션과 관련된 알고리즘, 예컨대, Im2Col 알고리즘, Default 알고리즘, 및 FFT 알고리즘 중에서 적어도 하나의 알고리즘을 선택하는 파라미터를 출력할 수 있다. 또한, 에이전트는 입력값에 기초하여 연산의 블록 사이즈와 관련된 파라미터, 및/또는 코드의 길이와 관련된 파라미터를 출력할 수 있다. 이때, 신경망 모델 최적화 장치(1000)는 에이전트를 통하여 출력된 최적화 파라미터를 획득할 수 있다. As an example, it is assumed that the operation type input to the agent is convolution. At this time, the trained agent may output a parameter for selecting at least one algorithm from among convolution-related algorithms, for example, the Im2Col algorithm, the default algorithm, and the FFT algorithm, based on the input value. Also, the agent may output a parameter related to the block size of an operation and/or a parameter related to a code length based on an input value. In this case, the apparatus 1000 for optimizing the neural network model may obtain the optimization parameters output through the agent.
도 9는 본 출원의 일 실시예에 따른 강화 학습 방식을 통하여 에이전트를 훈련시키는 일 양상을 도시한 도면이다. 9 is a diagram illustrating an aspect of training an agent through a reinforcement learning method according to an embodiment of the present application.
전술한 바와 같이, 본 출원의 일 실시예에 따른 신경망 모델 최적화 장치(1000)는 '강화 학습'을 통하여 학습된 에이전트를 통하여 최적화 파라미터를 획득할 수 있다. 구체적으로 에이전트는, 초기 규칙(policy)에 기초하여, 연산 유형 정보, 메모리 상태 정보, 및 임베디드 장치 정보(혹은 타겟 장치 정보)에 수신하여 최적화 파라미터(예컨대, 알고리즘 유형을 선택하는 파라미터, 연산의 블록 사이즈와 관련된 파라미터, 및/또는 코드의 길이와 관련된 파라미터 등)와 관련된 예측값을 출력하도록 구성될 수 있다. 한편, 코드 생성기는 최적화 파라미터를 획득하고, 최적화 파라미터에 기초하여 코드를 생성할 수 있다. 이때, 생성된 코드의 성능에 대한 실행 및 평가가 수행되고, 평가 결과에 기초하여 코드의 성능에 대한 평가값을 최대화하도록(즉, 코드의 성능이 최대화되도록) 에이전트의 초기 규칙이 갱신될 수 있다. 구체적으로 코드의 성능에 대한 평가값이 최대화되는 최적화 파라미터를 출력하도록, 에이전트의 초기 규칙이 갱신되도록 학습될 수 있다. 훈련이 완료된 에이전트는 연산 유형 정보, 메모리 상태 정보, 및/또는 임베디드 장치 정보를 수신하여 최대화된 성능을 가지는 코드를 생성할 수 있는 최적화 파라미터를 출력할 수 있다. As described above, the neural network model optimization apparatus 1000 according to an embodiment of the present application may acquire optimization parameters through an agent learned through 'reinforcement learning'. Specifically, the agent receives operation type information, memory state information, and embedded device information (or target device information) based on an initial rule (policy) and optimizes parameters (eg, parameters for selecting an algorithm type, blocks of operations) parameters related to the size, and/or parameters related to the length of the code, etc.). Meanwhile, the code generator may obtain optimization parameters and generate codes based on the optimization parameters. At this time, execution and evaluation of the performance of the generated code are performed, and based on the evaluation result, an initial rule of the agent may be updated to maximize the evaluation value of the code performance (ie, to maximize the performance of the code). . Specifically, the initial rule of the agent may be learned to be updated so as to output an optimization parameter that maximizes the evaluation value of the performance of the code. The trained agent may receive operation type information, memory state information, and/or embedded device information and output optimization parameters capable of generating code with maximized performance.
최적화 파라미터에 기초하여 임베디드 장치에서 이용될 최적 코드 정보를 생성하는 단계(S3300)에서는, 신경망 모델 최적화 장치(1000)는, S3200 단계에서 생성된 최적화 파라미터(예컨대, 연산에 대하여 수행될 알고리즘 유형을 선택하는 파라미터, 연산의 블록 사이즈와 관련된 파라미터, 및/또는 코드의 길이와 관련된 파라미터 등)에 기초하여 임베디드 장치(100)에서 이용될 최적 코드 정보를 생성할 수 있다. 구체적으로 신경망 모델 최적화 장치(1000)는, 코드 생성기를 통하여, 최적화 파라미터 및 해당 연산의 메모리 주소에 기초하여 최적 코드를 생성할 수 있다. 예컨대, 최적화 파라미터가 Im2Col 알고리즘, Default 알고리즘, 및 FFT 알고리즘 중에서 적어도 하나의 알고리즘(예컨대, Im2Col 알고리즘)을 선택하는 파라미터, 연산의 블록 사이즈 값과 관련된 파라미터, 및/또는 코드의 길이 값과 관련된 파라미터 중 적어도 하나를 포함하는 경우에는, 신경망 모델 최적화 장치(1000)는, 코드 생성기를 통하여, 최적화 파라미터 및 인스트럭션 정보에 포함된 연산의 메모리 주소에 기초하여, 최적 코드를 생성할 수 있다. In the step of generating optimal code information to be used in the embedded device based on the optimization parameter (S3300), the neural network model optimization apparatus 1000 selects the type of algorithm to be performed for the optimization parameter (eg, operation) generated in step S3200. Optimal code information to be used in the embedded device 100 may be generated based on a parameter related to a block size of an operation, a parameter related to a block size of an operation, and/or a parameter related to a code length. In detail, the neural network model optimization apparatus 1000 may generate an optimal code based on an optimization parameter and a memory address of a corresponding operation through a code generator. For example, the optimization parameter is a parameter for selecting at least one algorithm (eg, Im2Col algorithm) from among the Im2Col algorithm, the Default algorithm, and the FFT algorithm, a parameter related to a block size value of an operation, and/or a parameter related to a code length value. When at least one is included, the neural network model optimization apparatus 1000 may generate an optimal code through a code generator based on the optimization parameter and the memory address of the operation included in the instruction information.
한편, 도 8에서는 도시하지는 않았지만, 본 출원의 일 실시예에 따른 최적화 파라미터에 기초하여 임베디드 장치에서 이용될 최적 코드 정보를 생성하는 단계(S3300)는, 최적화 파라미터에 기초하여 인스트럭션 정보에 대응되도록 코드를 생성하는 단계, 생성된 코드를 컴파일하여 바이너리 파일 형태로 변환하는 단계를 더 포함할 수 있다. 구체적으로 신경망 모델 최적화 장치(1000)는 최적화 파라미터에 기초하여 코드(예컨대, C 언어 코드)를 생성하고, 인스트럭션 정보에 포함된 메모리 주소에 생성된 코드를 저장할 수 있다. 또한, 신경망 모델 최적화 장치(1000)는 생성된 코드를 컴파일하여 바이너리 파일(예, API 파일)로 변환할 수 있다. 또한 신경망 모델 최적화 장치(1000)는, 송수신부(1100)를 통하여, 생성된 코드의 바이너리 파일을 임베디드 장치(100) 혹은 임의의 외부 장치로 송신할 수 있다. 본 실시예에 따르면, 최적 코드가 바이너리 파일(예컨대, API 파일) 형태로 임베디드 장치(100)로 송신됨으로써, 임베디드 장치(100)의 사용자가 최적 코드를 시각적으로 확인할 수 있다. Meanwhile, although not shown in FIG. 8 , generating optimal code information to be used in an embedded device based on an optimization parameter according to an embodiment of the present application (S3300) includes code corresponding to instruction information based on the optimization parameter. The step of generating, compiling the generated code and converting it into a binary file form may be further included. In detail, the neural network model optimization apparatus 1000 may generate code (eg, C language code) based on the optimization parameter and store the generated code in a memory address included in instruction information. In addition, the apparatus 1000 for optimizing the neural network model may compile and convert the generated code into a binary file (eg, an API file). In addition, the neural network model optimization apparatus 1000 may transmit the binary file of the generated code to the embedded device 100 or an arbitrary external device through the transceiver 1100 . According to this embodiment, the optimal code is transmitted to the embedded device 100 in the form of a binary file (eg, an API file), so that the user of the embedded device 100 can visually check the optimal code.
본 출원의 실시예에 따른 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 의하면, 임베디드 장치의 하드웨어의 비표준화 문제와 기존 인공지능 실행 엔진의 구조적인 제약을 해결하고, 신경망 모델을 임베디드 장치의 하드웨어 플랫폼에 대하여 최적화시킬 수 있다. According to the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to an embodiment of the present application, the non-standardization problem of hardware of an embedded device and the structural limitations of existing artificial intelligence execution engines are solved, and the neural network model It can be optimized for the hardware platform of the embedded device.
본 출원의 실시예에 따른 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 의하면, 임베디드 장치에서의 신경망 모델의 실행 능력이 향상될 수 있다.According to the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to the embodiments of the present application, the execution capability of the neural network model in an embedded device can be improved.
본 출원의 실시예에 따른 신경망 모델 최적화 방법, 신경망 모델 최적화 장치, 및 신경망 모델 최적화 시스템에 의하면, 임베디드 장치에서 신경망 모델을 실행시키기 위하여 필요한 전력 사용량을 감소시킬 수 있다. According to the neural network model optimization method, the neural network model optimization apparatus, and the neural network model optimization system according to embodiments of the present application, power consumption required to execute a neural network model in an embedded device can be reduced.
상술한 신경망 모델 최적화 장치(1000)의 다양한 동작들은 신경망 모델 최적화 장치(1000)의 메모리(1200)에 저장될 수 있으며, 신경망 모델 최적화 장치(1000)의 프로세서(1300)는 메모리(1200)에 저장된 동작들을 수행하도록 제공될 수 있다. Various operations of the neural network model optimization apparatus 1000 described above may be stored in the memory 1200 of the neural network model optimization apparatus 1000, and the processor 1300 of the neural network model optimization apparatus 1000 may be stored in the memory 1200. Can be provided to perform actions.
본 출원에 개시된 신경망 모델 최적화 방법, 신경망 모델 최적화 장치 및 신경망 모델 최적화 시스템은 가전 제품, 차량용 센서, 유아 혹은 노인의 안전을 위한 제품 및 스마트 워치 등을 포함하여 다양한 임베디드 시스템에서의 인공지능 모델의 효율적인 실행을 위하여 이용될 수 있다. The neural network model optimization method, the neural network model optimization device, and the neural network model optimization system disclosed in this application provide an efficient method of artificial intelligence models in various embedded systems, including home appliances, vehicle sensors, products for the safety of infants or the elderly, and smart watches. can be used for execution.
이상에서 실시 형태들에 설명된 특징, 구조, 효과 등은 본 발명의 적어도 하나의 실시 형태에 포함되며, 반드시 하나의 실시 형태에만 한정되는 것은 아니다. 나아가, 각 실시 형태에서 예시된 특징, 구조, 효과 등은 실시 형태들이 속하는 분야의 통상의 지식을 가지는 자에 의해 다른 실시 형태들에 대해서도 조합 또는 변형되어 실시 가능하다. 따라서 이러한 조합과 변형에 관계된 내용들은 본 발명의 범위에 포함되는 것으로 해석되어야 할 것이다.The features, structures, effects, etc. described in the embodiments above are included in at least one embodiment of the present invention, and are not necessarily limited to only one embodiment. Furthermore, the features, structures, effects, etc. illustrated in each embodiment can be combined or modified with respect to other embodiments by a person having ordinary knowledge in the field to which the embodiments belong. Therefore, contents related to these combinations and variations should be construed as being included in the scope of the present invention.
또한, 이상에서 실시 형태를 중심으로 설명하였으나 이는 단지 예시일 뿐 본 발명을 한정하는 것이 아니며, 본 발명이 속하는 분야의 통상의 지식을 가진 자라면 본 실시 형태의 본질적인 특성을 벗어나지 않는 범위에서 이상에 예시되지 않은 여러 가지의 변형과 응용이 가능함을 알 수 있을 것이다. 즉, 실시 형태에 구체적으로 나타난 각 구성 요소는 변형하여 실시할 수 있는 것이다. 그리고 이러한 변형과 응용에 관계된 차이점들은 첨부된 청구 범위에서 규정하는 본 발명의 범위에 포함되는 것으로 해석되어야 할 것이다.In addition, although the embodiment has been described above, this is only an example and does not limit the present invention, and those skilled in the art to the present invention pertain to the above to the extent that does not deviate from the essential characteristics of the present embodiment. It will be appreciated that various modifications and applications not exemplified are possible. That is, each component specifically shown in the embodiment can be implemented by modifying it. And differences related to these modifications and applications should be construed as being included in the scope of the present invention as defined in the appended claims.

Claims (14)

  1. 학습이 완료된 신경망 모델의 실행 데이터에 기초하여 신경망 모델에 대한 최적화를 수행하는 신경망 모델 최적화 장치가, 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경을 고려하여 신경망 모델을 최적화하는 방법에 있어서, A method for optimizing a neural network model by an apparatus for optimizing a neural network model based on execution data of a trained neural network model in consideration of a computing environment of an embedded device in which the neural network model is to be driven,
    학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data) 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-; Acquiring execution data of a neural network model for which learning has been completed, wherein the execution data includes at least one of layer data of the neural network model, operation data constituting the neural network model, and parameters of the neural network model;
    상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계-상기 인스트럭션 정보는 연산의 유형, 및 메모리 주소 중 적어도 하나와 관련된 정보를 포함함-; performing optimization on the structure of the neural network model based on execution data of the neural network model and obtaining instruction information, wherein the instruction information includes information related to at least one of an operation type and a memory address;
    상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계; 및optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and
    상기 최적 코드 정보를 송신하는 단계;를 포함하되,Transmitting the optimal code information; including,
    상기 최적 코드 정보를 획득하는 단계는, Obtaining the optimal code information,
    상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계; obtaining computing environment information of the embedded device;
    강화 학습으로 훈련된 에이전트를 통하여, 인스트럭션 정보로부터 최적화 파라미터를 획득하는 단계; 및obtaining an optimization parameter from instruction information through an agent trained by reinforcement learning; and
    상기 최적화 파라미터에 기초하여 상기 임베디드 장치에서 이용될 코드 정보를 생성하는 단계;를 더 포함하는, Generating code information to be used in the embedded device based on the optimization parameter; Further comprising,
    신경망 모델 최적화 방법. Neural network model optimization methods.
  2. 제1 항에 있어서, According to claim 1,
    상기 최적화 파라미터를 획득하는 단계는, Obtaining the optimization parameters,
    상기 연산에 대응되는 적어도 하나 이상의 연산 유형 정보, 메모리 상태 정보, 및 상기 임베디드 장치의 컴퓨팅 환경 정보 중 적어도 하나를 상기 에이전트에 입력하는 단계; 및inputting at least one of at least one operation type information corresponding to the operation, memory state information, and computing environment information of the embedded device to the agent; and
    상기 에이전트를 통하여 출력되는 최적화 파라미터를 획득하는 단계;를 더 포함하는, Acquiring an optimization parameter output through the agent; further comprising,
    신경망 모델 최적화 방법. Methods for optimizing neural network models.
  3. 제2 항에 있어서, According to claim 2,
    상기 최적화 파라미터는, The optimization parameter is,
    상기 연산에 대하여 수행될 알고리즘 유형을 선택하는 파라미터, 상기 연산의 블록 사이즈와 관련된 파라미터, 및 코드의 길이와 관련된 파라미터 중 적어도 하나와 관련되는, Associated with at least one of a parameter for selecting the type of algorithm to be performed for the operation, a parameter related to the block size of the operation, and a parameter related to the length of the code,
    신경망 모델 최적화 방법.Neural network model optimization methods.
  4. 제1 항에 있어서, According to claim 1,
    상기 에이전트는, the agent,
    초기 규칙에 따라, 타겟 임베디드 장치의 컴퓨팅 환경과 관련된 타겟 장치 정보, 메모리 상태 정보, 및 연산(operation)에 대응되는 적어도 하나 이상의 알고리즘 유형 정보에 기초하여 파라미터와 관련된 예측값을 출력하도록 구성되되, According to the initial rule, based on target device information related to the computing environment of the target embedded device, memory state information, and at least one algorithm type information corresponding to an operation, a predicted value related to a parameter is output,
    상기 에이전트는, 예측값을 통하여 생성된 코드의 성능에 대한 평가값이 최대화되도록 상기 초기 규칙이 갱신됨으로써 훈련되는, The agent is trained by updating the initial rule so that the evaluation value for the performance of the code generated through the predicted value is maximized.
    신경망 모델 최적화 방법.Neural network model optimization methods.
  5. 제1 항에 있어서, According to claim 1,
    상기 임베디드 장치에서 이용될 코드 정보를 생성하는 단계는, The step of generating code information to be used in the embedded device,
    상기 최적화 파라미터에 기초하여 상기 인스트럭션 정보에 대응되도록 코드를 생성하는 단계; 및generating code to correspond to the instruction information based on the optimization parameter; and
    상기 생성된 코드를 컴파일하여 바이너리 파일 형태로 변환하는 단계;를 더 포함하는, Compiling the generated code and converting it into a binary file form; further comprising,
    신경망 모델 최적화 방법.Neural network model optimization methods.
  6. 학습이 완료된 신경망 모델의 실행 데이터에 기초하여 신경망 모델에 대한 최적화를 수행하는 신경망 모델 최적화 장치가, 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경을 고려하여 신경망 모델을 최적화하는 방법에 있어서, A method for optimizing a neural network model by an apparatus for optimizing a neural network model based on execution data of a trained neural network model in consideration of a computing environment of an embedded device in which the neural network model is to be driven,
    학습이 완료된 신경망 모델의 실행 데이터를 획득하는 단계-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-; Obtaining execution data of a neural network model on which training has been completed, wherein the execution data includes at least one of layer data of the neural network model, operation data constituting the neural network model, and parameters of the neural network model. ;
    상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계; optimizing the structure of the neural network model based on execution data of the neural network model and obtaining instruction information;
    상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하는 단계; 및optimizing an embedded device in which the neural network model is to be driven based on the instruction information and obtaining optimal code information; and
    상기 최적 코드 정보를 송신하는 단계;를 포함하되, Transmitting the optimal code information; including,
    상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계는, The step of optimizing the structure of the neural network model and obtaining instruction information,
    상기 실행 데이터에 기초하여 방향성 비사이클 그래프(DAG)를 생성하는 단계; generating a directed acyclic graph (DAG) based on the execution data;
    상기 방향성 비사이클 그래프에 기초하여 연산들의 실행 순서를 결정하는 단계; determining an execution order of operations based on the directed acyclic graph;
    미리 정해진 기준 연산 패턴에 기초하여 상기 기준 연산 패턴에 대응되는 상기 방향성 비사이클 그래프의 대상 연산 패턴을 검출하고, 상기 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하는 단계; detecting a target operation pattern of the directed acyclic graph corresponding to the reference operation pattern based on a predetermined reference operation pattern, and merging a first target operation and a second target operation included in the target operation pattern;
    상기 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 상기 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하는 단계; 및obtaining a first memory space map based on the determined execution order, and performing optimization related to memory allocation based on the first memory space map; and
    최적화 수행 결과에 기초하여 메모리 주소와 관련된 인스트럭션을 생성하는 단계;를 더 포함하는, Generating an instruction related to the memory address based on the result of performing the optimization; further comprising,
    신경망 모델 최적화 방법. Neural network model optimization methods.
  7. 제6 항에 있어서, According to claim 6,
    상기 제1 대상 연산과 상기 제2 대상 연산을 병합하는 단계는, The merging of the first target operation and the second target operation comprises:
    미리 정해진 기준 연산 패턴 정보를 획득하는 단계-상기 기준 연산 패턴 정보는 제1 연산 및 상기 제1 연산과 연계된 제2 연산을 포함함-; obtaining predetermined reference calculation pattern information, wherein the reference calculation pattern information includes a first calculation and a second calculation associated with the first calculation;
    상기 기준 연산 패턴 정보에 기초하여 상기 방향성 비사이클 그래프로부터 상기 제1 연산에 대응되는 상기 제1 대상 연산 및 상기 제2 연산에 대응되는 상기 제2 대상 연산을 검출하는 단계; 및detecting the first target operation corresponding to the first operation and the second target operation corresponding to the second operation from the directed acyclic graph based on the reference operation pattern information; and
    상기 제1 대상 연산과 상기 제2 대상 연산을 병합하고, 상기 병합 결과에 기초하여 커널을 변환하는 단계;를 더 포함하는, Further comprising merging the first target operation and the second target operation and converting a kernel based on the merging result.
    신경망 모델 최적화 방법. Methods for optimizing neural network models.
  8. 제6 항에 있어서, According to claim 6,
    상기 메모리 할당과 관련된 최적화를 수행하는 단계는, The step of performing the optimization related to the memory allocation,
    상기 결정된 실행 순서 및 상기 연산을 통하여 출력되는 데이터의 크기에 기초하여 상기 제1 메모리 공간 맵을 생성하는 단계; generating the first memory space map based on the determined execution order and the size of data output through the operation;
    제3 대상 연산으로 입력된 값이 저장되는 제1 메모리 텐서를 상기 제3 대상 연산을 통하여 출력된 값이 저장되는 제2 메모리 텐서로 변경하는 단계; 및 changing a first memory tensor storing a value input through a third target operation into a second memory tensor storing a value output through the third target operation; and
    상기 변경 결과에 기초하여 상기 제1 메모리 공간 맵으로부터 제2 메모리 공간 맵을 생성하는 단계;를 더 포함하는, Generating a second memory space map from the first memory space map based on the change result; further comprising,
    신경망 모델 최적화 방법.Neural network model optimization methods.
  9. 제6 항에 있어서, According to claim 6,
    상기 연산들의 실행 순서를 결정하는 단계는, Determining the execution order of the operations,
    상기 방향성 비사이클 그래프의 제1 브랜치(branch)에 포함된 제4 대상 연산에 요구되는 제1 메모리 공간과 상기 방향성 비사이클 그래프의 제2 브랜치에 포함된 제5 대상 연산에 요구되는 제2 메모리 공간을 연산하는 단계; A first memory space required for a fourth target operation included in the first branch of the directed acyclic graph and a second memory space required for a fifth target operation included in the second branch of the directed acyclic graph. Computing;
    상기 제1 메모리 공간과 상기 제2 메모리 공간을 비교하는 단계; 및 comparing the first memory space and the second memory space; and
    상기 비교 결과에 따라 상기 제4 대상 연산과 상기 제5 대상 연산의 실행 순서를 결정하는 단계;를 더 포함하는, Determining an execution order of the fourth target operation and the fifth target operation according to the comparison result;
    신경망 모델 최적화 방법.Methods for optimizing neural network models.
  10. 제9 항에 있어서, According to claim 9,
    상기 제1 메모리 공간이 상기 제2 메모리 공간보다 큰 경우, 상기 제4 대상 연산의 실행 순서는 상기 제5 대상 연산의 실행 순서보다 후순위로 할당하되, When the first memory space is larger than the second memory space, the execution order of the fourth target operation is assigned a lower priority than the execution order of the fifth target operation;
    상기 제1 메모리 공간이 상기 제2 메모리 공간보다 작은 경우, 상기 제4 대상 연산의 실행 순서는 상기 제5 대상 연산의 실행 순서보다 선순위로 할당하는,When the first memory space is smaller than the second memory space, the execution order of the fourth target operation is assigned a priority over the execution order of the fifth target operation.
    신경망 모델 최적화 방법.Neural network model optimization methods.
  11. 제10 항에 있어서,According to claim 10,
    상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하는 단계는, The step of optimizing the structure of the neural network model and obtaining instruction information,
    상기 신경망 모델의 연산(operation)과 관련된 입력 데이터 및 출력 데이터를 획득하는 단계; 및obtaining input data and output data related to the operation of the neural network model; and
    상기 입력 데이터 및 상기 출력 데이터를 미리 결정된 정수 범위에 해당하는 값으로 조정하는 단계;를 더 포함하는,Adjusting the input data and the output data to values corresponding to a predetermined range of integers; further comprising,
    신경망 모델 최적화 방법.Methods for optimizing neural network models.
  12. 컴퓨터에 제1 항 내지 제11 항 중 어느 하나의 항에 따른 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체.A computer-readable recording medium recording a program for executing the method according to any one of claims 1 to 11 in a computer.
  13. 학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경에 기초하여 신경망 모델에 대한 최적화를 수행하는 신경망 모델 최적화 장치에 있어서, A neural network model optimization apparatus for optimizing a neural network model based on execution data of a trained neural network model and a computing environment of an embedded device in which the neural network model is to be driven,
    학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 송수신부; 및a transceiver for acquiring execution data of the trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and
    상기 실행 데이터 및 상기 임베디드 장치의 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델에 대한 최적화를 수행하는 프로세서;를 포함하되, A processor performing optimization of the neural network model based on the execution data and computing environment information of the embedded device;
    상기 프로세서는, the processor,
    학습이 완료된 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-를 획득하고, 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보-상기 인스트럭션 정보는 연산의 유형, 및 메모리 주소 중 적어도 하나와 관련된 정보를 포함함-를 획득하고, 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 송신하도록 구성되되, Obtaining execution data of a neural network model on which learning has been completed, wherein the execution data includes at least one of layer data of the neural network model, operation data constituting the neural network model, and parameters of the neural network model, Optimization of the structure of the neural network model is performed based on execution data of the neural network model, and instruction information, including information related to at least one of a type of operation and a memory address, is obtained, and the instruction Based on the information, it is configured to optimize an embedded device in which the neural network model will be driven, obtain optimal code information, and transmit the optimal code information,
    상기 프로세서는, the processor,
    상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하고, 강화 학습으로 훈련된 에이전트를 통하여, 인스트럭션 정보로부터 최적화 파라미터를 획득하고, 상기 최적화 파라미터에 기초하여 상기 임베디드 장치에서 이용될 코드 정보를 생성함으로써 상기 최적 코드 정보를 획득하도록 구성된, The optimal code information by obtaining computing environment information of the embedded device, obtaining optimization parameters from instruction information through an agent trained through reinforcement learning, and generating code information to be used in the embedded device based on the optimization parameters. configured to obtain
    신경망 모델 최적화 장치.Neural network model optimizer.
  14. 학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경에 기초하여 신경망 모델에 대한 최적화를 수행하는 신경망 모델 최적화 장치에 있어서, A neural network model optimization apparatus for optimizing a neural network model based on execution data of a trained neural network model and a computing environment of an embedded device in which the neural network model is to be driven,
    학습이 완료된 신경망 모델의 실행 데이터 및 신경망 모델이 구동될 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 송수신부; 및a transceiver for acquiring execution data of the trained neural network model and computing environment information of an embedded device in which the neural network model is to be driven; and
    상기 실행 데이터 및 상기 임베디드 장치의 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델에 대한 최적화를 수행하는 프로세서;를 포함하되, A processor performing optimization of the neural network model based on the execution data and computing environment information of the embedded device;
    상기 프로세서는, the processor,
    학습이 완료된 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 계층 데이터, 상기 신경망 모델을 구성하는 연산 데이터(operation data), 및 상기 신경망 모델의 파라미터 중 적어도 하나를 포함함-를 획득하고, 상기 신경망 모델의 실행 데이터에 기초하여 상기 신경망 모델의 구조에 대한 최적화를 수행하고 인스트럭션 정보를 획득하고, 상기 인스트럭션 정보에 기초하여 상기 신경망 모델이 구동될 임베디드 장치에 대한 최적화를 수행하고 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 송신하도록 구성되되, Obtaining execution data of a neural network model on which learning has been completed, wherein the execution data includes at least one of layer data of the neural network model, operation data constituting the neural network model, and parameters of the neural network model, Based on the execution data of the neural network model, optimization of the structure of the neural network model is performed, instruction information is obtained, optimization of the embedded device in which the neural network model is to be driven is performed based on the instruction information, and optimal code information is obtained. Acquire and configured to transmit the optimal code information,
    상기 프로세서는, the processor,
    상기 실행 데이터에 기초하여 방향성 비사이클 그래프(DAG)를 생성하고, 상기 방향성 비사이클 그래프에 기초하여 연산들의 실행 순서를 결정하고, 미리 정해진 기준 연산 패턴에 기초하여 상기 기준 연산 패턴에 대응되는 상기 방향성 비사이클 그래프의 대상 연산 패턴을 검출하고, 상기 대상 연산 패턴에 포함된 제1 대상 연산과 제2 대상 연산을 병합하고, 상기 결정된 실행 순서에 기초하여 제1 메모리 공간 맵을 획득하고, 상기 제1 메모리 공간 맵에 기초하여 메모리 할당과 관련된 최적화를 수행하고, 최적화 수행 결과에 기초하여 실행 순서 및 메모리 주소와 관련된 인스트럭션을 생성함으로써, 상기 인스트럭션 정보를 획득하도록 구성된, A directed acyclic graph (DAG) is generated based on the execution data, an execution order of operations is determined based on the directed acyclic graph, and the directionality corresponding to the reference operation pattern is determined based on a predetermined reference operation pattern. A target operation pattern of an acyclic graph is detected, a first target operation and a second target operation included in the target operation pattern are merged, a first memory space map is obtained based on the determined execution order, and the first Performing optimization related to memory allocation based on the memory space map, and generating instructions related to an execution order and a memory address based on a result of performing the optimization, thereby obtaining the instruction information,
    신경망 모델 최적화 장치.Neural network model optimizer.
PCT/KR2023/002279 2022-02-23 2023-02-16 Neural network model optimization method to be executed in embedded device, neural network model optimization apparatus, and neural network model optimization system WO2023163453A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2022-0023382 2022-02-23
KR1020220023380A KR102462001B1 (en) 2022-02-23 2022-02-23 Method, device, and system for optimizing a neural network model to be executed on imbedded device
KR1020220023382A KR102462002B1 (en) 2022-02-23 2022-02-23 Method, device, and system for optimizing a neural network model to be executed on imbedded device
KR10-2022-0023380 2022-02-23

Publications (1)

Publication Number Publication Date
WO2023163453A1 true WO2023163453A1 (en) 2023-08-31

Family

ID=87766396

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/002279 WO2023163453A1 (en) 2022-02-23 2023-02-16 Neural network model optimization method to be executed in embedded device, neural network model optimization apparatus, and neural network model optimization system

Country Status (1)

Country Link
WO (1) WO2023163453A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190113928A (en) * 2017-03-24 2019-10-08 구글 엘엘씨 Device placement optimization through reinforcement learning
KR20200009435A (en) * 2018-07-19 2020-01-30 삼성전자주식회사 Method of managing data representation for deep learning, method of processing data for deep learning and deep learning system performing the same
KR20200024764A (en) * 2017-04-17 2020-03-09 딥시그 인크. Placement and Scheduling of Radio Signal Processing Dataflow Operations
KR102257028B1 (en) * 2020-10-06 2021-05-27 주식회사 딥이티 Apparatus and method for allocating deep learning task adaptively based on computing platform
KR102462002B1 (en) * 2022-02-23 2022-11-03 주식회사 에너자이(ENERZAi) Method, device, and system for optimizing a neural network model to be executed on imbedded device
KR102462001B1 (en) * 2022-02-23 2022-11-03 주식회사 에너자이(ENERZAi) Method, device, and system for optimizing a neural network model to be executed on imbedded device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190113928A (en) * 2017-03-24 2019-10-08 구글 엘엘씨 Device placement optimization through reinforcement learning
KR20200024764A (en) * 2017-04-17 2020-03-09 딥시그 인크. Placement and Scheduling of Radio Signal Processing Dataflow Operations
KR20200009435A (en) * 2018-07-19 2020-01-30 삼성전자주식회사 Method of managing data representation for deep learning, method of processing data for deep learning and deep learning system performing the same
KR102257028B1 (en) * 2020-10-06 2021-05-27 주식회사 딥이티 Apparatus and method for allocating deep learning task adaptively based on computing platform
KR102462002B1 (en) * 2022-02-23 2022-11-03 주식회사 에너자이(ENERZAi) Method, device, and system for optimizing a neural network model to be executed on imbedded device
KR102462001B1 (en) * 2022-02-23 2022-11-03 주식회사 에너자이(ENERZAi) Method, device, and system for optimizing a neural network model to be executed on imbedded device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ROCHA RODRIGO C. O. R.ROCHA@ED.AC.UK; PETOUMENOS PAVLOS PPETOUME@INF.ED.AC.UK; WANG ZHENG Z.WANG5@LEEDS.AC.UK; COLE MURRAY MIC@INF: "Effective function merging in the SSA form", PROCEEDINGS OF THE 41ST ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION, ACMPUB27, NEW YORK, NY, USA, 11 June 2020 (2020-06-11) - 20 June 2020 (2020-06-20), New York, NY, USA , pages 854 - 868, XP058454014, ISBN: 978-1-4503-7613-6, DOI: 10.1145/3385412.3386030 *

Similar Documents

Publication Publication Date Title
CN106095654B (en) Performance verification device, performance verification system, and performance verification method
WO2015115852A1 (en) Task scheduling method and apparatus
WO2020230977A1 (en) Metacognition-based high-speed environmental search method and device
WO2015126060A1 (en) Electronic device and method for processing image
WO2017104902A1 (en) User terminal device, server, and application execution method thereof
EP3942481A1 (en) Method of performing, by electronic device, convolution operation at certain layer in neural network, and electronic device therefor
WO2021230524A1 (en) Display device for reducing flicker and electronic device comprising same
WO2023163453A1 (en) Neural network model optimization method to be executed in embedded device, neural network model optimization apparatus, and neural network model optimization system
WO2020246724A1 (en) Electronic apparatus and method of performing operations thereof
WO2013089291A1 (en) M2m device for enabling the easy addition of an extending function
WO2022030903A1 (en) Application installation method and electronic device for supporting same
KR102462002B1 (en) Method, device, and system for optimizing a neural network model to be executed on imbedded device
KR102462001B1 (en) Method, device, and system for optimizing a neural network model to be executed on imbedded device
WO2021107577A1 (en) Electronic device for supporting to control auto brightness of display
EP3977264A1 (en) Application optimization method and electronic device supporting the same
WO2011037329A2 (en) Apparatus and method for providing context-aware service
WO2023027368A1 (en) Execution engine optimization method, execution engine optimization device, and execution engine optimization system
WO2022149716A1 (en) System and method for obtaining and applying a vignette filter and grain layer
WO2013015569A2 (en) Simulation device and simulation method therefor
WO2021157837A1 (en) Electronic device for scheduling based on heterogeneous multi-processor and operating method
WO2022092521A1 (en) Method for controlling state control parameter for adjusting state of network of base station by using any one of plurality of models, and electronic device for performing same
WO2015080531A1 (en) Method and apparatus for controlling reconfigurable processor
WO2023171930A1 (en) Neural network model compression method and neural network model compression device
WO2022154150A1 (en) Electronic device and control method therefor
WO2017150841A1 (en) Electronic device, application execution system, and control method therefor

Legal Events

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

Ref document number: 23760327

Country of ref document: EP

Kind code of ref document: A1