WO2023027368A1 - Execution engine optimization method, execution engine optimization device, and execution engine optimization system - Google Patents

Execution engine optimization method, execution engine optimization device, and execution engine optimization system Download PDF

Info

Publication number
WO2023027368A1
WO2023027368A1 PCT/KR2022/011390 KR2022011390W WO2023027368A1 WO 2023027368 A1 WO2023027368 A1 WO 2023027368A1 KR 2022011390 W KR2022011390 W KR 2022011390W WO 2023027368 A1 WO2023027368 A1 WO 2023027368A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
neural network
network model
execution engine
data
Prior art date
Application number
PCT/KR2022/011390
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 KR1020210111338A external-priority patent/KR102393767B1/en
Application filed by 주식회사 에너자이 filed Critical 주식회사 에너자이
Publication of WO2023027368A1 publication Critical patent/WO2023027368A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to an execution engine optimization method, an execution engine optimization apparatus, and an execution engine optimization system. Specifically, the present application relates to an execution engine optimization method for optimizing an execution engine used in an embedded device, an execution engine optimization device, and an execution engine optimization system.
  • 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 artificial intelligence execution engine adopts a method of acquiring information about model execution in an embedded device, allocating memory required for model execution, and executing the model.
  • An example of a representative execution engine adopting this method is Tensorflow Lite Micro. This method has the advantage of being able to flexibly analyze the model structure and control memory allocation even when the model is changed during model execution.
  • An object to be solved by the present invention is to provide an execution engine optimization method, an execution engine optimization device, and an execution engine optimization system for optimizing an execution engine in consideration of a computing environment of an embedded device.
  • An execution engine optimization method includes obtaining binary data of a neural network model on which training is completed; extracting execution data of the neural network model from the binary data, wherein the execution data is related to at least one of execution sequence data of the neural network model and structural data of the neural network model; obtaining computing environment information of the embedded device, wherein the computing environment information includes at least one of memory information and processor information of the embedded device; predicting an operation of the neural network model in the embedded device based on the execution data and the computing environment information and performing optimization of the execution engine; obtaining optimal code information to be used in the execution engine based on the optimization result; and transmitting the optimum code information.
  • An execution engine optimization system includes a processor generating an optimal code for optimizing an execution engine to be used in an embedded device based on data of a neural network model that has been trained; and a transceiver for communicating with the embedded device; a server including; and an embedded device that obtains the optimal code and executes the optimal code; wherein the processor obtains binary data of the neural network model for which learning has been completed, and from the binary data, execution data of the neural network model - the execution data Extracts related to at least one of execution order information of the neural network model and structural data of the neural network model, and computing environment information of the embedded device-the computing environment information is at least one of memory information and processor information of the embedded device.
  • Obtaining, predicting the operation of the neural network model in the embedded device based on the execution data and the computing environment information, performing optimization of the execution engine, and based on the optimization result It may be configured to obtain optimal code information to be used in the execution engine, and transmit the optimal code information to the embedded device through the transceiver.
  • the execution capability of a neural network model in an embedded device may be improved.
  • power consumption in an embedded device may be reduced.
  • FIG. 1 is a schematic diagram of an execution engine optimization system according to an embodiment of the present application.
  • FIG. 2 is a diagram illustrating operations of an execution engine optimization system according to an embodiment of the present application.
  • FIG. 3 is a flowchart illustrating a method of optimizing an execution engine according to an embodiment of the present application.
  • FIG. 4 is a flowchart detailing steps for performing optimization of an execution engine according to an embodiment of the present application.
  • FIG. 5 is a flowchart specifying a step of obtaining target structure information of a neural network model according to an embodiment of the present application.
  • FIG. 6 is a diagram illustrating one aspect of a method for generating a first optimal code according to an embodiment of the present application.
  • FIG. 7 is a flowchart embodying steps for performing optimization of an execution engine according to another embodiment of the present application.
  • FIG. 8 is a flowchart embodying a step of generating a second optimal code according to an embodiment of the present application.
  • FIG. 9 is a flowchart embodying steps for performing optimization of an execution engine in another embodiment of the present application.
  • An execution engine optimization method includes obtaining binary data of a neural network model on which training is completed; extracting execution data of the neural network model from the binary data, wherein the execution data is related to at least one of execution sequence data of the neural network model and structural data of the neural network model; obtaining computing environment information of the embedded device, wherein the computing environment information includes at least one of memory information and processor information of the embedded device; predicting an operation of the neural network model in the embedded device based on the execution data and the computing environment information and performing optimization of the execution engine; obtaining optimal code information to be used in the execution engine based on the optimization result; and transmitting the optimum code information.
  • the optimizing of the execution engine may include obtaining the structure data of the neural network model from the execution data; obtaining target structure information of the neural network model from the structure data; and generating a first optimal code for merging operations related to a data set of interest included in the target structure information.
  • the obtaining of the target structure information may include obtaining structure-of-interest information of the previously set neural network model; detecting the set of interest data corresponding to the structure information of interest from the structure data; and obtaining the target structure information of the neural network model based on the interest data set.
  • the optimizing of the execution engine may include the expected memory usage when the neural network model is operated in the computing environment of the embedded device based on the execution data and the computing environment information. Computing; and generating a second optimal code for determining a memory allocation amount based on the memory usage.
  • the generating of the second optimal code may include obtaining location information of a memory block from the memory information of the computing environment information; Evaluating memory efficiency based on the memory usage and the memory allocation; and generating a code for rearranging the memory block based on the location information of the memory block and the memory efficiency.
  • the optimizing of the execution engine may include comparing the memory usage and the memory allocation; and generating a code for adjusting the memory usage based on a comparison result between the memory allocation amount and the memory usage.
  • the code for controlling the memory usage may be related to the Im2Col conversion code.
  • the generating of the second optimal code may include obtaining location information of a memory block from the memory information of the computing environment information; Evaluating memory efficiency based on the memory usage and the memory allocation; and generating a code for rearranging the memory block based on the location information of the memory block and the memory efficiency.
  • a computer-readable recording medium recording a program for executing the execution engine optimization method may be provided.
  • An execution engine optimization system includes a processor generating an optimal code for optimizing an execution engine to be used in an embedded device based on data of a neural network model that has been trained; and a transceiver for communicating with the embedded device; a server including; and an embedded device that obtains the optimal code and executes the optimal code; wherein the processor obtains binary data of the neural network model for which learning has been completed, and from the binary data, execution data of the neural network model - the execution data Extracts related to at least one of execution order information of the neural network model and structural data of the neural network model, and computing environment information of the embedded device-the computing environment information is at least one of memory information and processor information of the embedded device.
  • Obtaining, predicting the operation of the neural network model in the embedded device based on the execution data and the computing environment information, performing optimization of the execution engine, and based on the optimization result It may be configured to obtain optimal code information to be used in the execution engine, and transmit the optimal code information to the embedded device through the transceiver.
  • FIG. 1 is a schematic diagram of an execution engine optimization system according to an embodiment of the present application.
  • the execution engine optimization system 10 may include an embedded device 100 and a server 1000 (or an execution engine optimization device).
  • the server 1000 may have a computing environment that exhibits superior performance to that of the embedded device 100 .
  • the embedded device 100 may have a first computing environment representing a first capability.
  • the server 1000 may have a second computing environment that exhibits second performance superior to the first performance.
  • performance may include any information related to a computing environment, such as memory capacity, processor specifications, execution speed, and power consumption.
  • the server 1000 of the execution engine optimization system 10 is configured to perform the neural network model based on the data of the trained neural network model and the computing environment information of the embedded device 100 in which the neural network model is actually executed. You can perform operations to optimize the model's execution engine.
  • the execution engine optimization system 10 according to an embodiment of the present application optimizes the execution engine in a server (1000, or an execution engine optimization device) with relatively excellent performance, rather than in the embedded device 100 having performance limitations. By performing, it is possible to efficiently and quickly obtain an inference engine that is optimal for the computing environment of the embedded device 100 and can execute the neural network model.
  • the server 1000 may include a transceiver 1100, a memory 1200, and a processor 1300.
  • the transceiver 1100 of the server 1000 may communicate with any external device including the embedded device 100 .
  • the server 1000 may transmit optimal code information obtained by performing optimization of an execution engine to the embedded device 100 through the transceiver 1100 .
  • the server 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 server 1000 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 server 1000 may be provided with both the wired type and the wireless type in some cases.
  • a wireless local area network (WLAN)-based communication method such as Wi-Fi may be mainly used.
  • a wireless type 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 server 1000 may store various types 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 server 1000 or in a detachable form.
  • the memory 1200 may store various data necessary for the operation of the server 1000, including an operating system (OS) for driving the server 1000 or a program for operating each component of the server 1000. there is.
  • OS operating system
  • the processor 1300 may control overall operations of the server 1000 .
  • the processor 1300 includes an operation of acquiring binary data of a neural network model for which learning has been completed, an operation of extracting execution data from the binary data, an operation of obtaining computing environment information of an embedded device, and an operation of executing data and computing environment information. It is possible to control overall operations of the server 1000, such as an operation of performing optimization of an execution engine based on the optimization result, an operation of obtaining optimum code information based on an optimization result, and an operation of transmitting optimum code information.
  • the processor 1300 may load and execute a program for overall operation of the server 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
  • AP application processor
  • hardware it may be provided in the form of an electronic circuit that processes electrical signals to perform a control function
  • software it may be provided in the form of a program or code that drives a hardware circuit.
  • 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 artificial intelligence model by inputting arbitrary software including an artificial intelligence execution engine into firmware.
  • the artificial intelligence execution engine is software for executing pre-learned artificial intelligence models in the embedded device 100 as efficiently as possible, and is a technology aimed at actual use of artificial intelligence and is efficient in the environment of the mounted device. function to increase
  • 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 may obtain code information optimized for the computing environment of the embedded device 100 from the server 1000 and add (or input) the optimized code information to the firmware. there is.
  • optimized code information can be generated by analyzing the internal structure of the neural network model after learning has been completed.
  • the optimized 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 from the server 1000 to firmware and execute a neural network model.
  • the server 1000 of the execution engine optimization system 10 may optimize an execution engine to be used in the embedded device 100 .
  • the server 1000 of the execution engine optimization system 10 is an execution engine of the neural network model based on data on the neural network model that has been trained and computing environment information of the embedded device 100 in which the neural network model will actually be executed.
  • Optimal code information may be obtained by performing an operation of optimizing .
  • FIG. 2 is a diagram illustrating operations of the execution engine optimization system 10 according to an embodiment of the present application.
  • the server 1000 may obtain computing environment information of the embedded device 100 from the embedded device 100 .
  • the computing environment information may include at least one of memory information, processor information, and/or performance information of the embedded device 100 .
  • the computing environment information may include any appropriate information related to the computing environment (or computing specifications) of the embedded device 100.
  • the server 1000 may obtain data of a neural network model on which learning has been completed.
  • the data of the trained neural network model may be arbitrary data related to information of the neural network model.
  • the data of the neural network model that has been trained may be binary data.
  • the neural network model may be a model obtained by performing learning in the server 1000 according to an embodiment of the present application.
  • the neural network model may be a model obtained by performing learning in an external device of the server 1000 .
  • a neural network model may be learned in an external server having higher performance than the server 1000 .
  • the server 1000 may obtain binary data of the learned neural network model from an external server (or external device) through the transceiver 1100 .
  • the server 1000 may extract execution data of a neural network model from binary data.
  • the server 1000 may extract execution data related to at least one of execution sequence data of the neural network model and structure data of the neural network model from the binary data.
  • the server 1000 may perform optimization of an execution engine to be used in the embedded device 100 .
  • the server 1000 may optimize the execution engine based on the computing environment information and execution data of the embedded device 100 .
  • the server 1000 predicts the operation of the neural network model in the embedded device 100 using execution data of the neural network model and computing environment information of the embedded device 100, and optimizes the execution engine based on the prediction result. can be done
  • the server 1000 may obtain optimal code information to be used for the execution engine based on the optimization result of the execution engine.
  • the server 1000 may generate code for merging neural network model operations or code related to memory management. Regarding the contents of obtaining the optimal code information, it will be described in more detail in FIGS. 3 to 9 .
  • the server 1000 may transmit optimal code information to the embedded device 100 through the transceiver 1100 .
  • the embedded device 100 may acquire optimal code information through any appropriate transceiver. Also, the embedded device 100 may execute optimal code information. In detail, the embedded device 100 may execute a neural network model optimized for the computing environment of the embedded device 100 by adding optimal code information to firmware.
  • FIG. 3 is a flowchart illustrating a method of optimizing an execution engine according to an embodiment of the present application.
  • An execution engine optimization method includes obtaining binary data of a trained neural network model (S1000), extracting execution data (S2000), and computing environment information of the embedded device 100. It may include acquiring (S3000), optimizing an execution engine (S4000), and acquiring optimal code information (S5000).
  • the server 1000 may obtain binary data of the trained neural network model.
  • binary data may mean encompassing an arbitrary information file of a neural network model on which learning has been completed.
  • binary data may be data in the form of binary data of arbitrary information files of a neural network model on which training is completed.
  • the neural network model may be learned in the server 1000 according to an embodiment of the present application.
  • the neural network model may be learned from an external server of the server 1000 according to an embodiment of the present application.
  • a neural network model may be learned from an external server having a computing environment superior in performance to that of the server 1000 .
  • the server 1000 may be implemented to acquire binary data of the neural network model from an external server through an arbitrary transceiver.
  • the server 1000 may extract execution data of the neural network model from binary data of the neural network model.
  • the binary data of the neural network model may be in the form of binarized information required to execute the neural network model, including information related to an execution sequence of the neural network model or information related to the internal structure of the neural network model. Accordingly, the server 1000 according to an embodiment of the present application may extract execution data necessary for the execution of the neural network model from binary data of the neural network model.
  • the server 1000 may obtain computing environment information of the embedded device 100 through the transceiver 1100.
  • the computing environment information may include any information related to the computing environment (or computing specifications) of the embedded device 100, including memory information or processor information of the embedded device 100.
  • the server 1000 may optimize the execution engine based on execution data of the neural network model and computing environment information of the embedded device 100 .
  • the server 1000 predicts the operation of the neural network model in the embedded device by using the execution data of the neural network model and the computing environment information of the embedded device 100, and based on this, the execution engine, which is software related to the execution of the neural network model, is used. optimization can be performed.
  • the server 1000 may obtain structure data of the neural network model from execution data of the neural network model, and may detect target structure information of the neural network model from the structure data.
  • the target structure information may be any information related to a structure generally used in relation to a calculation structure of a neural network model.
  • the server 1000 may perform optimization of an execution engine by generating code for merging operation structures included in target structure information. In this regard, it will be described in detail in FIGS. 4 to 6 .
  • the server 1000 may be implemented to generate code related to memory management using execution data of the neural network model and computing environment information of the embedded device 100 .
  • the server 1000 uses neural network model execution data and computing environment information (eg, memory information and processor information, etc.) of the embedded device 100 to allow the neural network model to be operated in the computing environment of the embedded device 100.
  • An execution engine may be optimized by calculating an expected memory usage amount at the time and generating a code related to memory management based on the calculated memory usage amount.
  • the server 1000 may generate code for determining a memory allocation amount based on memory usage.
  • the server 1000 may generate code for controlling memory usage in order to utilize the allocated memory as much as possible. In this regard, it will be described in detail in FIGS. 7 to 9 .
  • the server 1000 may generate code for rearranging memory blocks by using execution data of the neural network model and computing environment information of the embedded device 100 .
  • the server 1000 may obtain location information of a memory block of the embedded device 100 from computing environment information (eg, memory information) of the embedded device 100 .
  • the server 1000 may predict or evaluate memory efficiency based on the above-described amount of memory operation and amount of memory allocation.
  • the server 1000 may generate code for rearranging memory blocks based on location information and memory efficiency of memory blocks. This will be described in detail in FIG. 8 .
  • the server 1000 may acquire optimal code information to be used for the execution engine based on the optimization result.
  • the optimal code information may include code information for merging the computational structure of the neural network model, code information related to memory management, and/or code information for rearranging memory blocks.
  • the execution engine optimization method may further include transmitting optimal code information.
  • the server 1000 may transmit the optimal code information to the embedded device 100 through the transceiver 1100 .
  • FIGS. 4 to 9 a method of performing optimization of an execution engine according to embodiments of the present application will be described in detail with reference to FIGS. 4 to 9 .
  • FIGS. 4 to 6 an optimization operation of merging the calculation structure of the neural network model is described in detail.
  • 7 to 9 describe optimization operations for memory management in detail.
  • FIG. 4 is a flowchart detailing steps for performing optimization of an execution engine according to an embodiment of the present application.
  • Optimizing the execution engine according to an embodiment of the present application includes acquiring structure data of the neural network model (S4110), acquiring target structure information of the neural network model from the structure data (S4120), and It may include generating a first optimal code for merging operations related to the data set of interest included in the target structure information (S4130).
  • the server 1000 may obtain structural data representing the internal structure of the neural network model from execution data of the neural network model.
  • the server 1000 may obtain target structure information from the structure data of the neural network model.
  • a structure of a commonly used neural network model may exist for each type of neural network model. For example, in a specific network space, a structure that performs a convolution operation, a depthwise convolution operation, and an activation operation may be generally used.
  • the server 1000 may obtain structure-of-interest information related to a commonly used structure as described above, and may perform an operation of detecting a data set of interest corresponding to the structure-of-interest information from structure data. . Also, the server 1000 may obtain target structure information of the neural network model based on the detected data set of interest.
  • FIG. 5 is a flowchart specifying a step of obtaining target structure information of a neural network model according to an embodiment of the present application.
  • 6 is a diagram illustrating one aspect of a method for generating a first optimal code according to an embodiment of the present application.
  • Acquiring target structure information of a neural network model according to an embodiment of the present application includes acquiring structure information of interest (S4122), a data set of interest corresponding to structure information of interest from structure data (data set of interest) ) may be detected (S4124) and target structure information of the neural network model may be obtained based on the data set (S4126).
  • the server 1000 may obtain structure of interest information related to the neural network model.
  • a commonly used calculation structure for each type of neural network model may constitute a neural network model.
  • a structure in which the first operation O1 is performed and the second operation O2 is performed based on the output value output from the first operation O1 can be generally used in a neural network model having a specific network space.
  • a structure in which a convolution operation is performed, and a depthwise convolution operation and an activation operation are sequentially performed may be generally used.
  • the second model 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 obtaining an intermediate result value. Based on this, it may include a structure for performing a pointwise operation.
  • the server 1000 may obtain structure information of interest related to a structure for performing the first operation O1 and the second operation O2.
  • structure of interest information may be previously input by a user.
  • the server 1000 may obtain structure-of-interest information through a user's input.
  • this is only an example and may be implemented to acquire structure-of-interest information related to the neural network model by any suitable method, and obtain target structure information based on the structure-of-interest information.
  • the server 1000 selects an operation structure corresponding to the structure of interest information from among the data sets included in the structure data, based on the structure of interest information.
  • a branch may be implemented to detect a data set of interest.
  • the structure-of-interest information includes information on a structure for performing the first operation O1 and the second operation O2
  • the server 1000 provides a structure corresponding to the structure-of-interest information among data sets included in the structure data.
  • a first target operation TO1 and a second target operation TO2 related to the operation structure may be detected.
  • the server 1000 may obtain object structure information of the neural network model based on the interest data set corresponding to the interest structure information.
  • object structure information of the neural network model may be obtained based on a data set of interest related to a structure in which the first object operation TO1 is performed and the second object operation TO2 is sequentially performed.
  • the execution engine optimization method may include generating a first optimal code for merging operations related to a data set of interest included in target structure information (S4130).
  • the server 1000 may generate a first optimal code configured to perform an operation by merging the first object operation TO1 and the second object operation TO2 related to the object structure information.
  • the first optimal code may be generated using an operation fusion technique.
  • FIG. 7 is a flowchart embodying a step (S4000) of performing optimization of an execution engine according to another embodiment of the present application. Specifically, FIG. 7 is a flowchart illustrating a method of optimizing a memory allocation amount according to another embodiment of the present application.
  • Optimizing the execution engine according to another embodiment of the present application includes calculating the expected memory usage when the neural network model is operated in the computing environment of the embedded device (S4210) and based on the memory usage
  • a step of generating a second optimal code for determining a memory allocation amount (S4220) may be included.
  • the server 1000 In the step of calculating the expected memory usage when the neural network model is operated in the computing environment of the embedded device (S4210), the server 1000 operates the neural network model based on the execution data of the neural network model and the computing environment information of the embedded device 100. Expected memory usage when the model is operated in the computing environment of the embedded device 100 may be calculated.
  • the server 1000 In the step of generating the second optimal code for determining the memory allocation amount based on the memory usage (S4220), the server 1000 generates the second optimal code for determining or adjusting the memory allocation amount using the memory usage amount, and executes the Optimization of the engine can be performed.
  • FIG. 8 is a flowchart embodying a step of generating a second optimal code according to an embodiment of the present application. Specifically, FIG. 8 is a flowchart illustrating a method of optimizing a memory block according to an embodiment of the present application.
  • Generating the second optimal code (S4220) includes acquiring location information of memory blocks (S4230), evaluating memory efficiency (S4240), and rearranging the memory blocks. It may include a step of generating (S4250).
  • the server 1000 may obtain location information of the memory block from memory information of the computing environment information of the embedded device 100.
  • the server 1000 may calculate the memory efficiency using the expected memory usage and memory allocation when the neural network model is operated in the computing environment of the embedded device 100. At this time, if a memory block is allocated to a specific location, memory efficiency may be disturbed. In this case, the server 1000 according to an embodiment of the present application may rearrange the memory blocks based on location information and memory efficiency of the memory blocks, as will be described later.
  • the server 1000 may generate the code for rearranging the memory block based on location information and memory efficiency of the memory block.
  • the server 1000 may generate code for rearranging memory blocks by using location information of memory blocks when memory efficiency is lower than a preset threshold efficiency value.
  • the execution engine optimization system 10 may allocate an optimal memory for the computing environment (or computing specification) of the embedded device 100 .
  • FIG. 9 is a flowchart detailing steps for performing optimization of an execution engine according to another embodiment of the present application.
  • Optimizing the execution engine according to an embodiment of the present application includes comparing memory usage and memory allocation (S4310) and generating code for adjusting memory usage based on the comparison result (S4310). S4320) may be included.
  • the server 1000 compares the memory usage expected when the neural network model is operated in the embedded device 100 with the memory allocation determined based on the memory usage.
  • step S4320 of generating code for adjusting memory usage based on the comparison result the server 1000 may generate code for adjusting memory usage by comparing memory usage and memory allocation.
  • the server 1000 may generate code for adjusting the memory usage to increase.
  • the server 1000 may be implemented to improve the performance of the neural network model in the embedded device 100 by increasing the cache hit ratio by increasing memory usage by using the Im2Col extension technique. More specifically, when the Im2Col extension technique is used, execution speed can be expected to improve as the cache hit rate increases instead of memory usage increasing.
  • the server 1000 according to an embodiment of the present application utilizes the Im2Col extension technique when the expected memory usage is smaller than the memory allocation amount when the neural network model is operated in the embedded device 100, while maximizing the use of the memory.
  • the execution engine can be optimized to improve the execution speed of the neural network model in (100).
  • the server 1000 may generate code for adjusting the memory usage to be lowered.
  • the embedded device 100 of the execution engine optimization system 10 analyzes the structure of a model by using an execution engine optimized in the server 1000 superior to the computing specifications of the embedded device 100. Alternatively, you can directly run the neural network model without deciding on memory allocation.
  • an algorithm for analyzing the structure of a model and merging operations for a specific structure may be applied to the execution engine.
  • a complex and improved memory allocation algorithm or memory block rearrangement algorithm is applied to the execution engine in consideration of the computing specifications of the embedded device 100. can do. Accordingly, the execution capability of the neural network model in the embedded device 100 may be improved.
  • an operation of analyzing the structure of the above-described model or determining memory allocation is not performed in the embedded device 100 having limitations in the computing environment. Instead, it is performed in the server 1000, which has a relatively excellent computing environment. Therefore, when the model is executed in the embedded device 100, the memory of the embedded device 100 can be efficiently utilized and power consumption of the embedded device can be reduced.
  • Various operations of the server 1000 described above may be stored in the memory 1200 of the server 1000, and the processor 1300 of the server 1000 may be provided to perform the operations stored in the memory 1200.
  • the execution engine optimization method, execution engine optimization device, and execution engine 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

An execution engine optimization method according to one embodiment of the present application comprises the steps of: acquiring binary data of a learned neural network model; extracting, from the binary data, execution data of the neural network model; acquiring computing environment information of an embedded device; predicting an operation of the neural network model in the embedded device, on the basis of the execution data and the computing environment information, and optimizing an execution engine; acquiring, on the basis of the optimization result, optimal code information to be used for the execution engine; and transmitting the optimal code information.

Description

실행 엔진 최적화 방법, 실행 엔진 최적화 장치, 및 실행 엔진 최적화 시스템Execution Engine Optimization Method, Execution Engine Optimization Apparatus, and Execution Engine Optimization System
본 출원은 실행 엔진 최적화 방법, 실행 엔진 최적화 장치, 및 실행 엔진 최적화 시스템에 관한 것이다. 구체적으로 본 출원은 임베디드 장치에 사용되는 실행 엔진을 최적화하는 실행 엔진 최적화 방법, 실행 엔진 최적화 장치, 및 실행 엔진 최적화 시스템에 관한 것이다. The present application relates to an execution engine optimization method, an execution engine optimization apparatus, and an execution engine optimization system. Specifically, the present application relates to an execution engine optimization method for optimizing an execution engine used in an embedded device, an execution engine optimization device, and an execution engine optimization system.
인공지능 기술이 발전하면서 다양한 산업 분야에서 활용되는 임베디드 시스템이 내재된 임베디드 장치에 인공지능 기술이 접목되는 것이 요구되고 있다. 이에 따라 경량화 기술들이 개발되었고 저성능, 저사양인 임베디드 장치들에 인공지능 기술이 접목될 수 있게 되었다. 특히, 미리 학습이 완료된 인공지능 모델을 임베디드 장치에 최대한 효율적으로 실행시키도록 개발된 소프트웨어인 실행 엔진(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.
종래의 임베디드용 인공지능 실행 엔진은 임베디드 장치에서 모델의 실행에 대한 정보를 획득하고, 모델 실행에 필요한 메모리를 할당하여 모델을 실행하는 방식을 채택하고 있었다. 이러한 방식을 채택하는 대표적인 실행 엔진의 예로는 텐서플로우 라이트 마이크로(Tensorflow Lite Micro)가 존재한다. 이러한 방식은 모델 실행 중 모델이 바뀌었을 때에도 유연하게 모델의 구조를 분석하고 메모리 할당을 조절할 수 있다는 장점이 존재한다. A conventional embedded artificial intelligence execution engine adopts a method of acquiring information about model execution in an embedded device, allocating memory required for model execution, and executing the model. An example of a representative execution engine adopting this method is Tensorflow Lite Micro. This method has the advantage of being able to flexibly analyze the model structure and control memory allocation even when the model is changed during model execution.
다만, 임베디드 장치의 경우에는 모델 실행 중 업데이트를 진행하는 경우가 거의 없어 기존의 방식의 장점을 활용하지 못할 가능성이 높다. 또한, 컴퓨팅 환경에 제약이 존재하는 임베디드 장치에서 모델의 구조를 분석하고 메모리를 할당하는 것을 결정하는 것은 임베디드 장치의 메모리에 부하로 작용할 우려가 존재한다. 추가적으로, 임베디드 장치는 컴퓨팅 사양에 제약이 존재하기에 모델의 구조를 분석하고 메모리 할당을 결정하기 위하여 보다 복잡하고 효율적인 알고리즘을 사용하는 것에 한계가 존재한다. However, in the case of embedded devices, there is a high possibility that the advantages of the existing method cannot be utilized because there are almost no updates during model execution. In addition, there is a concern that analyzing the structure of a model and determining memory allocation in an embedded device having limitations in a computing environment may act as a load on the memory of the embedded device. Additionally, embedded devices have limitations in using more complex and efficient algorithms to analyze the structure of a model and determine memory allocation because of limitations in computing specifications.
이에, 임베디드 장치의 컴퓨팅 환경 또는 컴퓨팅 사양을 고려하여 효율적이고 연산 속도가 향상된 실행 엔진을 구현하기 위한 실행 엔진 최적화 방법, 장치 및 시스템의 개발이 요구된다.Therefore, it is required to develop an execution engine optimization method, apparatus, and system for implementing an execution engine that is efficient and has improved calculation speed in consideration of a computing environment or computing specifications of an embedded device.
본 발명이 해결하고자 하는 일 과제는, 임베디드 장치의 컴퓨팅 환경을 고려하여 실행 엔진을 최적화하는 실행 엔진 최적화 방법, 실행 엔진 최적화 장치 및 실행 엔진 최적화 시스템을 제공하는 것이다. An object to be solved by the present invention is to provide an execution engine optimization method, an execution engine optimization device, and an execution engine optimization system for optimizing an execution engine in consideration of a computing environment of an 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)을 예측하고 상기 실행 엔진의 최적화를 수행하는 단계; 상기 최적화 결과에 기초하여 상기 실행 엔진에 이용될 최적 코드 정보를 획득하는 단계; 및 상기 최적 코드 정보를 송신하는 단계;를 포함할 수 있다. An execution engine optimization method according to an embodiment of the present application includes obtaining binary data of a neural network model on which training is completed; extracting execution data of the neural network model from the binary data, wherein the execution data is related to at least one of execution sequence data of the neural network model and structural data of the neural network model; obtaining computing environment information of the embedded device, wherein the computing environment information includes at least one of memory information and processor information of the embedded device; predicting an operation of the neural network model in the embedded device based on the execution data and the computing environment information and performing optimization of the execution engine; obtaining optimal code information to be used in the execution engine based on the optimization result; and transmitting the optimum code information.
본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템은, 학습이 완료된 신경망 모델의 데이터에 기초하여 임베디드 장치에서 사용될 실행 엔진을 최적화하는 최적 코드를 생성하는 프로세서; 및 임베디드 장치와 통신하는 송수신부;를 포함하는 서버; 및 상기 최적 코드를 획득하고 상기 최적 코드를 실행하는 임베디드 장치;를 포함하되, 상기 프로세서는, 학습이 완료된 신경망 모델의 바이너리 데이터를 획득하고, 상기 바이너리 데이터로부터 상기 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 실행 순서 정보 및 상기 신경망 모델의 구조 데이터 중 적어도 하나와 관련됨-를 추출하고, 상기 임베디드 장치의 컴퓨팅 환경 정보-상기 컴퓨팅 환경 정보는 상기 임베디드 장치의 메모리 정보 및 프로세서 정보 중 적어도 하나를 포함함-를 획득하고, 상기 실행 데이터 및 상기 컴퓨팅 환경 정보에 기초하여 상기 임베디드 장치에서의 상기 신경망 모델의 동작(operation)을 예측하고 상기 실행 엔진의 최적화를 수행하고, 상기 최적화 결과에 기초하여, 상기 실행 엔진에 이용될 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 상기 송수신부를 통하여 상기 임베디드 장치로 송신하도록 구성될 수 있다. An execution engine optimization system according to an embodiment of the present application includes a processor generating an optimal code for optimizing an execution engine to be used in an embedded device based on data of a neural network model that has been trained; and a transceiver for communicating with the embedded device; a server including; and an embedded device that obtains the optimal code and executes the optimal code; wherein the processor obtains binary data of the neural network model for which learning has been completed, and from the binary data, execution data of the neural network model - the execution data Extracts related to at least one of execution order information of the neural network model and structural data of the neural network model, and computing environment information of the embedded device-the computing environment information is at least one of memory information and processor information of the embedded device. Obtaining, predicting the operation of the neural network model in the embedded device based on the execution data and the computing environment information, performing optimization of the execution engine, and based on the optimization result , It may be configured to obtain optimal code information to be used in the execution engine, and transmit the optimal code information to the embedded device through the transceiver.
본 발명의 과제의 해결 수단이 상술한 해결 수단들로 제한되는 것은 아니며, 언급되지 아니한 해결 수단들은 본 명세서 및 첨부된 도면으로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.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 execution engine optimization method, the execution engine optimization apparatus, and the execution engine optimization system according to embodiments of the present application, the execution capability of a neural network model in an embedded device may be improved.
본 출원의 실시예에 따른 실행 엔진 최적화 방법, 실행 엔진 최적화 장치, 및 실행 엔진 최적화 시스템에 의하면, 임베디드 장치에서의 전력 사용량이 감소될 수 있다. According to the execution engine optimization method, the execution engine optimization apparatus, and the execution engine optimization system according to embodiments of the present application, power consumption in an embedded device may 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 an execution engine optimization system according to an embodiment of the present application.
도 2는 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템의 동작들을 나타낸 도면이다.2 is a diagram illustrating operations of an execution engine optimization system according to an embodiment of the present application.
도 3은 본 출원의 일 실시예에 따른 실행 엔진을 최적화하는 방법을 나타낸 순서도이다.3 is a flowchart illustrating a method of optimizing an execution engine according to an embodiment of the present application.
도 4는 본 출원의 일 실시예에 따른 실행 엔진의 최적화를 수행하는 단계를 구체화한 순서도이다.4 is a flowchart detailing steps for performing optimization of an execution engine according to an embodiment of the present application.
도 5는 본 출원의 일 실시예에 따른 신경망 모델의 대상 구조 정보를 획득하는 단계를 구체화한 순서도이다.5 is a flowchart specifying a step of obtaining target structure information of a neural network model according to an embodiment of the present application.
도 6은 본 출원의 일 실시예에 따른 제1 최적 코드를 생성하는 방법의 일 양상을 나타낸 도면이다. 6 is a diagram illustrating one aspect of a method for generating a first optimal code according to an embodiment of the present application.
도 7은 본 출원의 다른 실시예에 따른 실행 엔진의 최적화를 수행하는 단계를 구체화한 순서도이다.7 is a flowchart embodying steps for performing optimization of an execution engine according to another embodiment of the present application.
도 8은 본 출원의 일 실시예에 따른 제2 최적 코드를 생성하는 단계를 구체화한 순서도이다. 8 is a flowchart embodying a step of generating a second optimal code according to an embodiment of the present application.
도 9는 본 출원의 또 다른 실시예에 실행 엔진의 최적화를 수행하는 단계를 구체화한 순서도이다.9 is a flowchart embodying steps for performing optimization of an execution engine in another embodiment of the present application.
본 출원의 일 실시예에 따른 실행 엔진 최적화 방법은, 학습이 완료된 신경망 모델의 바이너리 데이터를 획득하는 단계; 상기 바이너리 데이터로부터 상기 신경망 모델의 실행 데이터를 추출하는 단계-상기 실행 데이터는 상기 신경망 모델의 실행 순서 데이터 및 상기 신경망 모델의 구조 데이터 중 적어도 하나와 관련됨-; 상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계-상기 컴퓨팅 환경 정보는 상기 임베디드 장치의 메모리 정보 및 프로세서 정보 중 적어도 하나를 포함함-; 상기 실행 데이터 및 상기 컴퓨팅 환경 정보에 기초하여 상기 임베디드 장치에서의 상기 신경망 모델의 동작(operation)을 예측하고 상기 실행 엔진의 최적화를 수행하는 단계; 상기 최적화 결과에 기초하여 상기 실행 엔진에 이용될 최적 코드 정보를 획득하는 단계; 및 상기 최적 코드 정보를 송신하는 단계;를 포함할 수 있다. An execution engine optimization method according to an embodiment of the present application includes obtaining binary data of a neural network model on which training is completed; extracting execution data of the neural network model from the binary data, wherein the execution data is related to at least one of execution sequence data of the neural network model and structural data of the neural network model; obtaining computing environment information of the embedded device, wherein the computing environment information includes at least one of memory information and processor information of the embedded device; predicting an operation of the neural network model in the embedded device based on the execution data and the computing environment information and performing optimization of the execution engine; obtaining optimal code information to be used in the execution engine based on the optimization result; and transmitting the optimum code information.
본 출원의 일 실시예에 따르면, 상기 실행 엔진의 최적화를 수행하는 단계는, 상기 실행 데이터로부터 상기 신경망 모델의 상기 구조 데이터를 획득하는 단계; 상기 구조 데이터로부터 상기 신경망 모델의 대상 구조 정보를 획득하는 단계; 및 상기 대상 구조 정보에 포함된 관심 데이터 세트와 관련된 연산들을 병합(merge)시키는 제1 최적 코드를 생성하는 단계;를 포함할 수 있다. According to an embodiment of the present application, the optimizing of the execution engine may include obtaining the structure data of the neural network model from the execution data; obtaining target structure information of the neural network model from the structure data; and generating a first optimal code for merging operations related to a data set of interest included in the target structure information.
본 출원의 일 실시예에 따르면, 상기 대상 구조 정보를 획득하는 단계는, 미리 설정된 상기 신경망 모델의 관심 구조 정보를 획득하는 단계; 상기 구조 데이터로부터 상기 관심 구조 정보에 대응되는 상기 관심 데이터 세트를 검출하는 단계; 및 상기 관심 데이터 세트에 기초하여 상기 신경망 모델의 상기 대상 구조 정보를 획득하는 단계;를 포함할 수 있다. According to an embodiment of the present application, the obtaining of the target structure information may include obtaining structure-of-interest information of the previously set neural network model; detecting the set of interest data corresponding to the structure information of interest from the structure data; and obtaining the target structure information of the neural network model based on the interest data set.
본 출원의 일 실시예에 따르면, 상기 실행 엔진의 최적화를 수행하는 단계는, 상기 실행 데이터 및 상기 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델이 상기 임베디드 장치의 컴퓨팅 환경에서 동작될 경우의 예상되는 메모리 사용량을 연산하는 단계; 및 상기 메모리 사용량에 기초하여 메모리 할당량을 결정하는 제2 최적 코드를 생성하는 단계;를 포함할 수 있다. According to an embodiment of the present application, the optimizing of the execution engine may include the expected memory usage when the neural network model is operated in the computing environment of the embedded device based on the execution data and the computing environment information. Computing; and generating a second optimal code for determining a memory allocation amount based on the memory usage.
본 출원의 일 실시예에 따르면, 상기 제2 최적 코드를 생성하는 단계는, 상기 컴퓨팅 환경 정보의 상기 메모리 정보로부터 메모리 블록의 위치 정보를 획득하는 단계; 상기 메모리 사용량 및 상기 메모리 할당량에 기초하여 메모리 효율성을 평가하는 단계; 및 상기 메모리 블록의 위치 정보 및 상기 메모리 효율성에 기초하여 상기 메모리 블록을 재배열하는 코드를 생성하는 단계;를 포함할 수 있다. According to one embodiment of the present application, the generating of the second optimal code may include obtaining location information of a memory block from the memory information of the computing environment information; Evaluating memory efficiency based on the memory usage and the memory allocation; and generating a code for rearranging the memory block based on the location information of the memory block and the memory efficiency.
본 출원의 일 실시예에 따르면, 상기 실행 엔진의 최적화를 수행하는 단계는, 상기 메모리 사용량과 상기 메모리 할당량을 비교하는 단계; 및 상기 메모리 할당량과 상기 메모리 사용량의 비교 결과에 기초하여 상기 메모리 사용량을 조절하는 코드를 생성하는 단계;를 포함할 수 있다.According to one embodiment of the present application, the optimizing of the execution engine may include comparing the memory usage and the memory allocation; and generating a code for adjusting the memory usage based on a comparison result between the memory allocation amount and the memory usage.
본 출원의 일 실시예에 따르면, 상기 메모리 사용량을 조절하는 코드는 Im2Col 변환 코드와 관련될 수 있다. According to an embodiment of the present application, the code for controlling the memory usage may be related to the Im2Col conversion code.
본 출원의 일 실시예에 따르면, 상기 제2 최적 코드를 생성하는 단계는, 상기 컴퓨팅 환경 정보의 상기 메모리 정보로부터 메모리 블록의 위치 정보를 획득하는 단계; 상기 메모리 사용량 및 상기 메모리 할당량에 기초하여 메모리 효율성을 평가하는 단계; 및 상기 메모리 블록의 위치 정보 및 상기 메모리 효율성에 기초하여 상기 메모리 블록을 재배열하는 코드를 생성하는 단계;를 포함할 수 있다. According to one embodiment of the present application, the generating of the second optimal code may include obtaining location information of a memory block from the memory information of the computing environment information; Evaluating memory efficiency based on the memory usage and the memory allocation; and generating a code for rearranging the memory block based on the location information of the memory block and the memory efficiency.
본 출원의 일 실시예에 따르면, 상기 실행 엔진 최적화 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체가 제공될 수 있다.According to an embodiment of the present application, a computer-readable recording medium recording a program for executing the execution engine optimization method may be provided.
본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템은, 학습이 완료된 신경망 모델의 데이터에 기초하여 임베디드 장치에서 사용될 실행 엔진을 최적화하는 최적 코드를 생성하는 프로세서; 및 임베디드 장치와 통신하는 송수신부;를 포함하는 서버; 및 상기 최적 코드를 획득하고 상기 최적 코드를 실행하는 임베디드 장치;를 포함하되, 상기 프로세서는, 학습이 완료된 신경망 모델의 바이너리 데이터를 획득하고, 상기 바이너리 데이터로부터 상기 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 실행 순서 정보 및 상기 신경망 모델의 구조 데이터 중 적어도 하나와 관련됨-를 추출하고, 상기 임베디드 장치의 컴퓨팅 환경 정보-상기 컴퓨팅 환경 정보는 상기 임베디드 장치의 메모리 정보 및 프로세서 정보 중 적어도 하나를 포함함-를 획득하고, 상기 실행 데이터 및 상기 컴퓨팅 환경 정보에 기초하여 상기 임베디드 장치에서의 상기 신경망 모델의 동작(operation)을 예측하고 상기 실행 엔진의 최적화를 수행하고, 상기 최적화 결과에 기초하여, 상기 실행 엔진에 이용될 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 상기 송수신부를 통하여 상기 임베디드 장치로 송신하도록 구성될 수 있다. An execution engine optimization system according to an embodiment of the present application includes a processor generating an optimal code for optimizing an execution engine to be used in an embedded device based on data of a neural network model that has been trained; and a transceiver for communicating with the embedded device; a server including; and an embedded device that obtains the optimal code and executes the optimal code; wherein the processor obtains binary data of the neural network model for which learning has been completed, and from the binary data, execution data of the neural network model - the execution data Extracts related to at least one of execution order information of the neural network model and structural data of the neural network model, and computing environment information of the embedded device-the computing environment information is at least one of memory information and processor information of the embedded device. Obtaining, predicting the operation of the neural network model in the embedded device based on the execution data and the computing environment information, performing optimization of the execution engine, and based on the optimization result , It may be configured to obtain optimal code information to be used in the execution engine, and transmit the optimal code information to the embedded device through the transceiver.
본 출원의 상술한 목적, 특징들 및 장점은 첨부된 도면과 관련된 다음의 상세한 설명을 통해 보다 분명해질 것이다. 다만, 본 출원은 다양한 변경을 가할 수 있고 여러 가지 실시예들을 가질 수 있는 바, 이하에서는 특정 실시예들을 도면에 예시하고 이를 상세히 설명하고자 한다.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 description. 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 execution engine optimization method, execution engine optimization device, and execution engine optimization system of the present application will be described with reference to FIGS. 1 to 9 .
도 1은 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템의 개략도이다. 1 is a schematic diagram of an execution engine optimization system according to an embodiment of the present application.
본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)은 임베디드 장치(100) 및 서버(1000, 혹은 실행 엔진 최적화 장치)를 포함할 수 있다. The execution engine optimization system 10 according to an embodiment of the present application may include an embedded device 100 and a server 1000 (or an execution engine optimization device).
서버(1000)는 임베디드 장치(100)의 성능보다는 뛰어난 성능을 나타내는 컴퓨팅 환경을 가질 수 있다. 구체적으로, 임베디드 장치(100)는 제1 성능을 나타내는 제1 컴퓨팅 환경을 가질 수 있다. 반면, 서버(1000)는 제1 성능보다 뛰어난 제2 성능을 나타내는 제2 컴퓨팅 환경을 가질 수 있다. 여기서 성능이란, 메모리의 용량, 프로세서의 사양, 실행 속도, 전력량 등을 컴퓨팅 환경과 관련된 임의의 정보를 포괄하는 의미일 수 있다. The server 1000 may have a computing environment that exhibits superior performance to that of the embedded device 100 . Specifically, the embedded device 100 may have a first computing environment representing a first capability. On the other hand, the server 1000 may have a second computing environment that exhibits second performance superior to the first performance. Here, performance may include any information related to a computing environment, such as memory capacity, processor specifications, execution speed, and power consumption.
본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)의 서버(1000)는 학습이 완료된 신경망 모델에 대한 데이터와 신경망 모델이 실제로 수행될 임베디드 장치(100)의 컴퓨팅 환경 정보에 기초하여, 신경망 모델의 실행 엔진을 최적화하는 동작을 수행할 수 있다. 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)은 성능에 제약이 존재하는 임베디드 장치(100)가 아닌, 성능이 상대적으로 뛰어난 서버(1000, 혹은 실행 엔진 최적화 장치)에서 실행 엔진의 최적화를 수행함으로써, 임베디드 장치(100)의 컴퓨팅 환경에 최적이면서, 신경망 모델이 실행될 수 있는 실행 엔진(Inference engine)을 효율적으로 빠르게 획득할 수 있다.The server 1000 of the execution engine optimization system 10 according to an embodiment of the present application is configured to perform the neural network model based on the data of the trained neural network model and the computing environment information of the embedded device 100 in which the neural network model is actually executed. You can perform operations to optimize the model's execution engine. The execution engine optimization system 10 according to an embodiment of the present application optimizes the execution engine in a server (1000, or an execution engine optimization device) with relatively excellent performance, rather than in the embedded device 100 having performance limitations. By performing, it is possible to efficiently and quickly obtain an inference engine that is optimal for the computing environment of the embedded device 100 and can execute the neural network model.
본 출원의 일 실시예에 따른 서버(1000)는 송수신부(1100), 메모리(1200), 및 프로세서(1300)를 포함할 수 있다.The server 1000 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)의 컴퓨팅 환경 정보를 수신할 수 있다. The transceiver 1100 of the server 1000 may communicate with any external device including the embedded device 100 . For example, the server 1000 may transmit optimal code information obtained by performing optimization of an execution engine to the embedded device 100 through the transceiver 1100 . In addition, the server 1000 may receive computing environment information of the embedded device 100 from the embedded device 100 or any external device 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 server 1000 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 server 1000 may be provided with both the wired type and the wireless type 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 server 1000 may store various types 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 server 1000 or in a detachable form. The memory 1200 may store various data necessary for the operation of the server 1000, including an operating system (OS) for driving the server 1000 or a program for operating each component of the server 1000. there is.
프로세서(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 server 1000 . For example, the processor 1300 includes an operation of acquiring binary data of a neural network model for which learning has been completed, an operation of extracting execution data from the binary data, an operation of obtaining computing environment information of an embedded device, and an operation of executing data and computing environment information. It is possible to control overall operations of the server 1000, such as an operation of performing optimization of an execution engine based on the optimization result, an operation of obtaining optimum code information based on an optimization result, and an operation of transmitting optimum code information. In detail, the processor 1300 may load and execute a program for overall operation of the server 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.
임베디드 장치(100)는 특정 목적(혹은 특정 기능)을 가지고 만들어진 프로그래밍이 가능한 임의의 임베디드 시스템(Embedded system)이 내재된 장치를 포괄하는 의미일 수 있다.The embedded device 100 may mean a device including a programmable arbitrary embedded system made for a specific purpose (or specific function).
임베디드 장치(100)는 프로세서 및/또는 메모리를 포함하는 하드웨어를 포함할 수 있다. 또한, 임베디드 장치(100)는 하드웨어를 제어하기 위한 펌웨어(Firmware)를 포함할 수 있다. 또한, 임베디드 장치(100)는 인공지능 실행 엔진을 포함하여 임의의 소프트웨어를 펌웨어에 입력하여 인공지능 모델을 실행하도록 구성될 수 있다. 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 artificial intelligence model by inputting arbitrary software including an artificial intelligence execution engine into firmware.
여기서, 인공지능 실행 엔진(Inference Engine)은 미리 학습된 인공지능 모델을 임베디드 장치(100)에 최대한 효율적으로 실행시키기 위한 소프트웨어로서, 인공지능 실사용에 목적을 둔 기술이며 탑재되는 장치의 환경에 효율성을 높이는 기능을 수행한다. 예컨대, 모바일 기기의 경우, 모바일 기기의 컴퓨팅 환경인 느린 연산속도 및 저전력 사양에 맞춰 실행엔진이 구현될 수 있다. 다른 예로, 컴퓨팅 성능이 상대적으로 높은 PC 서버의 경우에는 고성능 병렬처리 능력을 극대화시키도록 실행 엔진이 구현될 수 있다.Here, the artificial intelligence execution engine (Inference Engine) is software for executing pre-learned artificial intelligence models in the embedded device 100 as efficiently as possible, and is a technology aimed at actual use of artificial intelligence and is efficient in the environment of the mounted device. function to increase 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)의 메모리 사양 및/또는 프로세서 사양 등을 포함한 컴퓨팅 환경을 고려하여 생성될 수 있다.The embedded device 100 according to an embodiment of the present application may obtain code information optimized for the computing environment of the embedded device 100 from the server 1000 and add (or input) the optimized code information to the firmware. there is. As will be described later, optimized code information can be generated by analyzing the internal structure of the neural network model after learning has been completed. In addition, the optimized code information may be generated in consideration of a computing environment including memory specifications and/or processor specifications of the embedded device 100 .
본 출원의 일 실시예에 따른 임베디드 장치(100)는 서버(1000)로부터 생성된 최적 코드 정보를 펌웨어에 추가하고, 신경망 모델의 실행을 수행할 수 있다. The embedded device 100 according to an embodiment of the present application may add optimal code information generated from the server 1000 to firmware and execute a neural network model.
이하에서는 도 2 내지 도 9를 참고하여, 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)의 동작을 구체적으로 서술한다. Hereinafter, the operation of the execution engine optimization system 10 according to an embodiment of the present application will be described in detail with reference to FIGS. 2 to 9 .
본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)의 서버(1000)는, 임베디드 장치(100)에 이용될 실행 엔진의 최적화를 수행할 수 있다. 구체적으로, 실행 엔진 최적화 시스템(10)의 서버(1000)는, 학습이 완료된 신경망 모델에 대한 데이터와 신경망 모델이 실제로 수행될 임베디드 장치(100)의 컴퓨팅 환경 정보에 기초하여, 신경망 모델의 실행 엔진을 최적화하는 동작을 수행하여 최적 코드 정보를 획득할 수 있다.The server 1000 of the execution engine optimization system 10 according to an embodiment of the present application may optimize an execution engine to be used in the embedded device 100 . Specifically, the server 1000 of the execution engine optimization system 10 is an execution engine of the neural network model based on data on the neural network model that has been trained and computing environment information of the embedded device 100 in which the neural network model will actually be executed. Optimal code information may be obtained by performing an operation of optimizing .
도 2는 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)의 동작들을 나타낸 도면이다.2 is a diagram illustrating operations of the execution engine optimization system 10 according to an embodiment of the present application.
본 출원의 일 실시예에 따른 서버(1000)는 임베디드 장치(100)로부터 임베디드 장치(100)의 컴퓨팅 환경 정보를 획득할 수 있다. 일 예로, 컴퓨팅 환경 정보는 임베디드 장치(100)의 메모리 정보, 프로세서 정보 및/또는 성능 정보 중 적어도 하나를 포함할 수 있다. 다만, 이는 예시에 불과하며 컴퓨팅 환경 정보는 임베디드 장치(100)의 컴퓨팅 환경(혹은 컴퓨팅 사양)과 관련된 임의의 적절한 정보를 포괄하는 의미일 수 있다.The server 1000 according to an embodiment of the present application may obtain computing environment information of the embedded device 100 from the embedded device 100 . For example, the computing environment information may include at least one of memory information, processor information, and/or performance information of the embedded device 100 . However, this is only an example, and the computing environment information may include any appropriate information related to the computing environment (or computing specifications) of the embedded device 100.
본 출원의 일 실시예에 따른 서버(1000)는 학습이 완료된 신경망 모델의 데이터를 획득할 수 있다. 여기서 학습이 완료된 신경망 모델의 데이터는 신경망 모델의 정보와 관련된 임의의 데이터일 수 있다. 또한, 학습이 완료된 신경망 모델의 데이터는 바이너리 형태의 데이터일 수 있다.The server 1000 according to an embodiment of the present application may obtain data of a neural network model on which learning has been completed. Here, the data of the trained neural network model may be arbitrary data related to information of the neural network model. Also, the data of the neural network model that has been trained may be binary data.
신경망 모델은 본 출원의 일 실시예에 따른 서버(1000)에서 학습이 수행되어 획득된 모델일 수 있다. 또는, 신경망 모델은 서버(1000)의 외부 장치에서 학습이 수행되어 획득된 모델일 수 있다. 예컨대, 보다 정교한 신경망 모델의 학습을 위하여 서버(1000)보다 성능이 뛰어난 외부 서버에서 신경망 모델이 학습될 수 있다. 이때, 서버(1000)는, 송수신부(1100)를 통하여, 외부 서버(혹은 외부 장치)로부터 학습된 신경망 모델의 바이너리 데이터를 획득할 수 있다. The neural network model may be a model obtained by performing learning in the server 1000 according to an embodiment of the present application. Alternatively, the neural network model may be a model obtained by performing learning in an external device of the server 1000 . For example, in order to learn a more sophisticated neural network model, a neural network model may be learned in an external server having higher performance than the server 1000 . At this time, the server 1000 may obtain binary data of the learned neural network model from an external server (or external device) through the transceiver 1100 .
본 출원의 일 실시예에 따른 서버(1000)는 바이너리 데이터로부터 신경망 모델의 실행 데이터를 추출할 수 있다. 구체적으로 서버(1000)는 이진화된 바이너리 데이터로부터, 신경망 모델의 실행 순서 데이터 및 신경망 모델의 구조 데이터 중 적어도 하나와 관련된 실행 데이터를 추출할 수 있다. The server 1000 according to an embodiment of the present application may extract execution data of a neural network model from binary data. In detail, the server 1000 may extract execution data related to at least one of execution sequence data of the neural network model and structure data of the neural network model from the binary data.
본 출원의 일 실시예에 따른 서버(1000)는, 임베디드 장치(100)에 이용될 실행 엔진의 최적화를 수행할 수 있다. 구체적으로 서버(1000)는 임베디드 장치(100)의 컴퓨팅 환경 정보 및 실행 데이터에 기초하여 실행 엔진의 최적화를 수행할 수 있다. 예컨대, 서버(1000)는 신경망 모델의 실행 데이터와 임베디드 장치(100)의 컴퓨팅 환경 정보를 이용하여 신경망 모델의 임베디드 장치(100)에서의 동작을 예측하고, 예측 결과에 기초하여 실행 엔진의 최적화를 수행할 수 있다. The server 1000 according to an embodiment of the present application may perform optimization of an execution engine to be used in the embedded device 100 . In detail, the server 1000 may optimize the execution engine based on the computing environment information and execution data of the embedded device 100 . For example, the server 1000 predicts the operation of the neural network model in the embedded device 100 using execution data of the neural network model and computing environment information of the embedded device 100, and optimizes the execution engine based on the prediction result. can be done
본 출원의 일 실시예에 따른 서버(1000)는 실행 엔진의 최적화 결과에 기초하여 실행 엔진에 이용될 최적 코드 정보를 획득할 수 있다. 구체적으로 서버(1000)는 신경망 모델의 연산을 병합시키는 코드 혹은 메모리 관리와 관련된 코드를 생성할 수 있다. 최적 코드 정보를 획득하는 내용과 관련해서는, 도 3 내지 도 9에서 보다 구체적으로 서술한다. The server 1000 according to an embodiment of the present application may obtain optimal code information to be used for the execution engine based on the optimization result of the execution engine. In detail, the server 1000 may generate code for merging neural network model operations or code related to memory management. Regarding the contents of obtaining the optimal code information, it will be described in more detail in FIGS. 3 to 9 .
본 출원의 일 실시예에 따른 서버(1000)는, 송수신부(1100)를 통하여, 최적 코드 정보를 임베디드 장치(100)로 송신할 수 있다. The server 1000 according to an embodiment of the present application may transmit optimal code information to the embedded device 100 through the transceiver 1100 .
본 출원의 일 실시예에 따른 임베디드 장치(100)는 임의의 적절한 송수신부를 통하여, 최적 코드 정보를 획득할 수 있다. 또한, 임베디드 장치(100)는 최적 코드 정보를 실행할 수 있다. 구체적으로 임베디드 장치(100)는 최적 코드 정보를 펌웨어에 추가하여 임베디드 장치(100)의 컴퓨팅 환경에 최적화된 신경망 모델을 실행할 수 있다. The embedded device 100 according to an embodiment of the present application may acquire optimal code information through any appropriate transceiver. Also, the embedded device 100 may execute optimal code information. In detail, the embedded device 100 may execute a neural network model optimized for the computing environment of the embedded device 100 by adding optimal code information to firmware.
도 3을 참고한다. 도 3은 본 출원의 일 실시예에 따른 실행 엔진을 최적화하는 방법을 나타낸 순서도이다. See Figure 3. 3 is a flowchart illustrating a method of optimizing an execution engine according to an embodiment of the present application.
본 출원의 일 실시예에 따른 실행 엔진 최적화 방법은, 학습이 완료된 신경망 모델의 바이너리 데이터를 획득하는 단계(S1000), 실행 데이터를 추출하는 단계(S2000), 임베디드 장치(100)의 컴퓨팅 환경 정보를 획득하는 단계(S3000), 실행 엔진의 최적화를 수행하는 단계(S4000) 및 최적 코드 정보를 획득하는 단계(S5000)를 포함할 수 있다. An execution engine optimization method according to an embodiment of the present application includes obtaining binary data of a trained neural network model (S1000), extracting execution data (S2000), and computing environment information of the embedded device 100. It may include acquiring (S3000), optimizing an execution engine (S4000), and acquiring optimal code information (S5000).
학습이 완료된 신경망 모델의 바이너리 데이터를 획득하는 단계(S1000)에서는, 서버(1000)는 학습이 완료된 신경망 모델의 바이너리 데이터를 획득할 수 있다. 이때, 바이너리 데이터는 학습이 완료된 신경망 모델의 임의의 정보 파일을 포괄하는 의미일 수 있다. 한편, 바이너리 데이터는 학습이 완료된 신경망 모델의 임의의 정보 파일들이 이진화된 형태의 데이터일 수 있다. In the step of acquiring binary data of the trained neural network model (S1000), the server 1000 may obtain binary data of the trained neural network model. In this case, binary data may mean encompassing an arbitrary information file of a neural network model on which learning has been completed. On the other hand, binary data may be data in the form of binary data of arbitrary information files of a neural network model on which training is completed.
일 예로, 신경망 모델은 본 출원의 일 실시예에 따른 서버(1000)에서 학습될 수 있다. For example, the neural network model may be learned in the server 1000 according to an embodiment of the present application.
다른 예로, 신경망 모델은 본 출원의 일 실시예에 따른 서버(1000)의 외부 서버로부터 학습될 수 있다. 예컨대, 서버(1000)의 컴퓨팅 환경보다 성능이 뛰어난 컴퓨팅 환경을 가지는 외부 서버로부터 신경망 모델이 학습될 수 있다. 이 경우, 보다 많은 학습 데이터를 이용하여 신경망 모델이 학습될 수 있어 보다 정교한 신경망 모델이 획득될 수 있다. 이때, 서버(1000)는, 임의의 송수신부를 통하여, 외부 서버로부터 신경망 모델의 바이너리 데이터를 획득하도록 구현될 수 있다. As another example, the neural network model may be learned from an external server of the server 1000 according to an embodiment of the present application. For example, a neural network model may be learned from an external server having a computing environment superior in performance to that of the server 1000 . In this case, since the neural network model can be learned using more training data, a more sophisticated neural network model can be obtained. In this case, the server 1000 may be implemented to acquire binary data of the neural network model from an external server through an arbitrary transceiver.
실행 데이터를 추출하는 단계(S2000)에서는, 서버(1000)는 신경망 모델의 바이너리 데이터로부터 신경망 모델의 실행 데이터를 추출할 수 있다. 구체적으로 신경망 모델의 바이너리 데이터는 신경망 모델의 실행 순서와 관련된 정보 또는 신경망 모델의 내부 구조와 관련된 정보를 포함하여 신경망 모델을 실행하는 데 필요한 임의의 정보들이 이진화되어 있는 형태일 수 있다. 따라서, 본 출원의 일 실시예에 따른 서버(1000)는 신경망 모델의 바이너리 데이터로부터 신경망 모델의 실행에 필요한 실행 데이터를 추출할 수 있다. In the step of extracting execution data (S2000), the server 1000 may extract execution data of the neural network model from binary data of the neural network model. Specifically, the binary data of the neural network model may be in the form of binarized information required to execute the neural network model, including information related to an execution sequence of the neural network model or information related to the internal structure of the neural network model. Accordingly, the server 1000 according to an embodiment of the present application may extract execution data necessary for the execution of the neural network model from binary data of the neural network model.
임베디드 장치(100)의 컴퓨팅 환경 정보를 획득하는 단계(S3000)에서는, 서버(1000)는, 송수신부(1100)를 통하여, 임베디드 장치(100)의 컴퓨팅 환경 정보를 획득할 수 있다. 여기서 컴퓨팅 환경 정보란 전술한 바와 같이, 임베디드 장치(100)의 메모리 정보 또는 프로세서 정보를 포함하여 임베디드 장치(100)의 컴퓨팅 환경(또는 컴퓨팅 사양)과 관련된 임의의 정보를 포괄하는 의미일 수 있다. In the step of obtaining computing environment information of the embedded device 100 (S3000), the server 1000 may obtain computing environment information of the embedded device 100 through the transceiver 1100. As described above, the computing environment information may include any information related to the computing environment (or computing specifications) of the embedded device 100, including memory information or processor information of the embedded device 100.
실행 엔진의 최적화를 수행하는 단계(S4000)에서는, 서버(1000)는 신경망 모델의 실행 데이터 및 임베디드 장치(100)의 컴퓨팅 환경 정보에 기초하여 실행 엔진의 최적화를 수행할 수 있다. 구체적으로 서버(1000)는 신경망 모델의 실행 데이터 및 임베디드 장치(100)의 컴퓨팅 환경 정보를 이용하여 임베디드 장치에서의 신경망 모델의 동작을 예측하고, 이에 기초하여 신경망 모델의 실행과 관련된 소프트웨어인 실행 엔진의 최적화를 수행할 수 있다. In the step of optimizing the execution engine ( S4000 ), the server 1000 may optimize the execution engine based on execution data of the neural network model and computing environment information of the embedded device 100 . In detail, the server 1000 predicts the operation of the neural network model in the embedded device by using the execution data of the neural network model and the computing environment information of the embedded device 100, and based on this, the execution engine, which is software related to the execution of the neural network model, is used. optimization can be performed.
일 예로, 서버(1000)는 신경망 모델의 실행 데이터로부터 신경망 모델의 구조 데이터를 획득하고, 구조 데이터로부터 신경망 모델의 대상 구조 정보를 검출할 수 있다. 여기서 대상 구조 정보란 신경망 모델의 연산 구조와 관련하여 일반적으로 이용되는 구조와 관련된 임의의 정보일 수 있다. 이때, 대상 구조 정보에 포함된 연산 구조들을 병합하여 연산을 수행하도록 구현하는 것이 효율적일 수 있다. 따라서 본 출원의 일 실시예에 따른 서버(1000)는 대상 구조 정보에 포함된 연산 구조들을 병합시키는 코드를 생성하여 실행 엔진의 최적화를 수행할 수 있다. 이와 관련하여는 도 4 내지 도 6에서 구체적으로 서술한다. For example, the server 1000 may obtain structure data of the neural network model from execution data of the neural network model, and may detect target structure information of the neural network model from the structure data. Here, the target structure information may be any information related to a structure generally used in relation to a calculation structure of a neural network model. In this case, it may be efficient to implement the operation to perform the operation by merging the operation structures included in the target structure information. Accordingly, the server 1000 according to an embodiment of the present application may perform optimization of an execution engine by generating code for merging operation structures included in target structure information. In this regard, it will be described in detail in FIGS. 4 to 6 .
다른 예로, 서버(1000)는 신경망 모델의 실행 데이터 및 임베디드 장치(100)의 컴퓨팅 환경 정보를 이용하여, 메모리 관리와 관련된 코드를 생성하도록 구현될 수 있다. 구체적으로 서버(1000)는 신경망 모델의 실행 데이터 및 임베디드 장치(100)의 컴퓨팅 환경 정보(예, 메모리 정보 및 프로세서 정보 등)을 이용하여, 신경망 모델이 임베디드 장치(100)의 컴퓨팅 환경에서 동작될 때의 예상되는 메모리 사용량을 연산하고, 연산된 메모리 사용량에 기초하여 메모리 관리와 관련된 코드를 생성함으로써, 실행 엔진의 최적화를 수행할 수 있다. 예컨대, 서버(1000)는 메모리 사용량에 기초하여 메모리 할당량을 결정하는 코드를 생성할 수 있다. 다른 예를 들어, 서버(1000)는 할당된 메모리를 최대한 활용하기 위하여 메모리 사용량을 조절하는 코드를 생성할 수 있다. 이와 관련하여는 도 7 내지 도 9에서 구체적으로 서술한다. As another example, the server 1000 may be implemented to generate code related to memory management using execution data of the neural network model and computing environment information of the embedded device 100 . Specifically, the server 1000 uses neural network model execution data and computing environment information (eg, memory information and processor information, etc.) of the embedded device 100 to allow the neural network model to be operated in the computing environment of the embedded device 100. An execution engine may be optimized by calculating an expected memory usage amount at the time and generating a code related to memory management based on the calculated memory usage amount. For example, the server 1000 may generate code for determining a memory allocation amount based on memory usage. For another example, the server 1000 may generate code for controlling memory usage in order to utilize the allocated memory as much as possible. In this regard, it will be described in detail in FIGS. 7 to 9 .
또 다른 예로, 서버(1000)는 신경망 모델의 실행 데이터 및 임베디드 장치(100)의 컴퓨팅 환경 정보를 이용하여, 메모리 블록을 재배열하는 코드를 생성할 수 있다. 구체적으로, 서버(1000)는 임베디드 장치(100)의 컴퓨팅 환경 정보(예, 메모리 정보)로부터 임베디드 장치(100)의 메모리 블록의 위치 정보를 획득할 수 있다. 또한, 서버(1000)는 전술한 메모리 연산량과 메모리 할당량에 기초하여 메모리 효율성을 예측하거나 평가할 수 있다. 또한, 서버(1000)는 메모리 블록의 위치 정보 및 메모리 효율성에 기초하여 메모리 블록을 재배열하는 코드를 생성할 수 있다. 이와 관련하여는 도 8에서 구체적으로 서술한다. As another example, the server 1000 may generate code for rearranging memory blocks by using execution data of the neural network model and computing environment information of the embedded device 100 . Specifically, the server 1000 may obtain location information of a memory block of the embedded device 100 from computing environment information (eg, memory information) of the embedded device 100 . In addition, the server 1000 may predict or evaluate memory efficiency based on the above-described amount of memory operation and amount of memory allocation. Also, the server 1000 may generate code for rearranging memory blocks based on location information and memory efficiency of memory blocks. This will be described in detail in FIG. 8 .
최적 코드 정보를 획득하는 단계(S5000)에서는, 서버(1000)는 최적화 결과에 기초하여 실행 엔진에 이용될 최적 코드 정보를 획득할 수 있다. 예컨대, 최적 코드 정보는 전술한 바와 같이 신경망 모델의 연산 구조를 병합하는 코드 정보, 메모리 관리와 관련된 코드 정보 및/또는 메모리 블록을 재배열하는 코드 정보를 포함할 수 있다. In the step of obtaining optimal code information ( S5000 ), the server 1000 may acquire optimal code information to be used for the execution engine based on the optimization result. For example, as described above, the optimal code information may include code information for merging the computational structure of the neural network model, code information related to memory management, and/or code information for rearranging memory blocks.
한편, 도 3에서는 도시하지 않았으나, 본 출원의 일 실시예에 따른 실행 엔진 최적화 방법은, 최적 코드 정보를 송신하는 단계를 더 포함할 수 있다. 구체적으로 최적 코드 정보를 송신하는 단계에서는, 서버(1000)는 송수신부(1100)를 통하여, 최적 코드 정보를 임베디드 장치(100)로 송신할 수 있다. Meanwhile, although not shown in FIG. 3 , the execution engine optimization method according to an embodiment of the present application may further include transmitting optimal code information. Specifically, in the step of transmitting the optimal code information, the server 1000 may transmit the optimal code information to the embedded device 100 through the transceiver 1100 .
이하에서는 도 4 내지 도 9를 참고하여 본 출원의 실시예들에 따른 실행 엔진의 최적화를 수행하는 방법에 대하여 구체적으로 서술한다. 도 4 내지 도 6에서는 신경망 모델의 연산 구조를 병합하는 최적화 동작에 대하여 구체적으로 서술한다. 도 7 내지 도 9에서는 메모리 관리를 위한 최적화 동작에 대하여 구체적으로 서술한다. Hereinafter, a method of performing optimization of an execution engine according to embodiments of the present application will be described in detail with reference to FIGS. 4 to 9 . In FIGS. 4 to 6, an optimization operation of merging the calculation structure of the neural network model is described in detail. 7 to 9 describe optimization operations for memory management in detail.
도 4를 참고한다. 도 4는 본 출원의 일 실시예에 따른 실행 엔진의 최적화를 수행하는 단계를 구체화한 순서도이다.See Figure 4. 4 is a flowchart detailing steps for performing optimization of an execution engine according to an embodiment of the present application.
본 출원의 일 실시예에 따른 실행 엔진의 최적화를 수행하는 단계(S4000)는 신경망 모델의 구조 데이터를 획득하는 단계(S4110), 구조 데이터로부터 신경망 모델의 대상 구조 정보를 획득하는 단계(S4120) 및 대상 구조 정보에 포함된 관심 데이터 세트와 관련된 연산들을 병합시키는 제1 최적 코드를 생성하는 단계(S4130)를 포함할 수 있다. Optimizing the execution engine according to an embodiment of the present application (S4000) includes acquiring structure data of the neural network model (S4110), acquiring target structure information of the neural network model from the structure data (S4120), and It may include generating a first optimal code for merging operations related to the data set of interest included in the target structure information (S4130).
신경망 모델의 구조 데이터를 획득하는 단계(S4110)에서는, 서버(1000)는 신경망 모델의 실행 데이터로부터 신경망 모델의 내부 구조를 나타내는 구조 데이터를 획득할 수 있다.In the step of acquiring structural data of the neural network model ( S4110 ), the server 1000 may obtain structural data representing the internal structure of the neural network model from execution data of the neural network model.
구조 데이터로부터 신경망 모델의 대상 구조 정보를 획득하는 단계(S4120)에서는, 서버(1000)는 신경망 모델의 구조 데이터로부터 대상 구조 정보를 획득할 수 있다. 구체적으로 신경망 모델의 유형별로 일반적으로 사용되는 신경망 모델의 구조가 존재할 수 있다. 예컨대, 특정 네트워크 스페이스에서는 컨볼루션(Convolution) 연산을 수행하고, 뎁스와이스 컨볼루션(Depthwise convolution) 연산을 수행하고, 액티베이션(Activation) 연산을 수행하는 구조가 일반적으로 이용될 수 있다. In the step of obtaining target structure information of the neural network model from the structure data (S4120), the server 1000 may obtain target structure information from the structure data of the neural network model. Specifically, a structure of a commonly used neural network model may exist for each type of neural network model. For example, in a specific network space, a structure that performs a convolution operation, a depthwise convolution operation, and an activation operation may be generally used.
일 실시예에 따르면, 서버(1000)는 전술한 바와 같이 일반적으로 이용되는 구조와 관련된 관심 구조 정보를 획득하고, 구조 데이터로부터 관심 구조 정보에 대응되는 관심 데이터 세트를 검출하는 동작을 수행할 수 있다. 또한, 서버(1000)는 검출된 관심 데이터 세트에 기초하여 신경망 모델의 대상 구조 정보를 획득할 수 있다. According to an embodiment, the server 1000 may obtain structure-of-interest information related to a commonly used structure as described above, and may perform an operation of detecting a data set of interest corresponding to the structure-of-interest information from structure data. . Also, the server 1000 may obtain target structure information of the neural network model based on the detected data set of interest.
도 5 내지 도 6을 참고한다. 도 5는 본 출원의 일 실시예에 따른 신경망 모델의 대상 구조 정보를 획득하는 단계를 구체화한 순서도이다. 도 6은 본 출원의 일 실시예에 따른 제1 최적 코드를 생성하는 방법의 일 양상을 나타낸 도면이다. See Figures 5-6. 5 is a flowchart specifying a step of obtaining target structure information of a neural network model according to an embodiment of the present application. 6 is a diagram illustrating one aspect of a method for generating a first optimal code according to an embodiment of the present application.
본 출원의 일 실시예에 따른 신경망 모델의 대상 구조 정보를 획득하는 단계(S4120)는 관심 구조 정보를 획득하는 단계(S4122), 구조 데이터로부터 관심 구조 정보에 대응되는 관심 데이터 세트(data set of interest)를 검출하는 단계(S4124) 및 데이터 세트에 기초하여 신경망 모델의 대상 구조 정보를 획득하는 단계(S4126)를 포함할 수 있다. Acquiring target structure information of a neural network model according to an embodiment of the present application (S4120) includes acquiring structure information of interest (S4122), a data set of interest corresponding to structure information of interest from structure data (data set of interest) ) may be detected (S4124) and target structure information of the neural network model may be obtained based on the data set (S4126).
관심 구조 정보를 획득하는 단계(S4122)에서는, 서버(1000)는 신경망 모델과 관련된 관심 구조 정보를 획득할 수 있다. In the step of obtaining structure of interest information (S4122), the server 1000 may obtain structure of interest information related to the neural network model.
전술한 바와 같이, 신경망 모델의 유형별로 일반적으로 사용되는 연산 구조가 신경망 모델을 구성할 수 있다. 구체적으로 제1 연산(O1)을 수행하고 제1 연산(O1)으로부터 출력되는 출력값에 기초하여 제2 연산(O2)를 수행하는 구조가 특정 네트워크 스페이스를 가지는 신경망 모델에서 일반적으로 이용될 수 있다. 예컨대, 제1 모델에서는, 컨볼루션(Convolution) 연산을 수행하고, 뎁스와이스 컨볼루션(Depthwise convolution) 연산과 액티베이션(Activation) 연산을 순차적으로 수행하는 구조가 일반적으로 이용될 수 있다. 다른 예를 들어, 제2 모델은, 이미지의 색상과 관련된 채널별로 필터를 적용하여 채널별로 데이터를 압축하는 뎁스와이스 컨볼루션(Depthwise convolution) 연산을 수행하여 중간 결과값을 획득하고, 중간결과 값에 기초하여 포인트와이스(Pointwise) 연산을 수행하는 구조를 포함할 수 있다. As described above, a commonly used calculation structure for each type of neural network model may constitute a neural network model. Specifically, a structure in which the first operation O1 is performed and the second operation O2 is performed based on the output value output from the first operation O1 can be generally used in a neural network model having a specific network space. For example, in the first model, a structure in which a convolution operation is performed, and a depthwise convolution operation and an activation operation are sequentially performed may be generally used. For another example, the second model 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 obtaining an intermediate result value. Based on this, it may include a structure for performing a pointwise operation.
이때 서버(1000)는 제1 연산(O1)과 제2 연산(O2)을 수행하는 구조와 관련된 관심 구조 정보를 획득할 수 있다. 일 예로, 관심 구조 정보는 사용자에 의해 미리 입력될 수 있다. 서버(1000)는 사용자의 입력을 통하여 관심 구조 정보를 획득할 수 있다. 다만, 이는 예시에 불과하며 임의의 적절한 방법으로 신경망 모델과 관련된 관심 구조 정보를 획득하고, 관심 구조 정보에 기초하여 대상 구조 정보를 획득하도록 구현될 수 있을 것이다. In this case, the server 1000 may obtain structure information of interest related to a structure for performing the first operation O1 and the second operation O2. For example, structure of interest information may be previously input by a user. The server 1000 may obtain structure-of-interest information through a user's input. However, this is only an example and may be implemented to acquire structure-of-interest information related to the neural network model by any suitable method, and obtain target structure information based on the structure-of-interest information.
구조 데이터로부터 관심 구조 정보에 대응되는 관심 데이터 세트를 검출하는 단계(S4124)에서는, 서버(1000)는 관심 구조 정보에 기초하여, 구조 데이터에 포함된 데이터 세트 중 관심 구조 정보에 대응되는 연산 구조를 가지는 관심 데이터 세트를 검출하도록 구현될 수 있다. 구체적으로 관심 구조 정보가 제1 연산(O1)과 제2 연산(O2)을 수행하는 구조에 대한 정보를 포함하고 있다면, 서버(1000)는 구조 데이터에 포함된 데이터 세트 중 관심 구조 정보에 대응되는 연산 구조와 관련된 제1 대상연산(TO1)과 제2 대상연산(TO2)을 검출할 수 있다. In the step of detecting a data set of interest corresponding to the structure of interest information from the structure data (S4124), the server 1000 selects an operation structure corresponding to the structure of interest information from among the data sets included in the structure data, based on the structure of interest information. A branch may be implemented to detect a data set of interest. In detail, if the structure-of-interest information includes information on a structure for performing the first operation O1 and the second operation O2, the server 1000 provides a structure corresponding to the structure-of-interest information among data sets included in the structure data. A first target operation TO1 and a second target operation TO2 related to the operation structure may be detected.
관심 데이터 세트에 기초하여 신경망 모델의 대상 구조 정보를 획득하는 단계(S4126)에서는, 서버(1000)는 관심 구조 정보에 대응되는 관심 데이터 세트에 기초하여 신경망 모델의 대상 구조 정보를 획득할 수 있다. 예컨대, 제1 대상연산(TO1)을 수행하고 순차적으로 제2 대상연산(TO2)을 수행하는 구조와 관련된 관심 데이터 세트에 기초하여 신경망 모델의 대상 구조 정보를 획득할 수 있다. In step S4126 of acquiring object structure information of the neural network model based on the interest data set, the server 1000 may obtain object structure information of the neural network model based on the interest data set corresponding to the interest structure information. For example, object structure information of the neural network model may be obtained based on a data set of interest related to a structure in which the first object operation TO1 is performed and the second object operation TO2 is sequentially performed.
다시 도 4를 참고하면, 본 출원의 일 실시예에 따른 실행 엔진 최적화 방법은 대상 구조 정보에 포함된 관심 데이터 세트와 관련된 연산들을 병합시키는 제1 최적 코드를 생성하는 단계(S4130)를 포함할 수 있다. 구체적으로 서버(1000)는 대상 구조 정보와 관련된 제1 대상연산(TO1)과 제2 대상연산(TO2)를 병합(merge)하여 연산하도록 구성된 제1 최적 코드를 생성할 수 있다. 이때, 제1 최적 코드는 연산 퓨전(Operation Fusion) 기법을 활용하여 생성될 수 있다. 이러한 연산 구조를 병합하는 최적화 과정을 통하여, 각각의 연산별로 소요되는 메모리 사용량(혹은 메모리할당량)을 감소시킬 수 있으며, 연산 속도를 높일 수 있다. Referring back to FIG. 4 , the execution engine optimization method according to an embodiment of the present application may include generating a first optimal code for merging operations related to a data set of interest included in target structure information (S4130). there is. In detail, the server 1000 may generate a first optimal code configured to perform an operation by merging the first object operation TO1 and the second object operation TO2 related to the object structure information. In this case, the first optimal code may be generated using an operation fusion technique. Through an optimization process of merging these operation structures, memory usage (or memory allocation) required for each operation can be reduced, and operation speed can be increased.
이하에서는 도 7 및 도 8을 참고하여 본 출원의 다른 실시예에 따른 실행 엔진의 최적화를 수행하는 내용을 구체적으로 서술한다. Hereinafter, content of performing optimization of an execution engine according to another embodiment of the present application will be described in detail with reference to FIGS. 7 and 8 .
도 7은 본 출원의 다른 실시예에 따른 실행 엔진의 최적화를 수행하는 단계(S4000)를 구체화한 순서도이다. 구체적으로 도 7은 본 출원의 다른 실시예에 따른 메모리 할당량을 최적화하는 방법을 도시한 순서도이다. 7 is a flowchart embodying a step (S4000) of performing optimization of an execution engine according to another embodiment of the present application. Specifically, FIG. 7 is a flowchart illustrating a method of optimizing a memory allocation amount according to another embodiment of the present application.
본 출원의 다른 실시예에 따른 실행 엔진의 최적화를 수행하는 단계(S4000)는 신경망 모델이 임베디드 장치의 컴퓨팅 환경에서 동작될 경우에 예상되는 메모리 사용량을 연산하는 단계(S4210) 및 메모리 사용량에 기초하여 메모리 할당량을 결정하는 제2 최적 코드를 생성하는 단계(S4220)를 포함할 수 있다. Optimizing the execution engine according to another embodiment of the present application (S4000) includes calculating the expected memory usage when the neural network model is operated in the computing environment of the embedded device (S4210) and based on the memory usage A step of generating a second optimal code for determining a memory allocation amount (S4220) may be included.
신경망 모델이 임베디드 장치의 컴퓨팅 환경에서 동작될 경우에 예상되는 메모리 사용량을 연산하는 단계(S4210)에서는, 서버(1000)는 신경망 모델의 실행 데이터 및 임베디드 장치(100)의 컴퓨팅 환경 정보에 기초하여 신경망 모델이 임베디드 장치(100)의 컴퓨팅 환경에서 동작될 때의 예상되는 메모리 사용량을 연산할 수 있다. In the step of calculating the expected memory usage when the neural network model is operated in the computing environment of the embedded device (S4210), the server 1000 operates the neural network model based on the execution data of the neural network model and the computing environment information of the embedded device 100. Expected memory usage when the model is operated in the computing environment of the embedded device 100 may be calculated.
메모리 사용량에 기초하여 메모리 할당량을 결정하는 제2 최적 코드를 생성하는 단계(S4220)에서는, 서버(1000)는, 메모리 사용량을 이용하여 메모리 할당량을 결정하거나 조절하는 제2 최적 코드를 생성함으로써, 실행 엔진의 최적화를 수행할 수 있다. In the step of generating the second optimal code for determining the memory allocation amount based on the memory usage (S4220), the server 1000 generates the second optimal code for determining or adjusting the memory allocation amount using the memory usage amount, and executes the Optimization of the engine can be performed.
도 8은 본 출원의 일 실시예에 따른 제2 최적 코드를 생성하는 단계를 구체화한 순서도이다. 구체적으로 도 8은 본 출원의 일 실시예에 따른 메모리 블록을 최적화하는 방법을 도시한 순서도이다. 8 is a flowchart embodying a step of generating a second optimal code according to an embodiment of the present application. Specifically, FIG. 8 is a flowchart illustrating a method of optimizing a memory block according to an embodiment of the present application.
본 출원의 다른 실시예에 따른 제2 최적 코드를 생성하는 단계(S4220)는 메모리 블록의 위치 정보를 획득하는 단계(S4230), 메모리 효율성을 평가하는 단계(S4240) 및 메모리 블록을 재배열하는 코드를 생성하는 단계(S4250)를 포함할 수 있다. Generating the second optimal code (S4220) according to another embodiment of the present application includes acquiring location information of memory blocks (S4230), evaluating memory efficiency (S4240), and rearranging the memory blocks. It may include a step of generating (S4250).
메모리 블록의 위치 정보를 획득하는 단계(S4230)에서는, 서버(1000)는 임베디드 장치(100)의 컴퓨팅 환경 정보의 메모리 정보로부터 메모리 블록의 위치 정보를 획득할 수 있다. In the step of acquiring location information of the memory block (S4230), the server 1000 may obtain location information of the memory block from memory information of the computing environment information of the embedded device 100.
메모리 효율성을 평가하는 단계(S4240)에서는, 서버(1000)는 신경망 모델이 임베디드 장치(100)의 컴퓨팅 환경에서 동작될 경우의 예상되는 메모리 사용량과 메모리 할당량을 이용하여 메모리 효율성을 계산할 수 있다. 이때, 메모리 블록이 특정 위치에 배정된 경우에는 메모리 효율을 방해할 수 있다. 이때, 본 출원의 일 실시예에 따른 서버(1000)는 후술할 바와 같이, 메모리 블록의 위치 정보 및 메모리 효율성에 기초하여 메모리 블록을 재배열할 수 있다.In the step of evaluating the memory efficiency (S4240), the server 1000 may calculate the memory efficiency using the expected memory usage and memory allocation when the neural network model is operated in the computing environment of the embedded device 100. At this time, if a memory block is allocated to a specific location, memory efficiency may be disturbed. In this case, the server 1000 according to an embodiment of the present application may rearrange the memory blocks based on location information and memory efficiency of the memory blocks, as will be described later.
메모리 블록을 재배열하는 코드를 생성하는 단계(S4250)에서는, 서버(1000)는 메모리 블록의 위치 정보 및 메모리 효율성에 기초하여 메모리 블록을 재배열하는 코드를 생성할 수 있다. 구체적으로 서버(1000)는, 메모리 효율이 미리 설정된 임계 효율값보다 낮은 경우, 메모리 블록의 위치 정보를 이용하여 메모리 블록을 재배열하는 코드를 생성할 수 있다. 이러한 메모리 블록의 위치의 최적화 과정을 통하여 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)은 임베디드 장치(100)의 컴퓨팅 환경(혹은 컴퓨팅 사양)에 대하여 최적의 메모리를 할당할 수 있다.In generating the code for rearranging the memory block (S4250), the server 1000 may generate the code for rearranging the memory block based on location information and memory efficiency of the memory block. In detail, the server 1000 may generate code for rearranging memory blocks by using location information of memory blocks when memory efficiency is lower than a preset threshold efficiency value. Through the process of optimizing the location of the memory block, the execution engine optimization system 10 according to an embodiment of the present application may allocate an optimal memory for the computing environment (or computing specification) of the embedded device 100 .
이하에서는 도 9를 참고하여 본 출원의 또 다른 실시예에 따른 실행 엔진의 최적화를 수행하는 내용을 구체적으로 서술한다. Hereinafter, with reference to FIG. 9 , optimization of an execution engine according to another embodiment of the present application will be described in detail.
도 9는 본 출원의 또 다른 실시예에 따른 실행 엔진의 최적화를 수행하는 단계를 구체화한 순서도이다. 9 is a flowchart detailing steps for performing optimization of an execution engine according to another embodiment of the present application.
본 출원의 일 실시예에 따른 실행 엔진의 최적화를 수행하는 단계(S4000)는, 메모리 사용량과 메모리 할당량을 비교하는 단계(S4310) 및 비교 결과에 기초하여 메모리 사용량을 조절하는 코드를 생성하는 단계(S4320)를 포함할 수 있다. Optimizing the execution engine according to an embodiment of the present application (S4000) includes comparing memory usage and memory allocation (S4310) and generating code for adjusting memory usage based on the comparison result (S4310). S4320) may be included.
메모리 사용량과 메모리 할당량을 비교하는 단계(S4230)에서는, 서버(1000)는 신경망 모델이 임베디드 장치(100)에서 동작될 때 예상되는 메모리 사용량과 메모리 사용량에 기초하여 결정된 메모리 할당량을 비교할 수 있다. In the step of comparing the memory usage and memory allocation (S4230), the server 1000 compares the memory usage expected when the neural network model is operated in the embedded device 100 with the memory allocation determined based on the memory usage.
비교 결과에 기초하여 메모리 사용량을 조절하는 코드를 생성하는 단계(S4320)에서는, 서버(1000)는 메모리 사용량과 메모리 할당량을 비교하여 메모리 사용량을 조절하는 코드를 생성할 수 있다.In step S4320 of generating code for adjusting memory usage based on the comparison result, the server 1000 may generate code for adjusting memory usage by comparing memory usage and memory allocation.
일 예로, 계산된 메모리 사용량이 메모리 할당량보다 적은 경우, 서버(1000)는 메모리 사용량을 높이도록 조절하는 코드를 생성할 수 있다. 구체적으로 서버(1000)는 Im2Col 확장 기법을 활용하여 메모리 사용량을 증가시켜 캐시 히트 비율(cache hit ratio)을 높여 임베디드 장치(100)에서의 신경망 모델의 성능을 향상시키도록 구현될 수 있다. 좀 더 구체적으로 Im2Col 확장 기법을 활용하는 경우, 메모리 사용량이 증가하는 대신 캐시 히트 비율이 높아져 실행 속도의 향상을 기대할 수 있다. 본 출원의 일 실시예에 따른 서버(1000)는 신경망 모델이 임베디드 장치(100)에서 동작될 때 예상되는 메모리 사용량이 메모리 할당량에 비해 적은 경우, Im2Col 확장 기법을 활용하여 메모리를 최대한 활용하면서도 임베디드 장치(100)에서의 신경망 모델의 실행 속도를 향상시키도록 실행 엔진을 최적화시킬 수 있다.For example, when the calculated memory usage is less than the memory allocation, the server 1000 may generate code for adjusting the memory usage to increase. In detail, the server 1000 may be implemented to improve the performance of the neural network model in the embedded device 100 by increasing the cache hit ratio by increasing memory usage by using the Im2Col extension technique. More specifically, when the Im2Col extension technique is used, execution speed can be expected to improve as the cache hit rate increases instead of memory usage increasing. The server 1000 according to an embodiment of the present application utilizes the Im2Col extension technique when the expected memory usage is smaller than the memory allocation amount when the neural network model is operated in the embedded device 100, while maximizing the use of the memory. The execution engine can be optimized to improve the execution speed of the neural network model in (100).
다른 예로, 계산된 메모리 사용량이 메모리 할당량보다 큰 경우, 서버(1000)는 메모리 사용량을 낮추도록 조절하는 코드를 생성할 수 있다.As another example, when the calculated memory usage is greater than the allocated memory, the server 1000 may generate code for adjusting the memory usage to be lowered.
본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)의 임베디드 장치(100)는 임베디드 장치(100)의 컴퓨팅 사양보다 뛰어난 서버(1000)에서 최적화된 실행 엔진을 이용하여, 모델의 구조를 분석하거나 메모리 할당을 결정하지 않고 신경망 모델을 곧바로 실행할 수 있다. The embedded device 100 of the execution engine optimization system 10 according to an embodiment of the present application analyzes the structure of a model by using an execution engine optimized in the server 1000 superior to the computing specifications of the embedded device 100. Alternatively, you can directly run the neural network model without deciding on memory allocation.
특히 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)에 의하면, 모델의 구조를 분석하여 특정 구조에 대한 연산을 병합시키는 알고리즘을 실행 엔진에 적용할 수 있다. 또한, 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)에 의하면, 임베디드 장치(100)의 컴퓨팅 사양을 고려하여 복잡하고 개선된 메모리 할당 알고리즘 또는 메모리 블록 재배열 알고리즘 등을 실행 엔진에 적용할 수 있다. 따라서, 임베디드 장치(100)에서의 신경망 모델의 실행 능력이 향상될 수 있다. In particular, according to the execution engine optimization system 10 according to an embodiment of the present application, an algorithm for analyzing the structure of a model and merging operations for a specific structure may be applied to the execution engine. In addition, according to the execution engine optimization system 10 according to an embodiment of the present application, a complex and improved memory allocation algorithm or memory block rearrangement algorithm is applied to the execution engine in consideration of the computing specifications of the embedded device 100. can do. Accordingly, the execution capability of the neural network model in the embedded device 100 may be improved.
또한, 본 출원의 일 실시예에 따른 실행 엔진 최적화 시스템(10)에 의하면, 전술한 모델의 구조를 분석하거나 메모리 할당을 결정하는 동작이 컴퓨팅 환경에 제약이 존재하는 임베디드 장치(100)에서 수행되지 않고, 컴퓨팅 환경이 상대적으로 뛰어난 서버(1000)에서 수행되게 된다. 따라서, 임베디드 장치(100)에서 모델 실행 시 임베디드 장치(100)의 메모리를 효율적으로 활용하고 임베디드 장치의 전력 사용량이 감소될 수 있다. In addition, according to the execution engine optimization system 10 according to an embodiment of the present application, an operation of analyzing the structure of the above-described model or determining memory allocation is not performed in the embedded device 100 having limitations in the computing environment. Instead, it is performed in the server 1000, which has a relatively excellent computing environment. Therefore, when the model is executed in the embedded device 100, the memory of the embedded device 100 can be efficiently utilized and power consumption of the embedded device can be reduced.
상술한 서버(1000)의 다양한 동작들은 서버(1000)의 메모리(1200)에 저장될 수 있으며, 서버(1000)의 프로세서(1300)는 메모리(1200)에 저장된 동작들을 수행하도록 제공될 수 있다. Various operations of the server 1000 described above may be stored in the memory 1200 of the server 1000, and the processor 1300 of the server 1000 may be provided to perform the operations stored in the memory 1200.
본 출원에 개시된 실행 엔진 최적화 방법, 실행 엔진 최적화 장치 및 실행 엔진 최적화 시스템은 가전 제품, 차량용 센서, 유아 혹은 노인의 안전을 위한 제품 및 스마트 워치 등을 포함하여 다양한 임베디드 시스템에서의 인공지능 모델의 효율적인 실행을 위하여 이용될 수 있다. The execution engine optimization method, execution engine optimization device, and execution engine 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 those skilled in the art 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 (9)

  1. 제1 성능을 나타내는 임베디드 장치에서 사용될 실행 엔진(Inference engine)을, 상기 제1 성능보다 뛰어난 제2 성능을 나타내는 서버가 상기 임베디드 장치의 컴퓨팅 환경을 고려하여 최적화하는 방법에 있어서, 상기 방법은, A method for optimizing an inference engine to be used in an embedded device exhibiting a first performance by a server exhibiting a second performance superior to the first performance in consideration of a computing environment of the embedded device, the method comprising:
    학습이 완료된 신경망 모델의 바이너리 데이터를 획득하는 단계; Acquiring binary data of the neural network model on which training is completed;
    상기 바이너리 데이터로부터 상기 신경망 모델의 실행 데이터를 추출하는 단계-상기 실행 데이터는 상기 신경망 모델의 실행 순서 데이터 및 상기 신경망 모델의 구조 데이터 중 적어도 하나와 관련됨-;extracting execution data of the neural network model from the binary data, wherein the execution data is related to at least one of execution sequence data of the neural network model and structural data of the neural network model;
    상기 임베디드 장치의 컴퓨팅 환경 정보를 획득하는 단계-상기 컴퓨팅 환경 정보는 상기 임베디드 장치의 메모리 정보 및 프로세서 정보 중 적어도 하나를 포함함-;obtaining computing environment information of the embedded device, wherein the computing environment information includes at least one of memory information and processor information of the embedded device;
    상기 실행 데이터 및 상기 컴퓨팅 환경 정보에 기초하여 상기 임베디드 장치에서의 상기 신경망 모델의 동작(operation)을 예측하고 상기 실행 엔진의 최적화를 수행하는 단계; predicting an operation of the neural network model in the embedded device based on the execution data and the computing environment information and performing optimization of the execution engine;
    상기 최적화 결과에 기초하여 상기 실행 엔진에 이용될 최적 코드 정보를 획득하는 단계; 및obtaining optimal code information to be used in the execution engine based on the optimization result; and
    상기 최적 코드 정보를 송신하는 단계;를 포함하는,Transmitting the optimal code information; including,
    실행 엔진 최적화 방법.Execution Engine Optimization Methods.
  2. 제1 항에 있어서, According to claim 1,
    상기 실행 엔진의 최적화를 수행하는 단계는, The step of optimizing the execution engine,
    상기 실행 데이터로부터 상기 신경망 모델의 상기 구조 데이터를 획득하는 단계; acquiring the structure data of the neural network model from the execution data;
    상기 구조 데이터로부터 상기 신경망 모델의 대상 구조 정보를 획득하는 단계; 및obtaining target structure information of the neural network model from the structure data; and
    상기 대상 구조 정보에 포함된 관심 데이터 세트와 관련된 연산들을 병합(merge)시키는 제1 최적 코드를 생성하는 단계;를 포함하는, Generating a first optimal code for merging operations related to a data set of interest included in the target structure information;
    실행 엔진 최적화 방법.Execution Engine Optimization Methods.
  3. 제2 항에 있어서, According to claim 2,
    상기 대상 구조 정보를 획득하는 단계는, Obtaining the target structure information,
    미리 설정된 상기 신경망 모델의 관심 구조 정보를 획득하는 단계; obtaining structure-of-interest information of the previously set neural network model;
    상기 구조 데이터로부터 상기 관심 구조 정보에 대응되는 상기 관심 데이터 세트를 검출하는 단계; 및detecting the set of interest data corresponding to the structure information of interest from the structure data; and
    상기 관심 데이터 세트에 기초하여 상기 신경망 모델의 상기 대상 구조 정보를 획득하는 단계;를 포함하는, Acquiring the target structure information of the neural network model based on the interest data set; comprising,
    실행 엔진 최적화 방법.Execution Engine Optimization Methods.
  4. 제1 항에 있어서, According to claim 1,
    상기 실행 엔진의 최적화를 수행하는 단계는, The step of optimizing the execution engine,
    상기 실행 데이터 및 상기 컴퓨팅 환경 정보에 기초하여 상기 신경망 모델이 상기 임베디드 장치의 컴퓨팅 환경에서 동작될 경우의 예상되는 메모리 사용량을 연산하는 단계; 및calculating expected memory usage when the neural network model is operated in the computing environment of the embedded device based on the execution data and the computing environment information; and
    상기 메모리 사용량에 기초하여 메모리 할당량을 결정하는 제2 최적 코드를 생성하는 단계;를 포함하는, Generating a second optimal code for determining a memory allocation amount based on the memory usage;
    실행 엔진 최적화 방법.Execution Engine Optimization Methods.
  5. 제4 항에 있어서, According to claim 4,
    상기 제2 최적 코드를 생성하는 단계는, Generating the second optimal code,
    상기 컴퓨팅 환경 정보의 상기 메모리 정보로부터 메모리 블록의 위치 정보를 획득하는 단계; obtaining location information of a memory block from the memory information of the computing environment information;
    상기 메모리 사용량 및 상기 메모리 할당량에 기초하여 메모리 효율성을 평가하는 단계; 및Evaluating memory efficiency based on the memory usage and the memory allocation; and
    상기 메모리 블록의 위치 정보 및 상기 메모리 효율성에 기초하여 상기 메모리 블록을 재배열하는 코드를 생성하는 단계;를 포함하는, Generating a code for rearranging the memory block based on the location information of the memory block and the memory efficiency;
    실행 엔진 최적화 방법. Execution Engine Optimization Methods.
  6. 제4 항에 있어서, According to claim 4,
    상기 실행 엔진의 최적화를 수행하는 단계는,The step of optimizing the execution engine,
    상기 메모리 사용량과 상기 메모리 할당량을 비교하는 단계; 및comparing the memory usage and the memory allocation; and
    상기 메모리 할당량과 상기 메모리 사용량의 비교 결과에 기초하여 상기 메모리 사용량을 조절하는 코드를 생성하는 단계;를 포함하는, Generating a code for adjusting the memory usage based on a comparison result of the memory allocation amount and the memory usage;
    실행 엔진 최적화 방법. Execution Engine Optimization Methods.
  7. 제6 항에 있어서, According to claim 6,
    상기 메모리 사용량을 조절하는 코드는 Im2Col 변환 코드와 관련되는, The code for controlling the memory usage is related to the Im2Col conversion code,
    실행 엔진 최적화 방법. Execution Engine Optimization Methods.
  8. 컴퓨터에 제1 항 내지 제7 항 중 어느 하나의 항에 따른 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체. A computer-readable recording medium recording a program for executing the method according to any one of claims 1 to 7 in a computer.
  9. 임베디드 장치의 컴퓨팅 환경을 고려하여 임베디드 장치에서 사용될 실행 엔진(Inference engine)을 최적화하는 시스템에 있어서, 상기 시스템은,A system for optimizing an inference engine to be used in an embedded device in consideration of the computing environment of the embedded device, the system comprising:
    학습이 완료된 신경망 모델의 데이터에 기초하여 임베디드 장치에서 사용될 실행 엔진을 최적화하는 최적 코드를 생성하는 프로세서; 및 임베디드 장치와 통신하는 송수신부;를 포함하는 서버; 및a processor for generating an optimal code for optimizing an execution engine to be used in an embedded device based on data of a trained neural network model; and a transceiver for communicating with the embedded device; a server including; and
    상기 최적 코드를 획득하고 상기 최적 코드를 실행하는 임베디드 장치;를 포함하되, An embedded device for obtaining the optimal code and executing the optimal code; including,
    상기 프로세서는,the processor,
    학습이 완료된 신경망 모델의 바이너리 데이터를 획득하고, 상기 바이너리 데이터로부터 상기 신경망 모델의 실행 데이터-상기 실행 데이터는 상기 신경망 모델의 실행 순서 정보 및 상기 신경망 모델의 구조 데이터 중 적어도 하나와 관련됨-를 추출하고, 상기 임베디드 장치의 컴퓨팅 환경 정보-상기 컴퓨팅 환경 정보는 상기 임베디드 장치의 메모리 정보 및 프로세서 정보 중 적어도 하나를 포함함-를 획득하고, 상기 실행 데이터 및 상기 컴퓨팅 환경 정보에 기초하여 상기 임베디드 장치에서의 상기 신경망 모델의 동작(operation)을 예측하고 상기 실행 엔진의 최적화를 수행하고, 상기 최적화 결과에 기초하여, 상기 실행 엔진에 이용될 최적 코드 정보를 획득하고, 상기 최적 코드 정보를 상기 송수신부를 통하여 상기 임베디드 장치로 송신하도록 구성된,Acquiring binary data of a neural network model that has been trained, extracting execution data of the neural network model from the binary data, the execution data being related to at least one of execution order information of the neural network model and structural data of the neural network model, , Computing environment information of the embedded device - the computing environment information includes at least one of memory information and processor information of the embedded device - is obtained, and based on the execution data and the computing environment information, in the embedded device Predicting the operation of the neural network model, performing optimization of the execution engine, obtaining optimal code information to be used in the execution engine based on the optimization result, and transmitting the optimal code information through the transceiver. configured to transmit to an embedded device;
    실행 엔진 최적화 시스템.Execution engine optimization system.
PCT/KR2022/011390 2021-08-24 2022-08-02 Execution engine optimization method, execution engine optimization device, and execution engine optimization system WO2023027368A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2021-0111338 2021-08-24
KR1020210111338A KR102393767B1 (en) 2021-08-24 2021-08-24 Method for, device for, and system for optimizing an inference engine
KR10-2022-0052708 2021-08-24
KR1020220052708A KR102573644B1 (en) 2021-08-24 2022-04-28 Method for, device for, and system for optimizing an inference engine

Publications (1)

Publication Number Publication Date
WO2023027368A1 true WO2023027368A1 (en) 2023-03-02

Family

ID=85323506

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/011390 WO2023027368A1 (en) 2021-08-24 2022-08-02 Execution engine optimization method, execution engine optimization device, and execution engine optimization system

Country Status (2)

Country Link
KR (1) KR102573644B1 (en)
WO (1) WO2023027368A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130086449A (en) * 2012-01-25 2013-08-02 전자부품연구원 Method for recording volume management program to relocate data block according to usage of each level volume
KR20190113928A (en) * 2017-03-24 2019-10-08 구글 엘엘씨 Device placement optimization through reinforcement learning
KR20210042012A (en) * 2019-10-08 2021-04-16 한국전자통신연구원 Apparatus and Method for Artificial Intelligence Inference
KR102257028B1 (en) * 2020-10-06 2021-05-27 주식회사 딥이티 Apparatus and method for allocating deep learning task adaptively based on computing platform
KR20210090349A (en) * 2020-01-10 2021-07-20 주식회사 소이넷 Artificail intelligence model accelerator and method thereof
KR102393767B1 (en) * 2021-08-24 2022-05-04 주식회사 에너자이(ENERZAi) Method for, device for, and system for optimizing an inference engine

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102192325B1 (en) * 2019-06-04 2020-12-28 (주)딥엑스 Data management device supporting high speed artificial neural network operation with caching data based on data locality of artificial neural networks
KR20200131722A (en) * 2019-10-15 2020-11-24 주식회사 뷰노 Method for improving reproducibility of trained deep neural network model and apparatus using the same

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130086449A (en) * 2012-01-25 2013-08-02 전자부품연구원 Method for recording volume management program to relocate data block according to usage of each level volume
KR20190113928A (en) * 2017-03-24 2019-10-08 구글 엘엘씨 Device placement optimization through reinforcement learning
KR20210042012A (en) * 2019-10-08 2021-04-16 한국전자통신연구원 Apparatus and Method for Artificial Intelligence Inference
KR20210090349A (en) * 2020-01-10 2021-07-20 주식회사 소이넷 Artificail intelligence model accelerator and method thereof
KR102257028B1 (en) * 2020-10-06 2021-05-27 주식회사 딥이티 Apparatus and method for allocating deep learning task adaptively based on computing platform
KR102393767B1 (en) * 2021-08-24 2022-05-04 주식회사 에너자이(ENERZAi) Method for, device for, and system for optimizing an inference engine

Also Published As

Publication number Publication date
KR20230029494A (en) 2023-03-03
KR102573644B1 (en) 2023-09-01

Similar Documents

Publication Publication Date Title
WO2012043962A1 (en) Method and system for visualizing an adaptive screen according to a terminal
WO2011147324A1 (en) Multi-interface solid state disk (ssd), processing method and system thereof
WO2015115783A1 (en) Charging circuit and electronic device having the same
WO2015108300A1 (en) Frame rate control method and electronic device thereof
EP3100162A1 (en) Task scheduling method and apparatus
WO2019132299A1 (en) System, device, and method for priority-based resource scaling in cloud system
WO2019156283A1 (en) Dynamic memory mapping for neural networks
CN105100730A (en) Monitoring method and camera device
WO2022050541A1 (en) Method for adjusting allocation of computing resources for multiple vnf, and server therefor
WO2014119864A1 (en) Software migration method and apparatus in micro-server environment
WO2021201387A1 (en) Neural network-based battery capacity estimation method and device
WO2016023493A1 (en) Control method of human-machine interface responding to operation instruction and terminal
WO2023101402A1 (en) Method for calculating production amount of production line, using artificial intelligence
CN112584471A (en) Energy-saving signal receiving method, energy-saving signal sending method, terminal and network equipment
WO2023027368A1 (en) Execution engine optimization method, execution engine optimization device, and execution engine optimization system
JP2021513281A (en) A device for determining the interception information of the search space and the interception method of the search space.
WO2012070900A2 (en) System for sharing event and data between personal devices
WO2020246724A1 (en) Electronic apparatus and method of performing operations thereof
KR102393767B1 (en) Method for, device for, and system for optimizing an inference engine
KR20100052157A (en) Black box apparatus for vehicle and method for monitoring vehicle state by the 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
WO2022010064A1 (en) Electronic device and method for controlling same
KR102581614B1 (en) Method for, device for, and system for optimizing an inference engine
WO2015137722A1 (en) Method and device for processing vliw instruction, and method and device for generating instruction for processing vliw instruction
WO2023282539A1 (en) Education content recommendation method, education content recommendation device, and education content recommendation system

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

Country of ref document: EP

Kind code of ref document: A1