WO2022265411A1 - 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템 - Google Patents

프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템 Download PDF

Info

Publication number
WO2022265411A1
WO2022265411A1 PCT/KR2022/008506 KR2022008506W WO2022265411A1 WO 2022265411 A1 WO2022265411 A1 WO 2022265411A1 KR 2022008506 W KR2022008506 W KR 2022008506W WO 2022265411 A1 WO2022265411 A1 WO 2022265411A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
optimization
data
subgraph
query
Prior art date
Application number
PCT/KR2022/008506
Other languages
English (en)
French (fr)
Inventor
이재진
박정호
조강원
김희훈
김진표
Original Assignee
주식회사 모레
서울대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 모레, 서울대학교산학협력단 filed Critical 주식회사 모레
Publication of WO2022265411A1 publication Critical patent/WO2022265411A1/ko
Priority to US18/542,544 priority Critical patent/US20240118878A1/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
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/042Knowledge-based neural networks; Logical representations of neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present disclosure relates to a method and system for determining the applicability of optimization to an intermediate expression of a program, and specifically, receives a subgraph of an intermediate expression as a query, determines whether the query is valid and whether optimization can be applied to the subgraph. It relates to a method and system for determining whether
  • a program may include data and instructions for performing operations on the data.
  • the simplest way to execute a program is to execute given instructions in sequence, but in this case, there are problems in that optimization techniques cannot be applied because it cannot be executed considering future operations.
  • an intermediate expression having the same meaning as a program can be constructed, and an optimization technique can be applied to the intermediate expression to transform it and then execute it.
  • an optimization technique can be applied to the intermediate expression to transform it and then execute it.
  • the present disclosure provides a method for determining the applicability of optimization to an intermediate expression of a program, a computer program stored in a recording medium, and an apparatus (system) to solve the above problems.
  • the present disclosure may be implemented in a variety of ways, including a method, apparatus (system) or computer program stored on a readable storage medium.
  • a method for determining the applicability of optimization to an intermediate expression of a program executed by at least one processor includes receiving, as a query, a subgraph of an intermediate expression to be determined for the applicability of optimization. Step, the step of determining the validity of the query and, if the query is valid, the step of determining the applicability of the optimization of the subgraph, the program includes data and a plurality of operations, the intermediate expression is a plurality of data nodes , a plurality of computation nodes, a plurality of data nodes, and a plurality of edges representing input/output relationships of the plurality of computation nodes.
  • the program includes a deep learning program
  • the data includes Tensor type data
  • optimizing the subgraph is further included.
  • the optimizing step includes fusing at least some nodes among a plurality of computation nodes included in an intermediate expression.
  • the method further includes generating an intermediate expression from a program and storing a correspondence between program data and data nodes of the intermediate expression in a database.
  • the step of storing a correspondence between program data and data nodes of an intermediate expression in a database includes storing pointer information indicating that program data and data nodes of an intermediate expression are stored in the database. It includes steps to
  • the step of determining the validity of the query may include, when the first data node is included in the subgraph, an operation node adjacent to the first data node and an operation node attached to the first data node ( incident) determining whether all edges satisfy the first query requirement included in the subgraph, the first computation node and the second computation node are included in the subgraph, and between the first computation node and the second computation node If a path exists, determining whether all nodes and all edges on the path satisfy the second query requirement included in the subgraph, and if both the first query requirement and the second query requirement are satisfied determining that the query is valid.
  • the step of determining the applicability of optimization of the subgraph if there is no data of a program corresponding to each of all data nodes included in the subgraph, it is determined that there is an applicability of optimization of the subgraph. It includes steps to
  • a computer-readable non-transitory storage medium in which instructions are recorded for executing a method for determining the applicability of optimization to an intermediate expression of a program according to an embodiment of the present disclosure in a computer.
  • the information processing system includes a memory and at least one processor connected to the memory and configured to execute at least one computer-readable program included in the memory, wherein the at least one program is an intermediate object of optimization applicability determination. and instructions for receiving a subgraph of the expression as a query, determining validity of the query, and determining applicability of optimization of the subgraph if the query is valid, wherein the intermediate expression includes a plurality of data nodes, a plurality of computation nodes, and It includes a plurality of edges representing input/output relationships between a plurality of data nodes and a plurality of computation nodes.
  • FIG. 1 is a diagram showing an example of a method for determining the applicability of optimization to an intermediate expression by an information processing system according to an embodiment of the present disclosure.
  • FIG. 2 is a block diagram showing the internal configuration of an information processing system according to an embodiment of the present disclosure.
  • FIG. 3 is a block diagram showing an internal configuration of a processor according to an embodiment of the present disclosure.
  • FIG. 4 is a flowchart illustrating an example of a method for determining the possibility of applying optimization to an intermediate expression of a program according to an embodiment of the present disclosure.
  • FIG. 5 is a flowchart illustrating an example of a method for determining validity of a query according to an embodiment of the present disclosure.
  • FIG. 6 is a flowchart illustrating an example of a method for determining optimization applicability according to an embodiment of the present disclosure.
  • FIG. 7 is a flowchart illustrating an example of a method for determining the possibility of applying optimization to an intermediate expression of a program according to an embodiment of the present disclosure.
  • FIG. 8 is a diagram illustrating an example of a method of generating an intermediate expression for a program according to an embodiment of the present disclosure.
  • FIG. 9 is a diagram illustrating an example of a method for determining validity of a query according to an embodiment of the present disclosure.
  • FIG. 10 is a diagram illustrating an example of a method for determining optimization applicability according to an embodiment of the present disclosure.
  • FIG. 11 is a diagram illustrating an example of a method of optimizing at least a part of an intermediate expression according to an embodiment of the present disclosure.
  • a modulee' or 'unit' used in the specification means a software or hardware component, and the 'module' or 'unit' performs certain roles.
  • 'module' or 'unit' is not meant to be limited to software or hardware.
  • a 'module' or 'unit' may be configured to reside in an addressable storage medium and may be configured to reproduce one or more processors.
  • a 'module' or 'unit' includes components such as software components, object-oriented software components, class components, and task components, processes, functions, and attributes. , procedures, subroutines, segments of program code, drivers, firmware, microcode, circuitry, data, databases, data structures, tables, arrays, or variables.
  • a 'module' or 'unit' may be implemented with a processor and a memory.
  • 'Processor' should be interpreted broadly to include general-purpose processors, central processing units (CPUs), microprocessors, digital signal processors (DSPs), controllers, microcontrollers, state machines, and the like.
  • 'processor' may refer to an application specific integrated circuit (ASIC), programmable logic device (PLD), field programmable gate array (FPGA), or the like.
  • ASIC application specific integrated circuit
  • PLD programmable logic device
  • FPGA field programmable gate array
  • 'Processor' refers to a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of a plurality of microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or a combination of any other such configurations. You may. Also, 'memory' should be interpreted broadly to include any electronic component capable of storing electronic information.
  • 'Memory' includes random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable-programmable read-only memory (EPROM), It may also refer to various types of processor-readable media, such as electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage, registers, and the like.
  • RAM random access memory
  • ROM read-only memory
  • NVRAM non-volatile random access memory
  • PROM programmable read-only memory
  • EPROM erasable-programmable read-only memory
  • a memory is said to be in electronic communication with the processor if the processor can read information from and/or write information to the memory.
  • Memory integrated with the processor is in electronic communication with the processor.
  • a 'system' may include at least one of a server device and a cloud device, but is not limited thereto.
  • a system may consist of one or more server devices.
  • a system may consist of one or more cloud devices.
  • the system may be operated by configuring a server device and a cloud device together.
  • 'each of a plurality of A' or 'each of a plurality of A' may refer to each of all components included in a plurality of A's, or each of some components included in a plurality of A's. .
  • an 'intermediate expression' may refer to a graph having the same meaning as a program and/or information related thereto, which is generated to efficiently execute a program.
  • an intermediate representation may include one or more nodes and one or more edges.
  • 'creating an intermediate expression' or 'adding a node or an edge to an intermediate expression' includes storing or updating information associated with the intermediate expression in a memory of an information processing system, or the like. can do.
  • 'storing to a database' may include storing specific information in a database or updating specific information stored in a database.
  • the information processing system 110 can extract information from the program 120 to create and/or update an intermediate expression 130 having the same meaning as the program 120, and the program 120 and the intermediate expression 130 Correspondence of may be stored and/or updated in the database 140.
  • the information processing system 110 may extract information about data and information about calculations from the program 120 .
  • the information processing system 110 generates a new variable or constant from the program 120, defines and changes a variable value or constant value, deletes the data type of the variable or constant, the size of the variable or constant, or deletes the variable or constant value.
  • Information about data, such as extinction can be extracted.
  • the information processing system 110 may extract information about the operation, such as the type of operation being performed, information on the input/output data of the operation, and parameters of the operation.
  • the program 120 may refer to any program consisting of data and calculations, and may include, for example, a deep learning program.
  • the data may be implemented in any data type capable of constituting a (deep learning) program, and may include, for example, Tensor type data.
  • the information processing system 110 may extract information about a data type, size of each dimension, and the like from tensor type data included in a deep learning program.
  • the information processing system 110 may generate and/or update the intermediate expression 130 for the program 120 using information extracted from the program 120 .
  • the intermediate expression 130 may be expressed in the form of a graph including nodes and edges.
  • data and operations extracted from the program 120 may be represented by nodes, and input/output relationships between data and operations may be represented by edges.
  • the information processing system 110 may store and/or update the correspondence between the program 120 and the intermediate expression 130 in the database 140 .
  • the information processing system 110 may extract tensor information and operation information from the deep learning program 120 .
  • the information processing system 110 may add a data node corresponding to the tensor to the intermediate expression 130, and the tensor and the tensor of the program 120 in the database 140.
  • Correspondence between data nodes of the intermediate expression 130 eg, pointer information indicating that a tensor of a program points to a data node of the intermediate expression
  • the intermediate expression 130 may be updated, and the corresponding relationship stored in the database 140 may be updated.
  • optimization is applied to the intermediate expression 130 and then executed, so that the execution result is It can reduce execution time or memory usage while maintaining
  • the intermediate expression 130 is executed using a GPU (Graphic Processing Unit)
  • performance may be improved by reducing memory access by fusing several operations into one operation.
  • optimization is not always possible, and optimization must be performed considering the subsequent operation of the program 120 .
  • the information processing system 110 may determine whether optimization is applicable to at least a part of the intermediate expression 130 prior to performing optimization.
  • the information processing system 110 may receive the subgraph of the intermediate expression 130 as a query and determine whether optimization is applicable to the received subgraph.
  • optimization may include fusing at least some of the computational nodes included in the intermediate representation 130 (computational fusion).
  • the information processing system 110 may determine validity of a query prior to determining whether optimization is applicable to a partial graph. For example, it may be determined whether a subgraph received as a query is a subgraph suitable for determining the possibility of optimization application. Then, the information processing system 110 may determine the applicability of optimization to the subgraph.
  • the information processing system 110 may include a memory 210, a processor 220, a communication module 230 and an input/output interface 240. As shown in FIG. 2 , the information processing system 110 may be configured to communicate information and/or data through a network using the communication module 230 .
  • Memory 210 may include any non-transitory computer readable recording medium.
  • the memory 210 is a non-perishable mass storage device (permanent mass storage device) such as random access memory (RAM), read only memory (ROM), disk drive, solid state drive (SSD), flash memory, and the like. mass storage device).
  • a non-perishable mass storage device such as ROM, SSD, flash memory, disk drive, etc. may be included in the information processing system 110 as a separate permanent storage device separate from memory.
  • the memory 210 includes an operating system and at least one program code (eg, generating and updating an intermediate expression installed and driven in the information processing system 110, determining the validity of a query, determining the applicability of optimization, applying optimization, etc. code) can be stored.
  • a recording medium readable by such a separate computer may include a recording medium directly connectable to the information processing system 110, for example, a floppy drive, a disk, a tape, a DVD/CD-ROM drive, a memory card, etc. It may include a computer-readable recording medium.
  • software components may be loaded into the memory 210 through the communication module 230 rather than a computer-readable recording medium.
  • At least one program is a computer program installed by files provided by developers or a file distribution system that distributes application installation files through the communication module 230 (eg, generation of intermediate expressions and It may be loaded into the memory 210 based on a program for update, query validity determination, optimization applicability determination, optimization application, and the like).
  • the processor 220 may be configured to process commands of a computer program by performing basic arithmetic, logic, and input/output operations. Commands may be provided to a user terminal (not shown) or other external system by the memory 210 or the communication module 230 .
  • the processor 220 may receive the subgraph of the intermediate expression as a query, determine the validity of the query by determining at least one condition, and determine the applicability of optimizing the subgraph if the query is valid.
  • the communication module 230 may provide a configuration or function for a user terminal (not shown) and the information processing system 110 to communicate with each other through a network, and the information processing system 110 may provide an external system (for example, a separate configuration or function to communicate with a cloud system, etc.).
  • control signals, commands, data, etc. provided under the control of the processor 220 of the information processing system 110 are transmitted through the communication module 230 and the network to the user terminal and/or the communication module of the external system. It may be transmitted to a terminal and/or an external system.
  • the user terminal and/or the external system may receive an optimization applicability determination result, a program execution result, and the like from the information processing system 110 .
  • the input/output interface 240 of the information processing system 110 is connected to the information processing system 110 or means for interface with a device (not shown) for input or output that the information processing system 110 may include.
  • a device not shown
  • the input/output interface 240 is shown as an element configured separately from the processor 220 , but is not limited thereto, and the input/output interface 240 may be included in the processor 220 .
  • the information processing system 110 may include more components than those of FIG. 2 . However, there is no need to clearly show most of the prior art components.
  • the processor 220 of the information processing system 110 may be configured to manage, process, and/or store information and/or data received from a plurality of user terminals and/or a plurality of external systems. According to an embodiment, the processor 220 may receive a partial graph of an intermediate expression as a query from a user terminal and/or an external system. In this case, the processor 220 may determine the validity of the query, and if the query is valid, determine the possibility of applying optimization to the subgraph.
  • FIG. 3 is a block diagram showing an internal configuration of a processor 220 according to an embodiment of the present disclosure.
  • the processor 220 may include an intermediate expression generation unit 310, an optimization applicability determination unit 320, and an intermediate expression conversion unit 330.
  • the internal configuration of the processor 220 shown in FIG. 3 is only an example, and may be implemented differently in some embodiments.
  • the processor 220 may further include components other than the illustrated components, and at least some of the illustrated components may be omitted.
  • the processor 220 is shown as a single processor in FIG. 3, it is not limited thereto and may be configured with a plurality of processors.
  • each part is shown separately in terms of functionality, but this does not necessarily mean that they are physically separated.
  • the intermediate expression generation unit 310 may extract information about data and information about calculations from a program. For example, the intermediate expression generation unit 310 generates a new variable or constant from the program, defines and changes a variable value or constant value, data type of the variable or constant, size of the variable or constant, deletes or disappears the variable or constant information can be extracted from the data. In addition, the intermediate expression generation unit 310 may extract information about the operation, such as the type of operation being performed, information on the input/output data of the operation, and parameters of the operation.
  • a program may refer to any program consisting of data and calculations, and may include, for example, a deep learning program, etc.
  • data may refer to any program that may constitute a deep learning program. It may be implemented as a data type, and may include, for example, tensor type data.
  • the intermediate expression generation unit 310 may extract information about data type, size of each dimension, etc. from tensor type data included in the deep learning program.
  • the intermediate expression generation unit 310 may generate an intermediate expression using the information extracted from the program, and store or update the generated intermediate expression.
  • the intermediate representation may be expressed in the form of a graph including nodes representing data and operations and edges representing input/output relationships between data and operations.
  • the intermediate expression may be stored in a memory of an information processing system, a database, or the like, but is not limited thereto.
  • the intermediate expression generating unit 310 may store and/or update a correspondence between programs and intermediate expressions in a database.
  • the process of storing or updating the correspondence between programs and intermediate expressions by the intermediate expression generating unit 310 may be performed concurrently, overlappingly, or sequentially with the intermediate expression generating, saving, or updating process.
  • the intermediate expression generation unit 310 may extract information for generating new tensors from a deep learning program, add a data node corresponding to the generated tensor to the intermediate expression, and add the tensor of the generated program.
  • Information that the data nodes of the intermediate expressions corresponding to each other can be stored in the database.
  • the correspondence between the program and the intermediate expression may be stored as pointer information indicating that the tensor of the program points to the data node of the intermediate expression.
  • the intermediate expression generating unit 310 extracts information in which the tensor is updated to a new tensor in the deep learning program, a new data node is added to the intermediate expression, and the tensor of the updated program and the data node of the added intermediate expression are Corresponding relationship can be modified. That is, the intermediate expression generating unit 310 may update the correspondence between the program and the intermediate expression.
  • the intermediate expression generating unit 310 may extract operation information from the program, add an operation node to the intermediate expression, and an edge directed from an input data node corresponding to the input data of the extracted operation to the operation node. and an edge directed from the computation node to the output data node corresponding to the output data of the computation.
  • the optimization applicability determination unit 320 may receive the subgraph of the intermediate expression as a query and determine validity of the query and optimization applicability. According to one embodiment, the optimization may include fusing at least some of the computational nodes included in the intermediate expression (computational fusion).
  • the optimization applicability determination unit 320 may determine the validity of a query prior to determining whether optimization can be applied to a subgraph. For example, the optimization applicability determining unit 320 may determine whether a subgraph received as a query is a subgraph suitable for determining optimization applicability.
  • the optimization applicability determination unit 320 determines the validity of the query by determining whether the following first query requirements and second query requirements are satisfied for the received subgraph in order to determine whether arithmetic convergence is possible. can do.
  • the first query requirement for computational convergence optimization is that, when a data node is included in a subgraph, both an operation node adjacent to the data node and an incident edge to the data node are included in the subgraph. that it should be That is, the condition that the edge node of the subgraph must be a computational node is the first query requirement for computational convergence optimization.
  • the second query requirement for computational convergence optimization is, when the first computational node and the second computational node are included in the subgraph and a path exists between the first computational node and the second computational node, All nodes and all edges must be included in the subgraph. That is, when there is a dependency between computational nodes, the second query requirement for computational fusion optimization is that only contiguous parts can be fused.
  • An example of how the optimization applicability determination unit 320 determines the validity of a query will be described later in detail with reference to FIGS. 5 and 9 .
  • the optimization applicability determination unit 320 may determine the applicability of optimization to the subgraph when it is determined that the query is valid. For example, the optimization applicability determination unit 320 may determine whether there is no hindrance to subsequent program execution even when optimization is applied to the subgraph. As a specific example, the optimization applicability determination unit 320 determines whether or not there is no program data corresponding to each of all data nodes included in the subgraph, and determines whether or not there is no program data corresponding to each of all data nodes included in the subgraph. If there is no data of , it can be determined that there is a possibility of applying the optimization. When optimization of arithmetic fusion is performed, an intermediate data node may be removed.
  • optimization applicability determining unit 320 determines the optimization applicability because it means that there is a possibility that the intermediate data node will be accessed later in the program.
  • An example of a method for the optimization applicability determining unit 320 to determine the optimization applicability will be described later in more detail with reference to FIGS. 6 and 10 .
  • the intermediate expression conversion unit 330 may receive information on whether optimization is applicable to the subgraph of the intermediate expression from the optimization applicability determination unit 320 and apply optimization to the corresponding subgraph. For example, the intermediate expression conversion unit 330 receives a determination that computational convergence can be optimized for a subgraph of the intermediate expression from the optimization applicability determination unit 320, and optimizes computational convergence for the corresponding subgraph. can be applied
  • the method 400 may be initiated when a processor (eg, a processor of an information processing system) receives, as a query, a partial graph of an intermediate expression, which is an object of optimization applicability determination (S410).
  • a processor eg, a processor of an information processing system
  • the optimization may include computation fusion of fusing at least some nodes among a plurality of computation nodes included in the intermediate expression.
  • an intermediate expression may refer to a graph that is generated to efficiently execute a program and has the same meaning as a program and/or information related thereto.
  • the program may include data and a plurality of operations.
  • the program may include a deep learning program, and the data may include tensor type data.
  • the intermediate expression may include a plurality of data nodes, a plurality of computation nodes, and a plurality of edges indicating an input/output relationship between the plurality of data nodes and the plurality of computation nodes.
  • the processor may determine the validity of the query (S420). For example, the processor may determine that the query is valid when both the first query requirement and the second query requirement below are satisfied.
  • the first query requirement is that when the first data node is included in the subgraph, both the operation node adjacent to the first data node and the edge attached to the first data node must be included in the subgraph.
  • the second query requirement is that when the first operation node and the second operation node are included in the subgraph and a path exists between the first operation node and the second operation node, all nodes and all edges on the path are included in the subgraph. that should be included.
  • the processor when the processor satisfies both the first query requirement that the edge node of the subgraph must be a computation node and the second query requirement that only continuous parts can be optimized if there is a dependency between computation nodes. can determine that the query is valid.
  • An example of how the processor determines the validity of the query will be described in more detail below with reference to FIGS. 5 and 9 .
  • the processor may determine whether optimization of the subgraph is applicable (S430). For example, when there is no program data corresponding to each of all data nodes included in the subgraph, the processor may determine that optimization of the subgraph is applicable. That is, when there is no possibility of accessing all data nodes in the subgraph later in the program, it may be determined that there is a possibility of applying the optimization of the subgraph.
  • An example of how the processor determines the applicability of the optimization is described below in more detail with reference to FIGS. 6 and 10 .
  • the processor determines whether the first query requirement and the second query requirement are satisfied, and determines that the query is valid only when both the first query requirement and the second query requirement are satisfied.
  • the first query requirement is that, when a specific data node is included in a subgraph, both an operation node adjacent to the corresponding data node and an edge attached to the corresponding data node must be included in the subgraph.
  • the second query requirement is that if a specific pair of computational nodes is included in a subgraph and a path exists between the pair of corresponding computational nodes, all nodes and all edges of the path must be included in the subgraph.
  • the processor performs a query only when both the first query requirement that the edge node of the subgraph must be a computation node and the second query requirement that only continuous parts can be optimized if there is a dependency between computation nodes are satisfied. can be determined to be valid.
  • the processor may first select a data node in the partial graph in which the first query requirement is not determined in order to determine whether the first query requirement is satisfied (S510). Then, it may be determined whether all operation nodes adjacent to the selected data node are included in the subgraph (S512). If there is even one operation node that is not included in the subgraph among the operation nodes adjacent to the selected data node, the processor may determine that the query is invalid (S520), and may terminate the query validity determination.
  • the processor may determine whether all edges attached to the selected data node are included in the subgraph (S514). If there is even one edge that is not included in the subgraph among the edges attached to the selected data node, the processor determines that the query is invalid (S520), and may end the query validity determination.
  • the processor may complete determining the first query requirement for the selected data node and determine whether there is a data node in the subgraph for which the first query requirement has not been determined ( S516). If there is a data node in the subgraph for which the first query requirement has not been determined, the first query requirement for the new data node may be determined by returning to step S510. In this way, it is possible to determine whether all data nodes in the subgraph satisfy the first query requirement, and if all data nodes in the subgraph satisfy the first query requirement, the processor determines the second query requirement. can do.
  • the processor may select a pair of operation nodes in the partial graph for which the second query requirement has not been determined (S530). Then, the processor may determine whether a path exists between the two selected computation nodes (S532), and if the path exists, it may determine whether all nodes and edges on the path are included in the subgraph (S534). . If there is even one node or edge on the path that is not included in the subgraph, the processor determines that the query is invalid (S520), and may terminate the query validity determination.
  • step S532 If the path between the two operation nodes does not exist in step S532 or if all nodes and edges on the path are included in the subgraph in step S534, the processor finishes determining the second query requirement for the selected pair of operation nodes, and in the subgraph It may be determined whether there is a pair of operation nodes for which the second query requirement has not been determined (S536). If there is an operation node pair in which the second query requirement has not been determined in the subgraph, the second query requirement may be determined for the new operation node pair by returning to step S530.
  • the processor determines whether the query is valid. By determining that the method (S420) may end (S540).
  • the processor may determine the possibility of applying optimization to the subgraph. For example, when there is no program data corresponding to each of all data nodes included in the partial graph, the processor may determine that optimization is applicable. That is, when there is no possibility of accessing all data nodes in the subgraph later in the program, it may be determined that there is a possibility of applying the optimization of the subgraph.
  • optimization of arithmetic fusion is performed, an intermediate data node may be removed, because if a program has a possibility of accessing an intermediate data node later, application of the optimization may interfere with the execution of the program.
  • the processor may first select a data node in the subgraph for which the optimization applicability is not determined in order to determine the optimization applicability (S610). Then, it may be determined whether data of a program corresponding to the selected data node exists (S620). If data of a program corresponding to the selected data node exists, the processor may determine that optimization is not applicable (S650), and may end the determination of optimization applicability.
  • the processor may determine whether there exists a data node in the partial graph for which optimization applicability has not been determined (S630). If there is a data node in the subgraph whose optimization applicability has not been determined, it is possible to return to step S610 and determine the optimization applicability of the new data node. In this way, it is possible to determine all data nodes in the subgraph, and if there is no program data corresponding to all data nodes in the subgraph, the processor determines that optimization for the subgraph can be applied. (S430) may end (S640).
  • a processor eg, a processor of an information processing system
  • a processor generates an intermediate expression from a program (S710), and stores a correspondence between data nodes of the program and data nodes of the intermediate expression in a database (S710). It can be stored (S720).
  • the intermediate expression may refer to a graph generated to efficiently execute a program and having the same meaning as a program and/or information related thereto.
  • the intermediate expression may include a plurality of data nodes, a plurality of computation nodes, and a plurality of edges representing input/output relationships between the plurality of data nodes and the plurality of computation nodes.
  • a processor extracts information about tensors and information about operations from a deep learning program, and when a new tensor is created in the program, the processor corresponds to the tensor.
  • Data nodes can be added to intermediate expressions.
  • a correspondence relationship between tensors of a program and data nodes of an intermediate expression (for example, pointer information indicating that a tensor of a program points to a data node of an intermediate expression) may be stored in the database.
  • the processor may update the intermediate expression and update the correspondence stored in the database.
  • the processor can add an operation node to the intermediate expression and an edge representing the input/output relationship between the tensor and the operation. there is.
  • the processor may determine the optimization applicability of the subgraph of the intermediate expression, which is the subject of optimization applicability determination (S730).
  • the detailed process of step S730 may be performed the same as or similar to the method 400 of FIG. 4 .
  • the processor may optimize the subgraph (S740). For example, the processor may optimize the subgraph by fusing at least some nodes among a plurality of operation nodes included in the intermediate expression. In this way, when several operations are fused into one operation and executed, memory access may be reduced and execution performance of the program may be improved.
  • FIGS. 4 to 7 The flow charts shown in FIGS. 4 to 7 and the above description are only examples, and may be implemented in various ways without being limited thereto. For example, one or more steps may be omitted, the order of each step may be changed, and at least some steps may be repeatedly performed or overlapped.
  • the information processing system may extract information about data and information about calculations from the program 800, generate an intermediate expression using the extracted information, and generate an intermediate expression between the program 800 and the intermediate expression.
  • Correspondence of expressions can be stored in a database.
  • an intermediate expression of the program 800 may be generated through the first to third states 810, 820, and 830, and a correspondence between the program and the intermediate expression may be stored in a database.
  • the first state 810 represents an example of a state in which the information processing system generates an intermediate expression up to the third line of the program 800 and stores a corresponding relationship.
  • the information processing system may extract information about tensor A, tensor B, and tensor C newly created from the program 800, and add data node A, data node B, and data node C corresponding to the information to the intermediate expression, Correspondence between the tensors of the program 800 and the data nodes of the intermediate expression may be stored in the database.
  • the second state 820 is an example of a state in which the information processing system generates intermediate expressions up to the fifth line of the program 800 after the first state 810 and stores the correspondence between the program 800 and the intermediate expressions. indicates The information processing system extracts information on the operation '+' from the fourth line of the program 800, the operation node '+', the data node D corresponding to the output data (tensor D) of the operation, and the input and output of the operation '+'. Three edges representing relationships can be added to the intermediate expression, and information that the tensor D of the program 900 corresponds to the data node D of the intermediate expression can be stored in the database.
  • the information processing system extracts information on the operation '*' from the fifth line of the program 800, the operation node '*', the data node E corresponding to the output data (tensor E) of the operation, and the operation '*' Three edges representing the input/output relationship of can be added to the intermediate expression, and information that the tensor E of the program 800 and the data node E of the intermediate expression correspond can be stored in the database.
  • the third state 830 represents an example of a state in which an intermediate expression from the second state 820 up to the sixth line of the program 900 is generated, and the corresponding relationship between the program 800 and the intermediate expression is updated accordingly.
  • the information processing system may extract information on updating the tensor D as a new tensor in line 6 of the program 800 and add a data node D' corresponding to the updated tensor D to the intermediate expression.
  • the information processing system may update the correspondence stored in the database so that the tensor D of the program 800 corresponds to the data node D' of the intermediate expression.
  • the information processing system may receive, as a query, the subgraphs 910, 920, and 930 of the intermediate expression, which are targets of optimization applicability determination, and determine validity of the query.
  • the processor may determine whether the first query requirement and the second query requirement are satisfied, and determine that the query is valid only when both the first query requirement and the second query requirement are satisfied.
  • the first query requirement is that when a specific data node is included in the subgraphs 910, 920, and 930, both the operation node adjacent to the corresponding data node and the edge attached to the corresponding data node are included in the subgraphs 910, 920, and 930. that it should be
  • the second query requirement is that if a specific pair of computational nodes is included in a subgraph and a path exists between the pair of corresponding computational nodes, all nodes and all edges on the path must be included in the subgraphs 910, 920, and 930. .
  • the processor satisfies the first query requirement that the edge nodes of the subgraphs 910, 920, and 930 be computation nodes, and the second query requirement that only contiguous parts can be optimized if there is a dependency between computation nodes.
  • a query can be determined to be valid only if all of them are satisfied.
  • FIG. 9 shows examples of subgraphs 910, 920, and 930 received as queries by the information processing system.
  • the data node D is included in the subgraph, but the operation node '+' adjacent to the data node D is not included in the subgraph. That is, since the edge node does not end with an operation node, the first subgraph 910 does not satisfy the first query requirement.
  • both the operation node '+' and the operation node '*' are included in the subgraph, but the data node D on the path between the two operation nodes is not included in the subgraph. That is, the subgraph is not continuous even though it includes two operation nodes having dependencies, so the second subgraph 920 does not satisfy the second query requirement.
  • the operation node adjacent to the data node D included in the subgraph and the edge attached to the data node D are all included in the subgraph to satisfy the first query requirement, and the All nodes and edges on the path between the two computational nodes are included in the subgraph, so the second query requirement is also satisfied. That is, the information processing system may determine that the query including the third partial graph 930 is valid.
  • the information processing system may determine that optimization is applicable when there is no program data corresponding to each of all data nodes included in the partial graphs 1010 and 1020 . That is, when there is no possibility of accessing all data nodes in the subgraphs 1010 and 1020 later in the program, it may be determined that there is a possibility of applying the optimization of the subgraphs 1010 and 1020 .
  • optimization of arithmetic fusion is performed, an intermediate data node may be removed, because if a program has a possibility of accessing an intermediate data node later, application of the optimization may interfere with the execution of the program.
  • FIG. 10 shows an example of a database in which correspondence relationships with partial graphs 1010 and 1020 received as queries by the information processing system are stored. Looking at the first subgraph 1010, data D of a program corresponding to a data node D included in the subgraph exists. Therefore, since the possibility that the program accesses the data node D in the future cannot be ruled out, the information processing system may determine that the application of optimization to the first partial graph 1010 is impossible.
  • the information processing system can determine that the application of optimization to the second partial graph 1020 is possible.
  • the information processing system may optimize the subgraph.
  • the information processing system may optimize the subgraph by fusing at least some nodes among a plurality of operation nodes included in the intermediate expression.
  • the information processing system obtains an intermediate expression by fusing the operation node '+' and the operation node '*' included in the subgraph 1110 into one operation node 'FMA (Fused Multiply-Add)' as shown in the figure.
  • FMA Feused Multiply-Add
  • the optimized intermediate expression 1120 is executed using a GPU, performance may be improved by reducing memory access by fusing several operations into one operation.
  • the above method may be provided as a computer program stored in a computer readable recording medium to be executed on a computer.
  • the medium may continuously store programs executable by a computer or temporarily store them for execution or download.
  • the medium may be various recording means or storage means in the form of a single or combined hardware, but is not limited to a medium directly connected to a certain computer system, and may be distributed on a network. Examples of the medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as CD-ROM and DVD, magneto-optical media such as floptical disks, and ROM, RAM, flash memory, etc. configured to store program instructions.
  • examples of other media include recording media or storage media managed by an app store that distributes applications, a site that supplies or distributes various other software, and a server.
  • the processing units used to perform the techniques may include one or more ASICs, DSPs, digital signal processing devices (DSPDs), programmable logic devices (PLDs) ), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, electronic devices, and other electronic units designed to perform the functions described in this disclosure. , a computer, or a combination thereof.
  • a general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
  • a processor may also be implemented as a combination of computing devices, eg, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other configuration.
  • the techniques include random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), PROM (on a computer readable medium, such as programmable read-only memory (EPROM), erasable programmable read-only memory (EPROM), electrically erasable PROM (EEPROM), flash memory, compact disc (CD), magnetic or optical data storage device, or the like. It can also be implemented as stored instructions. Instructions may be executable by one or more processors and may cause the processor(s) to perform certain aspects of the functionality described in this disclosure.

Abstract

본 개시는, 적어도 하나의 프로세서에 의해 수행되는 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법에 관한 것이다. 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법은, 최적화 적용 가능성 판단의 대상이 되는 중간표현의 부분 그래프를 질의로서 수신하는 단계, 질의의 유효성을 판단하는 단계 및 질의가 유효한 경우, 부분 그래프의 최적화 적용 가능성을 판단하는 단계를 포함하고, 프로그램은 데이터 및 복수의 연산을 포함하고, 중간표현은 복수의 데이터 노드(nodes), 복수의 연산 노드 및 복수의 데이터 노드와 복수의 연산 노드의 입출력 관계를 나타내는 복수의 엣지(edges)를 포함한다.

Description

프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템
본 개시는 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템에 관한 것으로, 구체적으로, 중간표현의 부분 그래프를 질의로서 수신하고, 질의가 유효한지 여부 및 부분 그래프에 대해 최적화 적용이 가능한지 여부를 판단하는 방법 및 시스템에 관한 것이다.
프로그램은 데이터와 데이터에 대해 연산을 실행하는 명령을 포함할 수 있다. 프로그램을 실행하는 가장 간단한 방법은 주어진 명령을 순서대로 실행하는 것이지만, 이 경우, 미래에 주어질 연산을 고려하여 실행할 수 없으므로 최적화 기법을 적용할 수 없는 등의 문제점이 있다.
이러한 문제점을 해결하기 위해, 주어진 명령을 순서대로 실행하는 대신에, 프로그램과 동일한 의미를 갖는 중간표현을 구성할 수 있으며, 중간표현에 최적화 기법을 적용하여 변형한 뒤 이를 실행할 수 있다. 중간표현을 최적화하여 실행하는 경우, 프로그램의 실행 결과는 유지하면서도 실행 시간, 메모리 사용량 등의 리소스를 절약할 수 있다는 장점이 있으나, 프로그램의 동작을 고려하지 않고 최적화를 하는 경우, 이후 프로그램의 실행에 차질이 생길 수 있다는 문제점이 있다.
본 개시는 상기와 같은 문제점을 해결하기 위한 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법, 기록매체에 저장된 컴퓨터 프로그램 및 장치(시스템)를 제공한다.
본 개시는 방법, 장치(시스템) 또는 판독 가능 저장 매체에 저장된 컴퓨터 프로그램을 포함한 다양한 방식으로 구현될 수 있다.
본 개시의 일 실시예에 따르면, 적어도 하나의 프로세서에 의해 수행되는 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법은, 최적화 적용 가능성 판단의 대상이 되는 중간표현의 부분 그래프를 질의로서 수신하는 단계, 질의의 유효성을 판단하는 단계 및 질의가 유효한 경우, 부분 그래프의 최적화 적용 가능성을 판단하는 단계를 포함하고, 프로그램은 데이터 및 복수의 연산을 포함하고, 중간표현은 복수의 데이터 노드(nodes), 복수의 연산 노드 및 복수의 데이터 노드와 복수의 연산 노드의 입출력 관계를 나타내는 복수의 엣지(edges)를 포함한다.
본 개시의 일 실시예에 따르면, 프로그램은 딥 러닝 프로그램을 포함하고, 데이터는 텐서(Tensor) 타입의 데이터를 포함한다.
본 개시의 일 실시예에 따르면, 부분 그래프의 최적화 적용이 가능한 경우, 부분 그래프를 최적화하는 단계를 더 포함한다.
본 개시의 일 실시예에 따르면, 최적화하는 단계는, 중간표현에 포함된 복수의 연산 노드 중 적어도 일부 노드들을 융합하는 단계를 포함한다.
본 개시의 일 실시예에 따르면, 프로그램으로부터 중간표현을 생성하는 단계 및 데이터베이스에 프로그램의 데이터와 중간표현의 데이터 노드의 대응관계를 저장하는 단계를 더 포함한다.
본 개시의 일 실시예에 따르면, 데이터베이스에 프로그램의 데이터와 중간표현의 데이터 노드의 대응관계를 저장하는 단계는, 프로그램의 데이터 및 프로그램의 데이터가 중간표현의 데이터 노드를 가리키는 포인터 정보를 데이터베이스에 저장하는 단계를 포함한다.
본 개시의 일 실시예에 따르면, 질의의 유효성을 판단하는 단계는, 제1 데이터 노드가 부분 그래프에 포함되는 경우, 제1 데이터 노드에 인접한(adjacent) 연산 노드 및 제1 데이터 노드에 부속한(incident) 엣지가 모두 부분 그래프에 포함되는 제1 질의 요건을 만족시키는지 여부를 판정하는 단계, 제1 연산 노드 및 제2 연산 노드가 부분 그래프에 포함되고 제1 연산 노드와 제2 연산 노드 사이에 경로(path)가 존재하는 경우, 경로 상의 모든 노드와 모든 엣지가 부분 그래프에 포함되는 제2 질의 요건을 만족시키는지 여부를 판정하는 단계 및 제1 질의 요건 및 제2 질의 요건이 모두 만족되는 경우 질의가 유효하다고 결정하는 단계를 포함한다.
본 개시의 일 실시예에 따르면, 부분 그래프의 최적화 적용 가능성을 판단하는 단계는, 부분 그래프에 포함된 모든 데이터 노드의 각각에 대응되는 프로그램의 데이터가 없는 경우, 부분 그래프의 최적화 적용 가능성이 있다고 판정하는 단계를 포함한다.
본 개시의 일 실시예에 따른 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법을 컴퓨터에서 실행하기 위한 명령어들을 기록한 컴퓨터 판독 가능한 비일시적 기록 매체가 제공된다.
정보 처리 시스템은, 메모리 및 메모리와 연결되고, 메모리에 포함된 컴퓨터 판독 가능한 적어도 하나의 프로그램을 실행하도록 구성된 적어도 하나의 프로세서를 포함하고, 적어도 하나의 프로그램은, 최적화 적용 가능성 판단의 대상이 되는 중간표현의 부분 그래프를 질의로서 수신하고, 질의의 유효성을 판단하고, 질의가 유효한 경우, 부분 그래프의 최적화 적용 가능성을 판단하기 위한 명령어들을 포함하고, 중간표현은 복수의 데이터 노드, 복수의 연산 노드 및 복수의 데이터 노드와 복수의 연산 노드의 입출력 관계를 나타내는 복수의 엣지를 포함한다.
본 개시의 일부 실시예에 따르면, 중간표현을 변환 또는 최적화하기 전에 최적화 가능 여부를 판단함으로써, 부적절한 최적화로 인해 프로그램의 실행 성능이 저하되는 것을 방지할 수 있다.
본 개시의 일부 실시예에 따르면, 중간표현에 대해 최적화를 적용한 뒤 이를 실행함으로써, 실행 결과는 유지하면서 실행 시간이나 메모리 사용량을 감소시킬 수 있다.
본 개시의 효과는 이상에서 언급한 효과로 제한되지 않으며, 언급되지 않은 다른 효과들은 청구범위의 기재로부터 본 개시가 속하는 기술분야에서 통상의 지식을 가진 자(“통상의 기술자”라 함)에게 명확하게 이해될 수 있을 것이다.
본 개시의 실시예들은, 이하 설명하는 첨부 도면들을 참조하여 설명될 것이며, 여기서 유사한 참조 번호는 유사한 요소들을 나타내지만, 이에 한정되지는 않는다.
도 1은 본 개시의 일 실시예에 따른 정보 처리 시스템이 중간표현에 대한 최적화 적용 가능성을 판단하는 방법의 예시를 나타내는 도면이다.
도 2는 본 개시의 일 실시예에 따른 정보 처리 시스템의 내부 구성을 나타내는 블록도이다.
도 3은 본 개시의 일 실시예에 따른 프로세서의 내부 구성을 나타내는 블록도이다.
도 4는 본 개시의 일 실시예에 따른 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법의 예시를 나타내는 흐름도이다.
도 5는 본 개시의 일 실시예에 따른 질의의 유효성을 판단하는 방법의 예시를 나타내는 흐름도이다.
도 6은 본 개시의 일 실시예에 따른 최적화 적용 가능성을 판단하는 방법의 예시를 나타내는 흐름도이다.
도 7은 본 개시의 일 실시예에 따른 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법의 예시를 나타내는 흐름도이다.
도 8은 본 개시의 일 실시예에 따른 프로그램에 대한 중간표현을 생성하는 방법의 예시를 나타내는 도면이다.
도 9는 본 개시의 일 실시예에 따른 질의의 유효성을 판단하는 방법의 예시를 나타내는 도면이다.
도 10은 본 개시의 일 실시예에 따른 최적화 적용 가능성을 판단하는 방법의 예시를 나타내는 도면이다.
도 11은 본 개시의 일 실시예에 따라 중간표현의 적어도 일부를 최적화하는 방법의 예시를 나타내는 도면이다.
이하, 본 개시의 실시를 위한 구체적인 내용을 첨부된 도면을 참조하여 상세히 설명한다. 다만, 이하의 설명에서는 본 개시의 요지를 불필요하게 흐릴 우려가 있는 경우, 널리 알려진 기능이나 구성에 관한 구체적 설명은 생략하기로 한다.
첨부된 도면에서, 동일하거나 대응하는 구성요소에는 동일한 참조부호가 부여되어 있다. 또한, 이하의 실시예들의 설명에 있어서, 동일하거나 대응되는 구성요소를 중복하여 기술하는 것이 생략될 수 있다. 그러나, 구성요소에 관한 기술이 생략되어도, 그러한 구성요소가 어떤 실시예에 포함되지 않는 것으로 의도되지는 않는다.
개시된 실시예의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나, 본 개시는 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 개시가 완전하도록 하고, 본 개시가 통상의 기술자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것일 뿐이다.
본 명세서에서 사용되는 용어에 대해 간략히 설명하고, 개시된 실시예에 대해 구체적으로 설명하기로 한다. 본 명세서에서 사용되는 용어는 본 개시에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어들을 선택하였으나, 이는 관련 분야에 종사하는 기술자의 의도 또는 판례, 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한, 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 상세히 그 의미를 기재할 것이다. 따라서, 본 개시에서 사용되는 용어는 단순한 용어의 명칭이 아닌, 그 용어가 가지는 의미와 본 개시의 전반에 걸친 내용을 토대로 정의되어야 한다.
본 명세서에서의 단수의 표현은 문맥상 명백하게 단수인 것으로 특정하지 않는 한, 복수의 표현을 포함한다. 또한, 복수의 표현은 문맥상 명백하게 복수인 것으로 특정하지 않는 한, 단수의 표현을 포함한다. 명세서 전체에서 어떤 부분이 어떤 구성요소를 포함한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있음을 의미한다.
또한, 명세서에서 사용되는 '모듈' 또는 '부'라는 용어는 소프트웨어 또는 하드웨어 구성요소를 의미하며, '모듈' 또는 '부'는 어떤 역할들을 수행한다. 그렇지만, '모듈' 또는 '부'는 소프트웨어 또는 하드웨어에 한정되는 의미는 아니다. '모듈' 또는 '부'는 어드레싱할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 재생시키도록 구성될 수도 있다. 따라서, 일 예로서, '모듈' 또는 '부'는 소프트웨어 구성요소들, 객체지향 소프트웨어 구성요소들, 클래스 구성요소들 및 태스크 구성요소들과 같은 구성요소들과, 프로세스들, 함수들, 속성들, 프로시저들, 서브루틴들, 프로그램 코드의 세그먼트들, 드라이버들, 펌웨어, 마이크로 코드, 회로, 데이터, 데이터베이스, 데이터 구조들, 테이블들, 어레이들 또는 변수들 중 적어도 하나를 포함할 수 있다. 구성요소들과 '모듈' 또는 '부'들은 안에서 제공되는 기능은 더 작은 수의 구성요소들 및 '모듈' 또는 '부'들로 결합되거나 추가적인 구성요소들과 '모듈' 또는 '부'들로 더 분리될 수 있다.
본 개시의 일 실시예에 따르면, '모듈' 또는 '부'는 프로세서 및 메모리로 구현될 수 있다. '프로세서'는 범용 프로세서, 중앙 처리 장치(CPU), 마이크로프로세서, 디지털 신호 프로세서(DSP), 제어기, 마이크로제어기, 상태 머신 등을 포함하도록 넓게 해석되어야 한다. 몇몇 환경에서, '프로세서'는 주문형 반도체(ASIC), 프로그램가능 로직 디바이스(PLD), 필드 프로그램가능 게이트 어레이(FPGA) 등을 지칭할 수도 있다. '프로세서'는, 예를 들어, DSP와 마이크로프로세서의 조합, 복수의 마이크로프로세서들의 조합, DSP 코어와 결합한 하나 이상의 마이크로프로세서들의 조합, 또는 임의의 다른 그러한 구성들의 조합과 같은 처리 디바이스들의 조합을 지칭할 수도 있다. 또한, '메모리'는 전자 정보를 저장 가능한 임의의 전자 컴포넌트를 포함하도록 넓게 해석되어야 한다. '메모리'는 임의 액세스 메모리(RAM), 판독-전용 메모리(ROM), 비-휘발성 임의 액세스 메모리(NVRAM), 프로그램가능 판독-전용 메모리(PROM), 소거-프로그램가능 판독 전용 메모리(EPROM), 전기적으로 소거가능 PROM(EEPROM), 플래쉬 메모리, 자기 또는 광학 데이터 저장장치, 레지스터들 등과 같은 프로세서-판독가능 매체의 다양한 유형들을 지칭할 수도 있다. 프로세서가 메모리로부터 정보를 판독하고/하거나 메모리에 정보를 기록할 수 있다면 메모리는 프로세서와 전자 통신 상태에 있다고 불린다. 프로세서에 집적된 메모리는 프로세서와 전자 통신 상태에 있다.
본 개시에서, '시스템'은 서버 장치와 클라우드 장치 중 적어도 하나의 장치를 포함할 수 있으나, 이에 한정되는 것은 아니다. 예를 들어, 시스템은 하나 이상의 서버 장치로 구성될 수 있다. 다른 예로서, 시스템은 하나 이상의 클라우드 장치로 구성될 수 있다. 또 다른 예로서, 시스템은 서버 장치와 클라우드 장치가 함께 구성되어 동작될 수 있다.
본 개시에서, '복수의 A의 각각' 또는 '복수의 A 각각'은 복수의 A에 포함된 모든 구성 요소의 각각을 지칭하거나, 복수의 A에 포함된 일부 구성 요소의 각각을 지칭할 수 있다.
본 개시에서, '중간표현'은 프로그램을 효율적으로 실행하기 위해 생성되는, 프로그램과 동일한 의미를 가지는 그래프 및/또는 이와 연관된 정보를 지칭할 수 있다. 일 실시예에서, 중간표현은 하나 이상의 노드 및 하나 이상의 엣지를 포함할 수 있다.
본 개시의 일부 실시예에서, '중간표현을 생성하는 것' 또는 '중간표현에 노드 또는 엣지를 추가하는 것'은 정보 처리 시스템의 메모리 등에 중간표현과 연관된 정보를 저장하는 것 또는 갱신하는 것을 포함할 수 있다.
본 개시의 일부 실시예에서, '데이터베이스에 저장하는 것'은 데이터베이스에 특정 정보를 저장하거나 데이터베이스에 저장된 특정 정보를 갱신하는 것을 포함할 수 있다.
도 1은 본 개시의 일 실시예에 따른 정보 처리 시스템(110)이 중간표현(130)에 대한 최적화 적용 가능성을 판단하는 방법의 예시를 나타내는 도면이다. 정보 처리 시스템(110)은 프로그램(120)으로부터 정보를 추출하여 프로그램(120)과 동일한 의미를 갖는 중간표현(130)을 생성 및/또는 갱신할 수 있고, 프로그램(120)과 중간표현(130)의 대응관계를 데이터베이스(140)에 저장 및/또는 갱신할 수 있다. 예를 들어, 정보 처리 시스템(110)은 프로그램(120)으로부터 데이터에 대한 정보 및 연산에 대한 정보를 추출할 수 있다. 구체적 예로, 정보 처리 시스템(110)은 프로그램(120)으로부터 새로운 변수 또는 상수의 생성, 변수 값 또는 상수 값의 정의 및 변경, 변수 또는 상수의 자료형, 변수 또는 상수의 크기, 변수 또는 상수의 삭제 또는 소멸 등 데이터에 대한 정보를 추출할 수 있다. 또한, 정보 처리 시스템(110)은 수행되는 연산의 종류, 연산의 입출력 데이터에 대한 정보, 연산의 파라미터 등 연산에 대한 정보를 추출할 수 있다.
일 실시예에 따르면, 프로그램(120)은 데이터와 연산으로 이루어진 임의의 프로그램을 지칭할 수 있는데, 예를 들어, 딥 러닝 프로그램 등을 포함할 수 있다. 또한, 데이터는 (딥 러닝)프로그램을 구성할 수 있는 임의의 데이터 타입으로 구현될 수 있는데, 예를 들어, 텐서(Tensor) 타입의 데이터 등을 포함할 수 있다. 정보 처리 시스템(110)은 딥 러닝 프로그램에 포함된 텐서 타입의 데이터로부터 자료형, 각 차원의 크기 등에 대한 정보를 추출할 수 있다.
일 실시예에 따르면, 정보 처리 시스템(110)은 프로그램(120)으로부터 추출한 정보를 이용하여 프로그램(120)에 대한 중간표현(130)을 생성 및/또는 갱신할 수 있다. 여기서, 중간표현(130)은 노드(nodes)와 엣지(edges)를 포함하는 그래프의 형태로 표현될 수 있다. 예를 들어, 프로그램(120)으로부터 추출된 데이터 및 연산은 노드로 표현될 수 있으며, 데이터와 연산의 입출력 관계는 엣지로 표현될 수 있다. 또한, 정보 처리 시스템(110)은 프로그램(120)과 중간표현(130)의 대응관계를 데이터베이스(140)에 저장 및/또는 갱신할 수 있다.
예를 들어, 정보 처리 시스템(110)은 딥 러닝 프로그램(120)으로부터 텐서에 대한 정보 및 연산에 대한 정보를 추출할 수 있다. 프로그램(120)에서 새로운 텐서가 생성되는 경우, 정보 처리 시스템(110)은 해당 텐서에 대응하는 데이터 노드를 중간표현(130)에 추가할 수 있으며, 데이터베이스(140)에 프로그램(120)의 텐서와 중간표현(130)의 데이터 노드의 대응관계(예: 프로그램의 텐서가 중간표현의 데이터 노드를 가리키는 포인터 정보)를 저장할 수 있다. 또한, 프로그램(120)에서 텐서가 새로운 텐서로 갱신되는 경우, 중간표현(130)을 갱신할 수 있으며, 데이터베이스(140)에 저장된 대응관계를 갱신할 수 있다. 프로그램(120)에서 연산에 대한 정보(연산의 종류, 입·출력 텐서에 대한 정보 등)를 추출한 경우, 중간표현(130)에 연산 노드를 추가하고, 텐서와 연산의 입출력 관계를 나타내는 엣지를 추가할 수 있다.
상술한 바와 같이 프로그램(120)에 대한 중간표현(130)을 구성하는 경우, 프로그램(120)의 명령을 순서대로 실행하는 대신 중간표현(130)에 대해 최적화를 적용한 뒤 이를 실행함으로써, 실행 결과는 유지하면서 실행 시간이나 메모리 사용량을 감소시킬 수 있다. 예를 들어, GPU(Graphic Processing Unit)를 이용하여 중간표현(130)을 실행하는 경우, 여러 개의 연산을 하나의 연산으로 융합하여 실행함으로써 메모리 접근이 줄어 성능이 향상될 수 있다. 다만, 이러한 최적화가 항상 가능한 것은 아니며, 이후 프로그램(120)의 동작까지 고려하여 최적화를 수행해야 한다. 이에 따라 정보 처리 시스템(110)은 최적화 수행에 앞서, 중간표현(130)의 적어도 일부에 대해 최적화 적용이 가능한지 여부를 판단할 수 있다.
일 실시예에 따르면, 정보 처리 시스템(110)은 중간표현(130)의 부분 그래프를 질의로서 수신하고, 수신된 부분 그래프에 대해 최적화 적용이 가능한지 여부를 판단할 수 있다. 일 실시예에서, 최적화는 중간표현(130)에 포함된 연산 노드 중 적어도 일부를 융합하는 것(연산 융합)을 포함할 수 있다.
일 실시예에 따르면, 정보 처리 시스템(110)은 부분 그래프에 대해 최적화 적용이 가능한지 여부를 판단하기에 앞서, 질의의 유효성을 판단할 수 있다. 예를 들어, 질의로서 수신된 부분 그래프가 최적화 적용 가능성을 판단하기에 적절한 부분 그래프인지 여부를 판단할 수 있다. 그런 다음, 정보 처리 시스템(110)은 부분 그래프에 대해 최적화 적용 가능성을 판단할 수 있다.
이와 같이, 중간표현(130)을 변환 또는 최적화하기 전에 최적화 가능 여부를 판단함으로써, 부적절한 최적화로 인해 프로그램(120)의 실행 성능이 저하되는 것을 방지할 수 있다.
도 2는 본 개시의 일 실시예에 따른 정보 처리 시스템(110)의 내부 구성을 나타내는 블록도이다. 정보 처리 시스템(110)은 메모리(210), 프로세서(220), 통신 모듈(230) 및 입출력 인터페이스(240)를 포함할 수 있다. 도 2에 도시된 바와 같이, 정보 처리 시스템(110)은 통신 모듈(230)을 이용하여 네트워크를 통해 정보 및/또는 데이터를 통신할 수 있도록 구성될 수 있다.
메모리(210)는 비-일시적인 임의의 컴퓨터 판독 가능한 기록매체를 포함할 수 있다. 일 실시예에 따르면, 메모리(210)는 RAM(random access memory), ROM(read only memory), 디스크 드라이브, SSD(solid state drive), 플래시 메모리(flash memory) 등과 같은 비소멸성 대용량 저장 장치(permanent mass storage device)를 포함할 수 있다. 다른 예로서, ROM, SSD, 플래시 메모리, 디스크 드라이브 등과 같은 비소멸성 대용량 저장 장치는 메모리와는 구분되는 별도의 영구 저장 장치로서 정보 처리 시스템(110)에 포함될 수 있다. 또한, 메모리(210)에는 운영체제와 적어도 하나의 프로그램 코드(예를 들어, 정보 처리 시스템(110)에 설치되어 구동되는 중간표현의 생성 및 갱신, 질의의 유효성 판단, 최적화 적용 가능성 판단, 최적화 적용 등을 위한 코드)가 저장될 수 있다.
이러한 소프트웨어 구성요소들은 메모리(210)와는 별도의 컴퓨터에서 판독 가능한 기록매체로부터 로딩될 수 있다. 이러한 별도의 컴퓨터에서 판독 가능한 기록매체는 이러한 정보 처리 시스템(110)에 직접 연결가능한 기록 매체를 포함할 수 있는데, 예를 들어, 플로피 드라이브, 디스크, 테이프, DVD/CD-ROM 드라이브, 메모리 카드 등의 컴퓨터에서 판독 가능한 기록매체를 포함할 수 있다. 다른 예로서, 소프트웨어 구성요소들은 컴퓨터에서 판독 가능한 기록매체가 아닌 통신 모듈(230)을 통해 메모리(210)에 로딩될 수도 있다. 예를 들어, 적어도 하나의 프로그램은 개발자들 또는 어플리케이션의 설치 파일을 배포하는 파일 배포 시스템이 통신 모듈(230)을 통해 제공하는 파일들에 의해 설치되는 컴퓨터 프로그램(예를 들어, 중간표현의 생성 및 갱신, 질의의 유효성 판단, 최적화 적용 가능성 판단, 최적화 적용 등을 위한 프로그램 등)에 기반하여 메모리(210)에 로딩될 수 있다.
프로세서(220)는 기본적인 산술, 로직 및 입출력 연산을 수행함으로써, 컴퓨터 프로그램의 명령을 처리하도록 구성될 수 있다. 명령은 메모리(210) 또는 통신 모듈(230)에 의해 사용자 단말(미도시) 또는 다른 외부 시스템으로 제공될 수 있다. 예를 들어, 프로세서(220)는 중간표현의 부분 그래프를 질의로서 수신하여, 적어도 하나의 조건을 판단함으로써 질의의 유효성을 판단하고, 질의가 유효한 경우 부분 그래프의 최적화 적용 가능성을 판단할 수 있다.
통신 모듈(230)은 네트워크를 통해 사용자 단말(미도시)과 정보 처리 시스템(110)이 서로 통신하기 위한 구성 또는 기능을 제공할 수 있으며, 정보 처리 시스템(110)이 외부 시스템(일례로 별도의 클라우드 시스템 등)과 통신하기 위한 구성 또는 기능을 제공할 수 있다. 일례로, 정보 처리 시스템(110)의 프로세서(220)의 제어에 따라 제공되는 제어 신호, 명령, 데이터 등이 통신 모듈(230)과 네트워크를 거쳐 사용자 단말 및/또는 외부 시스템의 통신 모듈을 통해 사용자 단말 및/또는 외부 시스템으로 전송될 수 있다. 예를 들어, 사용자 단말 및/또는 외부 시스템은 정보 처리 시스템(110)으로부터 최적화 적용 가능성 판단 결과, 프로그램의 실행 결과 등을 전달받을 수 있다.
또한, 정보 처리 시스템(110)의 입출력 인터페이스(240)는 정보 처리 시스템(110)과 연결되거나 정보 처리 시스템(110)이 포함할 수 있는 입력 또는 출력을 위한 장치(미도시)와의 인터페이스를 위한 수단일 수 있다. 도 2에서는 입출력 인터페이스(240)가 프로세서(220)와 별도로 구성된 요소로서 도시되었으나, 이에 한정되지 않으며, 입출력 인터페이스(240)가 프로세서(220)에 포함되도록 구성될 수 있다. 정보 처리 시스템(110)은 도 2의 구성요소들보다 더 많은 구성요소들을 포함할 수 있다. 그러나, 대부분의 종래기술적 구성요소들을 명확하게 도시할 필요성은 없다.
정보 처리 시스템(110)의 프로세서(220)는 복수의 사용자 단말 및/또는 복수의 외부 시스템으로부터 수신된 정보 및/또는 데이터를 관리, 처리 및/또는 저장하도록 구성될 수 있다. 일 실시예에 따르면, 프로세서(220)는 사용자 단말 및/또는 외부 시스템으로부터 중간표현의 부분 그래프를 질의로서 수신할 수도 있다. 이 경우, 프로세서(220)는 질의의 유효성을 판단하고, 질의가 유효한 경우, 부분 그래프의 최적화 적용 가능성을 판단할 수 있다.
도 3은 본 개시의 일 실시예에 따른 프로세서(220)의 내부 구성을 나타내는 블록도이다. 도시된 바와 같이 프로세서(220)는 중간표현 생성부(310), 최적화 적용 가능성 판단부(320), 중간표현 변환부(330)를 포함할 수 있다. 도 3에서 도시된 프로세서(220)의 내부 구성은 예시일 뿐이며, 일부 실시예에서는 다르게 구현될 수 있다. 예를 들어, 프로세서(220)는 도시된 구성 외 다른 구성을 더 포함할 수 있으며, 도시된 구성의 적어도 일부가 생략될 수 있다. 또한, 도 3에서 프로세서(220)는 단일 프로세서인 것으로 도시되었으나 이에 한정되지 않으며, 복수의 프로세서로 구성될 수 있다. 또한, 도 3에서는 기능적인 측면에서 각 부를 나누어 도시하였으나, 이는 반드시 물리적으로 분리됨을 의미하지는 않는다.
일 실시예에 따르면, 중간표현 생성부(310)는 프로그램으로부터 데이터에 대한 정보 및 연산에 대한 정보를 추출할 수 있다. 예를 들어, 중간표현 생성부(310)는 프로그램으로부터 새로운 변수 또는 상수의 생성, 변수 값 또는 상수 값의 정의 및 변경, 변수 또는 상수의 자료형, 변수 또는 상수의 크기, 변수 또는 상수의 삭제 또는 소멸 등 데이터에 대한 정보를 추출할 수 있다. 또한, 중간표현 생성부(310)는 수행되는 연산의 종류, 연산의 입출력 데이터에 대한 정보, 연산의 파라미터 등 연산에 대한 정보를 추출할 수 있다.
일 실시예에 따르면, 프로그램은 데이터와 연산으로 이루어진 임의의 프로그램을 지칭할 수 있는데, 예를 들어, 딥 러닝 프로그램 등을 포함할 수 있다, 또한, 데이터는 딥러닝 프로그램을 구성할 수 있는 임의의 데이터 타입으로 구현될 수 있는데, 예를 들어, 텐서 타입의 데이터 등을 포함할 수 있다. 중간표현 생성부(310)는 딥 러닝 프로그램에 포함된 텐서 타입의 데이터로부터 자료형, 각 차원의 크기 등에 대한 정보를 추출할 수 있다.
그런 다음, 중간표현 생성부(310)는 프로그램으로부터 추출한 정보를 이용하여 중간표현을 생성하고, 생성된 중간표현을 저장하거나 갱신할 수 있다. 일 실시예에서, 중간표현은 데이터 및 연산을 나타내는 노드와 데이터와 연산의 입출력 관계를 나타내는 엣지를 포함하는 그래프의 형태로 표현될 수 있다. 중간표현은 정보 처리 시스템의 메모리, 데이터베이스 등에 저장될 수 있으나, 이에 한정되지 않는다.
추가적으로, 중간표현 생성부(310)는 프로그램과 중간표현의 대응관계를 데이터베이스에 저장 및/또는 갱신할 수 있다. 중간표현 생성부(310)가 프로그램과 중간표현의 대응관계를 저장 또는 갱신하는 과정은 중간표현 생성, 저장 또는 갱신 과정과 동시에 수행되거나, 중첩적으로 수행되거나, 순차적으로 수행될 수 있다.
예를 들어, 중간표현 생성부(310)는 딥 러닝 프로그램에서 새로운 텐서가 생성되는 정보를 추출하고, 생성된 텐서에 대응하는 데이터 노드를 중간표현에 추가할 수 있으며, 생성된 프로그램의 텐서와 추가된 중간표현의 데이터 노드가 대응된다는 정보를 데이터베이스에 저장할 수 있다. 일 실시예에 따르면, 프로그램과 중간표현의 대응관계는 프로그램의 텐서가 중간표현의 데이터 노드를 가리키는 포인터 정보로서 저장될 수 있다. 또한, 중간표현 생성부(310)는 딥 러닝 프로그램에서 텐서가 새로운 텐서로 갱신되는 정보를 추출한 경우, 중간표현에 새로운 데이터 노드를 추가하고, 갱신된 프로그램의 텐서와 추가된 중간표현의 데이터 노드가 대응되는 것으로 대응관계를 수정할 수 있다. 즉, 중간표현 생성부(310)는 프로그램과 중간표현의 대응관계를 갱신할 수도 있다.
다른 예로, 중간표현 생성부(310)는 프로그램에서 연산에 대한 정보를 추출하고, 중간표현에 연산 노드를 추가할 수 있으며, 추출된 연산의 입력 데이터에 대응하는 입력 데이터 노드에서 연산 노드로 향하는 엣지 및 연산 노드에서 연산의 출력 데이터에 대응하는 출력 데이터 노드로 향하는 엣지를 추가할 수 있다.
최적화 적용 가능성 판단부(320)는 중간표현의 부분 그래프를 질의로서 수신하고, 질의의 유효성 및 최적화 적용 가능성을 판단할 수 있다. 일 실시예에 따르면, 여기서 최적화는 중간표현에 포함된 연산 노드 중 적어도 일부를 융합하는 것(연산 융합)을 포함할 수 있다.
일 실시예에 따르면, 최적화 적용 가능성 판단부(320)는 부분 그래프에 대해 최적화 적용이 가능한지 여부를 판단하기에 앞서, 질의의 유효성을 판단할 수 있다. 예를 들어, 최적화 적용 가능성 판단부(320)는 질의로서 수신된 부분 그래프가 최적화 적용 가능성을 판단하기에 적절한 부분 그래프인지 여부를 판단할 수 있다.
구체적 예로, 최적화 적용 가능성 판단부(320)는 연산 융합이 가능한지 여부를 판단하기 위해, 수신한 부분 그래프에 대해 다음 제1 질의 요건 및 제2 질의 요건을 만족하는지 여부를 판단함으로써 질의의 유효성을 판단할 수 있다. 연산 융합 최적화를 위한 제1 질의 요건은, 임의의 데이터 노드가 부분 그래프에 포함되는 경우, 해당 데이터 노드에 인접한(adjacent) 연산 노드 및 해당 데이터 노드에 부속한(incident) 엣지가 모두 부분 그래프에 포함되어야 한다는 것이다. 즉, 부분 그래프의 가장자리 노드는 연산 노드이어야 한다는 조건이 연산 융합 최적화를 위한 제1 질의 요건이다. 또한, 연산 융합 최적화를 위한 제2 질의 요건은, 제1 연산 노드 및 제2 연산 노드가 부분 그래프에 포함되고 제1 연산 노드와 제2 연산 노드 사이에 경로(path)가 존재하는 경우, 경로 상의 모든 노드와 모든 엣지가 부분 그래프에 포함되어야 한다는 것이다. 즉, 연산 노드 간에 종속성(dependency)이 있는 경우, 연속한 부분만 융합이 가능하다는 것이 연산 융합 최적화를 위한 제2 질의 요건이다. 최적화 적용 가능성 판단부(320)가 질의의 유효성을 판단하는 방법의 예시는 도 5 및 도 9를 참조하여 보다 상세히 후술된다.
상술한 예시 등의 방법으로 질의의 유효성을 판단한 최적화 적용 가능성 판단부(320)는 질의가 유효하다고 판단한 경우, 부분 그래프에 대한 최적화 적용 가능성을 판단할 수 있다. 예를 들어, 최적화 적용 가능성 판단부(320)는 부분 그래프에 대해 최적화를 적용하여도, 이후 프로그램의 실행에 지장이 없는 지 여부를 판단할 수 있다. 구체적 예로, 최적화 적용 가능성 판단부(320)는 부분 그래프에 포함된 모든 데이터 노드의 각각에 대응되는 프로그램의 데이터가 없는 지 여부를 판단하고, 부분 그래프에 포함된 모든 데이터 노드의 각각에 대응되는 프로그램의 데이터가 없는 경우, 최적화 적용 가능성이 있다고 판정할 수 있다. 연산 융합의 최적화를 수행하는 경우 중간 데이터 노드가 제거될 수 있는데, 상기 조건을 만족하지 않는 경우, 프로그램에서 추후 중간 데이터 노드에 접근할 가능성이 있다는 것을 뜻하므로 최적화를 적용할 수 없다. 최적화 적용 가능성 판단부(320)가 최적화 적용 가능성을 판단하는 방법의 예시는 도 6 및 도 10을 참조하여 보다 상세히 후술된다.
일 실시예에 따르면, 중간표현 변환부(330)는 최적화 적용 가능성 판단부(320)로부터 중간표현의 부분 그래프에 대한 최적화 적용 가능 여부를 제공받아, 해당 부분 그래프에 대해 최적화를 적용할 수 있다. 예를 들어, 중간표현 변환부(330)는 최적화 적용 가능성 판단부(320)로부터 중간표현의 부분 그래프에 대해 연산 융합의 최적화가 가능하다는 판단을 제공받고, 해당 부분 그래프에 대해 연산 융합의 최적화를 적용할 수 있다.
도 4는 본 개시의 일 실시예에 따른 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법(400)의 예시를 나타내는 흐름도이다. 일 실시예에 따르면, 방법(400)은 프로세서(예를 들어, 정보 처리 시스템의 프로세서)가 최적화 적용 가능성 판단의 대상이 되는 중간표현의 부분 그래프를 질의로서 수신함으로써 개시될 수 있다(S410). 여기서, 최적화는 중간표현에 포함된 복수의 연산 노드 중 적어도 일부 노드들을 융합하는 연산 융합을 포함할 수 있다.
일 실시예에 따르면, 중간표현은 프로그램을 효율적으로 실행하기 위해 생성되는, 프로그램과 동일한 의미를 가지는 그래프 및/또는 이와 연관된 정보를 지칭할 수 있다. 여기서, 프로그램은 데이터 및 복수의 연산을 포함할 수 있으며, 예를 들어, 프로그램은 딥 러닝 프로그램을 포함할 수 있고, 데이터는 텐서 타입의 데이터를 포함할 수 있다. 일 실시예에서, 중간표현은 복수의 데이터 노드, 복수의 연산 노드 및 복수의 데이터 노드와 복수의 연산 노드의 입출력 관계를 나타내는 복수의 엣지를 포함할 수 있다.
그런 다음, 프로세서는 질의의 유효성을 판단할 수 있다(S420). 예를 들어, 프로세서는 아래의 제1 질의 요건 및 제2 질의 요건이 모두 만족되는 경우, 질의가 유효하다고 결정할 수 있다. 제1 질의 요건은 제1 데이터 노드가 부분 그래프에 포함되는 경우 제1 데이터 노드에 인접한 연산 노드 및 제1 데이터 노드에 부속한 엣지가 모두 상기 부분 그래프에 포함되어야 한다는 것이다. 또한, 제2 질의 요건은 제1 연산 노드 및 제2 연산 노드가 부분 그래프에 포함되고 제1 연산 노드와 제2 연산 노드 사이에 경로가 존재하는 경우, 경로 상의 모든 노드와 모든 엣지가 부분 그래프에 포함되어야 한다는 것이다. 즉, 프로세서는 부분 그래프의 가장자리 노드가 연산 노드이어야 한다는 제1 질의 요건 및 연산 노드 사이에 종속성(dependency)이 있는 경우, 연속한 부분만 최적화 대상이 될 수 있다는 제2 질의 요건을 모두 만족하는 경우에만 질의가 유효하다고 결정할 수 있다. 프로세서가 질의의 유효성을 판단하는 방법의 예시는 도 5 및 도 9를 참조하여 보다 상세히 후술된다.
그 후, 프로세서는 질의가 유효한 경우, 부분 그래프의 최적화 적용 가능성을 판단할 수 있다(S430). 예를 들어, 프로세서는 부분 그래프에 포함된 모든 데이터 노드의 각각에 대응되는 프로그램의 데이터가 없는 경우, 부분 그래프의 최적화 적용 가능성이 있다고 판정할 수 있다. 즉, 프로그램에서 추후에 부분 그래프 내의 모든 데이터 노드에 접근할 가능성이 없는 경우에, 부분 그래프의 최적화 적용 가능성이 있다고 판단할 수 있다. 프로세서가 최적화 적용 가능성을 판단하는 방법의 예시는 도 6 및 도 10을 참조하여 보다 상세히 후술된다.
이와 같이, 중간표현을 최적화하기 전에 최적화 가능 여부를 판단함으로써, 부적절한 최적화로 인해 프로그램의 실행 성능이 저하되는 것을 방지할 수 있다.
도 5는 본 개시의 일 실시예에 따른 질의의 유효성을 판단하는 방법(S420)의 예시를 나타내는 흐름도이다. 일 실시예에 따르면, 프로세서는 제1 질의 요건 및 제2 질의 요건이 만족되는지 판단하고, 제1 질의 요건 및 제2 질의 요건이 모두 만족되는 경우에만 질의가 유효하다고 결정할 수 있다. 제1 질의 요건은 특정 데이터 노드가 부분 그래프에 포함되는 경우 해당 데이터 노드에 인접한 연산 노드 및 해당 데이터 노드에 부속한 엣지가 모두 부분 그래프에 포함되어야 한다는 것이다. 또한, 제2 질의 요건은 특정 연산 노드 쌍이 부분 그래프에 포함되고 해당 연산 노드 쌍 사이에 경로가 존재하는 경우, 경로 상의 모든 노드와 모든 엣지가 부분 그래프에 포함되어야 한다는 것이다. 즉, 프로세서는 부분 그래프의 가장자리 노드가 연산 노드이어야 한다는 제1 질의 요건 및 연산 노드 사이에 종속성이 있는 경우, 연속한 부분만 최적화 대상이 될 수 있다는 제2 질의 요건을 모두 만족하는 경우에만 질의가 유효하다고 결정할 수 있다.
프로세서는 먼저 제1 질의 요건이 만족되는지 여부를 판단하기 위해, 제1 질의 요건을 판단하지 않은 부분 그래프 내 데이터 노드를 선택할 수 있다(S510). 그런 다음, 선택된 데이터 노드에 인접한 연산 노드가 모두 부분 그래프에 포함되는지 여부를 판단할 수 있다(S512). 선택된 데이터 노드에 인접한 연산 노드 중 부분 그래프에 포함되지 않는 연산 노드가 하나라도 존재하는 경우, 프로세서는 질의가 유효하지 않다고 판단하고(S520), 질의의 유효성 판단을 종료할 수 있다.
인접한 연산 노드가 모두 부분 그래프에 포함되는 경우, 프로세서는 선택된 데이터 노드에 부속한 엣지가 모두 부분 그래프에 포함되는지 여부를 판단할 수 있다(S514). 선택된 데이터 노드에 부속한 엣지 중 부분 그래프에 포함되지 않는 엣지가 하나라도 존재하는 경우, 프로세서는 질의가 유효하지 않다고 판단하고(S520), 질의의 유효성 판단을 종료할 수 있다.
부속한 엣지가 모두 부분 그래프에 포함되는 경우, 프로세서는 선택된 데이터 노드에 대한 제1 질의 요건 판단을 마치고, 부분 그래프 내 제1 질의 요건을 판단하지 않은 데이터 노드가 존재하는지 여부를 판단할 수 있다(S516). 만약, 부분 그래프 내 제1 질의 요건을 판단하지 않은 데이터 노드가 존재하는 경우, 단계 S510로 돌아가 새로운 데이터 노드에 대해 제1 질의 요건을 판단할 수 있다. 이와 같은 방식으로 부분 그래프 내의 모든 데이터 노드에 대해 제1 질의 요건을 만족하는지 여부를 판단할 수 있으며, 부분 그래프 내 모든 데이터 노드가 제1 질의 요건을 만족하는 경우, 프로세서는 제2 질의 요건을 판단할 수 있다.
프로세서는 제2 질의 요건이 만족되는지 여부를 판단하기 위해, 제2 질의 요건을 판단하지 않은 부분 그래프 내 연산 노드 쌍을 선택할 수 있다(S530). 그런 다음, 프로세서는 선택된 두 연산 노드 사이에 경로가 존재하는지 여부를 판단하고(S532), 경로가 존재하는 경우, 경로 상의 모든 노드 및 엣지가 부분 그래프에 포함되는지 여부를 판단할 수 있다(S534). 경로 상의 노드 또는 엣지 중 부분 그래프에 포함되지 않는 것이 하나라도 존재하는 경우, 프로세서는 질의가 유효하지 않다고 판단하고(S520), 질의의 유효성 판단을 종료할 수 있다.
단계 S532에서 두 연산 노드 사이의 경로가 존재하지 않거나, 단계 S534에서 경로 상의 모든 노드 및 엣지가 부분 그래프에 포함되는 경우, 프로세서는 선택된 연산 노드 쌍에 대한 제2 질의 요건 판단을 마치고, 부분 그래프 내 제2 질의 요건을 판단하지 않은 연산 노드 쌍이 존재하는지 여부를 판단할 수 있다(S536). 만약, 부분 그래프 내 제2 질의 요건을 판단하지 않은 연산 노드 쌍이 존재하는 경우, 단계 S530으로 돌아가 새로운 연산 노드 쌍에 대해 제2 질의 요건을 판단할 수 있다. 이와 같은 방식으로 부분 그래프 내의 모든 연산 노드 쌍에 대해 제2 질의 요건을 만족하는지 여부를 판단할 수 있으며, 부분 그래프 내 모든 연산 노드 쌍에 대해 제2 질의 요건이 만족되는 경우, 프로세서는 질의가 유효하다고 판단함으로써 방법(S420)이 종료될 수 있다(S540).
도 6은 본 개시의 일 실시예에 따른 최적화 적용 가능성을 판단하는 방법(S430)의 예시를 나타내는 흐름도이다. 일 실시예에 따르면, 프로세서는 부분 그래프에 대한 최적화 적용 가능성을 판단할 수 있다. 예를 들어, 프로세서는 부분 그래프에 포함된 모든 데이터 노드의 각각에 대응되는 프로그램의 데이터가 없는 경우, 최적화 적용 가능성이 있다고 판정할 수 있다. 즉, 프로그램에서 추후 부분 그래프 내의 모든 데이터 노드에 접근할 가능성이 없는 경우에, 부분 그래프의 최적화 적용 가능성이 있다고 판단할 수 있다. 연산 융합의 최적화를 수행하는 경우 중간 데이터 노드가 제거될 수 있는데, 프로그램에서 추후 중간 데이터 노드에 접근할 가능성이 있는 경우에, 최적화를 적용하면 프로그램의 실행에 지장이 생길 수 있기 때문이다.
프로세서는 먼저 최적화 적용 가능성을 판단하기 위해, 최적화 적용 가능성을 판단하지 않은 부분 그래프 내 데이터 노드를 선택할 수 있다(S610). 그런 다음, 선택된 데이터 노드에 대응되는 프로그램의 데이터가 존재하는지 여부를 판단할 수 있다(S620). 선택된 데이터 노드에 대응되는 프로그램의 데이터가 존재하는 경우, 프로세서는 최적화 적용이 불가하다고 판단하고(S650), 최적화 적용 가능성 판단을 종료할 수 있다.
선택된 데이터 노드에 대응되는 프로그램의 데이터가 존재하지 않는 경우, 프로세서는 부분 그래프 내 최적화 적용 가능성을 판단하지 않은 데이터 노드가 존재하는지 여부를 판단할 수 있다(S630). 만약, 부분 그래프 내 최적화 적용 가능성을 판단하지 않은 데이터 노드가 존재하는 경우, 단계 S610로 돌아가 새로운 데이터 노드에 대해 최적화 적용 가능성을 판단할 수 있다. 이와 같은 방식으로 부분 그래프 내의 모든 데이터 노드에 대해 판단할 수 있으며, 부분 그래프 내 모든 데이터 노드에 대응되는 프로그램의 데이터가 존재하지 않는 경우, 프로세서는 부분 그래프에 대한 최적화 적용이 가능하다고 판단함으로써, 방법(S430)을 종료할 수 있다(S640).
도 7은 본 개시의 일 실시예에 따른 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법(700)의 예시를 나타내는 흐름도이다. 일 실시예에 따르면, 방법(700)은 프로세서(예를 들어, 정보 처리 시스템의 프로세서)가 프로그램으로부터 중간표현을 생성하고(S710), 데이터베이스에 프로그램의 데이터와 중간표현의 데이터 노드의 대응관계를 저장할 수 있다(S720). 여기서, 중간표현은 프로그램을 효율적으로 실행하기 위해 생성되는, 프로그램과 동일한 의미를 가지는 그래프 및/또는 이와 연관된 정보를 지칭할 수 있다. 일 실시예에 따르면, 중간표현은 복수의 데이터 노드, 복수의 연산 노드 및 복수의 데이터 노드와 복수의 연산 노드의 입출력 관계를 나타내는 복수의 엣지를 포함할 수 있다.
중간표현을 생성하고, 데이터베이스에 대응관계를 저장하는 예로, 프로세서는 딥 러닝 프로그램으로부터 텐서에 대한 정보 및 연산에 대한 정보를 추출하고, 프로그램에서 새로운 텐서가 생성되는 경우, 프로세서는 해당 텐서에 대응하는 데이터 노드를 중간표현에 추가할 수 있다. 또한, 데이터베이스에 프로그램의 텐서와 중간표현의 데이터 노드의 대응관계(예를 들어, 프로그램의 텐서가 중간표현의 데이터 노드를 가리키는 포인터 정보)를 저장할 수 있다. 프로그램에서 텐서가 새로운 텐서로 갱신되는 경우, 프로세서는 중간표현을 갱신할 수 있으며, 데이터베이스에 저장된 대응관계를 갱신할 수 있다. 또한, 프로그램으로부터 연산에 대한 정보(연산의 종류, 입·출력 텐서에 대한 정보 등)를 추출한 경우, 프로세서는 중간표현에 연산 노드를 추가하고, 텐서와 연산의 입출력 관계를 나타내는 엣지를 추가할 수 있다.
그런 다음, 프로세서는 최적화 적용 가능성 판단의 대상이 되는 중간표현의 부분 그래프의 최적화 적용 가능성을 판단할 수 있다(S730). 단계 S730의 세부 과정은 도 4의 방법(400)과 동일하거나 유사하게 수행될 수 있다.
최적화 적용이 가능한 경우, 프로세서는 부분 그래프를 최적화할 수 있다(S740). 예를 들어, 프로세서는 중간표현에 포함된 복수의 연산 노드 중 적어도 일부 노드를 융합함으로써, 부분 그래프를 최적화할 수 있다. 이와 같이 여러 개의 연산을 하나의 연산으로 융합하여 실행하는 경우, 메모리 접근이 줄어 프로그램의 실행 성능이 향상될 수 있다.
도 4 내지 도 7에서 도시한 흐름도 및 상술한 설명은 하나의 예시일 뿐이며, 이에 한정되지 않고 다양한 방식으로 구현될 수 있다. 예를 들어, 하나 이상의 단계가 생략되거나, 각 단계의 순서가 변경될 수 있으며, 적어도 일부의 단계가 반복 수행되거나, 중첩적으로 수행될 수 있다.
도 8은 본 개시의 일 실시예에 따른 프로그램(800)에 대한 중간표현을 생성하는 방법의 예시를 나타내는 도면이다. 일 실시예에 따르면, 정보 처리 시스템은 프로그램(800)으로부터 데이터에 대한 정보 및 연산에 대한 정보를 추출할 수 있으며, 추출된 정보를 이용하여 중간표현을 생성할 수 있고, 프로그램(800)과 중간표현의 대응관계를 데이터베이스에 저장할 수 있다.
구체적 예로, 제1 상태 내지 제3 상태(810, 820, 830)를 거쳐 프로그램(800)에 대한 중간표현이 생성되고, 프로그램과 중간표현의 대응관계가 데이터베이스에 저장될 수 있다. 제1 상태(810)는 정보 처리 시스템이 프로그램(800)의 셋째 줄까지의 중간표현을 생성하고, 대응관계를 저장한 상태의 예시를 나타낸다. 정보 처리 시스템은 프로그램(800)으로부터 새롭게 생성된 텐서 A, 텐서 B 및 텐서 C에 대한 정보를 추출하고, 이에 대응하는 데이터 노드 A, 데이터 노드 B, 데이터 노드 C를 중간표현에 추가할 수 있으며, 프로그램(800)의 텐서들과 중간표현의 데이터 노드들의 대응관계를 데이터베이스에 저장할 수 있다.
제2 상태(820)는 제1 상태(810) 이후, 정보 처리 시스템이 프로그램(800)의 다섯째 줄까지의 중간표현을 생성하고, 프로그램(800)과 중간표현의 대응관계를 저장한 상태의 예시를 나타낸다. 정보 처리 시스템은 프로그램(800)의 넷째 줄에서 연산 '+'에 대한 정보를 추출하여, 연산 노드 '+', 연산의 출력 데이터(텐서 D)에 대응하는 데이터 노드 D, 연산 '+'의 입출력 관계를 나타내는 세 개의 엣지를 중간표현에 추가할 수 있고, 프로그램(900)의 텐서 D와 중간표현의 데이터 노드 D가 대응된다는 정보를 데이터베이스에 저장할 수 있다. 또한, 정보 처리 시스템은 프로그램(800)의 다섯째 줄에서 연산 '*'에 대한 정보를 추출하여, 연산 노드 '*', 연산의 출력 데이터(텐서 E)에 대응하는 데이터 노드 E, 연산 '*'의 입출력 관계를 나타내는 세 개의 엣지를 중간표현에 추가할 수 있고, 프로그램(800)의 텐서 E와 중간표현의 데이터 노드 E가 대응된다는 정보를 데이터베이스에 저장할 수 있다.
제3 상태(830)는 제2 상태(820) 이후, 프로그램(900)의 여섯째 줄까지의 중간표현이 생성되고, 이에 따라 프로그램(800)과 중간표현의 대응관계가 갱신된 상태의 예시를 나타낸다. 정보 처리 시스템은 프로그램(800)의 여섯째 줄에서 텐서 D가 새로운 텐서로 갱신되는 정보를 추출하여, 갱신된 텐서 D에 대응하는 데이터 노드 D'를 중간표현에 추가할 수 있다. 또한, 정보 처리 시스템은 프로그램(800)의 텐서 D가 중간표현의 데이터 노드 D'와 대응되는 것으로 데이터베이스에 저장된 대응관계를 갱신할 수 있다.
도 9는 본 개시의 일 실시예에 따른 질의의 유효성을 판단하는 방법의 예시를 나타내는 도면이다. 일 실시예에 따르면, 정보 처리 시스템은 최적화 적용 가능성 판단의 대상이 되는 중간표현의 부분 그래프(910, 920, 930)를 질의로서 수신하고, 질의의 유효성을 판단할 수 있다.
예를 들어, 프로세서는 제1 질의 요건 및 제2 질의 요건이 만족되는지 판단하고, 제1 질의 요건 및 제2 질의 요건이 모두 만족되는 경우에만 질의가 유효하다고 결정할 수 있다. 제1 질의 요건은 특정 데이터 노드가 부분 그래프(910, 920, 930)에 포함되는 경우 해당 데이터 노드에 인접한 연산 노드 및 해당 데이터 노드에 부속한 엣지가 모두 부분 그래프(910, 920, 930)에 포함되어야 한다는 것이다. 또한, 제2 질의 요건은 특정 연산 노드 쌍이 부분 그래프에 포함되고 해당 연산 노드 쌍 사이에 경로가 존재하는 경우, 경로 상의 모든 노드와 모든 엣지가 부분 그래프(910, 920, 930)에 포함되어야 한다는 것이다. 즉, 프로세서는 부분 그래프(910, 920, 930)의 가장자리 노드가 연산 노드이어야 한다는 제1 질의 요건 및 연산 노드 사이에 종속성이 있는 경우, 연속한 부분만 최적화 대상이 될 수 있다는 제2 질의 요건을 모두 만족하는 경우에만 질의가 유효하다고 결정할 수 있다.
도 9는 정보 처리 시스템이 질의로서 수신한 부분 그래프(910, 920, 930)의 예시를 도시한다. 제1 부분 그래프(910)를 살펴보면, 데이터 노드 D는 부분 그래프에 포함되는데, 데이터 노드 D에 인접한 연산 노드 '+'는 부분 그래프에 포함되지 않는다. 즉, 가장자리 노드가 연산 노드로 끝나지 않아, 제1 부분 그래프(910)는 제1 질의 요건을 만족하지 않는다.
제2 부분 그래프(920)를 살펴보면, 연산 노드 '+'와 연산 노드 '*'가 모두 부분 그래프에 포함되는데, 두 연산 노드 사이의 경로 위에 있는 데이터 노드 D가 부분 그래프에 포함되지 않는다. 즉, 종속성이 있는 두 연산 노드를 포함하는데도 부분 그래프가 연속적이지 않아, 제2 부분 그래프(920)는 제2 질의 요건을 만족하지 않는다.
제3 부분 그래프(930)를 살펴보면, 부분 그래프에 포함된 데이터 노드 D에 인접한 연산 노드, 데이터 노드 D에 부속한 엣지가 모두 부분 그래프에 포함되어 제1 질의 요건을 만족하며, 부분 그래프에 포함된 두 연산 노드 사이의 경로 위에 있는 노드와 엣지가 모두 부분 그래프에 포함되어 제2 질의 요건 역시 만족한다. 즉, 정보 처리 시스템은 제3 부분 그래프(930)를 포함하는 질의를 유효하다고 판단할 수 있다.
도 10은 본 개시의 일 실시예에 따른 최적화 적용 가능성을 판단하는 방법의 예시를 나타내는 도면이다. 일 실시예에 따르면, 정보 처리 시스템은 부분 그래프(1010, 1020)에 포함된 모든 데이터 노드의 각각에 대응되는 프로그램의 데이터가 없는 경우, 최적화 적용 가능성이 있다고 판정할 수 있다. 즉, 프로그램에서 추후 부분 그래프(1010, 1020) 내의 모든 데이터 노드에 접근할 가능성이 없는 경우에, 부분 그래프(1010, 1020)의 최적화 적용 가능성이 있다고 판단할 수 있다. 연산 융합의 최적화를 수행하는 경우 중간 데이터 노드가 제거될 수 있는데, 프로그램에서 추후 중간 데이터 노드에 접근할 가능성이 있는 경우에, 최적화를 적용하면 프로그램의 실행에 지장이 생길 수 있기 때문이다.
도 10은 정보 처리 시스템이 질의로서 수신한 부분 그래프(1010, 1020)와 대응관계가 저장된 데이터베이스의 예시를 도시한다. 제1 부분 그래프(1010)를 살펴보면, 부분 그래프 내에 포함된 데이터 노드 D에 대응되는 프로그램의 데이터(D)가 존재한다. 따라서, 추후 프로그램이 데이터 노드 D에 접근할 가능성을 배제할 수 없어, 정보 처리 시스템은 제1 부분 그래프(1010)에 대한 최적화 적용이 불가능하다고 판단할 수 있다.
제2 부분 그래프(1020)를 살펴보면, 부분 그래프 내에 포함된 데이터 노드 D에 대응되는 프로그램의 데이터가 존재하지 않는다. 따라서, 추후 프로그램이 데이터 노드 D에 접근할 가능성이 없어, 정보 처리 시스템은 제2 부분 그래프(1020)에 대한 최적화 적용이 가능하다고 판단할 수 있다.
도 11은 본 개시의 일 실시예에 따라 중간표현의 적어도 일부를 최적화하는 방법의 예시를 나타내는 도면이다. 일 실시예에 따르면, 부분 그래프에 대한 최적화 적용이 가능한 경우, 정보 처리 시스템은 부분 그래프를 최적화할 수 있다. 예를 들어, 정보 처리 시스템은 중간표현에 포함된 복수의 연산 노드 중 적어도 일부 노드를 융합함으로써, 부분 그래프를 최적화할 수 있다.
구체적 예로, 정보 처리 시스템은 도시된 바와 같이 부분 그래프(1110)에 포함된 연산 노드 '+'와 연산 노드 '*'를 하나의 연산 노드 'FMA(Fused Multiply-Add)'로 융합함으로써 중간표현을 변환시킬 수 있다. 이와 같이, 프로그램의 명령을 순서대로 실행하는 대신 중간표현에 대해 최적화를 적용한 뒤 이를 실행함으로써, 실행 결과는 유지하면서 실행 시간이나 메모리 사용량을 감소시킬 수 있다. 예를 들어, GPU를 이용하여 최적화된 중간표현(1120)을 실행하는 경우, 여러 개의 연산을 하나의 연산으로 융합하여 실행함으로써 메모리 접근이 줄어 성능이 향상될 수 있다.
상술한 방법은 컴퓨터에서 실행하기 위해 컴퓨터 판독 가능한 기록 매체에 저장된 컴퓨터 프로그램으로 제공될 수 있다. 매체는 컴퓨터로 실행 가능한 프로그램을 계속 저장하거나, 실행 또는 다운로드를 위해 임시 저장하는 것일 수도 있다. 또한, 매체는 단일 또는 수개 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있는데, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 매체의 예시로는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD 와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등을 포함하여 프로그램 명령어가 저장되도록 구성된 것이 있을 수 있다. 또한, 다른 매체의 예시로, 애플리케이션을 유통하는 앱 스토어나 기타 다양한 소프트웨어를 공급 내지 유통하는 사이트, 서버 등에서 관리하는 기록매체 내지 저장매체도 들 수 있다.
본 개시의 방법, 동작 또는 기법들은 다양한 수단에 의해 구현될 수도 있다. 예를 들어, 이러한 기법들은 하드웨어, 펌웨어, 소프트웨어, 또는 이들의 조합으로 구현될 수도 있다. 본원의 개시와 연계하여 설명된 다양한 예시적인 논리적 블록들, 모듈들, 회로들, 및 알고리즘 단계들은 전자 하드웨어, 컴퓨터 소프트웨어, 또는 양자의 조합들로 구현될 수도 있음을 통상의 기술자들은 이해할 것이다. 하드웨어 및 소프트웨어의 이러한 상호 대체를 명확하게 설명하기 위해, 다양한 예시적인 구성요소들, 블록들, 모듈들, 회로들, 및 단계들이 그들의 기능적 관점에서 일반적으로 위에서 설명되었다. 그러한 기능이 하드웨어로서 구현되는지 또는 소프트웨어로서 구현되는지의 여부는, 특정 애플리케이션 및 전체 시스템에 부과되는 설계 요구사항들에 따라 달라진다. 통상의 기술자들은 각각의 특정 애플리케이션을 위해 다양한 방식들로 설명된 기능을 구현할 수도 있으나, 그러한 구현들은 본 개시의 범위로부터 벗어나게 하는 것으로 해석되어서는 안된다.
하드웨어 구현에서, 기법들을 수행하는 데 이용되는 프로세싱 유닛들은, 하나 이상의 ASIC들, DSP들, 디지털 신호 프로세싱 디바이스들(digital signal processing devices; DSPD들), 프로그램가능 논리 디바이스들(programmable logic devices; PLD들), 필드 프로그램가능 게이트 어레이들(field programmable gate arrays; FPGA들), 프로세서들, 제어기들, 마이크로제어기들, 마이크로프로세서들, 전자 디바이스들, 본 개시에 설명된 기능들을 수행하도록 설계된 다른 전자 유닛들, 컴퓨터, 또는 이들의 조합 내에서 구현될 수도 있다.
따라서, 본 개시와 연계하여 설명된 다양한 예시적인 논리 블록들, 모듈들, 및 회로들은 범용 프로세서, DSP, ASIC, FPGA나 다른 프로그램 가능 논리 디바이스, 이산 게이트나 트랜지스터 로직, 이산 하드웨어 컴포넌트들, 또는 본원에 설명된 기능들을 수행하도록 설계된 것들의 임의의 조합으로 구현되거나 수행될 수도 있다. 범용 프로세서는 마이크로프로세서일 수도 있지만, 대안으로, 프로세서는 임의의 종래의 프로세서, 제어기, 마이크로제어기, 또는 상태 머신일 수도 있다. 프로세서는 또한, 컴퓨팅 디바이스들의 조합, 예를 들면, DSP와 마이크로프로세서, 복수의 마이크로프로세서들, DSP 코어와 연계한 하나 이상의 마이크로프로세서들, 또는 임의의 다른 구성의 조합으로서 구현될 수도 있다.
펌웨어 및/또는 소프트웨어 구현에 있어서, 기법들은 랜덤 액세스 메모리(random access memory; RAM), 판독 전용 메모리(read-only memory; ROM), 비휘발성 RAM(non-volatile random access memory; NVRAM), PROM(programmable read-only memory), EPROM(erasable programmable read-only memory), EEPROM(electrically erasable PROM), 플래시 메모리, 컴팩트 디스크(compact disc; CD), 자기 또는 광학 데이터 스토리지 디바이스 등과 같은 컴퓨터 판독가능 매체 상에 저장된 명령들로서 구현될 수도 있다. 명령들은 하나 이상의 프로세서들에 의해 실행 가능할 수도 있고, 프로세서(들)로 하여금 본 개시에 설명된 기능의 특정 양태들을 수행하게 할 수도 있다.
이상 설명된 실시예들이 하나 이상의 독립형 컴퓨터 시스템에서 현재 개시된 주제의 양태들을 활용하는 것으로 기술되었으나, 본 개시는 이에 한정되지 않고, 네트워크나 분산 컴퓨팅 환경과 같은 임의의 컴퓨팅 환경과 연계하여 구현될 수도 있다. 또 나아가, 본 개시에서 주제의 양상들은 복수의 프로세싱 칩들이나 장치들에서 구현될 수도 있고, 스토리지는 복수의 장치들에 걸쳐 유사하게 영향을 받게 될 수도 있다. 이러한 장치들은 PC들, 네트워크 서버들, 및 휴대용 장치들을 포함할 수도 있다.
본 명세서에서는 본 개시가 일부 실시예들과 관련하여 설명되었지만, 본 개시의 발명이 속하는 기술분야의 통상의 기술자가 이해할 수 있는 본 개시의 범위를 벗어나지 않는 범위에서 다양한 변형 및 변경이 이루어질 수 있다. 또한, 그러한 변형 및 변경은 본 명세서에 첨부된 특허청구의 범위 내에 속하는 것으로 생각되어야 한다.

Claims (10)

  1. 적어도 하나의 프로세서에 의해 실행되는, 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법에 있어서,
    최적화 적용 가능성 판단의 대상이 되는 상기 중간표현의 부분 그래프를 질의로서 수신하는 단계;
    상기 질의의 유효성을 판단하는 단계; 및
    상기 질의가 유효한 경우, 상기 부분 그래프의 최적화 적용 가능성을 판단하는 단계를 포함하고,
    상기 프로그램은 데이터 및 복수의 연산을 포함하고,
    상기 중간표현은 복수의 데이터 노드(nodes), 복수의 연산 노드 및 복수의 데이터 노드와 복수의 연산 노드의 입출력 관계를 나타내는 복수의 엣지(edges)를 포함하는,
    프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  2. 제1항에 있어서,
    상기 프로그램은 딥 러닝 프로그램을 포함하고,
    상기 데이터는 텐서(Tensor) 타입의 데이터를 포함하는, 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  3. 제1항에 있어서,
    상기 부분 그래프의 최적화 적용이 가능한 경우, 상기 부분 그래프를 최적화하는 단계를 더 포함하는, 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  4. 제3항에 있어서,
    상기 최적화하는 단계는,
    상기 중간표현에 포함된 복수의 연산 노드 중 적어도 일부 노드들을 융합하는 단계를 포함하는,
    프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  5. 제1항에 있어서,
    상기 프로그램으로부터 상기 중간표현을 생성하는 단계; 및
    데이터베이스에 상기 프로그램의 데이터와 상기 중간표현의 데이터 노드의 대응관계를 저장하는 단계
    를 더 포함하는, 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  6. 제5항에 있어서,
    상기 데이터베이스에 상기 프로그램의 데이터와 상기 중간표현의 데이터 노드의 대응관계를 저장하는 단계는,
    상기 프로그램의 데이터 및 상기 프로그램의 데이터가 상기 중간표현의 데이터 노드를 가리키는 포인터 정보를 상기 데이터베이스에 저장하는 단계를 포함하는,
    프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  7. 제1항에 있어서,
    상기 질의의 유효성을 판단하는 단계는,
    제1 데이터 노드가 상기 부분 그래프에 포함되는 경우, 상기 제1 데이터 노드에 인접한(adjacent) 연산 노드 및 상기 제1 데이터 노드에 부속한(incident) 엣지가 모두 상기 부분 그래프에 포함되는 제1 질의 요건을 만족시키는지 여부를 판정하는 단계;
    제1 연산 노드 및 제2 연산 노드가 상기 부분 그래프에 포함되고 상기 제1 연산 노드와 상기 제2 연산 노드 사이에 경로(path)가 존재하는 경우, 경로 상의 모든 노드와 모든 엣지가 상기 부분 그래프에 포함되는 제2 질의 요건을 만족시키는지 여부를 판정하는 단계; 및
    상기 제1 질의 요건 및 상기 제2 질의 요건이 모두 만족되는 경우 상기 질의가 유효하다고 결정하는 단계
    를 포함하는, 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  8. 제7항에 있어서,
    상기 부분 그래프의 최적화 적용 가능성을 판단하는 단계는,
    상기 부분 그래프에 포함된 모든 데이터 노드의 각각에 대응되는 프로그램의 데이터가 없는 경우, 상기 부분 그래프의 최적화 적용 가능성이 있다고 판정하는 단계를 포함하는, 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법.
  9. 제1항에 따른 방법을 컴퓨터에서 실행하기 위한 명령어들을 기록한 컴퓨터 판독 가능한 비일시적 기록 매체.
  10. 정보 처리 시스템으로서,
    메모리; 및
    상기 메모리와 연결되고, 상기 메모리에 포함된 컴퓨터 판독 가능한 적어도 하나의 프로그램을 실행하도록 구성된 적어도 하나의 프로세서
    를 포함하고,
    상기 적어도 하나의 프로그램은,
    최적화 적용 가능성 판단의 대상이 되는 중간표현의 부분 그래프를 질의로서 수신하고,
    상기 질의의 유효성을 판단하고,
    상기 질의가 유효한 경우, 상기 부분 그래프의 최적화 적용 가능성을 판단하기 위한 명령어들을 포함하고,
    상기 중간표현은 복수의 데이터 노드, 복수의 연산 노드 및 복수의 데이터 노드와 복수의 연산 노드의 입출력 관계를 나타내는 복수의 엣지를 포함하는, 정보 처리 시스템.
PCT/KR2022/008506 2021-06-16 2022-06-15 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템 WO2022265411A1 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/542,544 US20240118878A1 (en) 2021-06-16 2023-12-15 Method and system for determining optimization applicability on intermediate representation from program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2021-0077964 2021-06-16
KR20210077964 2021-06-16
KR1020220072638A KR102457152B1 (ko) 2021-06-16 2022-06-15 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템
KR10-2022-0072638 2022-06-15

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/542,544 Continuation US20240118878A1 (en) 2021-06-16 2023-12-15 Method and system for determining optimization applicability on intermediate representation from program

Publications (1)

Publication Number Publication Date
WO2022265411A1 true WO2022265411A1 (ko) 2022-12-22

Family

ID=83804885

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/008506 WO2022265411A1 (ko) 2021-06-16 2022-06-15 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템

Country Status (3)

Country Link
US (1) US20240118878A1 (ko)
KR (2) KR102457152B1 (ko)
WO (1) WO2022265411A1 (ko)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060004953A (ko) * 2003-05-02 2006-01-16 트랜시티브 리미티드 프로그램 코드 변환을 위한 중간 표현들을 발생하기 위한개선된 아키텍쳐
US20170124452A1 (en) * 2015-10-28 2017-05-04 Google Inc. Processing computational graphs
WO2021052391A1 (zh) * 2019-09-18 2021-03-25 华为技术有限公司 一种构建中间表达的方法、编译器和服务器

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69942011D1 (de) * 1998-10-10 2010-03-25 Ibm Programmkodekonvertierung mit verringerter Übersetzung

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060004953A (ko) * 2003-05-02 2006-01-16 트랜시티브 리미티드 프로그램 코드 변환을 위한 중간 표현들을 발생하기 위한개선된 아키텍쳐
US20170124452A1 (en) * 2015-10-28 2017-05-04 Google Inc. Processing computational graphs
WO2021052391A1 (zh) * 2019-09-18 2021-03-25 华为技术有限公司 一种构建中间表达的方法、编译器和服务器

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GEIFMAN AMNON: "Graph Compilers for Deep Learning: Definition, Pros & Cons, and Popular Examples", BLOG, 28 April 2021 (2021-04-28), pages 1 - 12, XP093015592, Retrieved from the Internet <URL:https://deci.ai/blog/graph-compilers/> [retrieved on 20230119] *
MINGZHEN LI; YI LIU; XIAOYAN LIU; QINGXIAO SUN; XIN YOU; HAILONG YANG; ZHONGZHI LUAN; DEPEI QIAN: "The Deep Learning Compiler: A Comprehensive Survey", ARXIV.ORG, 6 February 2020 (2020-02-06), XP081597008 *

Also Published As

Publication number Publication date
KR20220168580A (ko) 2022-12-23
KR102457152B1 (ko) 2022-10-20
US20240118878A1 (en) 2024-04-11

Similar Documents

Publication Publication Date Title
CN110297689B (zh) 智能合约执行方法、装置、设备及介质
WO2018135766A1 (ko) 블록 체인을 이용하여 데이터를 관리하는 장치 및 방법
WO2017030252A1 (ko) 컨테이너 이미지 보안 검사 방법 및 그 장치
WO2011105860A2 (en) Method and apparatus for generating minimum boot image
WO2018036000A1 (zh) 应用程序跨系统运行的方法和装置
WO2019066222A1 (ko) 바이너리 파일에 기초하여 오픈소스 소프트웨어 패키지를 식별하는 방법 및 시스템
WO2018094839A1 (zh) 一种移动终端预装应用的安装方法及装置
WO2023123850A1 (zh) 一种固件可信根的实现方法、装置、设备和可读存储介质
WO2011065660A4 (ko) 계산 시뮬레이션 모사 시스템 및 그 방법
WO2022181958A1 (ko) 시스템 프로세스 정보를 이용한 클라우드 마이그레이션 데이터 분석 방법 및 그 시스템
WO2019135425A1 (ko) 오픈소스 소프트웨어의 라이선스를 검증하는 방법 및 시스템
US9361251B2 (en) Interrupt signal accepting apparatus and computer apparatus managing operations of at least two operating systems
WO2022265411A1 (ko) 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템
KR100288670B1 (ko) 데이터세그먼트처리방법및정보처리시스템
WO2021006574A1 (en) Method and apparatus for managing application
WO2018143510A1 (ko) 사물 인터넷 보안 모듈
WO2018199366A1 (ko) 덱스 파일의 난독화 적용 여부의 탐지 및 보안성 평가를 위한 방법 및 시스템
WO2022265412A1 (ko) 프로그램에 대한 중간 표현을 관리하는 방법 및 시스템
US20180217889A1 (en) Efficient Transfer of Data from CPU to Onboard Management Device
WO2022265410A1 (ko) 중간표현을 생성하는 방법 및 시스템
WO2019160323A1 (ko) 어플리케이션과 관련된 데이터를 관리하기 위한 방법 및 그 전자 장치
EP4350507A1 (en) Data processing system, method and apparatus
WO2015060493A1 (ko) 주행 중 내비게이션 데이터의 부분 업데이트 장치 및 방법
WO2013100415A1 (ko) 분산 데이터 품질 관리 시스템 및 그 방법
WO2018117747A1 (en) Electronic device, method for controlling thereof and computer-readable recording medium

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE