CN114756358A - DAG task scheduling method, device, equipment and storage medium - Google Patents

DAG task scheduling method, device, equipment and storage medium Download PDF

Info

Publication number
CN114756358A
CN114756358A CN202210671115.8A CN202210671115A CN114756358A CN 114756358 A CN114756358 A CN 114756358A CN 202210671115 A CN202210671115 A CN 202210671115A CN 114756358 A CN114756358 A CN 114756358A
Authority
CN
China
Prior art keywords
task
dag
dag task
scheduling
network model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210671115.8A
Other languages
Chinese (zh)
Other versions
CN114756358B (en
Inventor
胡克坤
鲁璐
赵坤
董刚
赵雅倩
李仁刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210671115.8A priority Critical patent/CN114756358B/en
Publication of CN114756358A publication Critical patent/CN114756358A/en
Application granted granted Critical
Publication of CN114756358B publication Critical patent/CN114756358B/en
Priority to PCT/CN2022/142437 priority patent/WO2023241000A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a DAG task scheduling method, device, equipment and storage medium. The method comprises the following steps: constructing a network model according to the sequence of the directed graph neural network and the sequential decoder, and defining an objective function of the network model by taking the minimum task scheduling length as an objective; acquiring a DAG task data set, and generating a corresponding information matrix for each DAG task in the DAG task data set; training the network model by using the information matrix, and updating model parameters of the network model by using reinforcement learning according to the objective function to obtain a trained DAG task scheduling model; and determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model, and executing the DAG task to be executed by using the parallel computing system according to the scheduling sequence. The method can shorten the DAG task scheduling length, improve the parallel execution efficiency of the DAG task, and solve the problem that enough supervision labels are difficult to collect for the optimal priority distribution of the DAG task.

Description

DAG task scheduling method, device, equipment and storage medium
Technical Field
The present invention relates to the field of task scheduling technologies, and in particular, to a method, an apparatus, a device, and a storage medium for DAG task scheduling.
Background
Currently, driven by the demand for high performance and complex functionality, parallel computing systems are increasingly used to execute real-time applications, such as autonomous driving tasks with complex functional components such as perception, planning, and control, which have extremely high requirements for high performance and real-time. DAG (Directed Acyclic Graph) tasks are often used to represent complex dependencies between multiple task components (subtasks) similar to real-time applications and to formally describe fine-grained parallel task scheduling problems, i.e., DAG task scheduling problems. Considering that a Non-preemptive task model can avoid task migration and switching overhead, priority-based Non-preemptive scheduling for DAG tasks is receiving much attention, and this problem is how to Non-preemptively schedule a given DAG task to be executed on a parallel computing system, so that processing time is minimized, and is a typical NP (Non-preemptive multimedia Complete) Complete problem. In the prior art, a large number of excellent heuristic scheduling algorithms such as a table scheduling algorithm and a clustering scheduling algorithm are accumulated in long-term parallel computing practice. However, due to the nature of heuristic strategies, these algorithms cannot establish basic design principles for the DAG task scheduler, for example, how to allocate priorities to each subtask by using DAG task execution time and DAG task graph topological structure features under different DAG task scales and configurations, and scheduling performance is not ideal.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, a device, and a medium for scheduling DAG tasks, which can shorten a length of the DAG task scheduling and improve parallel execution efficiency of the DAG tasks. The specific scheme is as follows:
in a first aspect, the present application discloses a DAG task scheduling method, including:
constructing a network model according to the sequence of the directed graph neural network and the sequential decoder, and defining an objective function of the network model by taking the minimum task scheduling length as an objective;
acquiring a DAG task data set, and generating a corresponding information matrix for each DAG task in the DAG task data set;
training the network model by using the information matrix, and updating model parameters of the network model by using reinforcement learning according to the objective function to obtain a trained DAG task scheduling model;
and determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model, and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence.
Optionally, before the network model is built according to the sequence of the directed graph neural network and the sequential decoder, the method further includes:
Constructing a graph convolution layer for DAG task feature learning based on an aggregation function and a nonlinear activation function;
and constructing the directed graph neural network according to the sequence of the input layer, the K-layer graph convolution layer and the output layer.
Optionally, before constructing the network model according to the sequence of the directed graph neural network and the sequential decoder, the method further includes:
the priority distribution state of subtasks in the DAG task is taken as a variable, and a vector expression of a context environment is defined for the DAG task;
constructing a sequential decoder for prioritization based on an attention mechanism and a vector expression of the context environment.
Optionally, the defining an objective function of the network model with the minimum task scheduling length as a target includes:
generating a deceleration evaluation index of the DAG task by taking the task scheduling length corresponding to the priority sequence of the DAG task at different time steps and the lower limit of the task scheduling length as independent variables; the lower limit of the task scheduling length is determined according to the path length of the key path of the DAG task;
constructing a reward function based on a strategy gradient algorithm and the deceleration evaluation index;
and constructing an objective function of the network model based on the reward function.
Optionally, the acquiring the DAG task dataset includes:
Configuring DAG task parameters; the DAG task parameters comprise the number of task layers, the number of sub-nodes of a target node, the generation probability of the sub-nodes of the target node, the adding probability of a connecting edge between two adjacent task layers and the calculation load of each sub-task;
and generating a DAG task according to the DAG task parameters to obtain the DAG task data set.
Optionally, the generating a corresponding information matrix for each DAG task in the DAG task data set includes:
generating a node characteristic matrix according to the characteristics of each subtask in the DAG task data set;
generating an adjacency matrix according to the connection relation between different subtasks in the DAG task data set;
and obtaining an information matrix corresponding to the DAG task based on the node characteristic matrix and the adjacency matrix.
Optionally, the training the network model by using the information matrix, and updating the model parameters of the network model by using reinforcement learning according to the objective function includes:
inputting the information matrix into the network model, and outputting vector representation of each subtask by using the directed graph neural network according to the characteristics of the subtasks and the dependency relationship among the subtasks;
Prioritizing, with the order decoder, the subtasks within the DAG task according to the vector representation of the subtasks based on attention mechanism and context environment of the DAG task;
calculating the task scheduling length of the DAG task by utilizing a DAG task scheduling simulator according to the priority sequence;
and updating the model parameters of the network model by utilizing reinforcement learning according to the task scheduling length and the objective function until the network model is converged.
In a second aspect, the present application discloses a DAG task scheduling apparatus, including:
the network construction module is used for constructing a network model according to the sequence of the directed graph neural network and the sequential decoder, and defining an objective function of the network model by taking the minimum task scheduling length as an objective;
the data set acquisition module is used for acquiring a DAG task data set and generating a corresponding information matrix for each DAG task in the DAG task data set;
the training module is used for training the network model by using the information matrix and updating model parameters of the network model by using reinforcement learning according to the objective function so as to obtain a trained DAG task scheduling model;
And the scheduling sequence determining module is used for determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence.
Optionally, the DAG task scheduling device further includes:
the graph convolution layer construction unit is used for constructing a graph convolution layer for DAG task feature learning based on the aggregation function and the nonlinear activation function;
and the directed graph neural network construction unit is used for constructing and obtaining the directed graph neural network according to the sequence of the input layer, the K-layer graph convolution layer and the output layer.
Optionally, the DAG task scheduling device further includes:
the vector expression definition unit is used for defining a vector expression of a context environment for the DAG task by taking the priority distribution state of the subtasks in the DAG task as a variable;
a sequential decoder construction unit for constructing a sequential decoder for prioritization based on an attention mechanism and a vector expression of the context environment to arrive at the decoder.
Optionally, the network building module includes:
the deceleration evaluation index construction unit is used for generating a deceleration evaluation index of the DAG task by taking the task scheduling length and the lower limit of the task scheduling length corresponding to the priority sequence of the DAG task at different time steps as independent variables; the lower limit of the task scheduling length is determined according to the path length of the key path of the DAG task;
The reward function construction unit is used for constructing a reward function based on a strategy gradient algorithm and the deceleration evaluation index;
and the target function construction unit is used for constructing a target function of the network model based on the reward function.
Optionally, the data set obtaining module includes:
a task parameter configuration unit, configured to configure DAG task parameters; the DAG task parameters comprise the number of task layers, the number of sub-nodes of a target node, the generation probability of the sub-nodes of the target node, the adding probability of a connecting edge between two adjacent task layers and the calculation load of each sub-task;
and the task generation unit is used for generating the DAG task according to the DAG task parameters so as to obtain the DAG task data set.
Optionally, the data set obtaining module includes:
a node feature matrix generating unit, configured to generate a node feature matrix according to a feature of each subtask in the DAG task data set;
the adjacency matrix generation unit is used for generating an adjacency matrix according to the connection relation between different subtasks in the DAG task data set;
and the information matrix determining unit is used for obtaining an information matrix corresponding to the DAG task based on the node characteristic matrix and the adjacency matrix.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor configured to execute the computer program to implement the DAG task scheduling method described above.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by the processor implements the aforementioned DAG task scheduling method.
According to the method, a network model is constructed according to the sequence of a directed graph neural network and a sequential decoder, and an objective function of the network model is defined by taking the minimum task scheduling length as an objective; acquiring a DAG task data set, and generating a corresponding information matrix for each DAG task in the DAG task data set; training the network model by using the information matrix, and updating model parameters of the network model by using reinforcement learning according to the objective function to obtain a trained DAG task scheduling model; and determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model, and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence. According to the method, a DAG task scheduling model is obtained based on the directed graph neural network and reinforcement learning, the directed graph neural network can automatically identify rich characteristics related to subtasks in the DAG task, a sequence decoder can utilize the characteristics to perform task priority sequencing on the subtasks, meanwhile, a scheduling target of minimizing the DAG task scheduling length is achieved by utilizing the reinforcement learning optimization model, the DAG task scheduling length can be shortened, the DAG task parallel execution efficiency is improved, and the problem that enough supervision labels are difficult to collect for optimal priority distribution of the DAG task can be solved by utilizing the reinforcement learning.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a DAG task scheduling method provided in the present application;
fig. 2 is a structural diagram of a specific DAG task scheduling system provided in the present application;
FIG. 3 is a diagram of a specific directed graph neural network architecture provided herein;
FIG. 4 is a flowchart of a specific training method for a DAG task scheduling model according to the present disclosure;
fig. 5 is a schematic structural diagram of a DAG task scheduling apparatus according to the present disclosure;
fig. 6 is a block diagram of an electronic device provided in the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, a large number of excellent heuristic scheduling algorithms such as a table scheduling algorithm and a clustering scheduling algorithm are accumulated in long-term parallel computing practice, but due to the nature of heuristic strategies, the algorithms cannot establish basic design principles for a DAG task scheduling program, for example, how to allocate priorities to sub-tasks by using DAG task execution time and DAG task graph topological structure characteristics under different DAG task scales and configurations, and scheduling performance is not ideal. In order to overcome the technical problem, the DAG task scheduling method can shorten the DAG task scheduling length and improve the parallel execution efficiency of DAG tasks.
The embodiment of the application discloses a DAG task scheduling method, which can comprise the following steps as shown in FIG. 1:
step S11: and constructing a network model according to the sequence of the directed graph neural network and the sequential decoder, and defining an objective function of the network model by taking the minimum task scheduling length as an objective.
In this embodiment, a Network model is first constructed according to the sequence of a Directed Graph Neural Network (DGNN) and a sequential decoder, and an objective function of the Network model is defined with a minimum task scheduling length as an objective; the directed graph neural network is used for identifying task characteristics of subtasks in the DAG task and outputting embedded representations, namely vector representations, corresponding to each subtask, wherein the task characteristics comprise execution time and dependency relationship; the sequence decoder is used for sequencing the priorities of all the subtasks according to the embedded representation output by the directed graph neural network and outputting the priority sequencing of the subtasks. The objective function is used for guiding the learning of the network model, so that the network model can finally realize the minimum task scheduling length for outputting the DAG task according to the input DAG task. The network model also comprises a DAG task scheduling simulator which is used for calculating the scheduling length of the DAG task on the given parallel computing system.
Before performing a detailed description of the present embodiment, the basic concept involved in the present embodiment is explained first. Parallel computing systems, which can be generally described as a quad
Figure 581371DEST_PATH_IMAGE001
. Wherein:
Figure 577140DEST_PATH_IMAGE002
is a set of processing nodes;
Figure 419195DEST_PATH_IMAGE003
is a set of communication links between processing nodes;
Figure 329251DEST_PATH_IMAGE004
is a set of computation speeds for the processing nodes,
Figure 205940DEST_PATH_IMAGE005
represent
Figure 559561DEST_PATH_IMAGE006
And satisfy
Figure 108485DEST_PATH_IMAGE007
Figure 104123DEST_PATH_IMAGE008
Is a collection of communication link bandwidths that may be,
Figure 507422DEST_PATH_IMAGE009
representing a communication link
Figure 31944DEST_PATH_IMAGE010
Of the bandwidth of (c).
The DAG task refers to a plurality of subtasks which have complex dependency relationships and can be executed in parallel on a parallel computing system, is represented by a commonly-used weighted directed acyclic graph and is recorded as
Figure 583011DEST_PATH_IMAGE011
. Wherein the content of the first and second substances,
Figure 123887DEST_PATH_IMAGE012
is a set of nodes, each node representing a subtask,
Figure 381693DEST_PATH_IMAGE013
is the total number of subtasks.
Figure 342696DEST_PATH_IMAGE014
Is a set of directed edges, directed edges
Figure 115480DEST_PATH_IMAGE015
Representing subtasks connected from the edge
Figure 469232DEST_PATH_IMAGE016
To another subtask thereof
Figure 643861DEST_PATH_IMAGE017
The communication and data dependencies between them,
Figure 510186DEST_PATH_IMAGE017
must be receiving
Figure 770266DEST_PATH_IMAGE016
Can only be started after the result of the calculation.
Figure 629506DEST_PATH_IMAGE018
Is a set of computational loads that are,
Figure 861905DEST_PATH_IMAGE019
representing subtasks
Figure 164710DEST_PATH_IMAGE016
And recording the sum of the computing loads of all the subtasks as
Figure 912086DEST_PATH_IMAGE020
Then there is
Figure 325750DEST_PATH_IMAGE021
Let Pred (t)i) And Succ (t)i) Are respectively as
Figure 694545DEST_PATH_IMAGE016
A direct predecessor subtask set and a direct successor subtask set. Balance
Figure 433831DEST_PATH_IMAGE016
And Pred (t)i) And Succ (t)i) The set of the connecting edges among all the subtasks in the task is respectively
Figure 402924DEST_PATH_IMAGE016
Incident edge set of
Figure 354700DEST_PATH_IMAGE022
And an emergent edge set
Figure 607696DEST_PATH_IMAGE023
(ii) a Note book
Figure 252303DEST_PATH_IMAGE016
Respectively are
Figure 708693DEST_PATH_IMAGE024
And
Figure 667421DEST_PATH_IMAGE025
then there is
Figure 525656DEST_PATH_IMAGE026
And
Figure 544428DEST_PATH_IMAGE027
. If it is
Figure 238845DEST_PATH_IMAGE028
Then call
Figure 63582DEST_PATH_IMAGE016
Is an entry subtask and is noted as tentry(ii) a If it is
Figure 979585DEST_PATH_IMAGE029
Then call
Figure 700416DEST_PATH_IMAGE016
Is an egress subtask and is denoted texit. Route of travel
Figure 396977DEST_PATH_IMAGE030
Is a finite sequence of subtask nodes and satisfies
Figure 743514DEST_PATH_IMAGE031
Is provided with
Figure 576340DEST_PATH_IMAGE032
. If a path contains both an ingress subtask and an egress subtask, the path is said to be a complete path. The path length Λ (λ) of λ is the sum of the computational loads of all subtasks on that path, i.e.
Figure 671335DEST_PATH_IMAGE033
Longest path length integrityThe path is called a critical path. Each subtask node viOriginal feature x ofiBesides the characteristics of task load, in-degree and out-degree node levels, the method also comprises the length of a critical path and the length of a non-critical path, wherein the length of the non-critical path can be obtained by subtracting the length of the critical path from the total calculation load of the DAG tasks. For example, as shown in fig. 2, a DAG task scheduling system is shown, which includes 9 nodes, and a DAG task having a unique entry and an exit, and the character strings in the nodes represent subtask IDs and computation loads. In fact, a DAG task may have multiple entries and exits, which can be changed to a DAG task with unique entries and exits by adding a virtual entry subtask or exit subtask and corresponding connecting edges. Unless otherwise stated, the latter type of DAG task is referred to in this embodiment, and the number of satisfied subtasks is satisfied nFar greater than the number of nodes of a parallel computing systemm
In this embodiment, before constructing the network model according to the order of the directed graph neural network and the sequential decoder, the method may further include: constructing a graph convolution layer for DAG task feature learning based on an aggregation function and a nonlinear activation function; and constructing the directed graph neural network according to the sequence of the input layer, the K-layer graph convolution layer and the output layer. Learning the vector representation of each subtask in the DAG task by utilizing the directed graph neural network;
the above vectors are expressed as
Figure 589613DEST_PATH_IMAGE034
As shown in fig. 3, a directed graph neural network is designed, which is composed of an input layer (input layer), a K-layer graph conv layer (graph conv layer) and an output layer (output layer), wherein the input layer reads a node feature matrix X and an adjacency matrix a of a DAG task; the graph convolution operation of the k-th layer graph convolution layer is implemented by an aggregation function (aggregate function) and a nonlinear activation function, as follows:
Figure 756152DEST_PATH_IMAGE035
(1)
Figure 928638DEST_PATH_IMAGE036
(2)
wherein the aggregate function aggregates data from the subtasks
Figure 460114DEST_PATH_IMAGE037
The update function performs nonlinear transformation on the aggregated messages; pred (t)i) Is composed of
Figure 600108DEST_PATH_IMAGE037
Is directly preceding the set of subtasks. For the aggregate function, it can adopt many ways such as taking the maximum value, taking the average value, etc., and this patent adopts the attention mechanism to realize:
Figure 304759DEST_PATH_IMAGE038
(3)
Wherein alpha isijRepresenting subtaskst j For is tot i The attention coefficient of (2), which is learned through training. For update function, it can be any non-linear activation function. Not in generality, the ReLu function is used in this embodiment to implement:
namely that
Figure 112178DEST_PATH_IMAGE039
The output layer directly outputs the vertex embedded representation learned by the Kth layer graph convolution layer. It can be understood that the graph convolution layer constructed by using the aggregation function and the nonlinear activation function can better adapt to the directed characteristics of the DAG task graph, extract the dependency relationship among the subtasks, and identify the characteristics of the subtasks and the dependency relationship between the subtasks and other subtasks in the DAG task, so that the embedded representation of subtask nodes can be more effectively learned, richer characteristics can be provided for the priority ordering of the subsequent subtasks, and the accuracy of the priority ordering can be further improved.
In this embodimentBefore the network model is built according to the sequence of the directed graph neural network and the sequential decoder, the method may further include: defining a vector expression of a context environment for a DAG task by taking a priority distribution state of a subtask in the DAG task as a variable; a sequential decoder for prioritization is constructed based on an attention mechanism and a vector expression of the context environment. It will be appreciated that the decoder described above is a sequential decoder for ordering all sub-tasks of the DAG task, specifically all of the DAG task learned from the directed graph neural network nAn embedded representation of a subtask node.
The sequential decoder sequentially selects the subtask nodes to generate the size ofnIn a priority order
Figure 860560DEST_PATH_IMAGE040
It corresponds to a priority ordered arrangement of subtasks
Figure 487850DEST_PATH_IMAGE041
And satisfies: priority level
Figure 933875DEST_PATH_IMAGE042
The sequential decoder in this embodiment can formally describe the DAG task priority assignment as a probability distribution defined by the following equation:
Figure 330222DEST_PATH_IMAGE043
(4)
wherein, the first and the second end of the pipe are connected with each other,
Figure 265817DEST_PATH_IMAGE044
are the network parameters to be optimized. The sequential decoder first derives a probability distribution
Figure 131136DEST_PATH_IMAGE045
The subtask node with the highest priority is sampled and then the next time
Figure 912010DEST_PATH_IMAGE046
And (5) sampling the subtask nodes with the second highest priority, and repeating the steps until all subtask nodes are selected by sampling.
At each time step
Figure 428442DEST_PATH_IMAGE047
The sequential decoder selects subtask nodes according to the following rule
Figure 472621DEST_PATH_IMAGE048
And give priority to it
Figure 74504DEST_PATH_IMAGE049
Figure 908336DEST_PATH_IMAGE050
(5)
Wherein the argmax function is used for determining a maximum independent variable point set; conditional probability distribution
Figure 544854DEST_PATH_IMAGE051
Calculated according to the following formula:
Figure 556672DEST_PATH_IMAGE052
(6)
wherein softmax is a normalized exponential function;
Figure 380272DEST_PATH_IMAGE053
transforming a matrix for the features to be trained; tan h is an activation function; att is an attention function;
Figure 519260DEST_PATH_IMAGE054
is the time step
Figure 744705DEST_PATH_IMAGE055
The subtask set with the priority not yet distributed is recorded as the subtask set with the priority distributed
Figure 130687DEST_PATH_IMAGE056
And satisfy
Figure 707162DEST_PATH_IMAGE057
In the process of prioritizing for a DAG task, aggregation
Figure 633530DEST_PATH_IMAGE056
And
Figure 962749DEST_PATH_IMAGE054
will be updated in real time according to the priority assignment status; cont is a context environment selected by the real-time subtask of the sequential decoder, and it can be understood that, in formula (6), the vector representation of the subtask is compared with the vector representation of the context environment, and then the weight of the subtask is assigned by using the attention mechanism; the vector representation of the context is calculated as follows:
cont=W[contO; contU]+b, (7)
wherein W represents a linear transformation, [;]"represents tensor connectors; contOAnd contUAre respectively as
Figure 847528DEST_PATH_IMAGE056
And
Figure 645720DEST_PATH_IMAGE054
corresponding embedded representations, which are calculated by the following formula:
Figure 375779DEST_PATH_IMAGE058
(8)
Figure 513499DEST_PATH_IMAGE059
(9)
where σ is a nonlinear activation function. Thus, a sequential decoder is constructed based on the attention mechanism, and the problem of selecting sub-task nodes is solved into the problem of randomly selecting sub-node numbers from the conditional probability distribution, so that the priority ordering of the sub-tasks can be more accurately determined according to the vector representation of the sub-task nodes.
In this embodiment, the defining an objective function of the network model with the minimum task scheduling length as a target may include: generating a deceleration evaluation index of the DAG task by taking the task scheduling length corresponding to the priority sequence of the DAG task at different time steps and the lower limit of the task scheduling length as independent variables; the lower limit of the task scheduling length is determined according to the path length of the key path of the DAG task; constructing a reward function based on a strategy gradient algorithm and the deceleration evaluation index; and constructing an objective function of the network model based on the reward function. It is to be appreciated that the DAG task scheduling problem can be modeled as a Markov Decision Process (MDP); a basic MDP can be generally described by a five-tuple:
Figure 54333DEST_PATH_IMAGE060
Wherein, the first and the second end of the pipe are connected with each other,
Figure 339821DEST_PATH_IMAGE061
is said sequential decodernSet of actions at time step
Figure 607991DEST_PATH_IMAGE062
Is used to select subtask nodes from DAG task
Figure 928114DEST_PATH_IMAGE063
And give priority to it
Figure 138384DEST_PATH_IMAGE064
Figure 645589DEST_PATH_IMAGE065
Is thatnA set of states for each time step; time step
Figure 920712DEST_PATH_IMAGE055
State of (1)
Figure 95342DEST_PATH_IMAGE066
Embedded representation of all subtask nodes including DAG task
Figure 961667DEST_PATH_IMAGE067
And assigned priority subtasks
Figure 972479DEST_PATH_IMAGE068
Namely, it is
Figure 848031DEST_PATH_IMAGE069
Figure 611588DEST_PATH_IMAGE070
Indicating an ambient immediate return value for evaluating the effect of a select action on the sequential decoder. Since the goal of DAG task scheduling is to minimize the task scheduling length, in this embodiment, a reward function is designed based on the deceleration evaluation index
Figure 648814DEST_PATH_IMAGE071
:
Figure 645458DEST_PATH_IMAGE072
(10)
Wherein the content of the first and second substances,
Figure 324701DEST_PATH_IMAGE073
is shown at time step
Figure 739502DEST_PATH_IMAGE074
DAG task prioritization
Figure 963941DEST_PATH_IMAGE075
Corresponding subtask
Figure 136296DEST_PATH_IMAGE063
The length of the schedule of (a) is,
Figure 88072DEST_PATH_IMAGE076
is shown at time step
Figure 91800DEST_PATH_IMAGE077
DAG task prioritization
Figure 736408DEST_PATH_IMAGE075
Corresponding subtask
Figure 442064DEST_PATH_IMAGE063
Is lower bound of the task schedule length. On a parallel computing system consisting of m computing nodes,
Figure 197531DEST_PATH_IMAGE078
the calculation can be based on the length of the critical path, and the specific calculation formula is as follows:
Figure 790186DEST_PATH_IMAGE079
(11)
wherein the content of the first and second substances,
Figure 871275DEST_PATH_IMAGE080
to be sorted according to priority
Figure 565692DEST_PATH_IMAGE075
Deterministic to subtask
Figure 859270DEST_PATH_IMAGE063
The length of the critical path is such that,
Figure 572011DEST_PATH_IMAGE081
to be sorted according to priority
Figure 761684DEST_PATH_IMAGE075
Deterministic to subtask
Figure 458245DEST_PATH_IMAGE063
All ofThe subtasks calculate the sum of the loads.
In MDP, it is assumed that the state transition matrix Π is deterministic, because for a given state and action, the determination of the next state is not random, because the scheduling action does not execute the task, it only affects the scheduling policy and changes the ranking of the tasks. Finally, setting the discount factor delta as constant 1, and according to formulas (4) and (10), utilizing a policy-gradient-based algorithm to target the expectation of the accumulated rewards corresponding to the maximum DAG task priority ordering pi, and defining an objective function J of the network model as follows:
Figure 804781DEST_PATH_IMAGE082
(12)
Wherein, the first and the second end of the pipe are connected with each other,
Figure 372029DEST_PATH_IMAGE083
the characterization specifies DAG task priority order as sampled from the learning strategy.
Step S12: and acquiring a DAG task data set, and generating a corresponding information matrix for each DAG task in the DAG task data set.
In this embodiment, a DAG task data set for model training is obtained, and then an information matrix of each DAG task in the DAG task data set, including a node feature matrix and an adjacency matrix, is extracted. Specifically, in this embodiment, the generating a corresponding information matrix for each DAG task in the DAG task data set may include: generating a node characteristic matrix according to the characteristics of each subtask in the DAG task data set; the node feature matrix is a feature matrix for representing the calculation load and the normalization calculation load of the subtasks and the in-degree and out-degree of the subtasks; generating an adjacency matrix according to the connection relation between different subtasks in the DAG task data set; and obtaining an information matrix corresponding to the DAG task based on the node characteristic matrix and the adjacency matrix.
In this embodiment, the acquiring the DAG task data set may include: configuring DAG task parameters; the DAG task parameters comprise the task layer number and the children of the target node The method comprises the following steps of counting nodes, generating probability of sub-nodes of a target node, adding probability of a connecting edge between two adjacent task layers and calculating load of each sub-task; and generating a DAG task according to the DAG task parameters to obtain the DAG task data set. Due to the lack of a publicly available large-scale DAG task data set, in this embodiment, a DAG task is generated first, and specifically, the DAG task can be acquired by using a parallel task generation model based on DAG task parameters. Synthesizing a DAG task like a nested fork-join task model; the model is controlled by four parameters, n respectivelydepth、nchild、pforkAnd ppert. Wherein n isdepthRepresenting the number or depth of DAG task layers; n ischildThe number of sub-nodes representing a certain node; p is a radical offorkRepresenting the probability of generating a child node for a node; p is a radical ofpertAnd randomly adding the probability of connecting edges between two adjacent layers of nodes. For the firstkEach subtask node in a layert i Sub-nodes thereoft j And edgee ij Is based on the probability pforkGenerating; first, thekThe number of sub-nodes in +1 layer is uniformly distributedn child And determining, namely determining the number of sub-nodes under the target node through uniform distribution. The process starts with the entry subtask node and repeats ndepthThen, thereby creating a block with ndepthA layered DAG task. Furthermore, with a probability ppertRandomly adding a connecting edge, p, between the kth level and the (k + 1) th level nodes of a DAG task pertThe larger the value the higher the parallelism of the generated DAG task. Finally, edges from the last level node to the egress node are added, and a computational load is distributed for each subtask. Wherein the calculation load obedience parameter of the subtask is mu (mu)>0) And a normal distribution of δ, where μ represents an average computation load of the subtasks, and δ represents a standard deviation of the computation load of each subtask, and of course, other distributions may be assumed as long as the computation load of each subtask is guaranteed to be a positive value, and the distribution is not limited herein. Extracting the characteristics of each subtask node and constructing a node characteristic matrix X for the constructed DAG task; and constructing an adjacency matrix A according to the interconnection relation among the nodes.
Step S13: and training the network model by using the information matrix, and updating model parameters of the network model by using reinforcement learning according to the objective function so as to obtain a trained DAG task scheduling model.
In this embodiment, after the network model is constructed, model parameters are initialized first. Initializing parameters W of each layer of the directed graph neural network according to a specific strategy such as normal distribution random Initialization, Xavier Initialization or He Initialization, and initializing model parameters of a sequential decoder
Figure 732603DEST_PATH_IMAGE084
Initialization is performed.
And then, training a network model by using an information matrix corresponding to the DAG task data set, wherein after the DAG task data set is obtained, the DAG task data set is divided into a training set and a test set, and a cross validation method, a leave-out method or a leave-one method and other dividing methods can be specifically adopted, wherein the test set is used for training the network model, and the test set is used for testing the trained network model.
In this embodiment, the training the network model by using the information matrix and updating the model parameters of the network model by using reinforcement learning according to the objective function may include:
s130: inputting the information matrix into the network model, and outputting vector representation of each subtask by using the directed graph neural network according to the characteristics of the subtasks and the dependency relationship among the subtasks;
s131: prioritizing, with the sequential decoder, the subtasks within the DAG task according to the vector representation of the subtasks based on an attention mechanism and a context environment of the DAG task;
s132: calculating the task scheduling length of the DAG task by utilizing a DAG task scheduling simulator according to the priority sequence;
S133: and updating the model parameters of the network model by utilizing reinforcement learning according to the task scheduling length and the objective function until the network model is converged.
The node characteristic matrix and the adjacent matrix contained in the information matrix are used as the input of a network model, forward propagation is carried out, vector representation of all subtasks is obtained through a directed graph neural network, a sequence decoder outputs priority ordering of the subtasks, the subtasks can be sequentially scheduled to be executed by a DAG task simulation scheduler, corresponding scheduling length is calculated, and then a model objective function value is calculated according to a formula (12); and according to a certain strategy, such as random gradient descent or Adam and other algorithms, the network parameter values of each layer are corrected through back propagation. Therefore, by utilizing a reinforcement learning algorithm, aiming at minimizing DAG task scheduling length, and continuously optimizing a network model by rewarding DAG task priority sequencing with shorter scheduling length; therefore, the obtained scheduling length is shorter, and the parallel computing efficiency is higher. The difficulty of collecting enough supervision tags for optimal priority assignment for DAG tasks can be effectively avoided.
Specifically, the network model is trained by relating to an objective function J defined by equation (11)
Figure 650881DEST_PATH_IMAGE085
Gradient of (a):
Figure 551841DEST_PATH_IMAGE086
(13)
wherein the content of the first and second substances,
Figure 989906DEST_PATH_IMAGE087
is a gradient operator. The model gradient in equation (12) can be estimated using the monte carlo stochastic gradient descent method:
Figure 521382DEST_PATH_IMAGE088
(14)
wherein the content of the first and second substances,
Figure 926955DEST_PATH_IMAGE089
representing subtasks of DAG tasks resulting from random sampling in the data setAnd (4) collecting. And optimizing the objective function by using a random gradient descent method or an Adam algorithm, and terminating the model training when the objective function value is not reduced or reaches the maximum iteration number, wherein the obtained scheduling scheme is the optimal scheduling scheme. Namely, the objective function gradient is estimated based on the Monte Carlo random gradient descent method. Therefore, in the embodiment, deep reinforcement learning on the DAG task is realized based on the directed graph neural network and the objective function. The DAG task scheduling length can be obtained by sequentially scheduling all subtasks to the parallel computing system ARC according to the arrangement through the DAG task scheduling simulator and executing the subtasks in parallel, and recording the completion time of the export task.
Step S14: and determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model, and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence.
In this embodiment, after the DAG task scheduling model is obtained through training, the node feature matrix and the adjacency matrix of the DAG task to be executed are input to the model, the optimal DAG task scheduling order obtained by the model is output as a result, and the DAG task to be executed is executed by using the parallel computing system according to the scheduling order. Therefore, for the non-preemptive scheduling problem of the DAG task, the task priority ordering is carried out based on the deep reinforcement learning and the directed graph neural network, the scheduling sequence of the tasks is further determined, the execution time of the tasks is reduced, and the execution efficiency of the tasks is improved.
The embodiment also provides a DAG task scheduling system based on the deep reinforcement learning and the directed graph neural network. As shown in fig. 2, the system is composed of an input module, a directed graph neural network, a sequence decoder, a schedule length calculation module, and a model parameter update module. The input module is responsible for reading a node characteristic matrix X and an adjacency matrix A of the DAG task; the directed graph neural network takes X and A as input, identifies the execution time and the dependency relationship of a DAG task, and learns the embedded representation of the subtasks; the embedded representations are decoded by a sequence decoder, and the priority sequence of all the subtasks is obtained through output; and the scheduling length calculation module schedules the parallel calculation system to execute according to the sequence, takes the scheduling length as a feedback signal and updates the model parameters by using a reinforcement learning algorithm. Therefore, the DAG task scheduling system based on the deep reinforcement learning and the directed graph neural network takes the DAG task as input, generates embedded representation for each subtask of the DAG task through the directed graph neural network, generates priority sequence of all subtasks by using a sequence decoder, and calculates task scheduling length or completion time corresponding to the sequence. The system targets minimizing the scheduled length of the DAG tasks, which is used as a reward signal to update the model through a reinforcement learning algorithm.
As can be seen from the above, in this embodiment, a network model is constructed according to the order of the directed graph neural network and the sequential decoder, and an objective function of the network model is defined with the minimum task scheduling length as an objective; acquiring a DAG task data set, and generating a corresponding information matrix for each DAG task in the DAG task data set; training the network model by using the information matrix, and updating model parameters of the network model by using reinforcement learning according to the objective function to obtain a trained DAG task scheduling model; and determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model, and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence. According to the method, a DAG task scheduling model is obtained based on a directed graph neural network and reinforcement learning, the directed graph neural network can automatically identify rich characteristics related to subtasks in the DAG task, a sequence decoder can use the characteristics to perform task priority sequencing on the subtasks, meanwhile, a scheduling target of minimizing the DAG task scheduling length is achieved by using a reinforcement learning optimization model, the DAG task scheduling length can be shortened, the parallel execution efficiency of the DAG task is improved, and the problem that enough supervision labels are difficultly collected for optimal priority distribution of the DAG task can be solved by using reinforcement learning.
Correspondingly, an embodiment of the present application further discloses a DAG task scheduling device, as shown in fig. 5, the device includes:
the network construction module 11 is configured to construct a network model according to the sequence of the directed graph neural network and the sequential decoder, and define an objective function of the network model with a minimum task scheduling length as an objective;
the data set acquisition module 12 is configured to acquire a DAG task data set, and generate a corresponding information matrix for each DAG task in the DAG task data set;
the training module 13 is configured to train the network model by using the information matrix, and update model parameters of the network model by using reinforcement learning according to the objective function to obtain a trained DAG task scheduling model;
and a scheduling order determining module 14, configured to determine a scheduling order of sub-tasks within the DAG task to be executed by using the DAG task scheduling model, and execute the DAG task to be executed by using the parallel computing system according to the scheduling order.
As can be seen from the above, in this embodiment, a network model is constructed according to the sequence of the directed graph neural network and the sequential decoder, and an objective function of the network model is defined with the minimum task scheduling length as an objective; acquiring a DAG task data set, and generating a corresponding information matrix for each DAG task in the DAG task data set; training the network model by using the information matrix, and updating model parameters of the network model by using reinforcement learning according to the objective function to obtain a trained DAG task scheduling model; and determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model, and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence. According to the method, a DAG task scheduling model is obtained based on the directed graph neural network and reinforcement learning, the directed graph neural network can automatically identify rich characteristics related to subtasks in the DAG task, a sequence decoder can utilize the characteristics to perform task priority sequencing on the subtasks, meanwhile, a scheduling target of minimizing the DAG task scheduling length is achieved by utilizing the reinforcement learning optimization model, the DAG task scheduling length can be shortened, the DAG task parallel execution efficiency is improved, and the problem that enough supervision labels are difficult to collect for optimal priority distribution of the DAG task can be solved by utilizing the reinforcement learning.
In some specific embodiments, the DAG task scheduling device may specifically include:
the graph convolution layer construction unit is used for constructing a graph convolution layer for DAG task feature learning based on the aggregation function and the nonlinear activation function;
and the directed graph neural network construction unit is used for constructing and obtaining the directed graph neural network according to the sequence of the input layer, the K-layer graph convolution layer and the output layer.
In some specific embodiments, the DAG task scheduling device may specifically include:
the vector expression definition unit is used for defining a vector expression of a context environment for the DAG task by taking the priority distribution state of the subtasks in the DAG task as a variable;
a sequential decoder construction unit for constructing a sequential decoder for priority ordering based on an attention mechanism and a vector expression of the context environment to obtain the decoder.
In some specific embodiments, the network building module 11 may specifically include:
the deceleration evaluation index construction unit is used for generating a deceleration evaluation index of the DAG task by taking the task scheduling length corresponding to the priority sequence of the DAG task at different time steps and the lower limit of the task scheduling length as arguments; the lower limit of the task scheduling length is determined according to the path length of the key path of the DAG task;
The reward function construction unit is used for constructing a reward function based on a strategy gradient algorithm and the deceleration evaluation index;
and the target function construction unit is used for constructing a target function of the network model based on the reward function.
In some embodiments, the data set obtaining module 12 may specifically include:
the task parameter configuration unit is used for configuring DAG task parameters; the DAG task parameters comprise the number of task layers, the number of sub-nodes of a target node, the generation probability of the sub-nodes of the target node, the adding probability of a connecting edge between two adjacent task layers and the calculation load of each sub-task;
and the task generation unit is used for generating a DAG task according to the DAG task parameters to obtain the DAG task data set.
In some embodiments, the data set obtaining module 12 may specifically include:
a node feature matrix generating unit, configured to generate a node feature matrix according to a feature of each subtask in the DAG task data set;
the adjacency matrix generation unit is used for generating an adjacency matrix according to the connection relation between different subtasks in the DAG task data set;
and the information matrix determining unit is used for obtaining an information matrix corresponding to the DAG task based on the node characteristic matrix and the adjacency matrix.
In some embodiments, the training module 13 may specifically include:
the vector representation determining unit is used for inputting the information matrix into the network model and outputting the vector representation of each subtask by utilizing the directed graph neural network according to the characteristics of the subtasks and the dependency relationship among the subtasks;
a prioritization determination unit to prioritize, with the order decoder, subtasks within the DAG task according to the vector representation of the subtasks based on an attention mechanism and a context environment of the DAG task;
a task scheduling length determining unit, configured to calculate a task scheduling length of the DAG task by using a DAG task scheduling simulator according to the priority order;
and the model optimization unit is used for updating the model parameters of the network model by utilizing reinforcement learning according to the task scheduling length and the objective function until the network model is converged.
Further, the embodiment of the present application also discloses an electronic device, which is shown in fig. 6, and the content in the drawing cannot be considered as any limitation to the application scope.
Fig. 6 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is used for storing a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the DAG task scheduling method disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to acquire external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the memory 22 can be a read-only memory, a random access memory, a magnetic disk or an optical disk as a carrier for storing resources, the resources stored thereon include an operating system 221, a computer program 222, and data 223 including DAG tasks, and the storage manner can be transient storage or permanent storage.
The operating system 221 is configured to manage and control each hardware device and the computer program 222 on the electronic device 20, so as to implement the operation and processing of the mass data 223 in the memory 22 by the processor 21, and may be Windows Server, Netware, Unix, Linux, or the like. The computer programs 222 may further include computer programs that can be used to perform other specific tasks in addition to the computer programs that can be used to perform the DAG task scheduling method performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, an embodiment of the present application further discloses a computer storage medium, where computer-executable instructions are stored in the computer storage medium, and when the computer-executable instructions are loaded and executed by a processor, the steps of the DAG task scheduling method disclosed in any of the foregoing embodiments are implemented.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The DAG task scheduling method, apparatus, device and medium provided by the present invention are described in detail above, and specific examples are applied herein to explain the principles and embodiments of the present invention, and the description of the above embodiments is only used to help understanding the method and its core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (15)

1. A DAG task scheduling method, comprising:
constructing a network model according to the sequence of the directed graph neural network and the sequence decoder, and defining an objective function of the network model by taking the minimum task scheduling length as an objective;
acquiring a DAG task data set, and generating a corresponding information matrix for each DAG task in the DAG task data set;
training the network model by using the information matrix, and updating model parameters of the network model by using reinforcement learning according to the objective function to obtain a trained DAG task scheduling model;
and determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model, and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence.
2. The DAG task scheduling method of claim 1, wherein prior to constructing the network model in an order of the directed graph neural network and the sequential decoder, further comprising:
constructing a graph convolution layer for DAG task feature learning based on an aggregation function and a nonlinear activation function;
and constructing the directed graph neural network according to the sequence of the input layer, the K-layer graph convolution layer and the output layer.
3. The DAG task scheduling method of claim 1, wherein before constructing the network model according to the sequence of the directed graph neural network and the sequential decoder, the method further comprises:
the priority distribution state of subtasks in the DAG task is taken as a variable, and a vector expression of a context environment is defined for the DAG task;
constructing a sequential decoder for prioritization based on an attention mechanism and a vector expression of the context environment.
4. The DAG task scheduling method of claim 1, wherein defining an objective function of the network model with a minimum task scheduling length as an objective comprises:
taking the task scheduling length corresponding to the priority sequence of the DAG task at different time steps and the lower limit of the task scheduling length as independent variables to generate a deceleration evaluation index of the DAG task; the lower limit of the task scheduling length is determined according to the path length of the key path of the DAG task;
constructing a reward function based on a strategy gradient algorithm and the deceleration evaluation index;
and constructing an objective function of the network model based on the reward function.
5. The DAG task scheduling method of claim 1, wherein the obtaining a DAG task dataset comprises:
Configuring DAG task parameters; the DAG task parameters comprise the task layer number, the sub-node number of the target node, the sub-node generation probability of the target node, the connecting edge adding probability between two adjacent task layers and the calculation load of each sub-task;
and generating a DAG task according to the DAG task parameters to obtain the DAG task data set.
6. The method as recited in claim 1, wherein the generating a corresponding information matrix for each DAG task within the DAG task dataset comprises:
generating a node characteristic matrix according to the characteristics of each subtask in the DAG task data set;
generating an adjacency matrix according to the connection relation between different subtasks in the DAG task data set;
and obtaining an information matrix corresponding to the DAG task based on the node characteristic matrix and the adjacency matrix.
7. The DAG task scheduling method according to any one of claims 1 to 6, wherein the training the network model by using the information matrix and updating model parameters of the network model by using reinforcement learning according to the objective function comprises:
inputting the information matrix into the network model, and outputting a vector representation of each subtask by using the directed graph neural network according to the characteristics of the subtasks and the dependency relationship among the subtasks;
Prioritizing, with the sequential decoder, the subtasks within the DAG task according to the vector representation of the subtasks based on an attention mechanism and a context environment of the DAG task;
calculating the task scheduling length of the DAG task by utilizing a DAG task scheduling simulator according to the priority sequence;
and updating the model parameters of the network model by using reinforcement learning according to the task scheduling length and the objective function until the network model converges.
8. A DAG task scheduling apparatus, comprising:
the network construction module is used for constructing a network model according to the sequence of the directed graph neural network and the sequential decoder, and defining an objective function of the network model by taking the minimum task scheduling length as an objective;
the data set acquisition module is used for acquiring a DAG task data set and generating a corresponding information matrix for each DAG task in the DAG task data set;
the training module is used for training the network model by using the information matrix and updating model parameters of the network model by using reinforcement learning according to the objective function so as to obtain a trained DAG task scheduling model;
And the scheduling sequence determining module is used for determining the scheduling sequence of the subtasks in the DAG task to be executed by using the DAG task scheduling model and executing the DAG task to be executed by using a parallel computing system according to the scheduling sequence.
9. The DAG task scheduling device of claim 8, further comprising:
the graph convolution layer construction unit is used for constructing a graph convolution layer for DAG task feature learning based on the aggregation function and the nonlinear activation function;
and the directed graph neural network construction unit is used for constructing and obtaining the directed graph neural network according to the sequence of the input layer, the K-layer graph convolution layer and the output layer.
10. The DAG task scheduling device of claim 8, further comprising:
the vector expression definition unit is used for defining a vector expression of a context environment for the DAG task by taking the priority distribution state of the subtasks in the DAG task as a variable;
a sequential decoder construction unit for constructing a sequential decoder for priority ordering based on an attention mechanism and a vector expression of the context environment to obtain the decoder.
11. The DAG task scheduler of claim 8, wherein the network construction module comprises:
The deceleration evaluation index construction unit is used for generating a deceleration evaluation index of the DAG task by taking the task scheduling length corresponding to the priority sequence of the DAG task at different time steps and the lower limit of the task scheduling length as arguments; the lower limit of the task scheduling length is determined according to the path length of the key path of the DAG task;
the reward function construction unit is used for constructing a reward function based on a strategy gradient algorithm and the deceleration evaluation index;
and the target function construction unit is used for constructing a target function of the network model based on the reward function.
12. The DAG task scheduler of claim 8, wherein the dataset acquisition module comprises:
a task parameter configuration unit, configured to configure DAG task parameters; the DAG task parameters comprise the number of task layers, the number of sub-nodes of a target node, the generation probability of the sub-nodes of the target node, the adding probability of a connecting edge between two adjacent task layers and the calculation load of each sub-task;
and the task generation unit is used for generating the DAG task according to the DAG task parameters so as to obtain the DAG task data set.
13. The DAG task scheduler of claim 8, wherein the dataset acquisition module comprises:
A node characteristic matrix generating unit, configured to generate a node characteristic matrix according to a characteristic of each subtask in the DAG task dataset;
the adjacency matrix generating unit is used for generating an adjacency matrix according to the connection relation between different subtasks in the DAG task data set;
and the information matrix determining unit is used for obtaining an information matrix corresponding to the DAG task based on the node characteristic matrix and the adjacency matrix.
14. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the DAG task scheduling method of any of claims 1 to 7.
15. A computer-readable storage medium for storing a computer program; wherein the computer program, when executed by the processor, implements the DAG task scheduling method of any of claims 1 to 7.
CN202210671115.8A 2022-06-15 2022-06-15 DAG task scheduling method, device, equipment and storage medium Active CN114756358B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210671115.8A CN114756358B (en) 2022-06-15 2022-06-15 DAG task scheduling method, device, equipment and storage medium
PCT/CN2022/142437 WO2023241000A1 (en) 2022-06-15 2022-12-27 Dag task scheduling method and apparatus, device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210671115.8A CN114756358B (en) 2022-06-15 2022-06-15 DAG task scheduling method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114756358A true CN114756358A (en) 2022-07-15
CN114756358B CN114756358B (en) 2022-11-04

Family

ID=82337171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210671115.8A Active CN114756358B (en) 2022-06-15 2022-06-15 DAG task scheduling method, device, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN114756358B (en)
WO (1) WO2023241000A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116151315A (en) * 2023-04-04 2023-05-23 之江实验室 Attention network scheduling optimization method and device for on-chip system
CN116739090A (en) * 2023-05-12 2023-09-12 北京大学 Deep neural network reasoning measurement method and device based on Web browser
CN116755397A (en) * 2023-05-26 2023-09-15 北京航空航天大学 Multi-machine collaborative task scheduling method based on graph convolution strategy gradient
CN116880994A (en) * 2023-09-07 2023-10-13 之江实验室 Multiprocessor task scheduling method, device and equipment based on dynamic DAG
CN116974729A (en) * 2023-09-22 2023-10-31 浪潮(北京)电子信息产业有限公司 Task scheduling method and device for big data job, electronic equipment and storage medium
WO2023241000A1 (en) * 2022-06-15 2023-12-21 苏州元脑智能科技有限公司 Dag task scheduling method and apparatus, device, and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117555306B (en) * 2024-01-11 2024-04-05 天津斯巴克斯机电有限公司 Digital twinning-based multi-production-line task self-adaptive scheduling method and system
CN117648174B (en) * 2024-01-29 2024-04-05 华北电力大学 Cloud computing heterogeneous task scheduling and container management method based on artificial intelligence

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756653A (en) * 2020-06-04 2020-10-09 北京理工大学 Multi-coflow scheduling method based on deep reinforcement learning of graph neural network
CN113127169A (en) * 2021-04-07 2021-07-16 中山大学 Efficient link scheduling method for dynamic workflow in data center network
CN114239711A (en) * 2021-12-06 2022-03-25 中国人民解放军国防科技大学 Node classification method based on heterogeneous information network small-sample learning
US20220100763A1 (en) * 2020-09-30 2022-03-31 Microsoft Technology Licensing, Llc Optimizing job runtimes via prediction-based token allocation
CN114327925A (en) * 2021-09-30 2022-04-12 国网山东省电力公司营销服务中心(计量中心) Power data real-time calculation scheduling optimization method and system
CN114422381A (en) * 2021-12-14 2022-04-29 西安电子科技大学 Communication network flow prediction method, system, storage medium and computer equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106228314A (en) * 2016-08-11 2016-12-14 电子科技大学 The workflow schedule method of study is strengthened based on the degree of depth
US20200042856A1 (en) * 2018-07-31 2020-02-06 International Business Machines Corporation Scheduler for mapping neural networks onto an array of neural cores in an inference processing unit
CN114625517A (en) * 2022-04-13 2022-06-14 北京赛博云睿智能科技有限公司 DAG graph computation distributed big data workflow task scheduling platform
CN114756358B (en) * 2022-06-15 2022-11-04 苏州浪潮智能科技有限公司 DAG task scheduling method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756653A (en) * 2020-06-04 2020-10-09 北京理工大学 Multi-coflow scheduling method based on deep reinforcement learning of graph neural network
US20220100763A1 (en) * 2020-09-30 2022-03-31 Microsoft Technology Licensing, Llc Optimizing job runtimes via prediction-based token allocation
CN113127169A (en) * 2021-04-07 2021-07-16 中山大学 Efficient link scheduling method for dynamic workflow in data center network
CN114327925A (en) * 2021-09-30 2022-04-12 国网山东省电力公司营销服务中心(计量中心) Power data real-time calculation scheduling optimization method and system
CN114239711A (en) * 2021-12-06 2022-03-25 中国人民解放军国防科技大学 Node classification method based on heterogeneous information network small-sample learning
CN114422381A (en) * 2021-12-14 2022-04-29 西安电子科技大学 Communication network flow prediction method, system, storage medium and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
橙子渣渣: "【论文解析】Fast Adaptive Task Offloading in Edge Computing Based on Meta Reinforcement Learning", 《(GRAPH NEURAL NETWORK) OR GNN》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023241000A1 (en) * 2022-06-15 2023-12-21 苏州元脑智能科技有限公司 Dag task scheduling method and apparatus, device, and storage medium
CN116151315A (en) * 2023-04-04 2023-05-23 之江实验室 Attention network scheduling optimization method and device for on-chip system
CN116151315B (en) * 2023-04-04 2023-08-15 之江实验室 Attention network scheduling optimization method and device for on-chip system
CN116739090A (en) * 2023-05-12 2023-09-12 北京大学 Deep neural network reasoning measurement method and device based on Web browser
CN116739090B (en) * 2023-05-12 2023-11-28 北京大学 Deep neural network reasoning measurement method and device based on Web browser
CN116755397A (en) * 2023-05-26 2023-09-15 北京航空航天大学 Multi-machine collaborative task scheduling method based on graph convolution strategy gradient
CN116755397B (en) * 2023-05-26 2024-01-23 北京航空航天大学 Multi-machine collaborative task scheduling method based on graph convolution strategy gradient
CN116880994A (en) * 2023-09-07 2023-10-13 之江实验室 Multiprocessor task scheduling method, device and equipment based on dynamic DAG
CN116880994B (en) * 2023-09-07 2023-12-12 之江实验室 Multiprocessor task scheduling method, device and equipment based on dynamic DAG
CN116974729A (en) * 2023-09-22 2023-10-31 浪潮(北京)电子信息产业有限公司 Task scheduling method and device for big data job, electronic equipment and storage medium
CN116974729B (en) * 2023-09-22 2024-02-09 浪潮(北京)电子信息产业有限公司 Task scheduling method and device for big data job, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2023241000A1 (en) 2023-12-21
CN114756358B (en) 2022-11-04

Similar Documents

Publication Publication Date Title
CN114756358B (en) DAG task scheduling method, device, equipment and storage medium
Tong et al. QL-HEFT: a novel machine learning scheduling scheme base on cloud computing environment
CN109976909B (en) Learning-based low-delay task scheduling method in edge computing network
Alkhanak et al. A hyper-heuristic cost optimisation approach for scientific workflow scheduling in cloud computing
US10754709B2 (en) Scalable task scheduling systems and methods for cyclic interdependent tasks using semantic analysis
Zhang et al. DeepMAG: Deep reinforcement learning with multi-agent graphs for flexible job shop scheduling
CN113778646B (en) Task level scheduling method and device based on execution time prediction
Khajemohammadi et al. Efficient workflow scheduling for grid computing using a leveled multi-objective genetic algorithm
US7689978B2 (en) System and method for autonomic optimization by computer programs
Sinclair et al. Hindsight learning for mdps with exogenous inputs
CN114139730B (en) Dynamic pricing and deployment method for machine learning tasks in edge cloud network
Fan et al. Dras: Deep reinforcement learning for cluster scheduling in high performance computing
Vahidipour et al. Priority assignment in queuing systems with unknown characteristics using learning automata and adaptive stochastic Petri nets
CN116069473A (en) Deep reinforcement learning-based Yarn cluster workflow scheduling method
Tuli et al. Optimizing the performance of fog computing environments using ai and co-simulation
Durán et al. From static to dynamic analysis and allocation of resources for BPMN processes
CN113220437B (en) Workflow multi-target scheduling method and device
Femmam et al. Labelled evolutionary Petri nets/genetic algorithm based approach for workflow scheduling in cloud computing
CN114327925A (en) Power data real-time calculation scheduling optimization method and system
Franke et al. On advantages of scheduling using genetic fuzzy systems
Alkhanak et al. A hyper-heuristic approach using a prioritized selection strategy for workflow scheduling in cloud computing
Brueckner et al. Swarming Polyagents Executing Hierarchical Task Networks
Ge et al. Capability-based project scheduling with genetic algorithms
Hegde et al. COUNSEL: Cloud Resource Configuration Management using Deep Reinforcement Learning
Prasad et al. Adaptive smoothed functional algorithms for optimal staffing levels in service systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant