Method, apparatus and computer program product for processing machine learning models

By generating computing graphs and based on incoming degree division, the computing power and communication bandwidth limitation problems of complex large-scale machine learning models are solved, and more effective processing methods and time savings are achieved.

CN112306468BActive Publication Date: 2024-12-20EMC IP HLDG CO LLC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201910712013.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-02
Publication Date
2024-12-20
Estimated Expiration
2039-08-02

AI Technical Summary

Technical Problem

The prior art is difficult to effectively deploy complex large-scale machine learning models, and the computing power and communication bandwidth limitations of a single computing device are difficult to meet the needs of the model. In parallel processing of models, there are difficulties in inter- and intra-layer communication, and different parameter formats lead to difficulty in dividing.

Method used

By obtaining the intermediate representation of the machine learning model written in the source language, a computational graph is generated and divided into ordered multiple parts based on the incoming of the nodes, so that the functions of each part can be executed in parallel, avoiding inter-layer and intra-layer communication, Structured text describes the intermediate representation for automatic division.

Benefits of technology

It realizes a more efficient and general processing method of machine learning models, saves training time, reduces time and space complexity, does not require inter- and intra-layer communication of deep learning models, and division can be carried out before the model runs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112306468B_ABST
    Figure CN112306468B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to methods, devices, and computer program products for processing machine learning models. The method includes obtaining an intermediate representation of a machine learning model written in a source language, the intermediate representation being independent of the source language and the target language and including structured text. The method also includes generating a computational graph based on the intermediate representation, the nodes in the computational graph representing functions related to the machine learning model, and the directed edges in the computational graph representing dependencies between functions. The method also includes dividing the computational graph into a plurality of ordered parts, so that the plurality of parts will be executed in sequence and the functions corresponding to the nodes in each part can be executed in parallel. By adopting the above method, when processing a machine learning model, it is not necessary to consider the inter-layer communication and intra-layer communication of a deep learning model, nor is it necessary to divide tensor data, and the processing method is more efficient in time and space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of artificial intelligence, and in particular, to methods, devices, and computer program products for processing machine learning models. Background Art

[0002] In recent years, with the advancement of artificial intelligence technology, machine learning or deep learning (DL) has promoted the development of many fields. At the same time, machine learning models have become more and more complex, requiring larger data sets to be used, and therefore more computing resources are required to execute such machine learning models. Currently, due to the limitations of the computing power of the CPU and the communication bandwidth between peripheral computing devices, the computing power of a single machine is often difficult to meet the requirements of large-scale machine learning models. Therefore, how to effectively deploy machine learning models has become the focus of current attention. Summary of the invention

[0003] Embodiments of the present disclosure provide a method, apparatus, and computer program product for processing a machine learning model.

[0004] According to a first aspect of the present disclosure, a method for processing a machine learning model is provided. The method includes obtaining an intermediate representation of a machine learning model written in a source language, the intermediate representation being independent of the source language and the target language and including structured text. The method also includes generating a computational graph based on the intermediate representation, the nodes in the computational graph representing functions related to the machine learning model, and the directed edges in the computational graph representing dependencies between functions. The method also includes dividing the computational graph into a plurality of ordered parts, so that the plurality of parts will be executed in sequence and the functions corresponding to the nodes in each part can be executed in parallel.

[0005] According to the second aspect of the present disclosure, an electronic device for processing a machine learning model is provided. The electronic device includes a processor; and a memory storing computer program instructions, the processor runs the computer program instructions in the memory to control the electronic device to perform an action, the action including: obtaining an intermediate representation of a machine learning model written in a source language, the intermediate representation is independent of the source language and the target language and includes structured text; generating a computational graph based on the intermediate representation, the nodes in the computational graph represent functions related to the machine learning model, and the directed edges in the computational graph represent dependencies between functions; and dividing the computational graph into a plurality of ordered parts, so that the plurality of parts will be executed in order and the functions corresponding to the nodes in each part can be executed in parallel.

[0006] According to a third aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a non-volatile computer-readable medium and includes machine-executable instructions, which, when executed, cause a machine to perform the steps of the method in the first aspect of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.

[0008] Figure 1 A schematic diagram illustrating an example environment 100 in which devices and / or methods according to embodiments of the present disclosure may be implemented;

[0009] Figure 2 A schematic diagram of a computation graph 200 according to an embodiment of the present disclosure is illustrated;

[0010] Figure 3 A flowchart of a method 300 for processing a machine learning model according to an embodiment of the present disclosure is illustrated;

[0011] Figure 4 A flowchart of a method 400 for dividing a computation graph into a plurality of parts according to an embodiment of the present disclosure is illustrated;

[0012] Figure 5 A schematic block diagram of an example device 500 suitable for implementing embodiments of the present disclosure is illustrated.

[0013] In the various drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0014] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0015] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0016] The principles of the present disclosure will be described below with reference to several example embodiments shown in the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that these embodiments are described only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way.

[0017] When using machine learning models to process data, data parallelism was initially used. In this way, each machine runs a machine learning model to process part of the data. However, due to the development of machine learning models, a single computing device has become difficult to run the entire machine learning model. Therefore, model parallelism is used to run larger and more complex machine learning models.

[0018] Program developers usually use a specific framework to write machine learning model programs and define neural networks layer by layer. Therefore, when processing machine learning models in a model-parallel manner, different layers in the machine learning model are usually distributed to different computing devices. However, when compiling a machine learning model program, the framework or compiler usually generates a single binary program. At this point, the program already has very little information about how to organize the layers. At this point, it is difficult for the framework and developers to split the entire computing task from this single binary program layer by layer to different computing nodes.

[0019] In addition, different parameter formats are used in different neural networks, such as the parameter formats of convolutional neural networks (CNN) and recurrent neural networks (RNN). Even in the same type of neural network (such as CNN), different partitioning schemes will lead to different parameter formats due to the different number of layers and nodes in the layers. Therefore, model parallelism of machine learning models is difficult to achieve.

[0020] In order to solve the above problems, the present disclosure proposes a method for processing a machine learning model. In this method, an intermediate representation of a machine learning model written in a source language is obtained. Then a computational graph is generated based on the intermediate representation. The manager divides the computational graph into multiple ordered parts according to the in-degree of the nodes in the computational graph, so that multiple parts can be executed in sequence, wherein the functions in each part can be executed in parallel. Through the above method, the processing of the machine learning model is at the function level rather than at the instruction level. Therefore, the processing of the machine learning model is more efficient and more general and feasible. Moreover, this method does not require inter-layer and intra-layer communication of the deep learning model, nor does it require the partitioning of parameter tensors and error tensors, etc. In addition, the automatic partitioning method is more efficient in time and space, and can be partitioned before running the machine learning model, saving training time.

[0021] under Figure 1 A schematic diagram of an example environment 100 is illustrated in which devices and / or methods according to embodiments of the present disclosure may be implemented.

[0022] like Figure 1 As shown, in the example environment 100, the intermediate representation 102 of the machine learning model is obtained by the machine learning model written in the source language. In some embodiments, the machine learning model written in the source language can be written in different source languages, and these source languages ​​can include, for example, CUDA, Java, Python, C++, Fortran, Ada, and C#. In some embodiments, the machine learning model written in the source language can be determined by different frameworks. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure.

[0023] In some embodiments, the intermediate representation 102 of the machine learning model can be obtained by compiling the machine learning model written in the source language by the compiler. Compilation is the process of converting source code / original code written in a programming language into machine code or native code of the target architecture. The intermediate representation 102 is a data structure or code used inside the compiler or virtual machine to represent the source code, and is independent of the source language and the target language. In some embodiments, the intermediate representation 102 of the machine learning model can be obtained by other means, for example, the programmer writes the machine learning model written in the source language into the intermediate representation 102 of the machine learning model according to the compilation rules of the compiler. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. The intermediate representation 102 of the machine learning model written in the source language can be obtained in any suitable manner.

[0024] In some embodiments, the intermediate representation 102 of the machine learning model may be described by structured text. For example, the intermediate representation 102 may include an intermediate representation of the machine learning model described in JavaScript Object Notation (JSON) or Extensible Markup Language (XML) format. Figure 1 The intermediate representation 102 of the machine learning model shown in is only used to illustrate the present disclosure, rather than to specifically limit the present disclosure. Those skilled in the art may describe the intermediate representation of the machine learning model in any suitable language as needed.

[0025] The intermediate representation 102 of the machine learning model is transmitted to the manager. The manager is used to process the received intermediate representation 102 of the machine learning model to achieve the partitioning of the machine learning model. The manager can be implemented in software or hardware.

[0026] The manager can generate a computation graph 104 based on the intermediate representation 102 of the machine learning model. The nodes in the computation graph 104 represent functions in the machine learning model. The computation graph 104 also includes dependencies between functions. For example, a directed edge in the computation graph 104 indicates that the input of the function corresponding to the end point of the directed edge depends on the output of the function corresponding to the starting point of the directed edge. Alternatively or additionally, the computation graph 104 is a directed acyclic graph.

[0027] As Figure 1 As shown, the computation graph 104 obtained from the intermediate representation 102 of the machine learning model includes: node 106, node 108, node 110, node 112, node 114, node 116, node 118, node 120 and node 122. In the computation graph 104, each node represents a function in the machine learning model, and the lines between the nodes represent the dependency relationship between the functions. For example, the output of node 106 is passed to node 112, and the output of node 110 is also passed to node 112, so node 112 depends on node 106 and node 110. Figure 1 The computation graph 104 in FIG. 1 is only used as an example to describe the computation graph. The number of nodes in the computation graph and the structure of the computation graph can be set to any suitable form based on the intermediate representation 102 of the machine learning model.

[0028] The manager divides the computation graph 104 generated from the intermediate representation 102 of the machine learning model into a plurality of ordered parts: a first part 124, a second part 126, a third part 128, a fourth part 130, and a fifth part 132. In some embodiments, the manager divides the computation graph 104 based on the in-degree of the nodes in the computation graph 104, where the in-degree of a node indicates the number of directed edges pointing to the node.

[0029] The manager then uses the obtained first part 124, second part 126, third part 128, fourth part 130, and fifth part 132 for deployment and execution 134 of the machine learning model. The various parts are executed sequentially during execution, and the functions in the various parts can be executed in parallel.

[0030] Combined with the above Figure 1 An example environment 100 is described in which devices and / or methods according to embodiments of the present disclosure may be implemented. Figure 2 A schematic diagram of a computation graph 200 according to an embodiment of the present disclosure is illustrated.

[0031] As an example, Figure 2 2 shows a computational graph 200 including eleven nodes obtained based on the intermediate representation of the machine learning model: node A 202, node B 204, node C 206, node D 208, node E 210, node F 212, node G 214, node H 216, node I 218, node J 220, and node K 222. In the computational graph, each node represents a function in the machine learning model, and the lines between the nodes represent the dependency between the functions. For example, the output of node A 202 is passed to node F 212, and the output of node B 214 is also passed to node F 212, so node F 212 depends on node A and node B 204. Figure 2 The computation graph is described only as an example. The number of nodes in the computation graph and the structure of the computation graph can be set to any appropriate form based on needs.

[0032] In the computation graph 200, node A 202, node B 204, node C 206, node D 208, and node E 210 have no directed edges pointing to them, so the in-degree of node A 202, node B 204, node C 206, node D 208, and node E 210 is 0. Node F 212 and node G 214 have two directed edges pointing to them respectively, so the in-degree of node F 212 and node G 214 is 2. Similarly, the in-degree of node H 216 is 2, the in-degree of node I 218 is 1, the in-degree of node J 220 is 2, and the in-degree of node K 222 is 1.

[0033] above Figure 2 FIG. 2 is a schematic diagram of a calculation graph 200 according to an embodiment of the present disclosure. Figure 2 To describe Figure 3 Method 300 for processing a machine learning model.

[0034] At box 302, the manager obtains an intermediate representation of a machine learning model written in a source language, wherein the intermediate representation of the machine learning model is independent of the source language and the target language and includes structured text.

[0035] In some embodiments, the intermediate representation of the machine learning model can be obtained by compiling the machine learning model written in the source language by the compiler. Compilation is the process of converting source code / original code written in a programming language into machine code or native code of the target architecture. The intermediate representation 102 is a data structure or code used internally by the compiler or virtual machine to represent the source code, and is independent of the source language and the target language.

[0036] In some embodiments, the intermediate representation of the machine learning model can be obtained by other means, for example, a programmer writes the machine learning model written in the source language into the intermediate representation of the machine learning model according to the compilation rules of the compiler. The above examples are only used to describe the present disclosure, but not to specifically limit the present disclosure. The intermediate representation of the machine learning model written in the source language can be obtained in any suitable manner.

[0037] In some embodiments, the intermediate representation of the machine learning model can be described by structured text. For example, the intermediate representation can include an intermediate representation of the machine learning model described in JavaScript Object Notation (JSON) or Extensible Markup Language (XML) format.

[0038] At box 304, the manager generates a computation graph based on the intermediate representation of the machine learning model, where nodes in the computation graph represent functions related to the machine learning model, and directed edges in the computation graph represent dependencies between functions.

[0039] The intermediate representation of the machine learning model contains dependencies between the input and output of the functions. The manager can generate a computational graph based on the functional dependencies.

[0040] In some embodiments, the nodes in the computation graph represent functions in the machine learning model. The directed edges in the computation graph represent that the input of the function corresponding to the end point of the directed edge depends on the output of the function corresponding to the starting point of the directed edge. Alternatively or additionally, the computation graph is a directed acyclic graph.

[0041] At block 306, the manager divides the computation graph into multiple sequential parts, so that the multiple parts will be executed in sequence and the functions corresponding to the nodes in each part can be executed in parallel. The manager divides the generated computation graph into multiple groups of functions that need to be executed sequentially, and the functions in each group of functions are not dependent on each other and can be executed in parallel. The process of dividing the computation graph into multiple parts will be described below in conjunction with Figure 4 Describe in detail.

[0042] like Figure 2As shown, the computation graph 200 can be divided into multiple parts, wherein the first part is node A 202, node B 204, node C 206, node D 208 and node E 210, the second part is node F 212, node G 214, the third part is node H 216, the fourth part is node I 218, the fifth part is node J 220, and the sixth part is node K 222. The above multiple parts need to be executed sequentially because the input of the function in the latter part needs to depend on the output of the function in the previous part, and the functions in each part can be executed in parallel.

[0043] Through the above method, the processing of the machine learning model is performed at the function level rather than at the instruction level. This makes the processing of the machine learning model more efficient and more universal and feasible, and eliminates the need for communication between and within layers of the deep learning model, and eliminates the need to partition parameter tensors and error tensors, etc. In addition, the automatic partitioning method is more efficient in time and space, and can be partitioned before running the machine learning model, saving the training time of the machine learning model.

[0044] Combined with the above Figure 3 A flowchart of a method 300 for processing a machine learning model according to an embodiment of the present disclosure is described below. Figure 4 Detailed Description Figure 3 The process of partitioning the computation graph in block 306, wherein Figure 4 A method 400 for partitioning a computation graph into multiple parts is illustrated in FIG.

[0045] At block 402, the manager determines the in-degree of at least some of the nodes in the computation graph, wherein the in-degree of a node represents the number of directed edges pointing to the node. In the computation graph, each node has some directed edges, such as directed edges starting from the node or directed edges ending at the node. In order to partition the nodes, the computation graph is partitioned using the in-degree of the nodes, i.e., the nodes are partitioned by determining the number of directed edges ending at the node. In some embodiments, the computation graph is a directed acyclic graph.

[0046] like Figure 2 As shown, in the computation graph 200, node A 202, node B 204, node C 206, node D 208, and node E 210 have no directed edges pointing to them, so the in-degrees of node A 202, node B 204, node C 206, node D 208, and node E 210 are 0. Node F 212 and node G 214 are pointed to by two directed edges respectively, so the in-degrees of node F 212 and node G 214 are 2. Similarly, the in-degree of node H 216 is 1, the in-degree of node J 220 is 2, and the in-degree of node K 222 is 1.

[0047] At block 404, the manager selects a first portion of the computation graph, each node in the first portion having a predetermined threshold in-degree. In some embodiments, the threshold in-degree is zero. After determining the in-degree of each node in the computation graph, the manager may select nodes with the threshold in-degree from all nodes as the selected first portion of the computation graph.

[0048] like Figure 2 As shown, nodes with a threshold in-degree of 0 are selected from the computation graph as the first part. Therefore, node A 202, node B 204, node C 206, node D 208, and node E 210 are selected as the first part.

[0049] At block 406, the manager removes the directed edges associated with the nodes in the first portion and the first portion of the computation graph to update the computation graph. After selecting the first portion of nodes, the manager removes the nodes in the first portion of the computation graph and the directed edges associated with the nodes to form an updated computation graph and updates the in-degree of the nodes in order to select other ordered portions.

[0050] like Figure 2 As shown, when the manager partitions the computation graph, it selects nodes with an in-degree of 0 as the first group. Then the nodes with an in-degree of 0 are removed, that is, node A 202, node B 204, node C 206, node D 208, and node E 210 are removed. The manager also deletes directed edges related to the nodes in the first group to form an updated computation graph. In addition, the manager adjusts the in-degrees of the nodes in the updated computation graph.

[0051] At block 408, the manager determines whether the node is still included in the updated computation graph. If the node is not included in the updated computation graph, then at block 410, the manager determines that the partitioning of the computation graph is complete.

[0052] If the updated computation graph still includes nodes, the operation returns to block 404 to use the updated computation graph as the computation graph to be processed. The manager then selects nodes with an in-degree of 0 from the updated computation graph as the second group based on the in-degree of the nodes, for example Figure 2 Node F 212 and node G 214 in . Then, the above method is iterated until all nodes are divided.

[0053] Finally, the computation graph 200 can be divided into multiple parts, wherein the first part is node A 202, node B 204, node C 206, node D 208 and node E 210, the second part is node F 212, node G 214, the third part is node H 216, the fourth part is node I 218, the fifth part is node J 220, and the sixth part is node K 222. Since the input of the function in the latter part depends on the output of the function in the former part, the parts are executed sequentially. However, there is no dependency between the nodes in each part, so they can be executed in parallel.

[0054] Through the above method, the machine learning model is divided at the function level, making the processing of the machine learning model more efficient and more general. In addition, the division has low time complexity, does not require too much auxiliary data, and is more efficient in space.

[0055] Figure 5 Schematic block diagram of an example device 500 that can be used to implement embodiments of the present disclosure. Figure 1 The manager in the apparatus 500 can be implemented by the apparatus 500. As shown in the figure, the apparatus 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 502 or computer program instructions loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the apparatus 500 can also be stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0056] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0057] The various processes and processing described above, such as methods 300 and 400, may be performed by the processing unit 501. For example, in some embodiments, the methods 300 and 400 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the CPU 501, one or more actions of the methods 300 and 400 described above may be performed.

[0058] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0059] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0060] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0061] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0062] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0063] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0064] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0065] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0066] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for processing a machine learning model, the method comprising: Obtaining an intermediate representation of a machine learning model written in a source language, wherein the intermediate representation is independent of the source language and the target language and includes structured text; Generate a computational graph based on the intermediate representation, wherein nodes in the computational graph represent functions related to the machine learning model, and directed edges in the computational graph represent dependencies between the functions; as well as Divide the computation graph into a plurality of sequential parts, so that the plurality of parts will be executed in the order and the functions corresponding to the nodes in each part can be executed in parallel; The step of dividing the computation graph into a plurality of ordered parts includes: Determine an in-degree of each node in at least a first portion of a plurality of nodes in the computation graph, wherein the in-degree of a node represents the number of directed edges pointing to the node; Wherein each node in the first part has a predetermined threshold in-degree.

2. The method according to claim 1, wherein dividing the computation graph into the plurality of parts further comprises: The computation graph is partitioned into the plurality of portions in order based on the in-degree for each node in the at least a first portion of the nodes.

3. The method of claim 2, wherein partitioning the computation graph into the plurality of ordered portions based on the in-degree comprises iteratively performing the following actions: The directed edges in the computation graph related to the nodes in the first part and the first part are removed to update the computation graph. The method of claim 3 , wherein the predetermined threshold in-degree is zero.

5. An electronic device for processing a machine learning model, the electronic device comprising: processor; as well as A memory storing computer program instructions, wherein the processor runs the computer program instructions in the memory to control the electronic device to perform actions, wherein the actions include: Obtaining an intermediate representation of a machine learning model written in a source language, wherein the intermediate representation is independent of the source language and the target language and includes structured text; generating a computation graph based on the intermediate representation, wherein nodes in the computation graph represent functions related to the machine learning model, and directed edges in the computation graph represent dependencies between the functions; and Divide the computation graph into a plurality of sequential parts, so that the plurality of parts will be executed in the order and the functions corresponding to the nodes in each part can be executed in parallel; The step of dividing the computation graph into a plurality of ordered parts includes: Determine an in-degree of each node in at least a first portion of a plurality of nodes in the computation graph, wherein the in-degree of a node represents the number of directed edges pointing to the node; Wherein each node in the first part has a predetermined threshold in-degree.

6. The electronic device according to claim 5, wherein dividing the computation graph into the plurality of parts further comprises: The computation graph is partitioned into the plurality of portions in order based on the in-degree for each node in the at least a first portion of the nodes.

7. The electronic device of claim 6, wherein partitioning the computation graph into the plurality of ordered parts based on the in-degree comprises iteratively performing the following actions: The directed edges in the computation graph related to the nodes in the first part and the first part are removed to update the computation graph. The electronic device of claim 7 , wherein the predetermined threshold in-degree is zero.

9. A computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions which, when executed, cause a machine to perform actions comprising: Obtaining an intermediate representation of a machine learning model written in a source language, wherein the intermediate representation is independent of the source language and the target language and includes structured text; Generate a computational graph based on the intermediate representation, wherein nodes in the computational graph represent functions related to the machine learning model, and directed edges in the computational graph represent dependencies between the functions; as well as Divide the computation graph into a plurality of sequential parts, so that the plurality of parts will be executed in the order and the functions corresponding to the nodes in each part can be executed in parallel; The step of dividing the computation graph into a plurality of ordered parts includes: Determine an in-degree of each node in at least a first portion of a plurality of nodes in the computation graph, wherein the in-degree of a node represents the number of directed edges pointing to the node; Wherein each node in the first part has a predetermined threshold in-degree.

10. The computer program product of claim 9, wherein dividing the computation graph into the plurality of portions further comprises: The computation graph is partitioned into the plurality of portions in order based on the in-degree for each node in the at least a first portion of the nodes.

11. The computer program product of claim 10, wherein partitioning the computation graph into the plurality of ordered portions based on the in-degree comprises iteratively performing the following actions: The directed edges in the computation graph related to the nodes in the first part and the first part are removed to update the computation graph.

12. The computer program product of claim 11, wherein the predetermined threshold in-degree is zero.

Citation Information

Patent Citations

  • Systems and Methods for Generating A Dense Graph

    US20140118355A1

  • Systems and methods for automatically generating code for deep learning systems

    US20180136912A1

  • System and method of connection information regularization, graph feature extraction and graph classification based on adjacency matrix

    US20200134362A1