Ahead-of-time scheduling method and apparatus for dynamic computation graph, and electronic device and medium

By constructing a deployment graph and using predictive analysis nodes to schedule the computing resources of the dynamic computing graph in advance, it solves the problem of low resource scheduling efficiency in the dynamic computing graph, achieves fast response and efficient scheduling, and is suitable for a wide range of application scenarios.

WO2024212763A1PCT designated stage expired Publication Date: 2024-10-17LYNXI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/082236
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-11
Filing Date
2024-03-18
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

The resource scheduling efficiency of dynamic calculation graphs in the existing technology is low, and it is impossible to realize early scheduling of resources, which affects the scheduling rate.

Method used

By determining the deployment information based on the dynamic calculation graph and the target training data set, constructing the deployment graph and mapping it to the processor, scheduling the computing resources of the dynamic nodes in advance, using the predictive analysis node to predict the next computing node, simplifying the calculation graph and reducing the number of nodes. , suitable for rapidly changing dynamic calculation graphs.

Benefits of technology

It realizes early response of resource scheduling, saves a lot of response time, improves the scheduling rate, is suitable for dynamic and static graph resource scheduling, and has a wide range of applications and universal applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024082236_17102024_PF_FP_ABST
    Figure CN2024082236_17102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to an ahead-of-time scheduling method and apparatus for a dynamic computation graph, and an electronic device and a medium. The method comprises: on the basis of a dynamic computation graph and a target training data set corresponding to the dynamic computation graph, determining deployment information for the dynamic computation graph; and performing ahead-of-time scheduling on computing resources of dynamic nodes in the dynamic computation graph according to the deployment information.
Need to check novelty before this filing date? Find Prior Art

Description

Method and device for advance scheduling of dynamic computation graphs, electronic equipment, and medium Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method and apparatus, an electronic device, and a computer-readable storage medium for advance scheduling of dynamic computation graphs. Background Art

[0002] The computational graph model is widely used to describe neural network algorithms. It consists of computational nodes and edges that represent data dependencies between nodes. It includes static graphs and dynamic computational graphs. Dynamic computational graphs are computational graphs that contain control or random execution processes, and the execution process changes according to specific inputs.

[0003] Summary of the Invention

[0004] The embodiments of the present application provide a method and apparatus, an electronic device, and a computer-readable storage medium for advance scheduling of dynamic computation graphs, which can achieve early response to resource scheduling, save a lot of response time, and thus improve the scheduling rate; and are suitable for dynamic computation graph and static graph resource scheduling, and have a wide range of applications and universality.

[0005] In a first aspect, an embodiment of the present application provides a method for pre-scheduling a dynamic computation graph, comprising: determining the deployment information of the dynamic computation graph based on the dynamic computation graph and a target training data set corresponding to the dynamic computation graph; and scheduling the computing resources of the dynamic nodes in the dynamic computation graph in advance according to the deployment information.

[0006] In some embodiments, a method for pre-scheduling a dynamic computation graph includes: constructing a deployment graph based on a target training data set corresponding to the dynamic computation graph and the execution path corresponding to each sample in the target training data set in the dynamic computation graph; the deployment graph includes multiple deployment nodes, and the deployment nodes store the execution probabilities of dynamic nodes corresponding to the deployment nodes; mapping the deployment graph and the dynamic computation graph to a processor; and pre-scheduling the computing resources of the dynamic nodes in the dynamic computation graph based on the mapped deployment graph and the dynamic computation graph.

[0007] In some embodiments, a method for pre-scheduling a dynamic computation graph includes: constructing a deployment graph and a prediction analysis node based on the dynamic computation graph and the contents of each sample in the target training data set corresponding to the dynamic computation graph, the deployment graph including multiple deployment nodes, the prediction analysis node being arranged before the control node in front of the dynamic node corresponding to the deployment node in the dynamic computation graph, the prediction analysis node being used to predict the next execution node in the dynamic computation graph; mapping the deployment graph, the dynamic computation graph and the prediction analysis node to a processor; and pre-scheduling the computing resources of the dynamic node in the dynamic computation graph based on the mapped deployment graph, the dynamic computation graph and the prediction analysis node.

[0008] In the second aspect, an embodiment of the present application provides a device for advance scheduling of a dynamic computation graph, comprising: a determination module for determining the deployment information of the dynamic computation graph based on the dynamic computation graph and a target training data set corresponding to the dynamic computation graph; and a scheduling module for scheduling the computing resources of the dynamic nodes in the dynamic computation graph in advance according to the deployment information.

[0009] In some embodiments, a device for pre-scheduling a dynamic computation graph includes: a first processing module for constructing the deployment graph based on a target training data set corresponding to the dynamic computation graph and an execution path corresponding to each sample in the target training data set in the dynamic computation graph; the deployment graph includes a plurality of deployment nodes, and the deployment nodes store the execution probabilities of dynamic nodes corresponding to the deployment nodes; a second processing module for mapping the deployment graph and the dynamic computation graph to a processor; and a third processing module for pre-scheduling the computing resources of the dynamic nodes in the dynamic computation graph based on the mapped deployment graph and the dynamic computation graph.

[0010] In some embodiments, the device for pre-scheduling a dynamic computation graph includes: a fourth processing module for constructing the deployment graph and the prediction analysis node based on the dynamic computation graph and the contents of each sample in the target training data set corresponding to the dynamic computation graph, the deployment graph including multiple deployment nodes, the prediction analysis node being arranged before the control node in front of the dynamic node corresponding to the deployment node in the dynamic computation graph, the prediction analysis node being used to predict the next execution node in the dynamic computation graph; a fifth processing module for mapping the deployment graph, the dynamic computation graph and the prediction analysis node to a processor; and a sixth processing module for pre-scheduling the computing resources of the dynamic node in the dynamic computation graph based on the mapped deployment graph, the dynamic computation graph and the prediction analysis node.

[0011] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any one of the methods for advance scheduling of dynamic computation graphs in the embodiments of the present application.

[0012] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any one of the methods for advance scheduling of dynamic computation graphs in the embodiments of the present application.

[0013] In an embodiment of the present application, corresponding deployment information is determined based on the dynamic computation graph and its target training data set, and the deployment information is used to schedule computing resources in advance during subsequent scheduling applications, thereby enabling early response of resource scheduling, saving a lot of response time, and improving the scheduling rate.

[0014] In some embodiments, the execution probability of each computing node in the dynamic computing graph can be determined through the target training data set, and a deployment graph can be constructed based on the execution probability. In the subsequent scheduling application process, the computing resources required for the next computing node can be scheduled in advance based on the deployment graph, which can achieve early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate.

[0015] Furthermore, by mapping the deployment node and the dynamic node corresponding to the deployment node to the same computing unit in the many-core architecture, the scheduling logic of each dynamic computing graph node can be executed within the core, that is, one core is responsible for scheduling its own computing tasks without the participation of other cores, effectively reducing the complexity of interaction between cores, thereby improving computing efficiency and ensuring computing stability.

[0016] Furthermore, by mapping the deployment node and the monitored node corresponding to the deployment node to the same computing unit in the many-core architecture, the transmission of the monitored node status between computing units can be reduced, the transmission efficiency can be improved, and thus the computing efficiency can be improved.

[0017] Furthermore, by determining the target number of dynamic nodes to be scheduled in advance through target bandwidth information, resource scheduling can be made to meet bandwidth requirements, thereby further solving the bandwidth problem.

[0018] In some embodiments, a prediction analysis node can also be obtained by training the content of the target training data set, and the pre-trained prediction analysis node can be deployed on the control node corresponding to the computing node, so that in the subsequent scheduling application process, the computing resources required for the next computing node can be scheduled in advance based on the deployment diagram, which can achieve early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate.

[0019] Furthermore, by selecting part of the data to train the prediction and analysis nodes, the amount of training data can be reduced, thereby improving training efficiency. In addition, in subsequent scheduling operations, only a small amount of input data is needed to accurately predict the computing node for the next jump, thereby increasing the prediction rate and reducing computing time, thereby further improving scheduling efficiency.

[0020] Furthermore, by jointly training the prediction analysis node with the actual execution path of the target training dataset in the dynamic computation graph and the specific content of the target training dataset, the precision and accuracy of the output results of the prediction analysis node can be further improved, the prediction effect can be improved, and the accuracy of subsequent scheduling can be improved.

[0021] Furthermore, by deploying the prediction and analysis nodes in dynamic nodes, the calculation graph can be simplified, the number of calculation graph branches and nodes can be reduced, thereby improving computing efficiency and scheduling stability.

[0022] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present application. Other features and aspects of the present application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] FIG1 is a flowchart of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0024] FIG2 is a schematic diagram showing the principles of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0025] FIG3 is a schematic diagram showing the principles of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0026] FIG4 is a flow chart of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0027] FIG5 is a schematic diagram showing the principles of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0028] FIG6 is a schematic diagram showing the principles of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0029] FIG7 is a schematic diagram showing the principles of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0030] FIG8 is a schematic diagram showing the principles of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0031] FIG9 is a flow chart of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0032] FIG10 is a block diagram of a device for advance scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0033] FIG11 is a block diagram of a device for advance scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0034] FIG12 is a block diagram of a device for advance scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0035] FIG13 is a block diagram of an electronic device provided in an embodiment of the present application.

[0036] FIG14 is a block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the present application and are not intended to limit the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the present application, not all of the structures.

[0038] Related technologies mainly focus on the deployment of static graphs. However, for the deployment of dynamic computational graphs, there are still problems such as low scheduling efficiency, poor deployment effects, and deployment difficulties.

[0039] In view of this, the embodiments of the present application provide a method and device, electronic device, and computer-readable storage medium for advance scheduling of dynamic computation graphs, which can achieve early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate; and are suitable for dynamic computation graph and static graph resource scheduling, and have a wide range of applications and universality.

[0040] In a first aspect, an embodiment of the present application provides a method for advance scheduling of dynamic computation graphs.

[0041] The method for pre-scheduling a dynamic computation graph according to an embodiment of the present application can be performed by a corresponding device, which can be implemented in software and / or hardware and generally integrated into an electronic device. For example, the method for pre-scheduling a dynamic computation graph can be applied to a terminal, specifically executed by hardware or software in the terminal.

[0042] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but a desktop computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0043] In the following embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse, and a joystick.

[0044] The method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the method for advance scheduling of dynamic computation graphs. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application is described below using an electronic device as an example of an execution subject.

[0045] Figure 1 is a flow chart of a method for early scheduling of a dynamic computation graph provided by an embodiment of the present application. Referring to Figure 1 , the method for early scheduling of a dynamic computation graph provided by an embodiment of the present application may include the following steps.

[0046] In step S11, based on the dynamic computation graph and the target training data set corresponding to the dynamic computation graph, the deployment information of the dynamic computation graph is determined;

[0047] In step S12, computing resources of dynamic nodes in the dynamic computing graph are scheduled in advance according to the deployment information.

[0048] In some optional implementations, the target training dataset is a training set for training a target neural network. The target neural network can be represented as a dynamic computation graph, i.e., the target training dataset is a training set for training a dynamic computation graph.

[0049] The data in the target training dataset can be changing data or pre-determined data.

[0050] It is understandable that different target neural networks or dynamic computation graphs may correspond to different target training data sets.

[0051] The dynamic computation graph is the graph structure corresponding to the target neural network.

[0052] The dynamic computation graph includes multiple dynamic nodes, each of which corresponds to a network node of the target neural network. For example, each dynamic node is a computation node for performing a corresponding computation operation.

[0053] In some optional implementations, the deployment information is information for deploying a dynamic computation graph.

[0054] In some optional implementations, the deployment information may include a deployment diagram. A deployment diagram is essentially a graphical representation of the deployment information, which can more intuitively and conveniently reflect the deployment status of the dynamic computation graph.

[0055] In some optional implementations, the deployment information includes a deployment graph; accordingly, based on the dynamic computation graph and the target training data set corresponding to the dynamic computation graph, the deployment information of the dynamic computation graph is determined, including: constructing a deployment graph based on the target training data set corresponding to the dynamic computation graph and the execution path corresponding to each sample in the target training data set in the dynamic computation graph; the deployment graph includes multiple deployment nodes, and the deployment nodes store the execution probabilities of the dynamic nodes corresponding to the deployment nodes.

[0056] In some optional implementations, the deployment information may include a deployment diagram and a prediction analysis node; accordingly, based on the dynamic computation graph and the target training data set corresponding to the dynamic computation graph, the deployment information of the dynamic computation graph is determined, including: based on the dynamic computation graph and the content of each sample in the target training data set corresponding to the dynamic computation graph, constructing a deployment diagram and a prediction analysis node; the deployment diagram includes multiple deployment nodes, the prediction analysis node is set before the control node before the dynamic node corresponding to the deployment node in the dynamic computation graph, and the prediction analysis node is used to predict the next execution node in the dynamic computation graph.

[0057] The following describes the construction process of the deployment diagram and prediction analysis node.

[0058] In some optional implementations, the process of constructing a deployment graph includes: constructing a deployment node corresponding to each dynamic node in the dynamic computation graph; wherein the deployment node is used to monitor a monitored node in the dynamic computation graph, and the monitored node is at least one dynamic node in the dynamic computation graph that precedes the dynamic node corresponding to the deployment node.

[0059] In other words, a deployment graph includes multiple deployment nodes. After the deployment nodes are determined, the corresponding deployment graph is formed. A deployment node corresponding to each dynamic node in the dynamic computation graph can be set, and the deployment node can monitor one or more dynamic nodes (i.e., monitored nodes) in the dynamic computation graph. These one or more dynamic nodes are dynamic nodes preceding the dynamic node corresponding to the deployment node.

[0060] In some optional implementations, when the execution probability of the dynamic node corresponding to the deployment node is stored in the deployment node, after constructing the deployment node corresponding to the dynamic node based on each dynamic node in the dynamic computation graph, the method may further include: determining the execution probability of the dynamic node corresponding to each deployment node based on the execution path of each sample; and determining the deployment graph based on the deployment node and the execution probability of the dynamic node corresponding to the deployment node.

[0061] As can be seen from this, in some optional implementations, the execution probability of the corresponding dynamic node can be stored in the deployment node. Based on this, after constructing the deployment node, it is also necessary to determine the execution probability of the corresponding dynamic node and store the execution probability in the deployment node to obtain the corresponding deployment diagram. Among them, the execution probability of the dynamic node can be determined based on the execution path of each sample in the target training set. For example, after determining the execution path of each sample, the frequency of "passing through" certain dynamic nodes in multiple execution paths can be determined, thereby determining the execution probability of the corresponding dynamic node.

[0062] In some optional implementations, the execution probability of the dynamic node corresponding to each deployment node is determined based on the execution path of each sample, including: when the sample is forward propagated once in the dynamic computation graph, the deployment graph records the number of times the current dynamic node is executed; the number of times each dynamic node is executed is converted into the conditional probability of the execution of the dynamic node corresponding to the deployment node when the monitored node monitored by the deployment node is executed, and the execution probability of the dynamic node corresponding to each deployment node is determined based on the conditional probability.

[0063] FIG2 and FIG3 exemplarily illustrate a deployment diagram and a dynamic computation diagram, respectively.

[0064] Figure 2 is a schematic diagram illustrating the principles of a method for pre-scheduling a dynamic computation graph, as provided in an embodiment of the present application. As shown in Figure 2 , circles within the dynamic computation graph represent computation nodes, and triangles within the dynamic computation graph represent control nodes. Control nodes are used to control and determine the next node in the dynamic computation graph to be executed.

[0065] Through each node and the edges between nodes, the execution path of an input data in the dynamic computation graph can be completed.

[0066] The deployment diagram includes multiple deployment nodes. Continuing with FIG2 , the circles in the deployment diagram represent deployment nodes.

[0067] Deployment nodes are used to monitor and control dynamic nodes.

[0068] The computing node monitored by the deployment node is the monitored node corresponding to the deployment node.

[0069] The execution probability is the probability that a certain input data is executed by a certain computing node.

[0070] During the actual execution process, the execution paths of different samples in the dynamic computation graph are the same or different, and the computation nodes to which they jump may also be the same or different. In this application, the execution probability corresponding to each computation node can be determined based on the actual execution path of each sample in the target training data set in the dynamic computation graph, and then the execution probability can be stored in the corresponding deployment node to generate a deployment graph.

[0071] In some embodiments, step S11 may include:

[0072] Based on each dynamic node in the dynamic computation graph, a deployment node corresponding to the dynamic node is constructed; wherein the deployment node is used to monitor the monitored node in the dynamic computation graph, and the monitored node is at least one dynamic node in the dynamic computation graph that precedes the dynamic node corresponding to the deployment node;

[0073] Based on the execution path of each sample, determine the execution probability of the dynamic node corresponding to each deployment node;

[0074] A deployment graph is determined based on the deployment nodes and the execution probabilities of the dynamic nodes corresponding to the deployment nodes.

[0075] In this embodiment, the multiple deployment nodes correspond one-to-one to the multiple computing nodes.

[0076] In some embodiments, the deployment node is used to monitor the nodes in the previous layer of the corresponding computing node, as shown in FIG2 .

[0077] In this embodiment, the deployment graph corresponding to the deployment node is a first-order deployment graph.

[0078] In some embodiments, the deployment node is used to monitor the nodes of the first multiple layers of the computing node corresponding to it, as shown in Figure 3. Figure 3 is a schematic diagram of the principle of the method for advance scheduling of the dynamic computing graph provided by an embodiment of the present application. As shown in Figure 3, the circle in the dynamic computing graph represents the computing node, and the triangle in the dynamic computing graph represents the control node, and the control node is used to control and determine the next node to be executed in the dynamic computing graph. In the embodiment shown in Figure 3, the deployment graph corresponding to the deployment node is a multi-stage deployment graph, in which the deployment node can monitor the first multiple layers of nodes of the computing node corresponding to it.

[0079] In some embodiments, the deployment node is used to monitor all or part of the nodes in the previous layer of the computing node corresponding to it; or, the deployment node is used to monitor the nodes in some layers in the previous multiple layers of the computing node corresponding to it, and the nodes in the monitored layer can be some or all of the nodes in that layer.

[0080] For each sample, the sample data is propagated once in the dynamic computation graph to obtain the execution path of each sample in the dynamic computation graph. Then, the execution paths corresponding to all samples in the target training data set are counted, and the execution probability of each computing node jumping to the next computing node is determined. The execution probability is stored in the deployment node corresponding to the computing node, and the corresponding deployment graph can be generated.

[0081] In some embodiments, determining the execution probability of the dynamic node corresponding to each deployment node based on the execution path of each sample may include:

[0082] When the sample propagates forward once in the dynamic computation graph, the deployment graph records the number of times the current dynamic node is executed;

[0083] The number of executions of each dynamic node is converted into a conditional probability of execution of the dynamic node corresponding to the deployment node when the monitored node monitored by the deployment node is executed, and the execution probability of the dynamic node corresponding to each deployment node is determined based on the conditional probability.

[0084] In this embodiment, each sample in the target training dataset may be propagated once in the dynamic computation graph.

[0085] FIG4 is a flow chart of a method for pre-scheduling a dynamic computation graph according to an embodiment of the present application. Referring to FIG4 , the method for pre-scheduling a dynamic computation graph according to an embodiment of the present application may include the following steps:

[0086] Step S401: Obtain a target training data set corresponding to the dynamic computation graph.

[0087] Step S402: Initialize the deployment graph corresponding to the dynamic computation graph.

[0088] Step S403: Build a connection between the deployment graph and the dynamic computation graph.

[0089] Step S404: For each sample in the target training data set, forward propagation is performed once in the dynamic computation graph, and the deployment graph records the number of times the dynamic node corresponding to the deployment graph is executed after the monitored node corresponding to the deployment graph is executed.

[0090] Step S405: The deployment diagram converts the number of executions of each dynamic node into an execution probability.

[0091] As shown in Figure 4, during the actual execution process, the target training dataset corresponding to the dynamic computation graph is first obtained to initialize the deployment graph corresponding to the dynamic computation graph.

[0092] For each sample in the target training dataset, when the sample is forward propagated once in the dynamic computation graph, the number of times the computation node is executed after the monitored node is executed is recorded through the deployment graph.

[0093] The number statistics may be determined based on the joint execution status of the monitored nodes.

[0094] That is, for the current computing node S, monitored node N1, and monitored node N2, the following times can be recorded:

[0095] The number of times N1 is executed and S is executed is represented by (C(S|N1);

[0096] The number of times N2 is executed and S is executed is represented by C(S|N2);

[0097] The number of times N1 and N2 are both executed and S is executed is represented by C(S|N1,N2).

[0098] In some embodiments, the number of times can be converted into a probability based on the following formula: P(S|N1),P(S|N2),P(S|N1,N2)=convert(C(S|N1),C(S|N2),C(S|N1,N2))

[0099] Where P(·) represents the predicted execution probability, P(S|N1) is the probability that N1 is executed and S is executed; P(S|N2) is the probability that N2 is executed and S is executed; P(S|N1,N2) is the probability that both N1 and N2 are executed and S is executed; C(S|N1) is the number of times N1 is executed and S is executed; C(S|N2) is the number of times N2 is executed and S is executed; C(S|N1,N2) is the number of times N1 and N2 are executed and S is executed; convert is a conversion function used to convert the number of executions into the corresponding execution probability.

[0100] Based on the above formula, the execution probability of each dynamic node can be obtained, and the execution probability is stored in the deployment node corresponding to the dynamic node.

[0101] FIG5 is a schematic diagram showing the principles of a method for early scheduling of dynamic computation graphs provided in an embodiment of the present application.

[0102] As shown in FIG5 , the hollow circles in the dynamic computation graph represent computation nodes, and the triangles in the dynamic computation graph represent control nodes. The control nodes are used to control and determine the next computation node in the dynamic computation graph to be jumped to.

[0103] It should be noted that in the actual calculation process, through each node and the edges between nodes, a complete jump calculation of input data in the dynamic calculation graph can be completed, that is, the corresponding execution path can be generated.

[0104] The deployment diagram includes multiple deployment nodes, as shown in FIG5 , where the hollow circles in the deployment diagram represent deployment nodes.

[0105] Deployment nodes are used to monitor and control dynamic nodes in a dynamic computation graph.

[0106] The computing node monitored by the deployment node is the monitored node corresponding to the deployment node.

[0107] It is understandable that, depending on the content of the samples, the corresponding next-hop computing nodes in the dynamic computation graph may be the same or different.

[0108] The prediction analysis node is used to predict the next computing node corresponding to the content based on the input content, and output the predicted next computing node.

[0109] In some embodiments, the prediction analysis node can be a linear regression node, a random forest node, a neural network node, etc., which is not limited in this application.

[0110] In some embodiments, the prediction and analysis node may be a pre-trained node deployed before the control node corresponding to the dynamic node.

[0111] As shown in Figure 5, the solid circle is the prediction analysis node.

[0112] During the actual execution process, the prediction analysis node can be trained based on the target training data set, so that the prediction analysis node can determine the next calculation node to which the sample under the content will jump after completing the current node calculation based on the specific content of each sample in the target training data set.

[0113] In some embodiments, step S11 may include:

[0114] Based on each dynamic node in the dynamic computation graph, a deployment node corresponding to the dynamic node is constructed;

[0115] The input data before the control node in the target training data set is used as a sample, and the next execution node of the sample corresponding to the input data before the control node is used as the sample label to train the prediction analysis node corresponding to the control node;

[0116] Set the prediction analysis node corresponding to the control node before the control node.

[0117] In this embodiment, multiple deployment nodes correspond one-to-one to multiple computing nodes. In some embodiments, a deployment node can also be used to monitor nodes in the previous layer of the corresponding computing node, or the deployment node can also be used to monitor nodes in the previous layers of the corresponding computing node. See Figures 2 and 3 for details, which will not be further described here.

[0118] During the actual training process, the sample data in the target training data set can be used to generate a series of labels of <data before the control node, whether the corresponding node is executed>, which can be used to train the predictive analysis nodes, such as BP training of neural networks, etc. This application does not limit this.

[0119] The data before the control node in <data before the control node, whether the corresponding node is executed> is the sample, and whether the corresponding node is executed is the sample label.

[0120] After obtaining the trained prediction analysis node, the prediction analysis node is deployed before the control node corresponding to the dynamic node in the dynamic calculation graph.

[0121] According to the method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application, by combining the characteristics of neural networks, the next jump node corresponding to each computing node is predicted based on the content of the target training data set, so that the predicted computing nodes can change accordingly based on the changes in the target training data set, thereby being suitable for rapidly changing dynamic computation graphs, having a wide range of applications and universality, and the prediction results are highly accurate.

[0122] In some embodiments, using input data before a control node in a target training data set as a sample and the next execution node of the sample corresponding to the input data before the control node as a sample label, training to obtain a prediction analysis node corresponding to the control node may include:

[0123] Extract part of the data from each sample of the target training data set;

[0124] The input data before the control node in some data is used as a sample, and the next execution node of the sample corresponding to the input data before the control node is used as the sample label, and the prediction analysis node corresponding to the control node is obtained through training.

[0125] In this embodiment, when the data volume of each sample in the target training data set is large, part of the data can be extracted from each original sample in the target training data set as a new sample to train the training samples of the prediction analysis node based on the new sample.

[0126] By extracting part of the data from each original sample for training the predictive analysis node, the amount of data can be reduced to increase the training rate.

[0127] According to the method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application, by selecting part of the data to train the prediction and analysis nodes, the amount of training data can be reduced, thereby improving training efficiency; in addition, in subsequent scheduling operations, only a small amount of input data is required to accurately predict the computing node for the next jump, thereby increasing the prediction rate and reducing the computing time consumption, so as to further improve scheduling efficiency.

[0128] In some embodiments, using input data before a control node in a target training data set as a sample and the next execution node of the sample corresponding to the input data before the control node as a sample label, training to obtain a prediction analysis node corresponding to the control node may include:

[0129] Based on the execution path corresponding to each sample in the dynamic computation graph, determine the execution probability corresponding to each dynamic node in the dynamic computation graph;

[0130] Based on the execution probability and the input data before the control node, the prediction analysis node corresponding to the control node is trained.

[0131] In this embodiment, the execution probability is the probability that a certain input data is executed by a certain computing node.

[0132] During the actual execution process, different samples have different execution paths in the dynamic computation graph, and the computation nodes they jump to may also be different.

[0133] In this embodiment, the execution probability corresponding to each computing node can be determined based on the actual execution path of each sample in the target training data set in the dynamic calculation graph, and then the execution probability and the specific content of each sample in the target training data set are combined to train the prediction analysis node, thereby improving the prediction accuracy and precision of the prediction analysis node.

[0134] According to the method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application, by jointly training the prediction analysis node through the actual execution path of the target training data set in the dynamic computation graph and the specific content of the target training data set, the precision and accuracy of the output results of the prediction analysis node can be further improved, the prediction effect can be improved, and the accuracy of subsequent scheduling can be improved.

[0135] Furthermore, in some embodiments, there is no connection channel between the multiple deployment nodes.

[0136] In some embodiments, a connection channel exists between a first target node and a second target node among the plurality of deployment nodes, and the connection channel is used to send and receive target information.

[0137] There can be one or more first target nodes and one or more second target nodes respectively.

[0138] In this embodiment, the first target node and the second target node may be any node among a plurality of deployment nodes, and the first target node and the second target node are different.

[0139] The target information may include, but is not limited to: the execution status of the monitored node and the execution probability of the dynamic node corresponding to the deployment node.

[0140] In some embodiments, the connection channel between the first target node and the second target node in the plurality of deployment nodes may be the same as the connection channel between the dynamic node corresponding to the first target node and the dynamic node corresponding to the second target node; or may be different.

[0141] The connection channel is used to transmit target information.

[0142] For example, the first target node sends the execution status of the corresponding monitored node to the second target node through the connection channel, or sends the currently determined execution probability to the second target node.

[0143] In some embodiments, when a connection exists between a first target node and a second target node, the first target node may receive execution status information and execution probability information sent by the second target node, and the first target node may use the received execution status information and execution probability information as reference data to determine whether the corresponding dynamic node is executed. For example, the first target node may perform a weighted calculation based on the corresponding execution probabilities and execution status information in the deployment diagram according to different weights to obtain a final probability value for the execution of the dynamic node.

[0144] In this method, based on obtaining the execution probability using training data, the first target node can combine the execution status information of other nodes (such as the second target node) to more accurately determine the execution probability of the corresponding dynamic node.

[0145] In some optional implementations, after determining the deployment information for the dynamic graph, computing resources for dynamic nodes in the dynamic computation graph can be pre-scheduled based on the deployment information. This pre-scheduled resource approach enables early resource scheduling, saving significant response time and improving scheduling rates.

[0146] In some optional implementations, the deployment information includes a deployment graph; accordingly, based on the deployment information, the computing resources of the dynamic nodes in the dynamic computing graph are scheduled in advance, including: mapping the deployment graph and the dynamic computing graph to the processor; based on the mapped deployment graph and the dynamic computing graph, the computing resources of the dynamic nodes in the dynamic computing graph are scheduled in advance.

[0147] From this, we can see that the deployment graph and dynamic computation graph can be mapped to the processor and the advance scheduling of computing resources can be performed.

[0148] In some optional implementations, the deployment information includes a deployment graph and a prediction analysis node; accordingly, based on the deployment information, the computing resources of the dynamic nodes in the dynamic computing graph are scheduled in advance, including: mapping the deployment graph, the dynamic computing graph and the prediction analysis node to the processor; based on the mapped deployment graph, the dynamic computing graph and the prediction analysis node, the computing resources of the dynamic nodes in the dynamic computing graph are scheduled in advance.

[0149] In some optional implementations, the deployment graph, the dynamic computation graph, and the predictive analysis node are mapped to the processor, including: deploying the predictive analysis node in a dynamic node located before the control node in the dynamic computation graph, updating the dynamic computation graph, and obtaining an updated dynamic computation graph; and mapping the deployment graph and the dynamic computation graph to the processor.

[0150] In other words, the prediction analysis node can be deployed in a dynamic node located before the control node in the dynamic calculation graph, the dynamic calculation graph can be updated, and the updated dynamic calculation graph and the deployment graph can be mapped to the processor.

[0151] In some optional implementations, the prediction analysis node and the original dynamic computation graph node may be merged into one node to obtain an updated dynamic computation graph.

[0152] For example, during the actual execution process, an output information can be added to each layer of the original target neural network, corresponding to the prediction analysis node, to represent the scheduling prediction of a subsequent node, as shown in Figure 6.

[0153] Figure 6 is a schematic diagram of the principle of the method for pre-scheduling a dynamic computation graph provided by an embodiment of the present application. In Figure 6, the prediction analysis node and the original dynamic graph node are merged into one node (corresponding to the node filled with half black and half white in the figure). The prediction analysis node is equivalent to adding an output information to each layer of the original target neural network, which is used to make scheduling predictions for a subsequent node.

[0154] The updated dynamic computation graph and deployment graph are then mapped to the processor.

[0155] According to the method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application, by deploying prediction and analysis nodes in dynamic nodes, the computation graph can be simplified, the number of computation graph branches and nodes can be reduced, thereby improving computational efficiency and scheduling stability.

[0156] The following describes the mapping method between the deployment graph and the dynamic computation graph.

[0157] In some optional implementations, the deployment graph and the dynamic computation graph are mapped to the processor based on at least one of the following mapping methods, the processor including a many-core architecture, and the mapping methods include:

[0158] Same mapping, including mapping the deployment node and the dynamic node corresponding to the deployment node to the same computing unit in the many-core architecture;

[0159] Pre-mapping, including mapping the deployment node and the monitored node corresponding to the deployment node to the same computing unit in the many-core architecture;

[0160] Central mapping, including uniformly mapping all deployment nodes of the deployment graph to at least one computing unit in the many-core architecture;

[0161] Random mapping, including randomly mapping deployment nodes and dynamic nodes to the many-core architecture.

[0162] The following is an explanation of the process of advance scheduling in the embodiment of the present application.

[0163] In some optional implementations, step S12 includes mapping the deployment graph and the dynamic computation graph to a processor; and pre-scheduling computing resources for dynamic nodes in the dynamic computation graph based on the mapped deployment graph and the dynamic computation graph. The processor may include a CPU, a many-core architecture, or other processors, which are not limited herein.

[0164] The following uses the many-core architecture as an example to illustrate how to map the deployment graph and dynamic computation graph to the processor.

[0165] In some embodiments, mapping the deployment graph and the dynamic computation graph to the processor may include: mapping the deployment graph and the dynamic computation graph to the processor based on at least one of the following mapping methods, the processor including a many-core architecture, and the mapping methods including: same mapping, front mapping, center mapping or random mapping.

[0166] In this embodiment, the many-core architecture is a special type of multi-core processor designed for highly parallel processing, containing many simpler, independent processor cores (from a few dozen cores to thousands or more).

[0167] By mapping the deployment graph and dynamic computation graph to the many-core architecture, bandwidth requirements can be met.

[0168] During the actual implementation process, the best mapping method can be selected based on actual needs, such as hardware performance or bandwidth characteristics, and this application does not limit this.

[0169] The following describes in detail how to implement various mapping methods.

[0170] In some embodiments, the same mapping includes mapping the deployment node and the dynamic node corresponding to the deployment node to the same computing unit in the many-core architecture, or mapping the deployment node and the updated dynamic node corresponding to the deployment node to the same computing unit in the many-core architecture.

[0171] Figure 7 is a schematic diagram of the principles of the method for advance scheduling of dynamic computing graphs provided in an embodiment of the present application. As shown in Figure 7, the deployment graph node and the corresponding dynamic computing graph node are mapped to the same computing unit in the many-core architecture, where Core represents a computing unit or computing core.

[0172] According to the method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application, by mapping the deployment node and the dynamic node corresponding to the deployment node to the same computing unit in the many-core architecture, the scheduling logic of each dynamic computation graph node can be executed within the core, that is, one core is responsible for scheduling its own computing tasks without the need for participation of other cores, effectively reducing the complexity of interactions between cores, thereby improving computing efficiency and ensuring computing stability.

[0173] In some embodiments, the pre-mapping includes mapping the deployment node and the monitored node corresponding to the deployment node to the same computing unit in the many-core architecture, or mapping the deployment node and the updated monitored node corresponding to the deployment node to the same computing unit in the many-core architecture.

[0174] Figure 8 is a schematic diagram of the principles of the method for advance scheduling of dynamic computational graphs provided in an embodiment of the present application. As shown in Figure 8, the deployment graph node and the monitored node monitored by the deployment graph are mapped to the same computing unit in the many-core architecture, and the deployment node determines the computing node to jump to next and the resource scheduling corresponding to the computing node based on the running status of the monitored node.

[0175] According to the method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application, by mapping the deployment node and the monitored node corresponding to the deployment node to the same computing unit in the many-core architecture, the transmission of the monitored node status between computing units can be reduced, the transmission efficiency can be improved, and thus the computing efficiency can be improved.

[0176] In some embodiments, the central mapping includes uniformly mapping all deployment nodes of the deployment graph to at least one computing unit in the many-core architecture, or uniformly mapping all deployment nodes of the deployment graph to at least one computing unit in the many-core architecture.

[0177] In this embodiment, the deployment diagram nodes may be uniformly mapped to one or more computing units in the many-core architecture.

[0178] For example, deployment nodes can be uniformly mapped to CPUs or control cores; dynamic computation graph nodes can be mapped to multiple cores.

[0179] It should be noted that, in some embodiments, the computing cores in the multi-cores cannot perform the control function.

[0180] In some embodiments, the random mapping includes randomly mapping the deployment node and the dynamic node to the many-core architecture, or randomly mapping the deployment node and the updated dynamic node to the many-core architecture.

[0181] In this embodiment, the mapping of deployment graph nodes does not follow the mapping of dynamic computation graph nodes.

[0182] During actual execution, for example, the deployment nodes and the dynamic nodes may be mapped based on the load balancing information.

[0183] For another example, deployment nodes and dynamic nodes can be randomly mapped to the many-core architecture.

[0184] According to the method for advance scheduling of dynamic computation graphs provided in an embodiment of the present application, by providing multiple mapping methods, the best mapping method can be selected based on actual conditions, which is highly flexible and has high universality.

[0185] In some optional implementations, the computing resources may be resources required for computing dynamic computation graph nodes.

[0186] In some embodiments, scheduling computing resources may include: preparing a computing environment, loading memory data, building a routing channel, obtaining instructions required to execute a dynamic node, and preparing in advance at least one of the component states for running the dynamic node.

[0187] The component state of the dynamic node prepared in advance for running includes but is not limited to configuring corresponding registers.

[0188] FIG9 is a flow chart of a method for scheduling a dynamic computation graph in advance according to an embodiment of the present application. Referring to FIG9 , the method for scheduling a dynamic computation graph in advance according to an embodiment of the present application may include the following steps:

[0189] Step S901: A deployment diagram node obtains the execution status of a monitored node through a monitoring edge.

[0190] Step S902: Search or calculate the execution probability of the corresponding dynamic node based on the obtained execution status.

[0191] Step S903: Determine whether the execution probability is greater than or equal to a preset threshold.

[0192] If the execution probability is greater than or equal to the preset threshold, jump to step S904; if the execution probability is less than the preset threshold, jump to step S901 and re-execute the corresponding steps.

[0193] Step S904: Schedule resources required for calculation of the corresponding dynamic node in advance.

[0194] The resources required for dynamic node calculation may include at least one of: preparing a computing environment, loading memory data, and building a routing channel.

[0195] During the actual execution process, as shown in Figure 9, the deployment node in the deployment diagram monitors the execution status of its corresponding monitored node. Execution status can be either executed or not executed. The deployment node then uses the acquired execution status to find or calculate the execution probability of the next node corresponding to the monitored node. Based on the acquired execution probability, the deployment node determines whether to pre-schedule computing resources for the corresponding compute node.

[0196] Continuing with FIG9 , in some embodiments, scheduling computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph and the dynamic computing graph may include:

[0197] Determining, based on the execution state of at least one monitored node, execution probabilities of dynamic nodes corresponding to deployment nodes that monitor the at least one monitored node;

[0198] When the execution probability is greater than the first threshold, computing resources of the dynamic nodes corresponding to the execution probability greater than the first threshold are scheduled in advance.

[0199] In this embodiment, the first threshold is a critical value used to characterize the degree of execution probability.

[0200] The first threshold value may be user-defined, such as being set to 75%, 90% or any other value, which is not limited in this application.

[0201] For example, when the first threshold is set to 90%, for the current monitored node S, the deployment node determines that the execution probability of the next-layer computing node A corresponding to the monitored node S is 92%, and the execution probability of the next-layer computing node B corresponding to the monitored node S is 8%. It is considered that the probability of jumping to the next-layer computing node A is higher, and the computing resources corresponding to the computing node A can be loaded in advance.

[0202] It should be noted that, in some embodiments, the number of deployment nodes that meet the advance scheduling requirements may be one or more. During the actual execution process, the computing nodes corresponding to one or more deployment nodes that meet the requirements may be scheduled in advance, thereby improving the prediction accuracy.

[0203] According to the method for early scheduling of dynamic computation graphs provided in an embodiment of the present application, a first threshold is set to determine the size of the execution probability corresponding to each computing node. If the probability exceeds the first threshold, the computing resources corresponding to the computing node are loaded in advance, and the prediction accuracy is high.

[0204] During the research and development process, the inventors discovered that in related technologies, resource scheduling for dynamic computation graphs cannot achieve advance resource scheduling, which often takes a long time and affects the scheduling rate.

[0205] In the present application, the execution probability corresponding to each computing node in the dynamic computing graph is determined by the actual execution path of each sample in the target training data set in the dynamic computing graph, and the execution probability is stored in the corresponding deployment graph node to obtain a deployment graph, so that in the subsequent scheduling application process, each dynamic node in the dynamic computing graph can be monitored in real time based on the deployment graph, and the computing resources required for the next computing node can be scheduled in advance based on the obtained execution probability, which can achieve early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate.

[0206] In addition, the execution probability of each computing node is determined by the target training data set, so that the execution probability can change accordingly based on the changes in the target training data set, making it suitable for rapidly changing dynamic computing graphs and having a wide range of applications and universality.

[0207] According to the method for early scheduling of dynamic computation graphs provided in an embodiment of the present application, the execution probability of each computing node in the dynamic computation graph is determined by a target training data set, a deployment graph is constructed based on the execution probability, and in the subsequent scheduling application process, the computing resources required for the next computing node are scheduled in advance based on the deployment graph, which can achieve early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate.

[0208] In some optional implementations, during actual execution, a deployment node in a deployment diagram can monitor the data content input to its corresponding monitored node in real time. The prediction and analysis node corresponding to the monitored node predicts the next hop node based on the input data content. The deployment node then obtains the next hop node output by the prediction and analysis node and pre-schedules the computing resources corresponding to the next hop node.

[0209] For example, for the currently monitored node S, input data X, the prediction analysis node predicts based on the input data X that the next-layer computing node corresponding to the monitored node S is dynamic node A, and the computing resources corresponding to computing node A can be loaded in advance.

[0210] During the research and development process, the inventors discovered that in related technologies, resource scheduling for dynamic computation graphs cannot achieve advance resource scheduling, which often takes a long time and affects the scheduling rate.

[0211] In the present application, the prediction analysis node is trained through the specific content of each sample in the target training data set to predict the computing node of the next jump based on the data of the input computing node, and the pre-trained prediction analysis node is deployed on the control node corresponding to the computing node, so that in the subsequent scheduling application process, the prediction analysis node corresponding to each dynamic node in the dynamic computing graph can be monitored in real time based on the deployment graph to obtain the next computing node output by the prediction analysis node, so as to schedule the computing resources required for the next computing node in advance, realize the early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate.

[0212] In addition, the next jump node corresponding to each computing node is predicted by the content of the target training data set, and the characteristics of the neural network are fully combined, so that the predicted computing nodes can change accordingly based on the changes in the target training data set, making it suitable for rapidly changing dynamic computing graphs and having a wide range of applications and universality.

[0213] According to the method for pre-scheduling of dynamic computation graphs provided in an embodiment of the present application, a prediction analysis node is obtained by training the content of a target training data set, and the pre-trained prediction analysis node is deployed on a control node corresponding to the computation node, so that in a subsequent scheduling application process, the computing resources required for the next computation node can be scheduled in advance based on the deployment graph, thereby achieving an early response of resource scheduling, saving a large amount of response time, and thus improving the scheduling rate.

[0214] In some embodiments, scheduling computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph and the dynamic computing graph may also include:

[0215] Determine the target number of dynamic nodes to be scheduled in advance based on the target bandwidth information;

[0216] Schedule computing resources corresponding to the target number of dynamic nodes in the dynamic computation graph in advance.

[0217] In this embodiment, the target bandwidth information is used to represent the bandwidth requirement.

[0218] The target quantity can be one or more.

[0219] The value of the target quantity may change based on changes in the target bandwidth information.

[0220] In the actual execution process, the bandwidth requirement of the constraint condition 'preloading, prescheduling' can be added to limit the prescheduling to one or several computing nodes.

[0221] According to the method for pre-scheduling a dynamic computation graph provided in an embodiment of the present application, the target number of pre-scheduled dynamic nodes is determined through target bandwidth information, so that resource scheduling can meet bandwidth requirements to further solve bandwidth problems.

[0222] In some embodiments, scheduling computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph, dynamic computing graph, and prediction analysis node may also include:

[0223] Determining a next-level computing node corresponding to the target computing node in the dynamic computing graph based on at least a portion of the data input to the target computing node in the scheduling execution graph;

[0224] Schedule computing resources corresponding to the next layer of computing nodes in the dynamic computing graph in advance.

[0225] In this step, the target computing node is the current computing node in the dynamic computing graph.

[0226] It should be noted that during the actual execution process, the probability of the computing nodes after the target computing node can be predicted based on part of the input data to determine the next layer of computing nodes corresponding to the current target computing node, so that the deployment diagram can schedule the computing resources required for the predicted next layer of computing nodes in advance.

[0227] In this embodiment, by predicting the next layer of computing nodes through partial input data, the computing time can be reduced to improve the response rate.

[0228] It should be noted that, in other embodiments, scheduling prediction may also be performed based on all input data of the target computing node, and this application does not limit this.

[0229] It should be understood that the above embodiment can also be used in combination with any other embodiment of the present application. The above embodiment is only a specific example of the present application, and is not intended to limit the scope of protection of the present application.

[0230] The method for pre-scheduling a dynamic computation graph provided in the embodiments of the present application can be performed by a device for pre-scheduling a dynamic computation graph. In the embodiments of the present application, the method for pre-scheduling a dynamic computation graph is performed by a device for pre-scheduling a dynamic computation graph as an example to illustrate the device for pre-scheduling a dynamic computation graph provided in the embodiments of the present application.

[0231] An embodiment of the present application also provides a device for advance scheduling of dynamic computation graphs.

[0232] Figure 10 is a block diagram of an apparatus for pre-scheduling a dynamic computation graph according to an embodiment of the present application. Referring to Figure 10 , the apparatus 100 for pre-scheduling a dynamic computation graph according to an embodiment of the present application may include the following modules.

[0233] A determination module 101 is configured to determine deployment information of a dynamic computation graph based on the dynamic computation graph and a target training dataset corresponding to the dynamic computation graph;

[0234] The scheduling module 102 is used to schedule computing resources of dynamic nodes in the dynamic computing graph in advance according to the deployment information.

[0235] In some optional implementations, the deployment information includes a deployment diagram; the determination module includes a first processing module, and the scheduling module includes a second processing module and a third processing module;

[0236] A first processing module is configured to construct the deployment graph based on a target training dataset corresponding to the dynamic computation graph and an execution path corresponding to each sample in the target training dataset in the dynamic computation graph; the deployment graph includes a plurality of deployment nodes, each of which stores an execution probability of a dynamic node corresponding to the deployment node;

[0237] A second processing module, configured to map the deployment graph and the dynamic computation graph to a processor;

[0238] The third processing module is used to schedule computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph and the dynamic computing graph.

[0239] FIG11 is a block diagram of an apparatus for pre-scheduling a dynamic computation graph according to an embodiment of the present application. Referring to FIG11 , the apparatus 110 for pre-scheduling a dynamic computation graph according to an embodiment of the present application may include: a first processing module 111 , a second processing module 112 , and a third processing module 113 .

[0240] In some optional implementations, the deployment information includes a deployment diagram and a prediction analysis node; the determination module includes a fourth processing module, and the scheduling module includes a fifth processing module and a sixth processing module;

[0241] a fourth processing module, configured to construct the deployment graph and the prediction analysis node based on the dynamic computation graph and the content of each sample in the target training data set corresponding to the dynamic computation graph, wherein the deployment graph includes a plurality of deployment nodes, the prediction analysis node is arranged before the control node preceding the dynamic node corresponding to the deployment node in the dynamic computation graph, and the prediction analysis node is used to predict the next execution node in the dynamic computation graph;

[0242] a fifth processing module, configured to map the deployment graph, the dynamic computation graph, and the prediction analysis node to a processor;

[0243] The sixth processing module is used to schedule computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph, the dynamic computing graph, and the prediction analysis node.

[0244] FIG12 is a block diagram of an apparatus for pre-scheduling a dynamic computation graph according to an embodiment of the present application. Referring to FIG12 , the apparatus 120 for pre-scheduling a dynamic computation graph according to an embodiment of the present application may include: a fourth processing module 121 , a fifth processing module 122 , and a sixth processing module 123 .

[0245] In summary, in the embodiment of the present application, the corresponding deployment information is determined based on the dynamic computation graph and its target training data set, and the deployment information is used to schedule computing resources in advance during the subsequent scheduling application process, thereby enabling early response of resource scheduling, saving a lot of response time, and improving the scheduling rate.

[0246] In some embodiments, the execution probability of each computing node in the dynamic computing graph can be determined through the target training data set, and a deployment graph can be constructed based on the execution probability. In the subsequent scheduling application process, the computing resources required for the next computing node can be scheduled in advance based on the deployment graph, which can achieve early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate.

[0247] In some embodiments, a prediction analysis node can also be obtained by training the content of the target training data set, and the pre-trained prediction analysis node can be deployed on the control node corresponding to the computing node, so that in the subsequent scheduling application process, the computing resources required for the next computing node can be scheduled in advance based on the deployment diagram, which can achieve early response of resource scheduling, save a lot of response time, and thus improve the scheduling rate.

[0248] In some embodiments of the present disclosure, the functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. Its specific implementation and technical effects can refer to the description of the above method embodiments. For the sake of brevity, they will not be repeated here.

[0249] In a third aspect, an embodiment of the present application provides an electronic device.

[0250] FIG13 is a block diagram of an electronic device provided in an embodiment of the present application.

[0251] 13 , an embodiment of the present application provides an electronic device, comprising: at least one processor 1301; at least one memory 1302; and one or more I / O interfaces 1303 connected between the processor 1301 and the memory 1302; wherein the memory 1302 stores one or more computer programs that can be executed by at least one processor 1301, and the one or more computer programs are executed by at least one processor 1301 so that the at least one processor 1301 can execute the above-mentioned method for advance scheduling of dynamic computation graphs.

[0252] FIG14 is a block diagram of an electronic device provided in an embodiment of the present application.

[0253] 14 , an embodiment of the present application provides an electronic device comprising a plurality of processing cores 1401 and an on-chip network 1402 , wherein the plurality of processing cores 1401 are all connected to the on-chip network 1402 , and the on-chip network 1402 is used to exchange data between the plurality of processing cores and external data.

[0254] One or more instructions are stored in one or more processing cores 1401, and the one or more instructions are executed by one or more processing cores 1401, so that one or more processing cores 1401 can execute the above-mentioned method for advance scheduling of dynamic computation graphs.

[0255] In some embodiments, the electronic device may be a brain-inspired chip. Because brain-inspired chips can use vectorized computing and require the weight information and other parameters of the neural network model to be loaded through external memory, such as Double Data Rate (DDR) synchronous dynamic random access memory, the embodiments of the present application utilize batch processing for higher computational efficiency.

[0256] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor / processing core, implements the aforementioned method for pre-scheduling a dynamic computation graph. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.

[0257] An embodiment of the present application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned method for advance scheduling of dynamic computation graphs.

[0258] It will be understood by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium).

[0259] As is well known to those skilled in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those skilled in the art, communication media typically contains computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0260] 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, fiber optic transmission, wireless transmission, 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 to be stored in the computer-readable storage medium in each computing / processing device.

[0261] The computer program instructions for performing the operation of the present application can 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, wherein the programming language includes object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or executed completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer by any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (such as by using an Internet service provider to connect to the Internet). In certain embodiments, by utilizing the state information of computer-readable program instructions to personalize electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLAs), the electronic circuits can execute computer-readable program instructions, thereby realizing various aspects of the present application.

[0262] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0263] Various aspects of the present application are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0264] These computer-readable program instructions can be provided to a processor 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 processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0265] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational 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 blocks in the flowchart and / or block diagram.

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

[0267] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.

Claims

1. A method for early scheduling of dynamic computation graphs, in, include: Determining deployment information of the dynamic computation graph based on the dynamic computation graph and the target training data set corresponding to the dynamic computation graph; According to the deployment information, computing resources of dynamic nodes in the dynamic computing graph are scheduled in advance.

2. The method according to claim 1, in, The deployment information includes a deployment diagram; The determining, based on the dynamic computation graph and the target training data set corresponding to the dynamic computation graph, deployment information of the dynamic computation graph includes: The deployment graph is constructed based on the target training data set corresponding to the dynamic computation graph and the execution path corresponding to each sample in the target training data set in the dynamic computation graph; the deployment graph includes multiple deployment nodes, and the deployment nodes store the execution probabilities of the dynamic nodes corresponding to the deployment nodes.

3. The method according to claim 1, in, The deployment information includes a deployment diagram and a prediction analysis node; The determining, based on the dynamic computation graph and the target training data set corresponding to the dynamic computation graph, deployment information of the dynamic computation graph includes: Constructing the deployment diagram and the prediction analysis node based on the dynamic calculation graph and the content of each sample in the target training data set corresponding to the dynamic calculation graph; The deployment graph includes a plurality of deployment nodes, the prediction analysis node is arranged before a control node before a dynamic node corresponding to the deployment node in the dynamic calculation graph, and the prediction analysis node is used to predict a next execution node in the dynamic calculation graph.

4. The method according to claim 2 or 3, in, The construction process of the deployment diagram includes: Based on each dynamic node in the dynamic computation graph, construct a deployment node corresponding to the dynamic node; The deployment node is used to monitor the monitored node in the dynamic computation graph, and the monitored node is at least one dynamic node before the dynamic node corresponding to the deployment node in the dynamic computation graph.

5. The method according to claim 4, in, In a case where the execution probability of the dynamic node corresponding to the deployment node is stored in the deployment node, after constructing the deployment node corresponding to the dynamic node based on each dynamic node in the dynamic computation graph, the method further includes: Determining, based on the execution path of each of the samples, the execution probability of the dynamic node corresponding to each of the deployment nodes; The deployment graph is determined based on the deployment nodes and execution probabilities of dynamic nodes corresponding to the deployment nodes.

6. The method according to claim 5, in, The determining, based on the execution path of each of the samples, the execution probability of the dynamic node corresponding to each of the deployment nodes comprises: When the sample is forward propagated once in the dynamic computation graph, the deployment graph records the number of times the current dynamic node is executed; The number of executions of each of the dynamic nodes is converted into a conditional probability of execution of the dynamic node corresponding to the deployment node when the monitored node monitored by the deployment node is executed, and the execution probability of the dynamic node corresponding to each of the deployment nodes is determined based on the conditional probability.

7. The method according to claim 3, in, The construction process of the prediction analysis node includes: Taking the input data of the dynamic node before the control node in the target training data set as a sample, taking the next execution node of the sample corresponding to the input data of the dynamic node before the control node as a sample label, training to obtain a prediction analysis node corresponding to the control node; The prediction analysis node corresponding to the control node is arranged before the control node.

8. The method according to claim 7, in, The method of taking the input data before the control node in the target training data set as a sample and the next execution node of the sample corresponding to the input data before the control node as a sample label, and training to obtain a prediction analysis node corresponding to the control node includes: Extracting part of the data from each sample of the target training data set respectively; The input data before the control node in the partial data is used as a sample, and the next execution node of the sample corresponding to the input data before the control node is used as a sample label, and a prediction analysis node corresponding to the control node is obtained through training.

9. The method according to claim 7, in, The method of taking the input data before the control node in the target training data set as a sample and the next execution node of the sample corresponding to the input data before the control node as a sample label, and training to obtain a prediction analysis node corresponding to the control node includes: Determine, based on the execution path corresponding to each sample in the dynamic computation graph, the execution probability corresponding to each dynamic node in the dynamic computation graph; Based on the execution probability and input data before the control node, a prediction analysis node corresponding to the control node is obtained through training.

10. The method according to claim 2, in, The step of scheduling computing resources of dynamic nodes in the dynamic computing graph in advance according to the deployment information includes: Mapping the deployment graph and the dynamic computation graph to a processor; Based on the mapped deployment graph and the dynamic computation graph, computing resources of dynamic nodes in the dynamic computation graph are scheduled in advance.

11. The method according to claim 3, in, The step of scheduling computing resources of dynamic nodes in the dynamic computing graph in advance according to the deployment information includes: Mapping the deployment graph, the dynamic computation graph, and the prediction analysis node to a processor; Based on the mapped deployment graph, the dynamic computation graph, and the prediction analysis node, computing resources of the dynamic nodes in the dynamic computation graph are scheduled in advance.

12. The method according to claim 11, in, The mapping of the deployment graph, the dynamic calculation graph, and the prediction analysis node to a processor includes: Deploy the prediction and analysis node in a dynamic node located before the control node in the dynamic calculation graph, update the dynamic calculation graph, and obtain the updated dynamic calculation graph; The deployment graph and the dynamic computation graph are mapped to the processor.

13. The method according to any one of claims 10 to 12, in, The deployment graph and the dynamic computation graph are mapped to the processor based on at least one of the following mapping methods, the processor including a many-core architecture, and the mapping method includes: Same mapping, including mapping the deployment node and the dynamic node corresponding to the deployment node to the same computing unit in the many-core architecture; Pre-mapping, including mapping the deployment node and the monitored node corresponding to the deployment node to the same computing unit in the many-core architecture; Central mapping, including uniformly mapping all deployment nodes of the deployment graph to at least one computing unit in the many-core architecture; Random mapping includes randomly mapping the deployment nodes and the dynamic nodes to the many-core architecture.

14. The method according to any one of claims 2 to 12, in, A connection channel exists between a first target node and a second target node among the multiple deployment nodes, and the connection channel is used for sending and receiving target information.

15. The method according to claim 10, in, The scheduling of computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph and the dynamic computing graph includes: Based on the execution state of at least one monitored node, respectively determining the execution probability of the dynamic node corresponding to the deployment node that monitors the at least one monitored node; the execution state includes execution or non-execution; When the execution probability is greater than a first threshold, computing resources of the dynamic nodes corresponding to the execution probability greater than the first threshold are scheduled in advance.

16. The method according to claim 10, in, The scheduling of computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph and the dynamic computing graph includes: Determining a target number of the dynamic nodes scheduled in advance based on the target bandwidth information; The computing resources corresponding to the target number of dynamic nodes in the dynamic computing graph are scheduled in advance.

17. The method according to claim 11, in, The scheduling of computing resources of dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph, the dynamic computing graph, and the prediction analysis node includes: Determining a next-layer computing node corresponding to the target computing node in the dynamic computing graph based on at least a portion of the data input to the target computing node; The computing resources corresponding to the computing nodes in the next layer in the dynamic computing graph are scheduled in advance.

18. A device for scheduling dynamic computation graphs in advance, in, include: A determination module, configured to determine deployment information of the dynamic computation graph based on the dynamic computation graph and a target training data set corresponding to the dynamic computation graph; The scheduling module is used to schedule the computing resources of the dynamic nodes in the dynamic computing graph in advance according to the deployment information.

19. The device according to claim 18, in, The deployment information includes a deployment diagram; the determination module includes a first processing module, and the scheduling module includes a second processing module and a third processing module; A first processing module is used to construct the deployment graph based on the target training data set corresponding to the dynamic calculation graph and the execution path corresponding to each sample in the target training data set in the dynamic calculation graph; the deployment graph includes a plurality of deployment nodes, and the deployment nodes store the execution probabilities of the dynamic nodes corresponding to the deployment nodes; A second processing module, used for mapping the deployment graph and the dynamic calculation graph to a processor; The third processing module is used to schedule the computing resources of the dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph and the dynamic computing graph.

20. The device according to claim 18, in, The deployment information includes a deployment diagram and a prediction analysis node; the determination module includes a fourth processing module, and the scheduling module includes a fifth processing module and a sixth processing module; A fourth processing module, configured to construct the deployment diagram and the prediction analysis node based on the dynamic calculation diagram and the content of each sample in the target training data set corresponding to the dynamic calculation diagram, wherein the deployment diagram includes a plurality of deployment nodes, the prediction analysis node is arranged before the control node before the dynamic node corresponding to the deployment node in the dynamic calculation diagram, and the prediction analysis node is used to predict the next execution node in the dynamic calculation diagram; A fifth processing module, used for mapping the deployment graph, the dynamic calculation graph and the prediction analysis node to a processor; The sixth processing module is used to schedule the computing resources of the dynamic nodes in the dynamic computing graph in advance based on the mapped deployment graph, the dynamic computing graph and the prediction analysis node.

21. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, in, When the processor executes the computer program, the method for advance scheduling of a dynamic computation graph as described in any one of claims 1 to 17 is implemented.

22. A computer-readable storage medium having a computer program stored thereon, in, When the computer program is executed by a processor, the method for advance scheduling of a dynamic computation graph as claimed in any one of claims 1 to 17 is implemented.

23. A computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, in, When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes a method for implementing advance scheduling for dynamic computation graphs as described in any one of claims 1-17.

Citation Information

Patent Citations

  • Machine learning calculation optimization method and platform

    CN114418127A

  • Neural network model deployment method and device, electronic equipment and storage medium

    CN115099399A

  • Calculation graph optimization-based inter-operator parallel scheduling method, equipment and medium

    CN115357356A

  • Model deployment method and device, model operation method and device, offline analysis tool and electronic equipment

    CN115525436A

  • Method and device for scheduling in advance aiming at dynamic calculation graph

    CN116594762A